| | |
| | | @param offlineSupport: 离线玩家是否支持该命令,默认支持,当玩家离线时,会在上线后执行该命令
|
| | | @return: GMCommon.Def_xxx, curPlayer
|
| | | 非 Def_Success 的错误类型 - 代表错误,可直接返回给后台
|
| | | Def_Success, curPlayer - curPlayer为空时代表玩家离线状态
|
| | | Def_Success, curPlayer - curPlayer为空时代表玩家离线状态,注:离线状态且需要支持离线处理的才返回 (Def_Success, None)
|
| | | GMCommon.Def_PlayerOfLine, dbPlayer - 不需要支持离线处理时,返回离线跟 dbPlayer
|
| | | '''
|
| | |
|
| | | queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
|
| | |
| | |
|
| | | # 玩家姓名
|
| | | if queryType == GMCommon.Def_GMKey_PlayerName:
|
| | | rec = PyGameData.g_usrCtrlDB.findDBPlayerByName(playerFind)
|
| | | dbPlayer = PyGameData.g_usrCtrlDB.findDBPlayerByName(playerFind, True)
|
| | | elif queryType == GMCommon.Def_GMKey_PlayerAccID:
|
| | | rec = PyGameData.g_usrCtrlDB.findDBPlayerByAccID(playerFind)
|
| | | dbPlayer = PyGameData.g_usrCtrlDB.findDBPlayerByAccID(playerFind, True)
|
| | | else:
|
| | | return GMCommon.Def_ParamErr, None
|
| | |
|
| | | if not rec:
|
| | | if not dbPlayer:
|
| | | # db找不到就是不存在该玩家
|
| | | return GMCommon.Def_NoTag, None
|
| | |
|
| | | playerID = rec.get(u'PlayerID', 0)
|
| | | playerID = dbPlayer.PlayerID
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if not curPlayer or curPlayer.IsEmpty():
|
| | | # 离线处理
|
| | | if offlineSupport:
|
| | | PlayerOfflineSupport.AddOfflineUnprocessed(playerID, "GMToolCMD", gmCmdDict)
|
| | | return GMCommon.Def_Success, None
|
| | | return GMCommon.Def_PlayerOfLine, None
|
| | | return GMCommon.Def_PlayerOfLine, dbPlayer
|
| | |
|
| | | return GMCommon.Def_Success, curPlayer
|
| | |
|
| | |
| | | execType = ret[0]
|
| | | execInfo = ret[1]
|
| | | else:
|
| | | mylog.info("no gm cmd -> %s" % self.funcName)
|
| | | execType = GMCommon.Def_GMCmdNone
|
| | |
|
| | | GetGMOrderMgr().PopCmd(self.orderId)
|