def alliance_appoint(p, req): ''' 公会任命 ''' cid, [other_cid, position] = req _m = g_UserMgr.getUser(cid) if not _m: defer.returnValue(CONNECTION_LOSE) if not _m.alliance or not _m.has_authority: defer.returnValue(ALLIANCE_NEED_VICE_LEADER) # 判断该玩家当前的公会状态 _other_m = yield g_UserMgr.get_offline_user(other_cid) if not _other_m or not _other_m.alliance or _other_m.alliance.aid != _m.alliance.aid: defer.returnValue(ALLIANCE_NOT_MEMBER_ERROR) if _other_m.position == position: defer.returnValue(ALLIANCE_HAD_IN_POSITION) if position == ALLIANCE_POSITION_LEADER: if _m.isLeader: _m.update_position(ALLIANCE_POSITION_NORMAL) res_err = _m.alliance.appoint_leader(_other_m, _m) defer.returnValue(res_err) else: defer.returnValue(ALLIANCE_NEED_LEADER) elif position == ALLIANCE_POSITION_VICE: if not _m.isLeader: defer.returnValue(ALLIANCE_NEED_LEADER) res_err = _m.alliance.appoint_vice(_other_m, _m) defer.returnValue(res_err) else: res_err = _m.alliance.appoint_normal(_other_m, _m) defer.returnValue(res_err)
def alliance_kick(p, req): ''' 将成员踢出公会 ''' cid, [kick_cid] = req _m = g_UserMgr.getUser(cid) if not _m: defer.returnValue(CONNECTION_LOSE) if not _m.alliance or not _m.has_authority: defer.returnValue(ALLIANCE_NEED_VICE_LEADER) _kick_m = yield g_UserMgr.get_offline_user(kick_cid) if not _kick_m: defer.returnValue(UNKNOWN_ERROR) # 判断该玩家当前的公会状态 if not _kick_m.alliance or _kick_m.alliance.aid != _m.alliance.aid: _m.alliance.del_invalid_member(_kick_m) defer.returnValue(NO_ERROR) if _kick_m.position and _m.position >= _kick_m.position: defer.returnValue(ALLIANCE_NEED_VICE_LEADER) yield _m.alliance.del_member(_kick_m, _m) defer.returnValue(NO_ERROR)
def check_valid_messages(self, cid, flag=False): ''' @param: flag-True:需要详细信息的标志位, False:不需要详情 ''' _all_messages = yield redis.hget(HASH_ALLIANCE_MESSAGES, self.__id) if _all_messages: _all_messages = loads(_all_messages) else: _all_messages = [] _daily_count = 0 # 今日已留言的次数 _valid_messages = [] _details = [] for _message in _all_messages: _m = g_UserMgr.getUser( _message[1] ) if not _m: continue # 检查时间是否过期, 7天 if check_valid_time(_message[0], hour=MESSAGES_VALID_HOUR): continue if cid == _m.cid and timestamp_is_today(_message[0]): _daily_count += 1 _valid_messages.append( _message ) if flag: _details.append( (_message[0], _m.cid, _m.lead_id, _m.nick_name, _m.level, _m.position, _message[2]) ) defer.returnValue( (_daily_count, _valid_messages, _details) )
def alliance_join_request(p, req): ''' 申请/取消申请加入公会 ''' cid, [alliance_id, req_type] = req _m = g_UserMgr.getUser(cid) if not _m: defer.returnValue(CONNECTION_LOSE) if _m.alliance: defer.returnValue(ALLIANCE_SELF_HAD_IN) if _m.cd_time > int(time()): defer.returnValue(IN_COOLDOWN_ERROR) _reqs = character_requests(cid) _alliance = server.get_alliance(alliance_id) # 该公会不存在 if not _alliance: defer.returnValue(ALLIANCE_UNKNOWN_ERROR) res_err = UNKNOWN_ERROR if req_type == 1: # 申请加入公会 if len(_reqs) >= ALLIANCE_REQUEST_MAX: defer.returnValue(ALLIANCE_APPLY_COUNT_ERROR) res_err = _alliance.new_request(_m) elif req_type == 2: # 取消申请 res_err = yield _alliance.del_request(_m.cid) defer.returnValue(res_err)
def alliance_create(p, req): cid, [name, create_type] = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) # 判断玩家是否有仙盟 if _m.alliance: returnValue(ALLIANCE_SELF_HAD_IN) name = name.strip() _all = server.alliances for _alliance in _all: # 仙盟名重复 if _alliance.name == name: returnValue(ALLIANCE_NAME_DUPLICATED) res_gs, golds, credits = yield gs_call('gs_create_alliance', [cid, create_type]) if res_gs: returnValue(res_gs) _alliance = yield server.create_alliance(name, _m) _rank = server.rank(_alliance) syslogger(LOG_ALLIANCE_CREATE, cid, _m.level, _m.vip_level, _alliance.aid) returnValue((golds, credits, _alliance.info + [_rank, _alliance.notice]))
def alliance_create(p, req): cid, [ name, create_type ] = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) # 判断玩家是否有仙盟 if _m.alliance: returnValue( ALLIANCE_SELF_HAD_IN ) name = name.strip() _all = server.alliances for _alliance in _all: # 仙盟名重复 if _alliance.name == name: returnValue( ALLIANCE_NAME_DUPLICATED ) res_gs, golds, credits = yield gs_call( 'gs_create_alliance', [ cid, create_type ] ) if res_gs: returnValue( res_gs ) _alliance = yield server.create_alliance( name, _m ) _rank = server.rank( _alliance ) syslogger(LOG_ALLIANCE_CREATE, cid, _m.level, _m.vip_level, _alliance.aid) returnValue( (golds, credits, _alliance.info+[_rank, _alliance.notice]) )
def sync( self ): if not self.__dirty or self.deleted: defer.returnValue( NO_ERROR ) yield redis.hset( HASH_ALLIANCE_INFO, self.__id, self.stream ) # 同步在线公会成员的信息, 离线玩家已经在下线时同步了 for _cid in self.__members: _m = g_UserMgr.getUser( _cid ) if _m: yield _m.sync()
def online_lead_cids(self, except_cids=[]): ''' 公会中在线的会长/副会长的CID列表 @param: except_cids-需要排除的玩家CID列表 ''' _cids = [] for _cid in self.__vice_leaders: if _cid in except_cids: continue _m = g_UserMgr.getUser( _cid ) if _m: _cids.append( _cid ) if self.leader_id in except_cids: return _cids _m = g_UserMgr.getUser( self.leader_id ) if _m: _cids.append( self.leader_id ) return _cids
def online_cids(self, except_cids=[]): ''' 公会中在线成员的CID列表 @param: except_cids-需要排除的玩家CID列表 ''' _cids = [] for _cid in self.__members: if _cid in except_cids: continue _m = g_UserMgr.getUser( _cid ) if _m: _cids.append( _cid ) return _cids
def alliance_members(p, req): ''' 成员列表顺序由客户端排序 ''' cid, = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) if not _m.alliance: returnValue(ALLIANCE_NOT_MEMBER_ERROR) _info = yield g_UserMgr.get_alliance_members(_m.alliance.members) returnValue(_info)
def alliance_join_audit_list(p, req): ''' 会长/副会长 获取加入公会的申请列表 ''' cid, = req _m = g_UserMgr.getUser(cid) if not _m: return CONNECTION_LOSE if not _m.alliance or not _m.has_authority: return ALLIANCE_NEED_VICE_LEADER _info = _m.alliance.request_info() return _info
def alliance_request_list(p, req): ''' 获取自己已申请的公会列表 ''' cid, = req _m = g_UserMgr.getUser(cid) if not _m: return CONNECTION_LOSE if _m.alliance: return ALLIANCE_SELF_HAD_IN _info = [_r.aid for _r in character_requests(cid) if _r.aid >= 0] return _info
def alliance_action(p, req): cid, [index] = req _m = g_UserMgr.getUser( cid ) if not _m: return CONNECTION_LOSE # 仙盟成员判断 if (not _m.alliance): return ALLIANCE_NOT_MEMBER_ERROR res_err = _m.alliance.get_all_actions( index ) return res_err
def alliance_action(p, req): cid, [index] = req _m = g_UserMgr.getUser(cid) if not _m: return CONNECTION_LOSE # 仙盟成员判断 if (not _m.alliance): return ALLIANCE_NOT_MEMBER_ERROR res_err = _m.alliance.get_all_actions(index) return res_err
def alliance_members(p, req): ''' 成员列表顺序由客户端排序 ''' cid, = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) if not _m.alliance: returnValue( ALLIANCE_NOT_MEMBER_ERROR ) _info = yield g_UserMgr.get_alliance_members( _m.alliance.members ) returnValue( _info )
def appoint_normal(self, member, action_member): if member.cid in self.__vice_leaders: self.__vice_leaders.remove( member.cid ) # 公会动态 self.new_action( (ALLIANCE_ACTION_10, int(time()), action_member.cid, \ action_member.lead_id, action_member.nick_name, action_member.level, [member.lead_id, member.nick_name]) ) # 通知在线玩家职位变化的标志位 _notice_flag = False _m = g_UserMgr.getUser( member.cid ) if _m: _notice_flag = True member.update_position( ALLIANCE_POSITION_NORMAL, _notice_flag ) return NO_ERROR
def alliance_hall_contribute(p, req): ''' 仙盟成员建设仙盟大殿 ''' cid, [contribute_id] = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) # 仙盟成员判断 if (not _m.alliance): returnValue(ALLIANCE_NOT_MEMBER_ERROR) res_err = yield _m.alliance.hall_contribute(contribute_id, _m) returnValue(res_err)
def alliance_hall_contribute(p, req): ''' 仙盟成员建设仙盟大殿 ''' cid, [contribute_id] = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) # 仙盟成员判断 if (not _m.alliance): returnValue( ALLIANCE_NOT_MEMBER_ERROR ) res_err = yield _m.alliance.hall_contribute( contribute_id, _m ) returnValue( res_err )
def alliance_sacrifice(p, req): ''' 仙盟女蜗宫拜祭 ''' cid, [sacrifice_type] = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) # 仙盟成员判断 if (not _m.alliance): returnValue(ALLIANCE_NOT_MEMBER_ERROR) res_err = yield _m.alliance.daily_sacrifice(sacrifice_type, _m) returnValue(res_err)
def alliance_get_messages(p, req): ''' 获取留言 ''' cid, [index] = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) # 仙盟成员判断 if (not _m.alliance): returnValue( ALLIANCE_NOT_MEMBER_ERROR ) res_err = yield _m.alliance.get_all_messages( _m, index ) returnValue( res_err )
def alliance_add_messages(p, req): ''' 新增留言 ''' cid, [content] = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) # 仙盟成员判断 if (not _m.alliance): returnValue( ALLIANCE_NOT_MEMBER_ERROR ) res_err = yield _m.alliance.new_messages( _m, content ) returnValue( res_err )
def alliance_add_messages(p, req): ''' 新增留言 ''' cid, [content] = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) # 仙盟成员判断 if (not _m.alliance): returnValue(ALLIANCE_NOT_MEMBER_ERROR) res_err = yield _m.alliance.new_messages(_m, content) returnValue(res_err)
def alliance_get_messages(p, req): ''' 获取留言 ''' cid, [index] = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) # 仙盟成员判断 if (not _m.alliance): returnValue(ALLIANCE_NOT_MEMBER_ERROR) res_err = yield _m.alliance.get_all_messages(_m, index) returnValue(res_err)
def alliance_hall_info(p, req): ''' 仙盟大殿的建设信息 ''' cid, = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) # 仙盟成员判断 if (not _m.alliance): returnValue( ALLIANCE_NOT_MEMBER_ERROR ) res_err = yield _m.alliance.hall_info( cid ) returnValue( res_err )
def alliance_hall_info(p, req): ''' 仙盟大殿的建设信息 ''' cid, = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) # 仙盟成员判断 if (not _m.alliance): returnValue(ALLIANCE_NOT_MEMBER_ERROR) res_err = yield _m.alliance.hall_info(cid) returnValue(res_err)
def alliance_sacrifice(p, req): ''' 仙盟女蜗宫拜祭 ''' cid, [sacrifice_type] = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) # 仙盟成员判断 if (not _m.alliance): returnValue( ALLIANCE_NOT_MEMBER_ERROR ) res_err = yield _m.alliance.daily_sacrifice( sacrifice_type, _m ) returnValue( res_err )
def alliance_shop_item_info(p, req): ''' 获取仙盟商店中道具的可兑换信息 ''' cid, = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) # 仙盟成员判断 if (not _m.alliance): returnValue(ALLIANCE_NOT_MEMBER_ERROR) res_err = yield _m.alliance.item_info(_m) returnValue(res_err[1:])
def alliance_shop_item_exchange(p, req): ''' 兑换仙盟商店中的道具 ''' cid, [shop_item_id] = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) # 仙盟成员判断 if (not _m.alliance): returnValue(ALLIANCE_NOT_MEMBER_ERROR) res_err = yield _m.alliance.item_exchange(_m, shop_item_id) returnValue(res_err)
def alliance_shop_item_info(p, req): ''' 获取仙盟商店中道具的可兑换信息 ''' cid, = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) # 仙盟成员判断 if (not _m.alliance): returnValue( ALLIANCE_NOT_MEMBER_ERROR ) res_err = yield _m.alliance.item_info(_m) returnValue( res_err[1:] )
def alliance_shop_item_exchange(p, req): ''' 兑换仙盟商店中的道具 ''' cid, [shop_item_id] = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) # 仙盟成员判断 if (not _m.alliance): returnValue( ALLIANCE_NOT_MEMBER_ERROR ) res_err = yield _m.alliance.item_exchange(_m, shop_item_id) returnValue( res_err )
def alliance_info(p, req): cid, = req _m = g_UserMgr.getUser( cid ) if not _m: return CONNECTION_LOSE _info = None _alliance = _m.alliance if _alliance: _rank = server.rank( _alliance ) _info = _alliance.info + [ _rank, _alliance.building_levels, _alliance.notice ] else: _info = [] return (_m.cd_time, _m.contribution, _m.position, _info)
def appoint_vice(self, member, action_member): if len(self.__vice_leaders) >= ALLIANCE_VICE_MAX: return ALLIANCE_VICE_LIMIT_ERROR self.__vice_leaders.append( member.cid ) # 通知在线玩家职位变化的标志位 _notice_flag = False _m = g_UserMgr.getUser( member.cid ) if _m: _notice_flag = True member.update_position( ALLIANCE_POSITION_VICE, _notice_flag ) # 公会动态 self.new_action( (ALLIANCE_ACTION_5, int(time()), action_member.cid, \ action_member.lead_id, action_member.nick_name, action_member.level, [member.lead_id, member.nick_name]) ) self.dirty() return NO_ERROR
def alliance_sacrifice_info(p, req): ''' 仙盟女娲宫基本信息 ''' cid, = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) # 仙盟成员判断 if (not _m.alliance): returnValue( ALLIANCE_NOT_MEMBER_ERROR ) res_err = yield _m.alliance.sacrifice_info( _m ) if isinstance(res_err, (tuple, list)): returnValue( res_err[:5] ) returnValue( res_err )
def alliance_sacrifice_info(p, req): ''' 仙盟女娲宫基本信息 ''' cid, = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) # 仙盟成员判断 if (not _m.alliance): returnValue(ALLIANCE_NOT_MEMBER_ERROR) res_err = yield _m.alliance.sacrifice_info(_m) if isinstance(res_err, (tuple, list)): returnValue(res_err[:5]) returnValue(res_err)
def alliance_upgrade(p, req): ''' 建筑升级 ''' cid, [build_type] = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) # 操作权限检查 if (not _m.alliance): returnValue(ALLIANCE_NOT_MEMBER_ERROR) if ((not _m.isLeader) and (not _m.isViceLeader)): returnValue(ALLIANCE_NEED_VICE_LEADER) res_err = yield _m.alliance.upgrade_level(_m, build_type) returnValue(res_err)
def alliance_search(p, req): cid, [name, index] = req _m = g_UserMgr.getUser( cid ) if not _m: return CONNECTION_LOSE _all = server.filter_by_name( name ) _list = _all[:index + ALLIANCES_PER_PAGE] _alliances = [] for _alliance in _list: _rank = server.rank( _alliance ) _alliances.append( _alliance.info + [ _rank ] ) return [index, len(_all), _alliances]
def alliance_upgrade(p, req): ''' 建筑升级 ''' cid, [build_type] = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) # 操作权限检查 if (not _m.alliance): returnValue( ALLIANCE_NOT_MEMBER_ERROR ) if((not _m.isLeader) and (not _m.isViceLeader)): returnValue( ALLIANCE_NEED_VICE_LEADER ) res_err = yield _m.alliance.upgrade_level(_m, build_type) returnValue( res_err )
def alliance_search(p, req): cid, [name, index] = req _m = g_UserMgr.getUser(cid) if not _m: return CONNECTION_LOSE _all = server.filter_by_name(name) _list = _all[:index + ALLIANCES_PER_PAGE] _alliances = [] for _alliance in _list: _rank = server.rank(_alliance) _alliances.append(_alliance.info + [_rank]) return [index, len(_all), _alliances]
def sync_char_data(p, req): ''' _type: 1-nick_name, 2-lead_id, 3-vip_level, 4-level, 5-might ''' cid, _type, _value = req user = g_UserMgr.getUser(cid) if user: if _type == SYNC_NICK_NAME: user.rename( _value ) elif _type == SYNC_LEAD_ID: user.update_lead_id( _value ) elif _type == SYNC_LEVEL: user.update_level( _value ) elif _type == SYNC_MIGHT: yield user.update_might( _value ) elif _type == SYNC_ARENA_RANK: user.update_arena_rank( _value ) elif _type == SYNC_VIP_LEVEL: user.update_vip_level( _value )
def alliance_modify_content(p, req): ''' 修改仙盟宣言/公告 ''' cid, [desc_type, new_desc] = req _m = g_UserMgr.getUser(cid) if not _m: return CONNECTION_LOSE # 操作权限检查 if (not _m.alliance) or ((not _m.isLeader) and (not _m.isViceLeader)): return ALLIANCE_NEED_VICE_LEADER ## 长度限制 #_length = len(new_desc) #if _length > 25: # return STRING_LENGTH_ERROR _m.alliance.update_description(desc_type, new_desc) return NO_ERROR
def appoint_leader(self, member, old_leader=None): self.__leader_id, self.__leader_name, self.__leader_level = member.cid, member.name, member.level # 通知在线玩家职位变化的标志位 _notice_flag = False _m = g_UserMgr.getUser( member.cid ) if _m: _notice_flag = True # 检查职位 if member.cid in self.__vice_leaders: self.__vice_leaders.remove( member.cid ) member.update_position( ALLIANCE_POSITION_LEADER, _notice_flag ) # 公会动态 if old_leader: self.new_action( (ALLIANCE_ACTION_4, int(time()), old_leader.cid, \ old_leader.lead_id, old_leader.nick_name, old_leader.level, [member.lead_id, member.nick_name]) ) self.dirty() return NO_ERROR
def alliance_modify_content(p, req): ''' 修改仙盟宣言/公告 ''' cid, [desc_type, new_desc] = req _m = g_UserMgr.getUser( cid ) if not _m: return CONNECTION_LOSE # 操作权限检查 if (not _m.alliance) or ((not _m.isLeader) and (not _m.isViceLeader)): return ALLIANCE_NEED_VICE_LEADER ## 长度限制 #_length = len(new_desc) #if _length > 25: # return STRING_LENGTH_ERROR _m.alliance.update_description(desc_type, new_desc) return NO_ERROR
def alliance_info(p, req): cid, = req _m = g_UserMgr.getUser(cid) if not _m: return CONNECTION_LOSE _info = None _alliance = _m.alliance if _alliance: _rank = server.rank(_alliance) _info = _alliance.info + [ _rank, _alliance.building_levels, _alliance.notice ] else: _info = [] return (_m.cd_time, _m.contribution, _m.position, _info)
def alliance_dissolve(p, req): ''' 解散仙盟 ''' cid, = req _m = g_UserMgr.getUser( cid ) if not _m: returnValue( CONNECTION_LOSE ) if not _m.alliance: returnValue( ALLIANCE_NOT_MEMBER_ERROR ) if not _m.isLeader: returnValue( ALLIANCE_NEED_LEADER ) res_err = yield server.dissolve_alliance( _m.alliance.aid ) if not res_err: syslogger(LOG_ALLIANCE_DISSOLVE, cid, _m.level, _m.vip_level, _m.alliance.aid) yield _m.clean_alliance() returnValue( res_err )
def alliance_join_audit(p, req): ''' 审核公会申请 ''' cid, [_type, req_cid] = req _m = g_UserMgr.getUser(cid) if not _m: defer.returnValue(CONNECTION_LOSE) if not _m.alliance or not _m.has_authority: defer.returnValue(ALLIANCE_NEED_VICE_LEADER) if _type == ALLIANCE_REQUEST_REJECT: if not req_cid: res_err = yield _m.alliance.reject_all() else: res_err = yield _m.alliance.del_request(req_cid) else: res_err = yield _m.alliance.del_request(req_cid, True, _m) defer.returnValue(res_err)
def alliance_leave(p, req): ''' 离开公会 ''' cid, = req _m = g_UserMgr.getUser(cid) if not _m: defer.returnValue(CONNECTION_LOSE) if not _m.alliance: defer.returnValue(ALLIANCE_NOT_MEMBER_ERROR) if _m.isLeader: defer.returnValue(ALLIANCE_LEADER_LEAVE_ERROR) _alliance = server.get_alliance(_m.alliance.aid) if not _alliance: defer.returnValue(ALLIANCE_UNKNOWN_ERROR) yield _alliance.del_member(_m) defer.returnValue(NO_ERROR)
def alliance_dissolve(p, req): ''' 解散仙盟 ''' cid, = req _m = g_UserMgr.getUser(cid) if not _m: returnValue(CONNECTION_LOSE) if not _m.alliance: returnValue(ALLIANCE_NOT_MEMBER_ERROR) if not _m.isLeader: returnValue(ALLIANCE_NEED_LEADER) res_err = yield server.dissolve_alliance(_m.alliance.aid) if not res_err: syslogger(LOG_ALLIANCE_DISSOLVE, cid, _m.level, _m.vip_level, _m.alliance.aid) yield _m.clean_alliance() returnValue(res_err)
def alliance_list(p, req): cid, [index,] = req _m = g_UserMgr.getUser( cid ) if not _m: return CONNECTION_LOSE _all = server.alliances _total = len(_all) _start = _total - index - ALLIANCES_PER_PAGE _start = _start if _start > 0 else 0 #_end = _total - index _list = _all[_start:] _list.reverse() _alliances = [] for _i, _alliance in enumerate(_list): #_rank = server.rank( _alliance ) _rank = _i + 1 _alliances.append( _alliance.info + [ _rank ] ) return [index, len(_all), _alliances]
def revise_member_name(p, req): cid, new_name = req user = g_UserMgr.getUser(cid) if user: user.rename(new_name)