From ab57c59ab33f5e4bf7e3bfd5514b04cb3d38dc2b Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 04 二月 2026 18:19:05 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_ServerCode
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 235 ++++++++++++++++++++++++++++++++++------------------------
1 files changed, 137 insertions(+), 98 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
index da8cf30..1da98ec 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -27,7 +27,6 @@
import PlayerCoin
import PlayerControl
import PlayerFamily
-import PlayerFamilyZhenfa
import PlayerLoginDayAward
import NPCCommon
import FunctionNPCCommon
@@ -40,7 +39,6 @@
import PlayerGoldInvest
import PlayerCrossRealmPK
import PlayerCrossChampionship
-import OpenServerCampaign
import PlayerCostRebate
import CrossActCTGBillboard
import CrossActAllRecharge
@@ -58,10 +56,8 @@
import PlayerActTurntable
import PlayerActBuyOne
import PlayerSpringSale
-import PlayerBossReborn
import PlayerWeekParty
import PlayerFeastWeekParty
-import PlayerFeastTravel
import PlayerFeastLogin
import PlayerFeastWish
import PlayerActTask
@@ -85,28 +81,52 @@
import IpyGameDataPY
import PlayerArena
import PyGameData
+import OpenServerActivity
import PlayerXiangong
import PlayerBillboard
import PlayerViewCache
+import GameFuncComm
import PlayerMail
import PlayerHero
import PlayerTree
+import PlayerLLMJ
+import DBDataMgr
import datetime
import time
-## 原GameServer通知的
-def GameServer_OnDay(index, tick): return
-def GameServer_OnHour(index, tick): return
-def GameServer_OnWeek(index, tick): return
-def GameServer_OnMonth(index, tick): return
-def GameServer_OnYear(index, tick): return
+def DoLogic_CrossCenterOnDay(centerEventValue):
+ '''收到跨服中心同步的onday事件,注意这里本服的触发跨服中心onday事件
+ 事件由跨服中心统一管理,跨服中心onday后,会广播同步给所有服务器,包含其他跨服服务器及游戏服
+ 由于是由跨服中心统一调度的,所以其他服务器可以各自处理各自跨服功能本服的跨服onday逻辑
+ 【注】常规处理可以无视功能所在跨服与游戏服的onday触发先后顺序,各自处理各自的逻辑即可
+ 如功能所在跨服管理功能的公共跨服数据onday,游戏服管理玩家自身的onday
+ 如果个别功能需要先处理公共数据再处理玩家自身数据的,则由功能自己管理,公共数据处理完毕后再同步给对应的游戏服
+ '''
+ GameWorld.Log("CrossCenterOnDay -> centerEventValue=%s" % centerEventValue)
+
+ PlayerFamily.FamilyCrossCenterOnDay()
+
+ # 其他跨服功能
+
+ # 游戏服额外处理玩家
+ if GameWorld.IsMainServer():
+ playerManager = GameWorld.GetPlayerManager()
+ for i in xrange(playerManager.OnlineCount()):
+ curPlayer = playerManager.OnlineAt(i)
+ if not GameWorld.IsNormalPlayer(curPlayer):
+ continue
+ PlayerOnCrossCenterEvent(curPlayer, centerEventValue)
+
+ PlayerBillboard.OnDay(centerEventValue)
+ return
def DoLogic_OnDay(tick):
GameWorld.Log("MapServer -> OnDay!")
#副本OnDay事件响应
#FBLogic.OnDay(tick)
+ OpenServerActivity.OnDay()
#仙盟
PlayerFamily.FamilyOnDay()
PlayerArena.OnDay()
@@ -123,14 +143,20 @@
PlayerOnDay(curPlayer)
PlayerMail.OnDayEx()
- PlayerControl.RemoveTimeoutLeaveServerPlayerInfo(tick)
PlayerBillboard.OnDay()
PlayerViewCache.OnDay()
+ return
+
+def DoLogic_CrossCenterOnHour(centerEventValue):
+ GameWorld.Log("CrossCenterOnHour -> centerEventValue=%s" % centerEventValue)
+
+ PlayerFamily.FamilyCrossCenterOnHour()
return
def DoLogic_OnHour(tick):
GameWorld.Log("MapServer -> OnHour!")
+ PlayerFamily.FamilyOnHour()
#副本OnHour事件
FBLogic.OnHour(time, tick)
@@ -220,6 +246,45 @@
return
#--------------------------------------------------------
+def PlayerOnCrossCenterEvent(curPlayer, centerEventValue=0):
+ ## 跨服中心过天
+ if not centerEventValue:
+ centerEventValue = DBDataMgr.GetEventTrigMgr().GetValue(ShareDefine.Def_CrossCenterEvent)
+ playerEventValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnCrossEvent)
+ if not playerEventValue:
+ playerEventValue = centerEventValue
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnCrossEvent, centerEventValue)
+
+ if playerEventValue == centerEventValue:
+ return
+
+ centerEventTime = GameWorld.ChangeStrToDatetime("%s:%02d:%02d" % centerEventValue, ChConfig.TYPE_Time_Format_YmdHMS)
+ playerEventTime = GameWorld.ChangeStrToDatetime("%s:%02d:%02d" % playerEventValue, ChConfig.TYPE_Time_Format_YmdHMS)
+
+ center_Day = centerEventTime.day
+ center_Month = centerEventTime.month
+ center_Year = centerEventTime.year
+
+ player_Day = playerEventTime.day
+ player_Month = playerEventTime.month
+ player_Year = playerEventTime.year
+
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnCrossEvent, centerEventValue)
+
+ if (center_Day != player_Day or center_Month != player_Month or center_Year != player_Year):
+ PlayerCrossCenterOnDay(curPlayer, centerEventValue)
+
+ return
+
+def PlayerCrossCenterOnDay(curPlayer, centerEventValue):
+ playerID = curPlayer.GetPlayerID()
+ GameWorld.Log("PlayerCrossCenterOnDay! centerEventValue=%s" % (centerEventValue), playerID)
+
+ PlayerFamily.PlayerCrossCenterOnDay(curPlayer)
+
+ GameWorld.Log("PlayerOnDayCross OK!", playerID)
+ return
+
def PlayerOnDay(curPlayer):
#记录玩家字典值,待初始化后执行
if not curPlayer.GetGameServerInitOK():
@@ -233,8 +298,11 @@
playerID = curPlayer.GetPlayerID()
GameWorld.Log("PlayerOnDay! ondayValue=%s" % (ondayValue), playerID)
+ # 过天同步下时间、开服天
+ ChPlayer.Sync_PyServerDataTimeToClient(curPlayer)
+ ChPlayer.Sync_OpenServerDay(curPlayer)
+
__DoPlayerOnDay(curPlayer, ShareDefine.Def_OnEventType)
- __DoPlayerOnDay(curPlayer, ShareDefine.Def_OnEventTypeEx)
GameWorld.Log("PlayerOnDay OK!", playerID)
return
@@ -245,65 +313,62 @@
return
# 常规过天
- if onEventType == ShareDefine.Def_OnEventType:
-
- #开服活动
- OpenServerCampaign.OnOpenServerCampaignDay(curPlayer)
-
- #清空每日事件奖励
- curPlayer.SetDayProcessGameEventCount(0)
-
- #OnDay时清除每日签到的信息
- PlayerSignDay.SignDayOnDay(curPlayer)
- # 累计登陆礼包登陆次数刷新
- PlayerLoginDayAward.NotePlayerLoginDayCnt(curPlayer)
-
- #------------------------------------------------------------------------------
-
- PlayerCoin.OnDay(curPlayer)
- PlayerTree.PlayerOnDay(curPlayer)
- #投资
- PlayerGoldInvest.OnDay(curPlayer)
- #战令
- PlayerZhanling.OnDay(curPlayer)
- #寻宝
- PlayerTreasure.OnDay(curPlayer)
- PlayerGoldGift.OnDay(curPlayer)
- #转盘
- PlayerActTurntable.PlayerOnDay(curPlayer)
- #情缘
- PlayerLove.DoPlayerOnDay(curPlayer)
- #仙宫
- PlayerXiangong.PlayerOnDay(curPlayer)
- PlayerControl.PayCoinOnDay(curPlayer)
- ChPlayer.PlayerOnDay(curPlayer)
- PlayerActivity.OnDay(curPlayer)
-
+ #if onEventType == ShareDefine.Def_OnEventType:
+ GameFuncComm.DoFuncOpenLogic(curPlayer)
+ #清空每日事件奖励
+ curPlayer.SetDayProcessGameEventCount(0)
+
+ #OnDay时清除每日签到的信息
+ PlayerSignDay.SignDayOnDay(curPlayer)
+ # 累计登陆礼包登陆次数刷新
+ PlayerLoginDayAward.NotePlayerLoginDayCnt(curPlayer)
+
+ #------------------------------------------------------------------------------
+
+ PlayerCoin.OnDay(curPlayer)
+ PlayerTree.PlayerOnDay(curPlayer)
+ #投资
+ PlayerGoldInvest.OnDay(curPlayer)
+ #战令
+ PlayerZhanling.OnDay(curPlayer)
+ #寻宝
+ PlayerTreasure.OnDay(curPlayer)
+ PlayerGoldGift.OnDay(curPlayer)
+ #转盘
+ PlayerActTurntable.PlayerOnDay(curPlayer)
+ #情缘
+ PlayerLove.DoPlayerOnDay(curPlayer)
+ #仙宫
+ PlayerXiangong.PlayerOnDay(curPlayer)
+ PlayerControl.PlayerOnDay(curPlayer)
+ ChPlayer.PlayerOnDay(curPlayer)
+ PlayerActivity.OnDay(curPlayer)
+ PlayerLLMJ.PlayerOnDay(curPlayer)
+ FunctionNPCCommon.ShopItemOnDay(curPlayer)
+ OpenServerActivity.PlayerOnDay(curPlayer)
+
# 特殊时间点X点过天
- elif onEventType == ShareDefine.Def_OnEventTypeEx:
- PlayerHero.PlayerOnDay(curPlayer)
- # 仙盟过天
- PlayerFamily.PlayerOnDay(curPlayer)
- # 重置物品每日使用次数
- ChItem.ResetItemUseCntToday(curPlayer)
- # 极品白拿
- PlayerFreeGoods.OnDay(curPlayer)
- #采集次数重置
- NPCCommon.PlayerOnDay(curPlayer)
- #跨服竞技场
- PlayerCrossRealmPK.DoPlayerOnDay(curPlayer)
- #跨服排位
- PlayerCrossChampionship.DoPlayerOnDay(curPlayer)
- #竞技场
- PlayerArena.OnDayEx(curPlayer)
- #特殊时间点过天的,一般是游戏功能,此时立即同步一次跨服玩家数据
- CrossPlayerData.SendMergePlayerDataNow(curPlayer)
-
+ #elif onEventType == ShareDefine.Def_OnEventTypeEx:
+ PlayerHero.PlayerOnDay(curPlayer)
+ # 仙盟过天
+ PlayerFamily.PlayerOnDay(curPlayer)
+ # 重置物品每日使用次数
+ ChItem.ResetItemUseCntToday(curPlayer)
+ # 极品白拿
+ PlayerFreeGoods.OnDay(curPlayer)
+ #采集次数重置
+ NPCCommon.PlayerOnDay(curPlayer)
+ #跨服竞技场
+ PlayerCrossRealmPK.DoPlayerOnDay(curPlayer)
+ #跨服排位
+ PlayerCrossChampionship.DoPlayerOnDay(curPlayer)
+ #竞技场
+ PlayerArena.OnDayEx(curPlayer)
+ #特殊时间点过天的,一般是游戏功能,此时立即同步一次跨服玩家数据
+ CrossPlayerData.SendMergePlayerDataNow(curPlayer)
+
# 以下为支持两种重置模式切换配置的
FBCommon.FBOnDay(curPlayer, onEventType)
-
- # 商店物品购买兑换OnDay
- FunctionNPCCommon.ShopItemOnDay(curPlayer, onEventType)
#许愿池
PlayerWishingWell.OnDay(curPlayer)
#通天令
@@ -395,17 +460,14 @@
# 每周提示玩家提示vip等级加入贵宾俱乐部
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasVIPClubNote, 0)
+ FunctionNPCCommon.ShopItemOnWeek(curPlayer)
elif onEventType == ShareDefine.Def_OnEventTypeEx:
#竞技场
PlayerArena.OnWeekEx(curPlayer)
- PlayerFamily.OnWeekEx(curPlayer)
# 以下为支持两种重置模式切换配置的
FBCommon.FBOnWeek(curPlayer, onEventType)
-
- # 商店物品购买兑换OnDay
- FunctionNPCCommon.ShopItemOnWeek(curPlayer, onEventType)
return
#---------------------------------------------------------------------
@@ -446,8 +508,6 @@
pass
#OnMonthEx
- # 商店物品购买兑换OnMonth
- FunctionNPCCommon.ShopItemOnMonth(curPlayer, onEventType)
return
#---------------------------------------------------------------------
@@ -694,6 +754,9 @@
#OnYear事件
if __Get_Can_OnYear(curPlayer):
PlayerOnYear(curPlayer)
+
+ # 跨服事件检查
+ PlayerOnCrossCenterEvent(curPlayer)
return
@@ -857,14 +920,6 @@
PyGameData.FBOpenTimeRecord = eval(msgValue)
return
- if key == ShareDefine.Def_Notify_WorldKey_VSFamilyInfo:
- PyGameData.VSFamilyInfo = eval(msgValue)
- return
-
- if key == ShareDefine.Def_Notify_WorldKey_FamilyZhenfaInfo:
- PlayerFamilyZhenfa.GameServer_FamilyZhenfa(eval(msgValue))
- return
-
if key == ShareDefine.Def_Notify_WorldKey_CoupleInfo:
syncCoupleInfo = eval(msgValue)
for playerID, coupleInfo in syncCoupleInfo.items():
@@ -909,9 +964,6 @@
elif actionName == ShareDefine.OperationActionName_SpringSale:
PlayerSpringSale.RefreshSpringSaleActionInfo(actNum)
-
- elif actionName == ShareDefine.OperationActionName_BossReborn:
- PlayerBossReborn.RefreshOperationAction_BossReborn()
elif actionName == ShareDefine.OperationActionName_FlashGiftbag:
PlayerFlashGiftbag.RefreshFlashGiftbagActionInfo(actNum)
@@ -961,9 +1013,6 @@
elif actionName == ShareDefine.OperationActionName_FeastWish:
PlayerFeastWish.RefreshFeastWishActionInfo()
- elif actionName == ShareDefine.OperationActionName_FeastTravel:
- PlayerFeastTravel.RefreshFeastTravelActionInfo()
-
elif actionName == ShareDefine.OperationActionName_FeastWeekParty:
PlayerFeastWeekParty.RefreshOperationAction_FeastWeekParty()
@@ -1009,16 +1058,6 @@
if key == ShareDefine.Def_Notify_WorldKey_CrossZoneName:
PyGameData.g_crossZoneName = msgValue
- return
-
- if key == ShareDefine.Def_Notify_WorldKey_CrossServerTime:
- PyGameData.g_crossServerTimeInfo = eval(msgValue)
- playerManager = GameWorld.GetPlayerManager()
- for index in xrange(playerManager.GetPlayerCount()):
- curPlayer = playerManager.GetPlayerByIndex(index)
- if not GameWorld.IsNormalPlayer(curPlayer):
- continue
- ChPlayer.Sync_PyServerDataTimeToClient(curPlayer)
return
# 幸运云购
--
Gitblit v1.8.0