def connectionLost(self, reason=protocol.connectionDone): if self.peer is not None: self.peer.transport.loseConnection() self.peer = None if self.playerId is not None and self.psoClient: for f in plugin_manager.onConnectionLoss: f(self) if self.playerId is not None and not self.changingBlocks: for f in plugin_manager.onClientRemove: f(self) clients.remove_client(self) if self.psoClient and self.myUsername is not None: if self.changingBlocks: print("[ShipProxy] %s is changing blocks." % self.myUsername) else: print("[ShipProxy] %s logged out." % self.myUsername) elif self.psoClient and self.myUsername is None: print("[ShipProxy] Client at %s lost connection." % self.transport.getPeer().host)