def _params(self): ss = ServerSocket(self.server.ip, self.server.port, self.server.buf) ret = ss.get_player_account(uid=self.uid) if ret['result'] != 0: return None, None, None, None uin = ret['uin'] ret = ss.get_player_world_info(uin) world_info = ret['world_info'] if len(world_info) == 0: return None, None, None, None world_info = Common.first(filter(lambda x: x['uid'] == self.uid, world_info)) world_id = world_info['world_id'] self.zone = world_id self.channel = world_info['channel_id'] world_info = ret['world_info'] return ss, uin, world_id, world_info
def get_player_world_info(self, uin): ss = ServerSocket(self.server.ip, self.server.port, self.server.buf) ret = ss.get_player_world_info(uin) if ret['result'] != self.success['result']: return [] return ret['world_info']