mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Handle HeroChat chat messages
Fix #63 and rewrite PMsend Suggestion and PMsend v1 by JamieSinn
This commit is contained in:
parent
57024a7b26
commit
72c2ff5ef0
1 changed files with 15 additions and 5 deletions
|
|
@ -206,11 +206,21 @@ namespace MinecraftClient
|
|||
|
||||
//Detect HeroChat PMsend
|
||||
//From Someone: message
|
||||
|
||||
else if (text.StartsWith("From"))
|
||||
else if (text.StartsWith("From "))
|
||||
{
|
||||
sender = tmp[1].ToString().Remove(tmp[1].ToString().Length-1);
|
||||
message = text.Substring(tmp[0].Length+ 1 + tmp[1].Length + 1);
|
||||
sender = text.Substring(5).Split(':')[0];
|
||||
message = text.Substring(text.IndexOf(':') + 2);
|
||||
return isValidName(sender);
|
||||
}
|
||||
|
||||
//Detect HeroChat Messages
|
||||
//[Channel] [Rank] User: Message
|
||||
else if (text.StartsWith("[") && text.Contains(':') && tmp.Length > 2)
|
||||
{
|
||||
int name_end = text.IndexOf(':');
|
||||
int name_start = text.Substring(0, name_end).LastIndexOf(']') + 2;
|
||||
sender = text.Substring(name_start, name_end - name_start);
|
||||
message = text.Substring(name_end + 2);
|
||||
return isValidName(sender);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue