mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-26 23:03:12 +00:00
Add a chat message length limit to avoid crashing with too big packets sent to clients.
This commit is contained in:
1 parent
236744c74e
commit
8abb3efbfb
6 files changed
+42
-24
No files matched your search
@@ -38,22 +38,22 @@ public class RconPlayer implements IPlayer {
|
||||
public IData getData() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getXP() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setXP(int xp) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void removeXP(int xp) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void update(IData data) {
|
||||
|
||||
@@ -71,6 +71,10 @@ public class RconPlayer implements IPlayer {
|
||||
|
||||
@Override
|
||||
public void sendChat(String message) {
|
||||
if (message.length() > MAX_CHAT_MESSAGE_LENGTH)
|
||||
{
|
||||
message = message.substring(0, MAX_CHAT_MESSAGE_LENGTH);
|
||||
}
|
||||
sender.addChatMessage(new ChatComponentText(message));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user