From 094b99fdbd566444b3e029bae944e0263e23a458 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 07 三月 2019 17:09:01 +0800
Subject: [PATCH] 6307 【后端】【2.0】多套装备开发单(镶嵌)

---
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
index 0aff318..eef5bf5 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
@@ -100,6 +100,7 @@
 import IpyGameDataPY
 import PlayerFamilyParty
 import GameWorldFamilyWar
+import AuctionHouse
 import PlayerXMZZ
 import PlayerTeam
 import PyGameData
@@ -287,6 +288,8 @@
 def __Func_HighPrecisionProcess(tick):
     if not GameWorld.GetGameWorld().GetDictByKey(ChConfig.Def_WorldKey_IsGameWorldInit):
         return
+    curTime = int(time.time())
+    
     #仙盟宴会答题定时器
     PlayerFamilyParty.FamilyParty_Process(tick)
     # 帮主弹劾时钟调用
@@ -304,6 +307,9 @@
     
     #操作Python表
     PlayerDBOper.PyDBProccess(tick)
+    
+    #拍卖行
+    AuctionHouse.OnAuctionItemTimeProcess(curTime)
     
     #每整分钟处理一次
     curDateTime = datetime.datetime.today()
@@ -1426,6 +1432,10 @@
     SendMapCommMapLinePlayerCount(True) # 同步一次普通地图线路人数信息
     #随机假仙盟
     PlayerFamily.RandomFakeFamily()
+    
+    # 记录服务器是否正常开启完毕
+    getUrl = ReadChConfig.GetPyMongoConfig("EventReport", "OpenStateUrl") + "?Type=MapInit&MapCount=%s"%GameWorld.GetGameWorld().GetGameMapManager().GetCount()
+    GameWorld.GetGameWorld().EventReport_EventReport("", "", "", "", 0, getUrl)
     return
 
 ## 服务器合服首次启动数据加载处理
@@ -1456,6 +1466,12 @@
     
     # 仙盟联赛重置
     GameWorldFamilyWar.DoFamilyWarReset()
+    # 重置所有仙盟联赛评级
+    familyManager = GameWorld.GetFamilyManager()
+    for i in xrange(familyManager.GetCount()):
+        family = familyManager.GetAt(i)
+        PlayerFamily.SetFamilyWarRank(family, 0)
+    PlayerFamily.DoFamilySort()
     
     # 设置合服首次启动加载成功
     PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServerInitOK, 1)
@@ -1826,14 +1842,27 @@
     gameMapManager = GameWorld.GetGameWorld().GetGameMapManager()
     
     curMap = gameMapManager.Find(mapServerPack.GetRouteServerIndex(), mapServerPack.GetMapID())
-    
     if curMap == None:
         return
     
+    if mapServerPack.GetState() not in [0,1,2,3] and curMap.GetState() != mapServerPack.GetState():
+        # 记录服务器是否正常开启完毕, 避免重复发送
+        GameWorld.DebugLog("MapServer_RunningStateRefresh--_%s"%([mapServerPack.GetState(), curMap.GetState(), mapServerPack.GetMapID(), curMap.GetID()]))
+        SendGameError("MapError")
+        
     curMap.SetState(mapServerPack.GetState())
     curMap.SetRefreshTick(tick)
+    
     return
 
+
+def SendGameError(state):
+    getUrl = ReadChConfig.GetPyMongoConfig("EventReport", "OpenStateUrl")
+    groupID = ReadChConfig.GetPyMongoConfig("platform", "GroupID")
+    userDBName = ReadChConfig.GetPyMongoConfig("connect", "USER_DB_NAME")
+    getUrl = getUrl + "?Type=%s&groupID=%s&userDBName=%s"%(state, groupID, userDBName)
+    GameWorld.GetGameWorld().EventReport_EventReport("", "", "", "", 0, getUrl)
+    
 ## 刷新地图服务器状态, 如果1分钟没有状态回报, 刷新为消失状态
 #  @param tick 当前时间
 #  @return None
@@ -1845,6 +1874,7 @@
 
     gameMapManager = GameWorld.GetGameWorld().GetGameMapManager()
     
+    isSendMapClose = False
     for i in range(0, gameMapManager.GetCount()):
         curMap = gameMapManager.GetAt(i)
 
@@ -1855,8 +1885,12 @@
         if tick - curMap.GetRefreshTick() < ChConfig.Def_Tick_MapServer_MssNone:
             #间隔未到
             continue
-
+        
         curMap.SetState(IPY_GameServer.mssNone)
+        if not isSendMapClose:
+            # 避免多地图发送过多邮件, 如关服的时候
+            SendGameError("MapDisconnect")   # 状态报告
+            isSendMapClose = True
 
     return
 #---------------------------------------------------------------------
@@ -1908,3 +1942,10 @@
     GameWorld.Log("通知C++关服!")
     GameWorld.GetGameWorld().OnServerClose()
     
+    
+def ChangeGameServerState(state):
+    # 只接收大于等于mssPyError
+    GameWorld.DebugLog("ChangeGameServerState:%s"%state)
+    SendGameError("GameServerError")
+    
+    
\ No newline at end of file

--
Gitblit v1.8.0