From 6f417ce437e575d368974b200d3dccdb1aa6ed9b Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 18 二月 2025 18:12:54 +0800
Subject: [PATCH] 10398 2月17-21版本更新(修复部分技能可能没有验证攻击距离的bug;)
---
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py | 94 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 93 insertions(+), 1 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py
index 415d287..7034a64 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py
@@ -28,6 +28,7 @@
#---------------------------------------------------------------------
import GameWorld
import PlayerDBOper
+import PyDataManager
import IPY_GameServer
import PlayerDBGSEvent
import CrossChampionship
@@ -38,6 +39,7 @@
import PyGameData
import ChConfig
import types
+import time
#---------------------------------------------------------------------
#系统提示参数列表
NotifyCodeList = IPY_GameServer.IPY_NotifyCodeList()
@@ -244,7 +246,8 @@
## 副本功能线路ID
def SetFBFuncLineID(curPlayer, funcLineID): return curPlayer.SetExAttr3(funcLineID)
-def GetFBFuncLineID(curPlayer): return curPlayer.GetExAttr3()
+def GetFBFuncMapID(curPlayer): return curPlayer.GetExAttr3() / 1000
+def GetFBFuncLineID(curPlayer): return curPlayer.GetExAttr3() % 1000
##VIP到期时间
def GetVIPExpireTime(curPlayer): return 0
@@ -280,6 +283,9 @@
curPlayer.MapServer_QueryPlayerResult(0, 0, "SetLeaveFamilyTime", sysMsg, len(sysMsg))
return
def GetLeaveFamilyTime(curPlayer):return curPlayer.GetExAttr12()
+##玩家离开仙盟时间(主动或被踢都算)
+def GetLeaveFamilyTimeEx(curPlayer):return curPlayer.GetExAttr19()
+def SetLeaveFamilyTimeEx(curPlayer, value):return curPlayer.SetExAttr19(value)
## 玩家所属服务器组ID
def GetPlayerServerGroupID(curPlayer): return curPlayer.GetExAttr13()
@@ -376,6 +382,12 @@
curPlayer.MapServer_QueryPlayerResult(0, 0, "DelItem", result, len(result))
return
+def MapServerGiveAward(curPlayer, eventName, moneyInfo={}, itemList=[], drDict={}):
+ ## 地图给奖励
+ result = str([eventName, moneyInfo, itemList, drDict])
+ curPlayer.MapServer_QueryPlayerResult(0, 0, "GiveAward", result, len(result))
+ return
+
## 增加仙盟活跃
# @param curPlayer
# @param successType: 成就类型
@@ -441,4 +453,84 @@
FuncOpenLogicDict[funcID](curPlayer)
return
+def AddOfflineUnprocessed(playerID, eventName, eventData, outtimeDays=30):
+ '''添加玩家离线未处理的事件
+ @param eventName: 事件名
+ @param eventData: 事件数据,由功能自定定义,任意格式
+ @param outtimeDays: 过期天数,0-永久, >0-指定天数, 默认30天
+ '''
+ playerRecMgr = PyDataManager.GetDBPlayerRecDataManager()
+ recData = playerRecMgr.AddPlayerRecData(ShareDefine.Def_PlayerRecType_OfflineUnprocessed, playerID)
+ recData.SetValue1(outtimeDays)
+ recData.SetUserDataByKey("eventName", eventName)
+ recData.SetUserDataByKey("eventData", eventData)
+ GameWorld.Log("添加玩家离线未处理的事件: %s, %s, %s" % (eventName, outtimeDays, eventData), playerID)
+ return
+def DoOfflineUnprocessed(curPlayer, eventName, dofunc):
+ '''执行处理玩家离线未处理的事件
+ @param dofunc: 执行函数,参数[curPlayer, recData, eventName, eventData]
+ '''
+ if not dofunc:
+ return
+ playerID = curPlayer.GetPlayerID()
+ playerRecMgr = PyDataManager.GetDBPlayerRecDataManager()
+ recDataList = playerRecMgr.GetPlayerRecDataList(ShareDefine.Def_PlayerRecType_OfflineUnprocessed, playerID)
+ delRecDataList = []
+ # 需按添加顺序执行逻辑
+ for recData in recDataList:
+ if recData.GetUserDataByKey("eventName") != eventName:
+ continue
+ eventData = recData.GetUserDataByKey("eventData")
+ GameWorld.Log("执行玩家上次离线前未处理事件: %s, %s" % (eventName, eventData), playerID)
+ dofunc(curPlayer, recData, eventName, eventData)
+ delRecDataList.append(recData)
+
+ # 执行完后再统一删除
+ for recData in delRecDataList:
+ playerRecMgr.DelRecData(recData)
+ return
+
+def DelOfflineUnprocessed(eventName):
+ ## 删除玩家离线未处理的事件
+ playerRecMgr = PyDataManager.GetDBPlayerRecDataManager()
+ recDict = playerRecMgr.GetPlayerRecDataDict(ShareDefine.Def_PlayerRecType_OfflineUnprocessed)
+ if not recDict:
+ return
+
+ delCnt = 0
+ for recDataList in recDict.values():
+ for recData in recDataList[::-1]: # 倒序处理删除到期
+ if recData.GetUserDataByKey("eventName") != eventName:
+ continue
+ playerRecMgr.DelRecData(recData)
+ delCnt += 1
+
+ GameWorld.DebugLog("删除玩家离线未处理的事件: %s, delCnt=%s" % (eventName, delCnt))
+ return
+
+def DelOuttimeOfflineUnprocessed():
+ ## 删除过期玩家离线未处理的事件
+ playerRecMgr = PyDataManager.GetDBPlayerRecDataManager()
+ recDict = playerRecMgr.GetPlayerRecDataDict(ShareDefine.Def_PlayerRecType_OfflineUnprocessed)
+ if not recDict:
+ return
+
+ curTime = int(time.time())
+ for recDataList in recDict.values():
+ for recData in recDataList[::-1]: # 倒序处理删除到期
+ recTime = recData.GetTime()
+ outtimeDays = recData.GetValue1()
+ if not outtimeDays:
+ continue
+ diffDays = GameWorld.GetDiff_Day(curTime, recTime) + 1
+ if diffDays <= outtimeDays:
+ continue
+ playerRecMgr.DelRecData(recData)
+
+ GameWorld.DebugLog("删除玩家离线未处理的过期事件: %s, %s" % (outtimeDays, recData.GetUserData()), recData.GetPlayerID())
+ return
+
+def DoOnDay():
+ DelOuttimeOfflineUnprocessed()
+ return
--
Gitblit v1.8.0