From f50014d70d74530c3c7f918fcec9a0f49f367a3e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 22 十月 2024 18:50:31 +0800
Subject: [PATCH] 10284 同步其他版本(修复查询离线玩家代币数值错误bug;优化GM命令ClearInvest、SetMoney;)
---
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py | 6 +++++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py | 2 ++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py | 12 +++++++++++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py | 37 -------------------------------------
4 files changed, 18 insertions(+), 39 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py
index 7621542..9ec54d2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py
@@ -32,12 +32,22 @@
if not msgList:
GameWorld.DebugAnswer(curPlayer, "重置所有投资: ClearInvest 0")
GameWorld.DebugAnswer(curPlayer, "重置指定投资: ClearInvest 类型")
+ GameWorld.DebugAnswer(curPlayer, "激活指定投资: ClearInvest A 类型")
GameWorld.DebugAnswer(curPlayer, "类型:7-永久卡;8-周卡;9-登录卡;10-等级卡;11-boss卡;")
return
investType = msgList[0]
if not investType:
investTypeList = ChConfig.InvestTypeList
+ elif investType == "A":
+ investType = msgList[1] if len(msgList) > 1 else 0
+ if investType not in ChConfig.InvestTypeList:
+ GameWorld.DebugAnswer(curPlayer, "不存在该投资类型!")
+ return
+ PlayerGoldInvest.__DoLogicInvest(curPlayer, investType)
+ GameWorld.DebugAnswer(curPlayer, "激活投资: %s" % investType)
+ return
+
elif investType not in ChConfig.InvestTypeList:
GameWorld.DebugAnswer(curPlayer, "不存在该投资类型!")
return
@@ -50,6 +60,6 @@
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestReward % (itype, keyNum), 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestProgress % (itype, keyNum), 0)
PlayerGoldInvest.Sync_InvestInfo(curPlayer, itype)
-
+
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 09df85b..5235a9d 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
@@ -81,6 +81,8 @@
isOK = True
if not isOK:
GameWorld.DebugAnswer(curPlayer, "设置玩家货币失败,详见日志或流向")
+ else:
+ GameWorld.DebugAnswer(curPlayer, "设置%s%s=%s" % (moneyType, moneyNameDict.get(moneyType, moneyType), PlayerControl.GetMoneyReal(curPlayer, moneyType)))
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
index 7591379..4dee309 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
@@ -28,45 +28,8 @@
import time
-def __TransferPlayerInvestDBKey(curPlayer):
- ## 转换玩家存储字典,换key名
-
- # 旧版key
- # 投资理财 Def_PDictType_GoldInvest
- Def_PDict_GoldInvest_Time = "Invest_Time_%s" # 投资时的时间,参数为投资类型
- #Def_PDict_GoldInvest_Gold = "Invest_Gold_%s" # 投资的额度,参数为投资类型 标记是否已投资,可用投资时间即可,不处理
- #Def_PDict_GoldInvest_AwardData = "Invest_AwardData_%s" # 投资时的数据,参数为投资类型 默认1,无用,可不管
- Def_PDict_GoldInvest_GotRewardValue = "Invest_GotRewardValue_%s_%s" # 等级回报已领取数值,参数为投资类型 索引
-
- playerID = curPlayer.GetPlayerID()
- for investType in [ChConfig.InvestType_NewMonth, ChConfig.InvestType_Month1]:
- investTimeKeyOld = Def_PDict_GoldInvest_Time % investType
- investTime = curPlayer.NomalDictGetProperty(investTimeKeyOld, 0, ChConfig.Def_PDictType_GoldInvest)
- if not investTime:
- continue
-
- investTimeKeyNew = ChConfig.Def_PDict_InvestTime % investType
- PlayerControl.NomalDictSetProperty(curPlayer, investTimeKeyNew, investTime)
- PlayerControl.NomalDictSetProperty(curPlayer, investTimeKeyOld, 0, ChConfig.Def_PDictType_GoldInvest)
- GameWorld.Log("转换投资key: investType=%s,investTimeKeyNew=%s,investTime=%s,investTimeKeyOld=%s"
- % (investType, investTimeKeyNew, investTime, investTimeKeyOld), playerID)
-
- maxDay = __GetInvestMaxDays(investType)
- for i in xrange(1, maxDay + 1):
- rewardKeyOld = Def_PDict_GoldInvest_GotRewardValue % (investType, i)
- reward = curPlayer.NomalDictGetProperty(rewardKeyOld, 0, ChConfig.Def_PDictType_GoldInvest)
- if not reward:
- continue
-
- GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_InvestReward, i, 1, True, [investType])
- PlayerControl.NomalDictSetProperty(curPlayer, rewardKeyOld, 0, ChConfig.Def_PDictType_GoldInvest)
- GameWorld.Log(" 转换投资已领取记录: i=%s,rewardKeyOld=%s" % (i, rewardKeyOld), playerID)
-
- return
-
## 登录
def OnLogin(curPlayer):
- __TransferPlayerInvestDBKey(curPlayer)
for investType in ChConfig.InvestTypeList:
if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_InvestTime % investType):
continue
diff --git a/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py b/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py
index 790f5ea..a54574e 100644
--- a/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py
+++ b/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py
@@ -155,7 +155,11 @@
# 需要额外同步的自定义货币
CurrencyValueDict = {}
for moneyType in [99, 41, 42]:
- CurrencyValueDict['PlayerCurrency_%s' % moneyType] = roleDict.get("PlayerCurrency_%s" % moneyType, 0)
+ if moneyType == 99:
+ moneyValue = dbPlayer.ExAttr11
+ else:
+ moneyValue = roleDict.get("PlayerCurrency_%s" % moneyType, 0)
+ CurrencyValueDict['PlayerCurrency_%s' % moneyType] = moneyValue
playerInfo.update(CurrencyValueDict)
return GMCommon.Def_Success, playerInfo
--
Gitblit v1.8.0