Fix the chat history not correctly showing.

This commit is contained in:
kyoko
2022-06-12 11:37:44 +08:00
committed by Luke H-W
parent 38107326a1
commit 80f9346983
8 changed files with 189 additions and 48 deletions

View File

@@ -1052,7 +1052,9 @@ public class Player {
this.messageHandler.append(message.toString());
return;
}
this.sendPacket(new PacketPrivateChatNotify(GameConstants.SERVER_CONSOLE_UID, getUid(), message.toString()));
this.getServer().getChatManager().sendPrivateMessageFromServer(getUid(), message.toString());
// this.sendPacket(new PacketPrivateChatNotify(GameConstants.SERVER_CONSOLE_UID, getUid(), message.toString()));
}
/**
@@ -1062,7 +1064,8 @@ public class Player {
* @param message The message to send.
*/
public void sendMessage(Player sender, Object message) {
this.sendPacket(new PacketPrivateChatNotify(sender.getUid(), this.getUid(), message.toString()));
// this.sendPacket(new PacketPrivateChatNotify(sender.getUid(), this.getUid(), message.toString()));
this.getServer().getChatManager().sendPrivateMessage(sender, this.getUid(), message.toString());
}
// ---------------------MAIL------------------------
@@ -1541,6 +1544,9 @@ public class Player {
// First notify packets sent
this.setHasSentAvatarDataNotify(true);
// Send server welcome chat.
this.getServer().getChatManager().sendServerWelcomeMessages(this);
// Set session state
session.setState(SessionState.ACTIVE);
@@ -1558,6 +1564,9 @@ public class Player {
public void onLogout() {
try{
// Clear chat history.
this.getServer().getChatManager().clearHistoryOnLogout(this);
// stop stamina calculation
getStaminaManager().stopSustainedStaminaHandler();