From 320a417a53a57a9cb7d7759f430afe5f6e6399a6 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 29 一月 2019 16:28:30 +0800
Subject: [PATCH] 6087 【后端】【1.5.200】春节红包雨活动(额度特效增加红包类型参数)
---
ServerPython/CoreServerGroup/GameServer/Script/GM/GMShell.py | 56 ++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 48 insertions(+), 8 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GM/GMShell.py b/ServerPython/CoreServerGroup/GameServer/Script/GM/GMShell.py
index c734e31..2bc0744 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GM/GMShell.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GM/GMShell.py
@@ -19,9 +19,10 @@
import GameWorld
import Commands
import IPY_GameServer
-import MergeChildMsg
+import PyGameData
import traceback
import GMCommon
+import ShareDefine
import os
#---------------------------------------------------------------------
g_broadCastList = []
@@ -86,12 +87,12 @@
return
#非跨服服务器下使用跨服专属GM命令,则发送到跨服
- if not GameWorld.IsMergeServer():
+ if not GameWorld.IsCrossServer():
callFunc = GameWorld.GetExecFunc(Commands, "%s.%s"%(callFunName, "OnGetMergeParam"))
if callFunc != None:
extendParamList = callFunc(curPlayer)
alist.extend(extendParamList)
- MergeChildMsg.SendMergerChildToCenterStringData(ChConfig.Def_SendGMCMD, alist)
+ #MergeChildMsg.SendMergerChildToCenterStringData(ShareDefine.ClientServerMsg_GMCMD, alist)
return
callFunc = GameWorld.GetExecFunc(Commands, "%s.%s"%(callFunName, "OnExec"))
@@ -105,12 +106,10 @@
del alist[0]
#把剩余参数转换为整型
for i in range(0, len(alist)):
- if not alist[i].isdigit():
- continue
value = GameWorld.ToIntDef(alist[i], None)
if value == None:
- GameWorld.DebugAnswer(curPlayer, "参数错误, 参数%s必须为纯数字!" % (i + 1))
- return
+ #GameWorld.DebugAnswer(curPlayer, "参数错误, 参数%s必须为纯数字!" % (i + 1))
+ continue
alist[i] = value
callFunc(curPlayer,alist)
@@ -246,7 +245,7 @@
return cmdDict
## 收到子服务器发送的GM命令
-def ClientServer_SendGMCMD(cmdMsgList, tick):
+def ClientServerMsg_GMCMD(cmdMsgList, tick):
if len(cmdMsgList) == 0:
return
@@ -260,3 +259,44 @@
#只将实际参数传入
callFunc(cmdMsgList[1:], tick)
return
+
+def AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict):
+ # 玩家不在线,先记录,等玩家上线后处理,开关服后无效
+ key = (queryType, playerFind)
+ ctgInfoList = PyGameData.g_gmtOfflinePlayerInfo.get(key, [])
+ ctgInfoList.append(gmCmdDict)
+ PyGameData.g_gmtOfflinePlayerInfo[key] = ctgInfoList
+ GameWorld.Log("离线玩家添加GMT: g_gmtOfflinePlayerInfo=%s" % str(PyGameData.g_gmtOfflinePlayerInfo))
+ GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, "Player is off line.")
+ return
+
+def OnPlayerLogin(curPlayer):
+ gmtList = []
+ nameKey = (ChConfig.queryType_sqtPlayerByName, curPlayer.GetName())
+ if nameKey in PyGameData.g_gmtOfflinePlayerInfo:
+ gmtList += PyGameData.g_gmtOfflinePlayerInfo.pop(nameKey)
+
+ accIDKey = (ChConfig.queryType_sqtPlayerByAccID, curPlayer.GetAccID())
+ if accIDKey in PyGameData.g_gmtOfflinePlayerInfo:
+ gmtList += PyGameData.g_gmtOfflinePlayerInfo.pop(accIDKey)
+
+ if not gmtList:
+ return
+
+ tagMapID = curPlayer.GetRealMapID()
+ GameWorld.Log("离线玩家上线GMT: tagMapID=%s, %s" % (tagMapID, gmtList), curPlayer.GetPlayerID())
+ if not tagMapID:
+ return
+
+ for gmCmdDict in gmtList:
+ pack_type = gmCmdDict.get("pack_type")
+ if not pack_type:
+ continue
+
+ callFunc = GameWorld.GetExecFunc(Commands, "%s.%s"%(pack_type, "OnOfflineCTGInfo"))
+ if callFunc:
+ GameWorld.Log("玩家上线执行GMT: %s, tagMapID=%s, %s" % (pack_type, tagMapID, gmCmdDict), curPlayer.GetPlayerID())
+ callFunc(curPlayer, tagMapID, gmCmdDict)
+
+ return
+
--
Gitblit v1.8.0