示例#1
0
    def _send_global_chat_message(self, sender, message):
        server_message = ServerChatMessage()
        server_message.load_client_message(message)
        server_message.sender_guid = sender
        message_packet = server_message.to_packet()

        self.server.broadcast(
            message_packet,
            state = WorldConnectionState.IN_WORLD
        )
        return 0
示例#2
0
    def _send_channel_message(self, channel, sender, message):
        members = channel.get_members()
        if sender not in members:
            return 1

        server_message = ServerChatMessage()
        server_message.load_client_message(message)
        server_message.sender_guid = sender
        message_packet = server_message.to_packet()

        self.server.broadcast(
            message_packet,
            state = WorldConnectionState.IN_WORLD,
            guids = members
        )
        return 0
示例#3
0
    def _send_global_chat_message(self, sender, message):
        server_message = ServerChatMessage()
        server_message.load_client_message(message)
        server_message.sender_guid = sender
        message_packet = server_message.to_packet()

        self.server.broadcast(message_packet,
                              state=WorldConnectionState.IN_WORLD)
        return 0
示例#4
0
    def _send_channel_message(self, channel, sender, message):
        members = channel.get_members()
        if sender not in members:
            return 1

        server_message = ServerChatMessage()
        server_message.load_client_message(message)
        server_message.sender_guid = sender
        message_packet = server_message.to_packet()

        self.server.broadcast(message_packet,
                              state=WorldConnectionState.IN_WORLD,
                              guids=members)
        return 0