1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/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