From 985bdf70fd0022733f75bf2106e69c6de77c26b1 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 28 十一月 2025 17:29:51 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(卑弥呼所有技能;技能表增加字段Buff保留-BuffRetain,支持死亡保留、复活保留;增加触发方式42-大回合开始时(死亡后有效);增加属性ID 73复活生命加成、74复活怒气加成;优化效果6014-支持失败次数额外概率;优化死亡、复活时的buff处理;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldEvent.py | 34 ++++++++++++++++++++++++++++++++--
1 files changed, 32 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 bbeaa36..78b2a7c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldEvent.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldEvent.py
@@ -27,6 +27,7 @@
import ShareDefine
import PyGameData
import BattleObj
+import ChPlayer
import ObjPool
import datetime
@@ -233,9 +234,23 @@
## 每秒分钟执行一次
if not PyGameData.g_initGameTime:
return
- if tick - PyGameData.g_highProcessTick < 1000:
+ curTime = int(time.time())
+ if not PyGameData.g_highProcessTime:
+ PyGameData.g_highProcessTime = curTime
+
+ if curTime < PyGameData.g_highProcessTime:
+ GameWorld.Log("时间回调了: lastProcessTime=%s" % (GameWorld.ChangeTimeNumToStr(PyGameData.g_highProcessTime)))
+ PyGameData.g_highProcessTime = curTime
+ OnFixServerTimeProcess()
+
+ passSeconds = curTime - PyGameData.g_highProcessTime
+ if passSeconds < 1:
return
- PyGameData.g_highProcessTick = tick
+ if passSeconds > 10:
+ GameWorld.Log("时间误差过大: passSeconds=%s,lastProcessTime=%s" % (passSeconds, GameWorld.ChangeTimeNumToStr(PyGameData.g_highProcessTime)))
+ OnFixServerTimeProcess()
+
+ PyGameData.g_highProcessTime = curTime
if PyGameData.g_serverClosing:
CheckCloseMapOK()
@@ -249,6 +264,21 @@
return
+def OnFixServerTimeProcess():
+
+ # 补同步一次服务器时间给前端
+ playerManager = GameWorld.GetPlayerManager()
+ for i in xrange(playerManager.GetPlayerCount()):
+ curPlayer = playerManager.GetPlayerByIndex(i)
+
+ if not GameWorld.IsNormalPlayer(curPlayer):
+ continue
+
+ ChPlayer.Sync_PyServerDataTimeToClient(curPlayer)
+ ChPlayer.Sync_OpenServerDay(curPlayer)
+
+ return
+
def OnMinute(tick):
## 每整分钟执行一次
curTime = GameWorld.GetCurrentTime()
--
Gitblit v1.8.0