mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix for previous commit
Tried to handle two syntaxes at the same time. Bad idea. Handling the two different syntaxes separately.
This commit is contained in:
parent
e56d504067
commit
774043fddb
1 changed files with 16 additions and 4 deletions
|
|
@ -182,16 +182,28 @@ namespace MinecraftClient
|
|||
|
||||
//Detect Essentials (Bukkit) /m messages
|
||||
//[Someone -> me] message
|
||||
//[Someone [rank] -> me] message
|
||||
else if (text[0] == '[' && tmp.Length > 3 && (tmp[1] == "->" || tmp[2] == "->")
|
||||
&& ((tmp[2] == "me]" || tmp[2] == "moi]")
|
||||
|| (tmp[3] == "me]" || tmp[3] == "moi]"))) //'me' is replaced by 'moi' in french servers
|
||||
//[~Someone -> me] message
|
||||
else if (text[0] == '[' && tmp.Length > 3 && tmp[1] == "->"
|
||||
&& (tmp[2] == "me]" || tmp[2] == "moi]")) //'me' is replaced by 'moi' in french servers
|
||||
{
|
||||
message = text.Substring(tmp[0].Length + 4 + tmp[2].Length + 1);
|
||||
sender = tmp[0].Substring(1);
|
||||
if (sender[0] == '~') { sender = sender.Substring(1); }
|
||||
return isValidName(sender);
|
||||
}
|
||||
|
||||
//Detect Essentials (Bukkit) /me messages with some custom rank
|
||||
//[Someone [rank] -> me] message
|
||||
//[~Someone [rank] -> me] message
|
||||
else if (text[0] == '[' && tmp.Length > 3 && tmp[2] == "->"
|
||||
&& (tmp[3] == "me]" || tmp[3] == "moi]")) //'me' is replaced by 'moi' in french servers
|
||||
{
|
||||
message = text.Substring(tmp[0].Length + 1 + tmp[1].Length + 4 + tmp[2].Length + 1);
|
||||
sender = tmp[0].Substring(1);
|
||||
if (sender[0] == '~') { sender = sender.Substring(1); }
|
||||
return isValidName(sender);
|
||||
}
|
||||
|
||||
else return false;
|
||||
}
|
||||
catch (IndexOutOfRangeException) { return false; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue