From c35e176a3b05f745600c6e60f168313d2b9e7b30 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 17 九月 2025 12:00:19 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(司马懿技能;增加按层级结算持续buff效果5003;增加非按攻击力计算伤害支持;技能伤害增加可限制最大攻击力百分比上限配置;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldEvent.py |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldEvent.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldEvent.py
index c486584..ecd028e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldEvent.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldEvent.py
@@ -18,10 +18,15 @@
 import DBDataMgr
 import GameWorld
 import IpyGameDataPY
+import IPY_GameWorld
 import PlayerEventCounter
+import PlayerControl
+import NetPackCommon
+import PlayerOnline
 import ShareDefine
-import PlayerTeam
 import PyGameData
+import BattleObj
+import ObjPool
 
 import datetime
 import time
@@ -230,6 +235,11 @@
     if tick - PyGameData.g_highProcessTick < 1000:
         return
     PyGameData.g_highProcessTick = tick
+    
+    if PyGameData.g_serverClosing:
+        CheckCloseMapOK()
+        return
+    
     OnMinute(tick)
     
     # 其他逻辑
@@ -255,8 +265,10 @@
     #GameWorldActionControl.Dispose_OperationActionState()
     #GameWorldActionControl.Dispose_DailyActionState()
     #GameWorldActionControl.Dispose_FBStateTime()
+    PlayerOnline.OnMinute()
+    BattleObj.OnMinute()
+    ObjPool.OnMinute()
     
-    PlayerTeam.OnCheckTeamPlayerDisconnectTimeout(tick)
     __CheckIpyDataRecycle(curTime)
     return
     
@@ -362,3 +374,47 @@
     PyGameData.g_ipyDataRecycleCheckTime = 1    
     IpyGameDataPY.IPYData.Recycle()
     return
+
+
+# 关闭地图通知py处理
+def CloseMap(tick):
+    serverID = GameWorld.GetGameWorld().GetServerID()
+    GameWorld.Log("地图服务器关闭开始保存数据! serverID=%s" % serverID)
+    PyGameData.g_serverClosing = 1
+    
+    playerManager = GameWorld.GetPlayerManager()
+    for i in xrange(playerManager.GetPlayerCount()):
+        curPlayer = playerManager.GetPlayerByIndex(i)
+        if not curPlayer or curPlayer.GetID() == 0 or curPlayer.IsEmpty():
+            continue
+        
+        #镜像玩家回收、真实玩家踢下线
+        if GameWorld.IsMirrorPlayer(curPlayer):
+            PlayerControl.DeleteMirror(curPlayer)
+        else:
+            curPlayer.Kick(IPY_GameWorld.disMapServerClose)
+            
+    DBDataMgr.OnServerClose()
+    return
+
+def CheckCloseMapOK():
+    '''检查等待关服数据处理完毕
+    没有玩家了,且公共数据已入库完毕
+    '''
+    if PyGameData.g_serverClosing != 1:
+        return
+    if not PyGameData.g_closeSaveDataOK:
+        return
+    if GameWorld.GetPlayerManager().OnlineCount():
+        return
+    DBDataMgr.ClearBackupFile() # 正常关服数据处理完毕可直接删除备档
+    
+    from PyMongoDB.DBCommon import CommonDefine
+    from PyMongoDB.Common import CommFunc
+    data = ''
+    data = CommFunc.WriteBYTE(data, CommonDefine.dgPlayerSaveGameServerData)  
+    NetPackCommon.SendPyPackToMapServerSelf(data, len(data))
+    GameWorld.Log("python 已处理地图关闭逻辑")
+    PyGameData.g_serverClosing = 2
+    return
+    
\ No newline at end of file

--
Gitblit v1.8.0