def player_joined(self): """ Called when we join the game. If the server is in online mode, this means the server accepted our session. """ Protocol.player_joined(self) self.logger.info("Joined the game.")
def player_joined(self): """Called when the player joins the game""" Protocol.player_joined(self) self.logger.info("%s has joined." % self.username) self.switch_protocol_mode("play")
def player_joined(self): """Called when the player joins the game""" Protocol.player_joined(self) self.logger.info("%s has joined." % self.display_name) self.switch_protocol_mode("play")
def close(self, reason=None): if not self.closed and reason is not None: # Kick the player if possible. if self.protocol_mode == "play": def real_kick(*a): self.send_packet(0x40, self.buff_type.pack_chat(reason)) Protocol.close(self, reason) if self.safe_kick: self.safe_kick.addCallback(real_kick) else: real_kick() else: if self.protocol_mode == "login": self.send_packet(0x00, self.buff_type.pack_chat(reason)) Protocol.close(self, reason) else: Protocol.close(self, reason)
def close(self, reason=None): """Closes the connection""" if not self.closed and reason is not None: # Kick the player if possible. if self.protocol_mode == "play": def real_kick(*a): self.send_packet("disconnect", self.buff_type.pack_chat(reason)) super(ServerProtocol, self).close(reason) if self.safe_kick: self.safe_kick.addCallback(real_kick) else: real_kick() else: if self.protocol_mode == "login": self.send_packet("login_disconnect", self.buff_type.pack_chat(reason)) Protocol.close(self, reason) else: Protocol.close(self, reason)
def close(self, reason=None): """Closes the connection""" if not self.closed and reason is not None: # Kick the player if possible. if self.protocol_mode == "play": def real_kick(*a): self.send_packet( "disconnect", self.buff_type.pack_chat(reason)) super(ServerProtocol, self).close(reason) if self.safe_kick: self.safe_kick.addCallback(real_kick) else: real_kick() else: if self.protocol_mode == "login": self.send_packet( "login_disconnect", self.buff_type.pack_chat(reason)) Protocol.close(self, reason) else: Protocol.close(self, reason)
def player_left(self): """Called when the player leaves the game""" Protocol.player_left(self) self.logger.info("%s has left." % self.username)
def __init__(self, factory, addr): Protocol.__init__(self, factory, addr) self.server_id = crypto.make_server_id() self.verify_token = crypto.make_verify_token()
def player_left(self): Protocol.player_left(self) self.logger.info("Left the game.")
def player_joined(self): Protocol.player_joined(self) self.logger.info("Joined the game.")
def connection_made(self): Protocol.connection_made(self) self.switch_protocol_mode(self.protocol_mode_next)
def player_left(self): """Called when we leave the game.""" Protocol.player_left(self) self.logger.info("Left the game.")
def __init__(self, factory, addr): Protocol.__init__(self, factory, addr)
def player_left(self): Protocol.player_left(self) self.logger.info("%s has left." % self.username)
def real_kick(*a): self.send_packet(0x40, self.buff_type.pack_chat(reason)) Protocol.close(self, reason)
def __init__(self, factory, remote_addr): Protocol.__init__(self, factory, remote_addr)
def connection_lost(self, reason=None): """Called when the connection is lost""" if self.protocol_mode in ("login", "play"): self.factory.players.discard(self) Protocol.connection_lost(self, reason)
def player_left(self): """Called when the player leaves the game""" Protocol.player_left(self) self.logger.info("%s has left." % self.display_name)
def connection_made(self): """Called when the connection is established""" Protocol.connection_made(self) self.switch_protocol_mode(self.protocol_mode_next)
def player_joined(self): Protocol.player_joined(self) self.logger.info("%s has joined." % self.username) self.switch_protocol_mode("play")
def real_kick(*a): self.send_packet("disconnect", self.buff_type.pack_chat(reason)) Protocol.close(self, reason)
def __init__(self, factory, remote_addr): Protocol.__init__(self, factory, remote_addr) self.server_id = crypto.make_server_id() self.verify_token = crypto.make_verify_token()