diff --git a/src/main/java/emu/grasscutter/game/managers/ChatManager.java b/src/main/java/emu/grasscutter/game/managers/ChatManager/ChatManager.java similarity index 95% rename from src/main/java/emu/grasscutter/game/managers/ChatManager.java rename to src/main/java/emu/grasscutter/game/managers/ChatManager/ChatManager.java index 7377717a5..42ff2df41 100644 --- a/src/main/java/emu/grasscutter/game/managers/ChatManager.java +++ b/src/main/java/emu/grasscutter/game/managers/ChatManager/ChatManager.java @@ -1,4 +1,4 @@ -package emu.grasscutter.game.managers; +package emu.grasscutter.game.managers.ChatManager; import emu.grasscutter.command.CommandMap; import emu.grasscutter.game.player.Player; @@ -10,7 +10,7 @@ import emu.grasscutter.server.packet.send.PacketPrivateChatNotify; import java.util.Arrays; import java.util.List; -public class ChatManager { +public class ChatManager implements ChatManagerHandler { static final List PREFIXES = Arrays.asList('/', '!'); private final GameServer server; diff --git a/src/main/java/emu/grasscutter/game/managers/ChatManager/ChatManagerHandler.java b/src/main/java/emu/grasscutter/game/managers/ChatManager/ChatManagerHandler.java new file mode 100644 index 000000000..3239265e2 --- /dev/null +++ b/src/main/java/emu/grasscutter/game/managers/ChatManager/ChatManagerHandler.java @@ -0,0 +1,12 @@ +package emu.grasscutter.game.managers.ChatManager; + +import emu.grasscutter.game.player.Player; +import emu.grasscutter.server.game.GameServer; + +public interface ChatManagerHandler { + GameServer getServer(); + void sendPrivateMessage(Player player, int targetUid, String message); + void sendPrivateMessage(Player player, int targetUid, int emote); + void sendTeamMessage(Player player, int channel, String message); + void sendTeamMessage(Player player, int channel, int icon); +} diff --git a/src/main/java/emu/grasscutter/server/game/GameServer.java b/src/main/java/emu/grasscutter/server/game/GameServer.java index f44aa1bc4..a54d3900d 100644 --- a/src/main/java/emu/grasscutter/server/game/GameServer.java +++ b/src/main/java/emu/grasscutter/server/game/GameServer.java @@ -10,12 +10,12 @@ import emu.grasscutter.game.drop.DropManager; import emu.grasscutter.game.dungeons.DungeonManager; import emu.grasscutter.game.expedition.ExpeditionManager; import emu.grasscutter.game.gacha.GachaManager; -import emu.grasscutter.game.managers.ChatManager; +import emu.grasscutter.game.managers.ChatManager.ChatManager; +import emu.grasscutter.game.managers.ChatManager.ChatManagerHandler; import emu.grasscutter.game.managers.InventoryManager; import emu.grasscutter.game.managers.MultiplayerManager; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.ServerQuestHandler; -import emu.grasscutter.game.quest.handlers.QuestBaseHandler; import emu.grasscutter.game.shop.ShopManager; import emu.grasscutter.game.tower.TowerScheduleManager; import emu.grasscutter.game.world.World; @@ -44,7 +44,7 @@ public final class GameServer extends KcpServer { private final Map players; private final Set worlds; - private final ChatManager chatManager; + private ChatManagerHandler chatManager; private final InventoryManager inventoryManager; private final GachaManager gachaManager; private final ShopManager shopManager; @@ -107,9 +107,12 @@ public final class GameServer extends KcpServer { return worlds; } - public ChatManager getChatManager() { + public ChatManagerHandler getChatManager() { return chatManager; } + public void setChatManager(ChatManagerHandler chatManager) { + this.chatManager = chatManager; + } public InventoryManager getInventoryManager() { return inventoryManager;