mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 20:53:40 -04:00
Fix custom chat tokens with : in them
This commit is contained in:
parent
db1fe40f90
commit
a0725bfe48
@ -116,11 +116,12 @@ namespace MCGalaxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string[] lines = tokensFile.GetText();
|
string[] lines = tokensFile.GetText();
|
||||||
string[] parts = new string[2];
|
char[] colon = new char[] {':'};
|
||||||
|
|
||||||
foreach (string line in lines) {
|
foreach (string line in lines) {
|
||||||
if (line.StartsWith("//")) continue;
|
if (line.StartsWith("//")) continue;
|
||||||
line.FixedSplit(parts, ':');
|
string[] parts = line.Split(colon, 2);
|
||||||
if (parts[1] == null) continue; // not a proper line
|
if (parts.Length == 1) continue; // not a proper line
|
||||||
|
|
||||||
string key = parts[0].Trim(), value = parts[1].Trim();
|
string key = parts[0].Trim(), value = parts[1].Trim();
|
||||||
if (key.Length == 0) continue;
|
if (key.Length == 0) continue;
|
||||||
|
@ -155,7 +155,7 @@ namespace MCGalaxy.Network {
|
|||||||
// DoSendAsync returns false if SendAsync completed sync
|
// DoSendAsync returns false if SendAsync completed sync
|
||||||
// If that happens, SendCallback isn't called so we need to send data here instead
|
// If that happens, SendCallback isn't called so we need to send data here instead
|
||||||
if (s.DoSendAsync(s.sendQueue.Dequeue())) return;
|
if (s.DoSendAsync(s.sendQueue.Dequeue())) return;
|
||||||
|
|
||||||
if (s.player.disconnected) s.sendQueue.Clear();
|
if (s.player.disconnected) s.sendQueue.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user