fix:command player said to server won't be shown at chat history (#1643)

Original commits:

* fix:command player said to server won't be shown at chat history

* Update ChatManager.java
This commit is contained in:
dragon 2022-08-11 13:50:08 +08:00 committed by GitHub
parent d286f1628e
commit edd4c8ca88
1 changed files with 4 additions and 6 deletions

View File

@ -136,11 +136,6 @@ public class ChatManager implements ChatManagerHandler {
// Get target.
Player target = getServer().getPlayerByUid(targetUid);
// Check if command
if (tryInvokeCommand(player, target, message)) {
return;
}
if (target == null && targetUid != GameConstants.SERVER_CONSOLE_UID) {
return;
}
@ -152,7 +147,10 @@ public class ChatManager implements ChatManagerHandler {
player.sendPacket(packet);
putInHistory(player.getUid(), targetUid, packet.getChatInfo());
if (target != null) {
// Check if command
boolean isCommand = tryInvokeCommand(player, target, message);
if ((target != null) && (!isCommand)) {
target.sendPacket(packet);
putInHistory(targetUid, player.getUid(), packet.getChatInfo());
}