10382 【后台】称号管理支持升星(支持升星、设置星级,支持离线设置;发放代币、后台充值、头像管理增加离线操作支持;)
| | |
| | | GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind, gmCmdDict, 'GMTAddPayCoin', [orderId, value, isOnlineGMT], False)
|
| | | return
|
| | |
|
| | | def OnOfflineCTGInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | def OnOfflineGMTInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | value = GameWorld.ToIntDef(gmCmdDict.get('value', ''), 0)
|
| | | isOnlineGMT = False # 是否是在线接收的GM工具命令
|
| | |
| | | import GMCommon
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | #import GMShell
|
| | | import GMShell
|
| | |
|
| | |
|
| | | ## 执行逻辑
|
| | |
| | | playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '')
|
| | | titleID = GameWorld.ToIntDef(gmCmdDict.get('titleID', ''), 0)
|
| | | expireTime = GameWorld.ToIntDef(gmCmdDict.get('expireTime', ''), 0)
|
| | | setValue = GameWorld.ToIntDef(gmCmdDict.get('setValue', ''), 0)
|
| | | opType = gmCmdDict.get('opType', '')
|
| | |
|
| | | if titleID <= 0:
|
| | |
| | | return
|
| | |
|
| | | if not tagPlayer:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_PlayerOfLine)
|
| | | # # 玩家不在线,先记录,等玩家上线后处理
|
| | | # GMShell.AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict)
|
| | | # 玩家不在线,先记录,等玩家上线后处理
|
| | | GMShell.AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict)
|
| | | return
|
| | |
|
| | | isOnlineGMT = True # 是否是在线接收的GM工具命令
|
| | | GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind, gmCmdDict, "GMTAddTitle", [orderId, isOnlineGMT, titleID, expireTime, opType], False)
|
| | | GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind, gmCmdDict, "GMTAddTitle", [orderId, isOnlineGMT, titleID, expireTime, opType, setValue], False)
|
| | | return
|
| | |
|
| | | #def OnOfflineGMTInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | # orderId = gmCmdDict.get('orderId', '')
|
| | | # titleID = GameWorld.ToIntDef(gmCmdDict.get('titleID', ''), 0)
|
| | | # expireTime = GameWorld.ToIntDef(gmCmdDict.get('expireTime', ''), 0)
|
| | | # isOnlineGMT = False # 是否是在线接收的GM工具命令
|
| | | # cmdStr = str([orderId, isOnlineGMT, titleID, expireTime])
|
| | | # GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTAddTitle',
|
| | | # cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | # return
|
| | | def OnOfflineGMTInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | titleID = GameWorld.ToIntDef(gmCmdDict.get('titleID', ''), 0)
|
| | | expireTime = GameWorld.ToIntDef(gmCmdDict.get('expireTime', ''), 0)
|
| | | setValue = GameWorld.ToIntDef(gmCmdDict.get('setValue', ''), 0)
|
| | | opType = gmCmdDict.get('opType', '')
|
| | | isOnlineGMT = False # 是否是在线接收的GM工具命令
|
| | | cmdStr = str([orderId, isOnlineGMT, titleID, expireTime, opType, setValue])
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTAddTitle',
|
| | | cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
|
| | |
|
| | |
| | | import ChConfig
|
| | | import GameWorld
|
| | | import PyGameData
|
| | | import GMShell
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | #---------------------------------------------------------------------
|
| | |
| | |
|
| | | if not tagPlayer:
|
| | | # 玩家不在线,先记录,等玩家上线后处理
|
| | | key = (queryType, playerFind)
|
| | | ctgInfoList = PyGameData.g_ctgOfflinePlayerInfo.get(key, [])
|
| | | ctgInfoList.append(gmCmdDict)
|
| | | PyGameData.g_ctgOfflinePlayerInfo[key] = ctgInfoList
|
| | | GameWorld.Log("离线CTG: g_ctgOfflinePlayerInfo=%s" % str(PyGameData.g_ctgOfflinePlayerInfo))
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success)
|
| | | GMShell.AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict)
|
| | | return
|
| | |
|
| | | GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind, gmCmdDict, 'GMTCTG', [orderId, value, appID, isAddBourseMoney, True], False)
|
| | | return
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | ctgList = []
|
| | | nameKey = (ChConfig.queryType_sqtPlayerByName, curPlayer.GetName())
|
| | | if nameKey in PyGameData.g_ctgOfflinePlayerInfo:
|
| | | ctgList += PyGameData.g_ctgOfflinePlayerInfo.pop(nameKey)
|
| | | def OnOfflineGMTInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | value = gmCmdDict.get('value', '')
|
| | | appID = gmCmdDict.get('appID', '')
|
| | | isAddBourseMoney = GameWorld.ToIntDef(gmCmdDict.get('isAddBourseMoney', ''), 0)
|
| | | cmdStr = str([orderId, value, appID, isAddBourseMoney, False])
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTCTG', |
| | | cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | |
|
| | | accIDKey = (ChConfig.queryType_sqtPlayerByAccID, curPlayer.GetAccID())
|
| | | if accIDKey in PyGameData.g_ctgOfflinePlayerInfo:
|
| | | ctgList += PyGameData.g_ctgOfflinePlayerInfo.pop(accIDKey)
|
| | | |
| | | if not ctgList:
|
| | | return
|
| | | |
| | | tagMapID = curPlayer.GetRealMapID()
|
| | | GameWorld.Log("离线玩家上线CTG: tagMapID=%s, %s" % (tagMapID, ctgList), curPlayer.GetPlayerID())
|
| | | if not tagMapID:
|
| | | return
|
| | | |
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for gmCmdDict in ctgList:
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | value = gmCmdDict.get('value', '')
|
| | | appID = gmCmdDict.get('appID', '')
|
| | | isAddBourseMoney = GameWorld.ToIntDef(gmCmdDict.get('isAddBourseMoney', ''), 0)
|
| | | cmdStr = str([orderId, value, appID, isAddBourseMoney, False])
|
| | | playerManager.MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTCTG', |
| | | cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | value = GameWorld.ToIntDef(gmCmdDict.get('value', ''), 0)
|
| | | isOnlineGMT = False # 是否是在线接收的GM工具命令
|
| | | cmdStr = str([orderId, value, isOnlineGMT])
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTAddPayCoin', cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
|
| | |
| | | import GMCommon
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import GMShell
|
| | |
|
| | | ## 执行逻辑
|
| | | # @param curPlayer 当前玩家
|
| | |
| | | return
|
| | |
|
| | | if not tagPlayer:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_PlayerOfLine)
|
| | | # # 玩家不在线,先记录,等玩家上线后处理
|
| | | # GMShell.AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict)
|
| | | #GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_PlayerOfLine)
|
| | | # 玩家不在线,先记录,等玩家上线后处理
|
| | | GMShell.AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict)
|
| | | return
|
| | |
|
| | | isOnlineGMT = True # 是否是在线接收的GM工具命令
|
| | | GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind, gmCmdDict, "GMTFace", [orderId, isOnlineGMT, faceType, opID, expireTime, opType], False)
|
| | | return
|
| | |
|
| | | #def OnOfflineGMTInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | # orderId = gmCmdDict.get('orderId', '')
|
| | | # titleID = GameWorld.ToIntDef(gmCmdDict.get('titleID', ''), 0)
|
| | | # expireTime = GameWorld.ToIntDef(gmCmdDict.get('expireTime', ''), 0)
|
| | | # isOnlineGMT = False # 是否是在线接收的GM工具命令
|
| | | # cmdStr = str([orderId, isOnlineGMT, titleID, expireTime])
|
| | | # GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTAddTitle',
|
| | | # cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | # return
|
| | | def OnOfflineGMTInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | opID = GameWorld.ToIntDef(gmCmdDict.get('opID', ''), 0)
|
| | | expireTime = GameWorld.ToIntDef(gmCmdDict.get('expireTime', ''), None)
|
| | | faceType = gmCmdDict.get('faceType', '')
|
| | | opType = gmCmdDict.get('opType', '')
|
| | | isOnlineGMT = False # 是否是在线接收的GM工具命令
|
| | | cmdStr = str([orderId, isOnlineGMT, faceType, opID, expireTime, opType])
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTFace',
|
| | | cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
|
| | |
|
| | |
| | | GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind, gmCmdDict, "GMTMagicWeaponExp", [orderId, mwID, mwExp, isOnlineGMT], False)
|
| | | return
|
| | |
|
| | | def OnOfflineCTGInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | def OnOfflineGMTInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | mwID = GameWorld.ToIntDef(gmCmdDict.get('mwID', ''), 0)
|
| | | mwExp = GameWorld.ToIntDef(gmCmdDict.get('mwExp', ''), 0)
|
| | |
| | |
|
| | |
|
| | | #===============================================================================
|
| | | # def OnOfflineCTGInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | # def OnOfflineGMTInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | # gold = int(gmCmdDict.get('GoldState', 0))
|
| | | # cmdStr = str([gold])
|
| | | #
|
| | |
| | | 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.")
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, "玩家不在线,将在上线后自动处理")
|
| | | return
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | |
| | | if not pack_type:
|
| | | continue
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(Commands, "%s.%s"%(pack_type, "OnOfflineCTGInfo"))
|
| | | callFunc = GameWorld.GetExecFunc(Commands, "%s.%s"%(pack_type, "OnOfflineGMTInfo"))
|
| | | if callFunc:
|
| | | GameWorld.Log("玩家上线执行GMT: %s, tagMapID=%s, %s" % (pack_type, tagMapID, gmCmdDict), curPlayer.GetPlayerID())
|
| | | callFunc(curPlayer, tagMapID, gmCmdDict)
|
| | |
| | | import GameWorldFamilyWar
|
| | | import PlayerFBHelpBattle
|
| | | import GameWorldSkyTower
|
| | | import GMT_CTG
|
| | | import PyGameData
|
| | | import GMShell
|
| | | import IPY_PlayerDefine
|
| | |
| | | GameWorldSkyTower.OnPlayerLogin(curPlayer)
|
| | | #福地
|
| | | GameWorldMineArea.OnPlayerLogin(curPlayer)
|
| | | GMT_CTG.OnPlayerLogin(curPlayer)
|
| | |
|
| | | else:
|
| | | pass
|
| | |
| | | g_yesterdayPlayerLVDict = {} #昨日玩家等级字典{playerID:lv,..}
|
| | | g_onedayJobPlayerLoginoffTimeDict = {} #近24小时登录/离线的玩家职业数 {职业:{playerID:loginoffTime, ...}}
|
| | |
|
| | | g_ctgOfflinePlayerInfo = {} # {playerID:[[ctgInfo], ...], ...} # 离线玩家CTG信息缓存
|
| | | g_gmtOfflinePlayerInfo = {} # {(queryType, playerFind):[gmtInfo, ...], ...} # 离线玩家GMT信息缓存
|
| | |
|
| | | g_questionIDHistory = {}#出过的题记录 {familyid:[出过的题id,..]}
|
| | |
| | | # if curDienstgradMgr.GetUseGradID() == dienstgradID:
|
| | | # UnUseDienstgrad(curPlayer)
|
| | | #===========================================================================
|
| | | |
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TitleStar % dienstgradID, 0)
|
| | | curDienstgradMgr.DeleteDienstgrad(dienstgradID)
|
| | | #通知称号删除
|
| | | curDienstgradMgr.Sync_PlayerDelDienstgrad(dienstgradID)
|
| | |
| | | SyncTitleStarInfo(curPlayer, titleID)
|
| | | return
|
| | |
|
| | | def GMSetTitleStar(curPlayer, titleID, setValue=None):
|
| | | ## GM设置星级
|
| | | |
| | | curDienstgradMgr = curPlayer.GetDienstgradManager()
|
| | | curDienstgrad = curDienstgradMgr.GetDienstgrad(titleID)
|
| | | if curDienstgrad == None:
|
| | | return False, "The player has not activated the titleID(%s)" % titleID
|
| | | |
| | | if setValue == None:
|
| | | curStar = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TitleStar % titleID)
|
| | | setStar = curStar + 1 # 没指定星级时默认升星
|
| | | else:
|
| | | setStar = setValue
|
| | | |
| | | if setStar > 0:
|
| | | if not IpyGameDataPY.GetIpyGameData("TitleStarUp", titleID, setStar):
|
| | | return False, "The titleID(%s) star(%s) is not exist." % (titleID, setStar)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TitleStar % titleID, setStar)
|
| | | GameWorld.Log("GM设置称号星级: titleID=%s,setStar=%s" % (titleID, setStar), curPlayer.GetPlayerID())
|
| | | |
| | | CalcAllDienstgradAttr(curPlayer)
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.RefreshPlayerAttrState()
|
| | | |
| | | SyncTitleStarInfo(curPlayer, titleID)
|
| | | return True, ""
|
| | |
|
| | | #-------------------------------------------------------------
|
| | | ## 获取已激活称号列表
|
| | | # @param curPlayer
|
| | |
| | | return
|
| | |
|
| | | def SyncTitleStarInfo(curPlayer, titleID=None):
|
| | | force = False
|
| | | if titleID > 0:
|
| | | force = True
|
| | | syncIDList = [titleID]
|
| | | else:
|
| | | syncIDList = []
|
| | |
| | | titleStarList = []
|
| | | for titleID in syncIDList:
|
| | | curStar = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TitleStar % titleID)
|
| | | if not curStar:
|
| | | if not curStar and not force:
|
| | | continue
|
| | | starInfo = ChPyNetSendPack.tagMCTitleStar()
|
| | | starInfo.Clear()
|
| | |
| | | import DataRecordPack
|
| | | import GMCommon
|
| | | import PlayerDienstgrad
|
| | | import ChConfig
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | |
| | | return
|
| | |
|
| | | Result = GMCommon.Def_Success
|
| | | orderId, isOnlineGMT, titleID, expireTime, opType = packCMDList
|
| | | orderId, isOnlineGMT, titleID, expireTime, opType, setValue = packCMDList
|
| | |
|
| | | errorMsg = ""
|
| | | isOK = False
|
| | | if opType == "add":
|
| | | isOK = PlayerDienstgrad.PlayerAddDienstgrad(curPlayer, titleID, expireTime=expireTime)
|
| | | elif opType == "del":
|
| | | isOK = PlayerDienstgrad.PlayerDelDienstgrad(curPlayer, titleID)
|
| | | elif opType == "starUp":
|
| | | isOK, errorMsg = PlayerDienstgrad.GMSetTitleStar(curPlayer, titleID)
|
| | | elif opType == "setStar":
|
| | | isOK, errorMsg = PlayerDienstgrad.GMSetTitleStar(curPlayer, titleID, setValue)
|
| | |
|
| | | if not isOK:
|
| | | errorMsg = "%s fail! Please check that the ID(%s) is correct." % (opType, titleID)
|
| | | if errorMsg:
|
| | | errorMsg = "%s fail! %s" % (opType, errorMsg)
|
| | | else:
|
| | | errorMsg = "%s fail! Please check that the ID(%s) is correct." % (opType, titleID)
|
| | | GameWorld.Log("GMT_AddTitle, errorMsg=%s" % errorMsg, curPlayer.GetPlayerID())
|
| | | resultMsg = str([orderId, errorMsg, 'GMT_AddTitle', GMCommon.Def_Unknow])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'GMToolResult', resultMsg, len(resultMsg))
|
| | | return
|
| | |
|
| | | resultDict = {"titleID":titleID, "expireTime":expireTime, "isOnlineGMT":isOnlineGMT, "opType":opType}
|
| | | curStar = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TitleStar % titleID)
|
| | | resultDict = {"titleID":titleID, "expireTime":expireTime, "isOnlineGMT":isOnlineGMT, "opType":opType, "star":curStar}
|
| | | GameWorld.Log("GMT_AddTitle, isOnlineGMT=%s,resultDict=%s" % (isOnlineGMT, resultDict), curPlayer.GetPlayerID())
|
| | | #流向 记录
|
| | | DataRecordPack.DR_ToolGMOperate(query_ID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), 'GMT_AddTitle', resultDict)
|