hxp
2024-05-27 cc1f0cf4835adc4ac99e05d6fc718b65291bb476
10162 后台优化(查询玩家增加 代金券显示)
2个文件已修改
18 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GetPlayerInfo.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GetPlayerInfo.py
@@ -52,6 +52,7 @@
                  'Gold':PlayerControl.GetMoneyReal(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money),   # 元宝
                  'GoldPaper':PlayerControl.GetMoneyReal(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper),   # 绑钻
                  'Silver':PlayerControl.GetSilver(curPlayer),  # 银两
                  'SilverPaper':PlayerControl.GetMoneyReal(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Paper),   # 神玉
                  
                  'FamilyName':curPlayer.GetFamilyName(),  # 家族名称
                  
@@ -62,6 +63,12 @@
                  'Online':1,
                  }
    
    # 需要额外同步的自定义货币
    CurrencyValueDict = {}
    for moneyType in [ShareDefine.TYPE_Price_PayCoin]:
        CurrencyValueDict['PlayerCurrency_%s' % moneyType] = PlayerControl.GetMoneyReal(curPlayer, moneyType)
    playerInfo.update(CurrencyValueDict)
    resultMsg = str([packCMDList[0], playerInfo, 'GMT_GetPlayerInfo'])
    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'GMToolResult', 
                                                              resultMsg, len(resultMsg))
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py
@@ -101,6 +101,7 @@
        # 回复gm
        return GMCommon.Def_NoTag, ''
    
    roleDict = {}
    moneyMinusDict = {}
    collection = userdb[UCN_RoleNomalDict]
    docs = collection.find({'PlayerID':dbPlayer.PlayerID})
@@ -113,8 +114,10 @@
                obj.readRecord(doc['%s'%(i+1)])
                if obj.DictName.startswith("MoneyMinus_") and obj.DictValue > 0:
                    moneyMinusDict[int(obj.DictName[len("MoneyMinus_"):])] = -obj.DictValue # 货币负值
                    if 1 in moneyMinusDict and 2 in moneyMinusDict:
                    if 1 in moneyMinusDict and 2 in moneyMinusDict and 4 in moneyMinusDict:
                        break
                if obj.DictValue > 0:
                    roleDict[obj.DictName] = obj.DictValue
                
    playerInfo = {
                  'AccID':dbPlayer.AccID,   # 账号
@@ -133,6 +136,7 @@
                  'Gold':moneyMinusDict[1] if 1 in moneyMinusDict else dbPlayer.Gold,   # 元宝
                  'GoldPaper':moneyMinusDict[2] if 2 in moneyMinusDict else dbPlayer.GoldPaper,   # 绑钻
                  'Silver':dbPlayer.Silver,  # 银两
                  'SilverPaper':moneyMinusDict[4] if 4 in moneyMinusDict else dbPlayer.SilverPaper,   # 神玉
                  
                  'FamilyName':dbPlayer.FamilyName,  # 家族名称
                  
@@ -143,6 +147,11 @@
                  'Online':0,
                  }
    
    # 需要额外同步的自定义货币
    CurrencyValueDict = {}
    for moneyType in [99]:
        CurrencyValueDict['PlayerCurrency_%s' % moneyType] = roleDict.get("PlayerCurrency_%s" % moneyType, 0)
    playerInfo.update(CurrencyValueDict)
    return GMCommon.Def_Success, playerInfo