def sendServerMessage(self, message): ''' Sends a chat message from the server to all players. @param message: The message you want everyone to see. ''' self.getGame().sendServerCommand(ChatMsg(OPEN_CHAT, text=message))
def sendPublicChat(self, player, text): self.sendRequest(ChatMsg(OPEN_CHAT, text=text.encode()))
def sendTeamChat(self, player, text): self.sendRequest(ChatMsg(TEAM_CHAT, player.teamId, text=text.encode()))
def sendPrivateChat(self, player, targetId, text): self.sendRequest(ChatMsg(PRIVATE_CHAT, targetId, text=text.encode()))
def sendPrivateChat(self, fromPlayer, toPlayer, text): fromPlayer.agent.sendRequest( ChatMsg(PRIVATE_CHAT, toPlayer.id, text=text.encode()))