mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 20:53:40 -04:00
Cleanup partial message handling
This commit is contained in:
parent
fa7da22a43
commit
cd83c2766b
@ -676,8 +676,8 @@ namespace MCGalaxy.Commands.CPE {
|
||||
new string[] { "Enter the three maximum coordinates of the cube in units (separated by spaces). 1 block = 16 units.",
|
||||
"Maximum coordinates for a normal block are &416 &216 &116." },
|
||||
|
||||
new string[] { "Type a number between '0' and '2' for collision type of this block.",
|
||||
"0 - block is walk-through (e.g. air).", "1 - block is swim-through (e.g. water).",
|
||||
new string[] { "Type a number between '0' and '6' for collision type of this block.",
|
||||
"0 - block is walk-through (e.g. air).", "1 - block is swim-through/climable (e.g. rope).",
|
||||
"2 - block is solid (e.g. dirt).",
|
||||
},
|
||||
new string[] { "Type a number between '0.25' (25% speed) and '3.96' (396% speed).",
|
||||
|
@ -105,7 +105,7 @@ namespace MCGalaxy {
|
||||
public string whisperTo = "";
|
||||
public bool ignoreAll, ignoreGlobal, ignoreIRC, ignoreTitles, ignoreNicks, ignore8ball, ignoreDrawOutput;
|
||||
|
||||
public string storedMessage = "";
|
||||
string partialMessage = "";
|
||||
|
||||
public bool trainGrab;
|
||||
public bool onTrain, trainInvincible;
|
||||
|
@ -495,8 +495,8 @@ namespace MCGalaxy {
|
||||
}
|
||||
|
||||
if (HasCpeExt(CpeExt.LongerMessages) && continued != 0) {
|
||||
if (text.Length < NetUtils.StringSize) storedMessage = storedMessage + text + " ";
|
||||
else storedMessage = storedMessage + text;
|
||||
partialMessage += text;
|
||||
if (text.Length < NetUtils.StringSize) partialMessage += " ";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -505,18 +505,18 @@ namespace MCGalaxy {
|
||||
text = text.Replace("^detail.user=", "");
|
||||
}
|
||||
|
||||
if (storedMessage != "" && !text.EndsWith(">") && !text.EndsWith("<")) {
|
||||
text = storedMessage.Replace("|>|", " ").Replace("|<|", "") + text;
|
||||
storedMessage = "";
|
||||
if (partialMessage != "" && !text.EndsWith(">") && !text.EndsWith("<")) {
|
||||
text = partialMessage + text;
|
||||
partialMessage = "";
|
||||
}
|
||||
|
||||
if (text.EndsWith(">")) {
|
||||
storedMessage += text.Substring(0, text.Length - 1) + "|>|";
|
||||
SendMessage(Colors.teal + "Partial message: &f" + storedMessage.Replace("|>|", " ").Replace("|<|", ""));
|
||||
partialMessage += text.Substring(0, text.Length - 1) + " ";
|
||||
SendMessage(Colors.teal + "Partial message: &f" + partialMessage);
|
||||
return true;
|
||||
} else if (text.EndsWith("<")) {
|
||||
storedMessage += text.Substring(0, text.Length - 1) + "|<|";
|
||||
SendMessage(Colors.teal + "Partial message: &f" + storedMessage.Replace("|<|", "").Replace("|>|", " "));
|
||||
partialMessage += text.Substring(0, text.Length - 1);
|
||||
SendMessage(Colors.teal + "Partial message: &f" + partialMessage);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user