| | |
| | | #导入
|
| | | import GMCommon
|
| | | import GameWorld
|
| | | import PlayerFamily
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | #---------------------------------------------------------------------
|
| | |
| | | if queryType == 'normal':
|
| | | curFamily = GameWorld.GetFamilyManager().FindFamilyByName(familyName)
|
| | | familyInfo.append(GetQueryFamilyInfo(curFamily, True))
|
| | | |
| | | # 模糊查询
|
| | | elif queryType == 'faintness':
|
| | | for index in range(GameWorld.GetFamilyManager().GetCount()):
|
| | | |
| | | curFamily = GameWorld.GetFamilyManager().GetAt(index)
|
| | |
|
| | | familyMgr = GameWorld.GetFamilyManager()
|
| | | sortFamilyIDList = PlayerFamily.GetSortFamilyIDList()
|
| | | for familyID in sortFamilyIDList:
|
| | | curFamily = familyMgr.FindFamily(familyID)
|
| | | if not curFamily:
|
| | | continue
|
| | | if familyName not in curFamily.GetName():
|
| | | continue
|
| | | |
| | | familyInfo.append(GetQueryFamilyInfo(curFamily, False))
|
| | | |
| | | # 全部
|
| | | elif queryType == 'all':
|
| | | for index in range(GameWorld.GetFamilyManager().GetCount()):
|
| | | |
| | | curFamily = GameWorld.GetFamilyManager().GetAt(index)
|
| | | familyMgr = GameWorld.GetFamilyManager()
|
| | | sortFamilyIDList = PlayerFamily.GetSortFamilyIDList()
|
| | | for familyID in sortFamilyIDList:
|
| | | curFamily = familyMgr.FindFamily(familyID)
|
| | | if not curFamily:
|
| | | continue
|
| | | familyInfo.append(GetQueryFamilyInfo(curFamily, False))
|
| | | |
| | | |
| | | if len(familyInfo) > pow(2, 14):
|
| | | #数据过大
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_MaxLimit)
|
| | | return
|
| | | |
| | | |
| | | #执行成功
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, familyInfo)
|
| | | return
|
| | |
| | | player = GameWorld.GetPlayerManager().FindPlayerByID(curMember.GetPlayerID())
|
| | |
|
| | | # 是否在线
|
| | | isOnline = 0
|
| | | if player != None:
|
| | | isOnline = 1
|
| | | onlineCnt += 1
|
| | |
|
| | | if not memberDetail:
|
| | | continue
|
| | |
|
| | | offLineTime = curMember.GetExattr2()
|
| | | offLineSeconds = GameWorld.GetPastSeconds(GameWorld.ChangeTimeNumToStr(offLineTime)) if offLineTime else 0
|
| | | |
| | | # 成员信息
|
| | | member = {
|
| | | 'FamilyLV':curMember.GetFamilyLV(),
|
| | | 'PlayerID':curMember.GetPlayerID(),
|
| | | 'Name':curMember.GetName(),
|
| | | 'LV':curMember.GetLV(),
|
| | | 'FamilyLV':curMember.GetFamilyLV(),
|
| | | 'ActiveValue':curMember.GetFamilyActiveValue(),
|
| | | 'IsOnLine':isOnline, |
| | | 'OffLineSeconds':offLineSeconds, |
| | | }
|
| | | memberInfo.append(member)
|
| | | |
| | | |
| | | familyInfo = {
|
| | | 'Rank':PlayerFamily.GetFamilyIDRank(curFamily.GetID()), # 排名
|
| | | 'WarRank':PlayerFamily.GetFamilyWarRank(curFamily), # 联赛排名
|
| | | 'FightPower':PlayerFamily.GetFamilyTotalFightPower(curFamily), # 总战力
|
| | | 'FamilyName':curFamily.GetName(),
|
| | | 'LeaderName':curFamily.GetLeaderName(),
|
| | | 'LV':curFamily.GetLV(),
|
| | | 'Broadcast':curFamily.GetBroadcast(),
|
| | | 'MemberCnt':memberCnt,
|
| | | |
| | | 'FamilyID':curFamily.GetID(), |
| | | 'Hornor':curFamily.GetHornor(), |
| | | 'Money':curFamily.GetMoney(),
|
| | | 'CreateTime':curFamily.GetCreateTime(),
|
| | | 'MemberInfo':memberInfo,
|
| | | 'OnLineCnt':onlineCnt,
|
| | | }
|
| | | if memberInfo:
|
| | | familyInfo['MemberInfo'] = memberInfo
|
| | |
|
| | | return familyInfo
|
| | |
|