def send_command_stc(self, command_type, *args): if not self.server.is_client(self): # Ignore commands sent to disconnected clients return if len(args) > 1 and isinstance(args[1], TsuserverException): new_args = [args[0], args[1].message] args = tuple(new_args) command_type, *args = Constants.encode_ao_packet([command_type] + list(args)) self.receive_command_stc(command_type, *args)
def convert_symbol_to_word(mes): if mes is None: return None return Constants.encode_ao_packet([mes])[0]