From c85a609a308ef971bc4774a5d4c9d7e3203f5708 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 04 六月 2021 19:02:40 +0800
Subject: [PATCH] 8971 【主干】【BT2】仙玉和灵石增加支持负数

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py                                   |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py                                   |   10 +++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py                                |    4 
 ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py                                   |   19 +++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py                          |    8 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTDelPlayerMoney.py |    7 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GetPlayerInfo.py     |    6 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintMoney.py                        |    4 
 ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py                                                        |   10 +++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py                          |   89 ++++++++++++++++++++++++-----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                                      |    1 
 11 files changed, 125 insertions(+), 35 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
index edf8b61..87bd2d3 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -959,7 +959,9 @@
 CDBPlayerRefresh_BossActScore, # boss 活动积分 230
 CDBPlayerRefresh_FuncSysPrivilege, # 功能特权令 231
 CDBPlayerRefresh_Environment, # 环保值 232
-) = range(146, 233)
+CDBPlayerRefresh_MoneyMinusGold, # 仙玉 - 负值 233
+CDBPlayerRefresh_MoneyMinusGoldPaper, # 绑玉 - 负值 234
+) = range(146, 235)
 
 TYPE_Price_Gold_Paper_Money = 5    # 金钱类型,(先用礼券,再用金子)
 TYPE_Price_Family_Contribution = 6 # 战盟贡献度(活跃度转换得来)
@@ -1007,6 +1009,12 @@
                            TYPE_Price_Environment:CDBPlayerRefresh_Environment,
                            }
 
+# 支持负值的货币及对应0418刷新类型
+MoneyMinusRefreshDict = {
+                         1:CDBPlayerRefresh_MoneyMinusGold,
+                         2:CDBPlayerRefresh_MoneyMinusGoldPaper,
+                         }
+
 # 高效战斗状态
 Def_Battle_Status = (
     Def_Battle_Start,    # 激活
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 7de0565..663335c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3549,6 +3549,7 @@
 Def_PDict_MysticalShopGoods = "MysticalShopGoods_%s"   # 神秘商店商品ID,索引
 Def_PDict_MysticalShopRefreshCnt = "MysticalShopRefreshCnt"   # 神秘商店已手动刷新次数
 Def_PDict_MysticalShopLVRefreshCnt = "MysticalShopLVRefreshCnt"   # 神秘商店等级段刷新次数
+Def_PDict_MoneyMinus = "MoneyMinus_%s"  # 货币对应负值, 参数[货币类型]
 Def_PDict_Currency = "PlayerCurrency_%s"  # 自定义货币类型, 参数[自定义货币类型]
 Def_PDict_TJGSet = "TJGSet"  # 脱机挂系统设定
 Def_PDict_TJGDeadTime = "TJGDeadTime"  # 脱机被杀时间
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py
index 2013809..4815d2b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py
@@ -773,7 +773,7 @@
     dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), 
                 'AccID':curPlayer.GetAccID(), "eventName":eventName,
                 'MoneyType':moneyType, 'MoneyCount':moneyCount, 
-                'PlayerMoneyCount':PlayerControl.GetMoney(curPlayer, moneyType), 
+                'PlayerMoneyCount':PlayerControl.GetMoneyReal(curPlayer, moneyType), 
                 'VIPLV':curPlayer.GetVIPLv(), 'PlayerLV':curPlayer.GetLV()}
     
     dataDict.update(addDataDict)
@@ -823,7 +823,7 @@
     dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), 
                 'AccID':curPlayer.GetAccID(), "eventName":eventName,
                 'MoneyType':moneyType, 'MoneyCount':moneyCount, 
-                'PlayerMoneyCount':PlayerControl.GetMoney(curPlayer, moneyType), 
+                'PlayerMoneyCount':PlayerControl.GetMoneyReal(curPlayer, moneyType), 
                 'VIPLV':curPlayer.GetVIPLv(), 'PlayerLV':curPlayer.GetLV()}
     
     dataDict.update(addDataDict)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
index 44567ba..3c8eaf7 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
@@ -697,7 +697,7 @@
     EventReport(ShareDefine.Def_UserAction_VirtualResource, 
                 "Price=%s&Quantity=%s&OperateType=%s&CurrencyType=%s&Recharged=%s&Flow=%s&Balance=%s&OperatorExtra=%s"%(
                 price, quantity, reason_name, type_name, Recharged, flow, 
-                PlayerControl.GetMoney(curPlayer, type_name), json.dumps(extraDict, ensure_ascii=False)), curPlayer)
+                PlayerControl.GetMoneyReal(curPlayer, type_name), json.dumps(extraDict, ensure_ascii=False)), curPlayer)
     return
 
 ## 写任务事件记录
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintMoney.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintMoney.py
index 4b9b3e5..7ff97fc 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintMoney.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintMoney.py
@@ -27,7 +27,7 @@
     if msgList:
         moneyType = msgList[0]
         name = SetMoney.moneyNameDict.get(moneyType, str(moneyType))
-        GameWorld.DebugAnswer(curPlayer, "%s%s=%s" % (moneyType, name, PlayerControl.GetMoney(curPlayer, moneyType)))
+        GameWorld.DebugAnswer(curPlayer, "%s%s=%s" % (moneyType, name, PlayerControl.GetMoneyReal(curPlayer, moneyType)))
         return
     
     GameWorld.DebugAnswer(curPlayer, "--------------------")
@@ -35,7 +35,7 @@
     moneyTypeList.sort()
     for moneyType in moneyTypeList:
         name = SetMoney.moneyNameDict[moneyType]
-        GameWorld.DebugAnswer(curPlayer, "%s%s=%s" % (moneyType, name, PlayerControl.GetMoney(curPlayer, moneyType)))
+        GameWorld.DebugAnswer(curPlayer, "%s%s=%s" % (moneyType, name, PlayerControl.GetMoneyReal(curPlayer, moneyType)))
     return
 
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py
index 0eca5f9..23e21ed 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py
@@ -46,7 +46,7 @@
         else:
             moneyList = [moneyType]
         for moneyType in moneyList:
-            GameWorld.DebugAnswer(curPlayer, "(%s) %s: %s" % (moneyType, moneyNameDict.get(moneyType, moneyType), PlayerControl.GetMoney(curPlayer, moneyType)))
+            GameWorld.DebugAnswer(curPlayer, "(%s) %s: %s" % (moneyType, moneyNameDict.get(moneyType, moneyType), PlayerControl.GetMoneyReal(curPlayer, moneyType)))
         return
     
     if len(List) != 2:
@@ -73,12 +73,12 @@
         GameWorld.DebugAnswer(curPlayer, Lang.GBText("钱币类型不正确"))
         return
     #0文不处理
-    if moneyCount < 0:
+    if moneyType not in ShareDefine.MoneyMinusRefreshDict and moneyCount < 0:
         return
     isOK = False
-    playerMoney = PlayerControl.GetMoney(curPlayer, moneyType)
+    playerMoney = PlayerControl.GetMoneyReal(curPlayer, moneyType)
     if playerMoney > moneyCount:
-        isOK = PlayerControl.PayMoney(curPlayer, moneyType, playerMoney - moneyCount, ChConfig.Def_Cost_GM, {ChConfig.Def_Cost_Reason_SonKey:"SetMoney"})
+        isOK = PlayerControl.PayMoney(curPlayer, moneyType, playerMoney - moneyCount, ChConfig.Def_Cost_GM, {ChConfig.Def_Cost_Reason_SonKey:"SetMoney"}, isMinus=True)
     elif playerMoney < moneyCount:
         isOK = PlayerControl.GiveMoney(curPlayer, moneyType, moneyCount - playerMoney, ChConfig.Def_GiveMoney_GM, {ChConfig.Def_Give_Reason_SonKey:"SetMoney"})
     else:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index f683c33..a8fe4ce 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -2824,6 +2824,58 @@
     
     return 0
 
+def GetMoneyReal(curPlayer, moneyType):
+    ## 获取货币实际值,支持负值
+    moneyMinus = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MoneyMinus % moneyType)
+    if moneyMinus != 0:
+        return -moneyMinus
+    return GetMoney(curPlayer, moneyType)
+
+def SetMoney(curPlayer, moneyType, value):
+    ## 设置货币值,支持负值
+    if moneyType in ShareDefine.MoneyMinusRefreshDict:
+        moneyMinus = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MoneyMinus % moneyType)
+        if value < 0:
+            if moneyMinus != value:
+                SetMoneyMinus(curPlayer, moneyType, value)
+            value = 0
+        else:
+            if moneyMinus != 0:
+                SetMoneyMinus(curPlayer, moneyType, 0)
+                
+    #金子
+    if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:
+        curPlayer.SetGold(value)
+        
+    #金票
+    elif moneyType == IPY_GameWorld.TYPE_Price_Gold_Paper:
+        curPlayer.SetGoldPaper(value)
+        
+    #银子
+    elif moneyType == IPY_GameWorld.TYPE_Price_Silver_Money:
+        SetSilver(curPlayer, value)
+        
+    #银票
+    elif moneyType == IPY_GameWorld.TYPE_Price_Silver_Paper:
+        curPlayer.SetSilverPaper(value)
+        
+    #自定义货币
+    elif moneyType in ShareDefine.TYPE_Price_CurrencyDict:
+        SetPlayerCurrency(curPlayer, moneyType, value)
+        
+    return
+
+def SetMoneyMinus(curPlayer, moneyType, value):
+    value = abs(value) # 存值及通知使用正数
+    NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MoneyMinus % moneyType, value)
+    #通知客户端
+    if moneyType not in ShareDefine.MoneyMinusRefreshDict:
+        return
+    refreshType = ShareDefine.MoneyMinusRefreshDict[moneyType]
+    if refreshType != None:
+        SendPropertyRefresh(curPlayer, refreshType, value)
+    return
+
 ## 获取玩家仓库金钱数
 #  @param curPlayer: 玩家实例
 #  @param moneyType: 金钱类型
@@ -2997,9 +3049,10 @@
 # @param costType ,消费点类型
 # @param infoDict ,扩展信息, 子消费对象可以通过设置ChConfig.Def_Cost_Reason_SonKey key值
 # @param quantity ,数量
+# @param isMinus ,是否允许扣成负值
 # @return 返回值真, 付款成功
 # @remarks 玩家付款
-def PayMoney(curPlayer, type_Price, price, costType=ChConfig.Def_Cost_Unknown, infoDict={}, quantity=1, costVIPGold= -1, isNotify=True):
+def PayMoney(curPlayer, type_Price, price, costType=ChConfig.Def_Cost_Unknown, infoDict={}, quantity=1, costVIPGold= -1, isNotify=True, isMinus=False):
     if price == 0:
         return True
     if price < 0:
@@ -3012,12 +3065,12 @@
         
     #金子支付
     if type_Price == IPY_GameWorld.TYPE_Price_Gold_Money:
-        curPlayerGold = curPlayer.GetGold()
-        if curPlayerGold < price:
+        curPlayerGold = GetMoneyReal(curPlayer, type_Price)
+        if curPlayerGold < price and not isMinus:
             NotifyCode(curPlayer, "GoldErr")
             return False
         updPlayerGold = curPlayerGold - price
-        curPlayer.SetGold(updPlayerGold)
+        SetMoney(curPlayer, type_Price, updPlayerGold)
         
         curBourseMoney = GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
         updBourseMoney = curBourseMoney
@@ -3027,18 +3080,20 @@
         #其他如果当前金子比交易额度还少,则强制调整交易额度为当前金子数(这种情况一般是非交易所消费的,需要同步扣除交易所可购买额度)
         elif updPlayerGold < updBourseMoney:
             updBourseMoney = updPlayerGold
+        updBourseMoney = max(0, updBourseMoney)
         if updBourseMoney != curBourseMoney:
             SetPlayerCurrency(curPlayer, ShareDefine.TYPE_Price_BourseMoney, updBourseMoney)
         infoDict["BourseMoney"] = updBourseMoney
         
     #金票支付
     elif type_Price == IPY_GameWorld.TYPE_Price_Gold_Paper:
-        curPlayerGoldPaper = curPlayer.GetGoldPaper()
-        if curPlayerGoldPaper < price:
+        curPlayerGoldPaper = GetMoneyReal(curPlayer, type_Price)
+        if curPlayerGoldPaper < price and not isMinus:
             NotifyCode(curPlayer, "GoldPaperErr")
             return False
-        curPlayer.SetGoldPaper(curPlayerGoldPaper - price)
-       
+        updGoldPaper = curPlayerGoldPaper - price
+        SetMoney(curPlayer, type_Price, updGoldPaper)
+        
     #银子支付
     elif type_Price == IPY_GameWorld.TYPE_Price_Silver_Money:
         curPlayerSilver = GetSilver(curPlayer)
@@ -3272,24 +3327,24 @@
         return True
         
     if priceType == IPY_GameWorld.TYPE_Price_Gold_Money:
-        if curPlayer.GetGold() + value > ChConfig.Def_PlayerTotalMoney_Gold:
+        updPlayerGold = GetMoneyReal(curPlayer, priceType) + value
+        if updPlayerGold > ChConfig.Def_PlayerTotalMoney_Gold:
             #超过金钱上限
             NotifyCode(curPlayer, "MoneyIsFull", [priceType])
             return
+        SetMoney(curPlayer, priceType, updPlayerGold)
         
-        curPlayer.SetGold(curPlayer.GetGold() + value)
+        if isGiveBourseMoney and updPlayerGold > 0:
+            GiveMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney, min(value, updPlayerGold))
+        addDataDict["BourseMoney"] = GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
         
-        if isGiveBourseMoney:
-            GiveMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney, value)
-            addDataDict["BourseMoney"] = GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
-            
     elif priceType == IPY_GameWorld.TYPE_Price_Gold_Paper:
-        if curPlayer.GetGoldPaper() + value > ChConfig.Def_PlayerTotalMoney_Gold:
+        updPlayerGoldPaper = GetMoneyReal(curPlayer, priceType)  + value
+        if updPlayerGoldPaper > ChConfig.Def_PlayerTotalMoney_Gold:
             #超过金钱上限
             NotifyCode(curPlayer, "MoneyIsFull", [priceType])
             return
-        
-        curPlayer.SetGoldPaper(curPlayer.GetGoldPaper() + value)
+        SetMoney(curPlayer, priceType, updPlayerGoldPaper)
         
     elif priceType == IPY_GameWorld.TYPE_Price_Silver_Money:
         # 金钱支持超过20亿, 暂不做上限控制
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTDelPlayerMoney.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTDelPlayerMoney.py
index 6ba2146..b28e886 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTDelPlayerMoney.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTDelPlayerMoney.py
@@ -46,17 +46,18 @@
     elif not moneyValue:
         Result = GMCommon.Def_ParamErr
         retMsg = "money value error."
-    elif not PlayerControl.HaveMoney(curPlayer, moneyType, moneyValue, False):
+    #仙玉、绑玉后台直接扣除的不检查货币是否足够,支持直接扣成负值
+    elif moneyType not in ShareDefine.MoneyMinusRefreshDict and not PlayerControl.HaveMoney(curPlayer, moneyType, moneyValue, False):
         Result = GMCommon.Def_ParamErr
         retMsg = "money is not enough. only %s" % PlayerControl.GetMoney(curPlayer, moneyType)
         
     if Result == GMCommon.Def_Success:
         infoDict = {ChConfig.Def_Cost_Reason_SonKey:delRemark}
-        if not PlayerControl.PayMoney(curPlayer, moneyType, moneyValue, ChConfig.Def_Cost_GM, infoDict, isNotify=False):
+        if not PlayerControl.PayMoney(curPlayer, moneyType, moneyValue, ChConfig.Def_Cost_GM, infoDict, isNotify=False, isMinus=True):
             Result = GMCommon.Def_Unknow
             retMsg = "pay money error."
         else:
-            retMsg = "remaining money %s" % PlayerControl.GetMoney(curPlayer, moneyType)
+            retMsg = "remaining money %s" % PlayerControl.GetMoneyReal(curPlayer, moneyType)
             
     resultMsg = str([orderId, retMsg, 'GMT_DelPlayerMoney', Result])
     GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'GMToolResult', resultMsg, len(resultMsg))
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GetPlayerInfo.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GetPlayerInfo.py
index e83c24f..84effa1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GetPlayerInfo.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GetPlayerInfo.py
@@ -17,7 +17,9 @@
 """Version = 2015-05-22 14:30"""
 #---------------------------------------------------------------------
 import GameWorld
+import IPY_GameWorld
 import PlayerControl
+import ShareDefine
 #---------------------------------------------------------------------
 
 ## 请求逻辑
@@ -47,8 +49,8 @@
                   'VIPLV':curPlayer.GetVIPLv(),  # vip等级
                   
                   'MapID':curPlayer.GetMapID(),  #当前地图id
-                  'Gold':curPlayer.GetGold(),   # 元宝
-                  'GoldPaper':curPlayer.GetGoldPaper(),   # 绑钻
+                  'Gold':PlayerControl.GetMoneyReal(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money),   # 元宝
+                  'GoldPaper':PlayerControl.GetMoneyReal(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper),   # 绑钻
                   'Silver':PlayerControl.GetSilver(curPlayer),  # 银两
                   
                   'FamilyName':curPlayer.GetFamilyName(),  # 家族名称
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index edf8b61..016cccc 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -959,7 +959,9 @@
 CDBPlayerRefresh_BossActScore, # boss 活动积分 230
 CDBPlayerRefresh_FuncSysPrivilege, # 功能特权令 231
 CDBPlayerRefresh_Environment, # 环保值 232
-) = range(146, 233)
+CDBPlayerRefresh_MoneyMinusGold, # 仙玉 - 负值 233
+CDBPlayerRefresh_MoneyMinusGoldPaper, # 绑玉 - 负值 234
+) = range(146, 235)
 
 TYPE_Price_Gold_Paper_Money = 5    # 金钱类型,(先用礼券,再用金子)
 TYPE_Price_Family_Contribution = 6 # 战盟贡献度(活跃度转换得来)
@@ -1007,6 +1009,12 @@
                            TYPE_Price_Environment:CDBPlayerRefresh_Environment,
                            }
 
+# 支持负值的货币及对应0418刷新类型,不需要通知的话配置None
+MoneyMinusRefreshDict = {
+                         1:CDBPlayerRefresh_MoneyMinusGold,
+                         2:CDBPlayerRefresh_MoneyMinusGoldPaper,
+                         }
+
 # 高效战斗状态
 Def_Battle_Status = (
     Def_Battle_Start,    # 激活
diff --git a/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py b/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py
index 4c7628f..0454831 100644
--- a/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py
+++ b/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py
@@ -101,6 +101,21 @@
         # 回复gm
         return GMCommon.Def_NoTag, ''
     
+    moneyMinusDict = {}
+    collection = userdb[UCN_RoleNomalDict]
+    docs = collection.find({'PlayerID':dbPlayer.PlayerID})
+    if docs.count():
+        obj = DataServerPlayerData.tagRoleNomalDict()
+        doc = list(docs)[0]
+        #有数据
+        if doc.has_key('__PackSave'):
+            for i in xrange(doc['Count']):
+                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:
+                        break
+                
     playerInfo = {
                   'AccID':dbPlayer.AccID,   # 账号
                   'AccState':dbPlayer.AccState,  # 账号状态
@@ -115,8 +130,8 @@
                   'VIPLV':dbPlayer.VIPLv,  # vip等级
                   
                   'MapID':dbPlayer.MapID,  #当前地图id
-                  'Gold':dbPlayer.Gold,   # 元宝
-                  'GoldPaper':dbPlayer.GoldPaper,   # 绑钻
+                  'Gold':moneyMinusDict[1] if 1 in moneyMinusDict else dbPlayer.Gold,   # 元宝
+                  'GoldPaper':moneyMinusDict[2] if 2 in moneyMinusDict else dbPlayer.GoldPaper,   # 绑钻
                   'Silver':dbPlayer.Silver,  # 银两
                   
                   'FamilyName':dbPlayer.FamilyName,  # 家族名称

--
Gitblit v1.8.0