mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Reduce merge conflicts
This commit is contained in:
parent
290ec9cc79
commit
4538095d74
2 changed files with 155 additions and 151 deletions
|
|
@ -1131,17 +1131,19 @@ namespace MinecraftClient
|
|||
/// <param name="text">Text to send to the server</param>
|
||||
public void SendText(string text)
|
||||
{
|
||||
if (String.IsNullOrEmpty(text))
|
||||
return;
|
||||
|
||||
int maxLength = handler.GetMaxChatMessageLength();
|
||||
|
||||
lock (chatQueue)
|
||||
{
|
||||
if (String.IsNullOrEmpty(text))
|
||||
return;
|
||||
int maxLength = handler.GetMaxChatMessageLength();
|
||||
if (text.Length > maxLength) //Message is too long?
|
||||
{
|
||||
if (text[0] == '/')
|
||||
{
|
||||
//Send the first 100/256 chars of the command
|
||||
text = text.Substring(0, maxLength);
|
||||
text = text[..maxLength];
|
||||
chatQueue.Enqueue(text);
|
||||
}
|
||||
else
|
||||
|
|
@ -1149,13 +1151,15 @@ namespace MinecraftClient
|
|||
//Split the message into several messages
|
||||
while (text.Length > maxLength)
|
||||
{
|
||||
chatQueue.Enqueue(text.Substring(0, maxLength));
|
||||
text = text.Substring(maxLength, text.Length - maxLength);
|
||||
chatQueue.Enqueue(text[..maxLength]);
|
||||
text = text[maxLength..];
|
||||
}
|
||||
chatQueue.Enqueue(text);
|
||||
}
|
||||
}
|
||||
else chatQueue.Enqueue(text);
|
||||
else
|
||||
chatQueue.Enqueue(text);
|
||||
|
||||
TrySendMessageToServer();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue