#!/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 ReadChConfig 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 = {"operate":operate} if GameWorld.IsCrossServer(): strMsg.update({"error":1}) # ²éѯ¿ç·þ״̬ elif operate == "cross_server_state": crossServerIP = ReadChConfig.GetPyMongoConfig("Merge", "MergeServerIP") isOpen = GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossServerOpen) isConn = GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossServerConnState) strMsg.update({"OpenState":isOpen, "ConnState":isConn, "CrossServerIP":crossServerIP}) # ²éѯ¿ç·þ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.update({"GroupID":GameWorld.GetServerGroupID(), "ZoneID":zoneID, "SeasonID":seasonID, "SeasonState":seasonState, "MatchState":matchState}) # ÖØÐÂͬ²½¿ç·þ״̬ elif operate == "reconn_cross_Server": CrossRealmMsg.OnGameServerInitOK() strMsg.update({"OK":1}) 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