mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 20:16:36 -04:00
prefer NetUtils.StringSize to hardcoding 64
This commit is contained in:
parent
18bbaa053f
commit
aa558ec565
@ -26,7 +26,7 @@ namespace MCGalaxy {
|
||||
message = Regex.Replace(message, @"(&[0-9a-f])+(&[0-9a-f])", "$2");
|
||||
message = Regex.Replace(message, @"(&[0-9a-f])+$", "");
|
||||
|
||||
int limit = 64; string color = "";
|
||||
int limit = NetUtils.StringSize; string color = "";
|
||||
while ( message.Length > 0 ) {
|
||||
//if (Regex.IsMatch(message, "&a")) break;
|
||||
|
||||
|
@ -40,7 +40,7 @@ namespace MCGalaxy.Eco {
|
||||
if (text == PlayerDB.GetLoginMessage(p)) {
|
||||
Player.Message(p, "%cYou already have that login message."); return;
|
||||
}
|
||||
if (text.Length > 64) {
|
||||
if (text.Length > NetUtils.StringSize) {
|
||||
Player.Message(p, "%cLogin message must be 64 characters or less."); return;
|
||||
}
|
||||
Command.all.Find("loginmessage").Use(null, p.name + " " + text);
|
||||
@ -69,7 +69,7 @@ namespace MCGalaxy.Eco {
|
||||
if (text == PlayerDB.GetLogoutMessage(p)) {
|
||||
Player.Message(p, "%cYou already have that logout message."); return;
|
||||
}
|
||||
if (text.Length > 64) {
|
||||
if (text.Length > NetUtils.StringSize) {
|
||||
Player.Message(p, "%cLogin message must be 64 characters or less."); return;
|
||||
}
|
||||
Command.all.Find("logoutmessage").Use(null, p.name + " " + text);
|
||||
|
@ -600,7 +600,7 @@ namespace MCGalaxy {
|
||||
}
|
||||
|
||||
if (HasCpeExt(CpeExt.LongerMessages) && continued != 0) {
|
||||
if (text.Length < 64) storedMessage = storedMessage + text + " ";
|
||||
if (text.Length < NetUtils.StringSize) storedMessage = storedMessage + text + " ";
|
||||
else storedMessage = storedMessage + text;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user