def send_chat(self, message, sender=UUID(int=0)): for player in self.players: data = player.buff_type.pack_chat(message) + player.buff_type.pack( "B", 0) if player.protocol_version > 578: data += player.buff_type.pack_uuid(sender) player.send_packet("chat_message", data)
def buildProtocol(self, addr): # Build protocol with an unassigned uuid try: k = [*self.uuid_dict.keys()][[*self.uuid_dict.values()].index(None)] pc = InternalProxyExternalProtocol(self, self.buff_class, self.handle_direction, self.other_factory, self.config) pc.uuid = UUID(hex=k) return pc except ValueError: pass
def send_chat(self, message, sender=None): if sender is None: sender = UUID(int=0) for player in self.players: player.send_packet("chat_message", player.buff_type.pack_chat(message), player.buff_type.pack('B', 0), player.buff_type.pack_uuid(sender))
def send_chat(self, message, sender=None): if sender is None: sender = UUID(int=0) self.send_packet( "chat_message", self.buff_type.pack_chat(message), self.buff_type.pack('b', 1), self.buff_type.pack_uuid(sender) )
def buildProtocol(self, addr): # Build protocol with an unassigned uuid try: k = [*self.uuid_dict.keys()][[*self.uuid_dict.values() ].index(None)] return InternalProxyMCClientProtocol(self, self.buff_class, self.handle_direction, self.other_factory, self.protocol_version, uuid=UUID(hex=k)) except ValueError: pass
def write_chat(self, text, direction): if direction == "upstream": return self.buff_type.pack_string(text) elif direction == "downstream": data = self.buff_type.pack_chat(text) # 1.8.x+ if self.downstream.protocol_version >= 47: data += self.buff_type.pack('B', 0) # 1.16.x+ if self.downstream.protocol_version >= 736: data += self.buff_type.pack_uuid(UUID(int=0)) return data
def send_chat_message(self, message): self.protocol.send_packet( 'chat_message', self.protocol.buff_type.pack_string(message), self.protocol.buff_type.pack("b", 1), self.protocol.buff_type.pack_uuid(UUID(int=0)))