From 899cbe5a67b93eac7d60663426bb6b7959271cc1 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 30 八月 2021 14:34:24 +0800
Subject: [PATCH] 1111 【后端】【bt3】【bt3_1.100.1】【主干】【gt_1.101.1】回本服后刷新本服角色信息时增加刷新视野逻辑
---
ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_GetFamilyInfo.py | 51 +++++++++++++++++++++++++++++----------------------
1 files changed, 29 insertions(+), 22 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_GetFamilyInfo.py b/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_GetFamilyInfo.py
index 04c84da..74084f4 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_GetFamilyInfo.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_GetFamilyInfo.py
@@ -19,6 +19,7 @@
#导入
import GMCommon
import GameWorld
+import PlayerFamily
#---------------------------------------------------------------------
#全局变量
#---------------------------------------------------------------------
@@ -44,28 +45,34 @@
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
@@ -89,38 +96,38 @@
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 > 1 else offLineTime
+
# 成员信息
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
--
Gitblit v1.8.0