New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package GM.Commands.GMT_CrossClientServerMaintain
|
| | | #
|
| | | # @todo:跨服子服维护
|
| | | # @author hxp
|
| | | # @date 2018-12-30
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 跨服子服维护
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2018-12-30 18:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ShareDefine
|
| | | import DataRecordPack
|
| | | import CrossRealmMsg
|
| | | import GameWorld
|
| | | import GMCommon
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## 执行逻辑
|
| | | # @param curPlayer 当前玩家
|
| | | # @param gmCmdDict: 命令字典
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(orderId, gmCmdDict):
|
| | | |
| | | GameWorld.Log("GMT_CrossClientServerMaintain gmCmdDict=%s" % str(gmCmdDict))
|
| | | operate = gmCmdDict.get('operate', '')
|
| | | |
| | | strMsg = ""
|
| | | if GameWorld.IsCrossServer():
|
| | | strMsg = "this server is cross server. can not do!"
|
| | | |
| | | # 查询跨服状态
|
| | | elif operate == "cross_server_state":
|
| | | isOpen = GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossServerOpen)
|
| | | isConn = GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossServerConnState)
|
| | | strMsg = {"OpenState":isOpen, "ConnState":isConn}
|
| | | |
| | | # 查询跨服PK状态 |
| | | elif operate == "cross_pk_state":
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | zoneID = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID)
|
| | | seasonID = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID)
|
| | | seasonState = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonState)
|
| | | matchState = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossDailyActionState % ShareDefine.DailyActionID_CrossReamPK)
|
| | | |
| | | strMsg = {"GroupID":GameWorld.GetServerGroupID(), "ZoneID":zoneID, "SeasonID":seasonID, "SeasonState":seasonState, "MatchState":matchState}
|
| | | |
| | | # 重新同步跨服状态
|
| | | elif operate == "reconn_cross_Server":
|
| | | CrossRealmMsg.OnGameServerInitOK()
|
| | | |
| | | else:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
|
| | | return
|
| | | |
| | | # 记录流向
|
| | | DataRecordPack.DR_ToolGMOperate(0, '', '', 'GMT_CrossClientServerMaintain', str(gmCmdDict))
|
| | | # 回复
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, strMsg=strMsg) |
| | | return
|
| | | |