From d4a9aa327f04c0226e2d80d9c01e0e6d5276247a Mon Sep 17 00:00:00 2001 From: Light2 Date: Fri, 28 Mar 2014 00:55:22 +0100 Subject: [PATCH] Added /broadcast GM command --- scripts/commands/broadcast.py | 12 ++++++++++++ src/services/chat/ChatService.java | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 scripts/commands/broadcast.py diff --git a/scripts/commands/broadcast.py b/scripts/commands/broadcast.py new file mode 100644 index 00000000..afcaebef --- /dev/null +++ b/scripts/commands/broadcast.py @@ -0,0 +1,12 @@ +from services.sui import SUIWindow +from services.sui.SUIWindow import Trigger +from java.util import Vector +import sys + +def setup(): + return + +def run(core, actor, target, commandString): + core.chatService.broadcastGalaxy(commandString) + return + diff --git a/src/services/chat/ChatService.java b/src/services/chat/ChatService.java index 356193c9..eb7c5a15 100644 --- a/src/services/chat/ChatService.java +++ b/src/services/chat/ChatService.java @@ -57,6 +57,7 @@ import protocol.swg.ChatOnSendPersistentMessage; import protocol.swg.ChatPersistentMessageToClient; import protocol.swg.ChatPersistentMessageToServer; import protocol.swg.ChatRequestPersistentMessage; +import protocol.swg.ChatSystemMessage; import protocol.swg.ObjControllerMessage; import protocol.swg.objectControllerObjects.PlayerEmote; import protocol.swg.objectControllerObjects.SpatialChat; @@ -586,5 +587,9 @@ public class ChatService implements INetworkDispatch { return mail; } + + public void broadcastGalaxy(String message) { + core.simulationService.notifyAllClients(new ChatSystemMessage(message, (byte) 0).serialize()); + } }