From f9bd7ebdd8ac7016e8cc2e0ffcb20df22d75c2a0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 27 二月 2023 15:57:07 +0800
Subject: [PATCH] 9415 【BT7】【BT8】【BT9】【主干】【后端】古神战场(跨服服务器及本服服务器时间均超过5点后可购买)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py     |    8 ++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GMTExec/BattlefieldBuyOpen.py |   66 +++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GMTExec/BattlefieldBuyOpen.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GMTExec/BattlefieldBuyOpen.py
new file mode 100644
index 0000000..ca590b8
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GMTExec/BattlefieldBuyOpen.py
@@ -0,0 +1,66 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Script.Player.GMTExec.BattlefieldBuyOpen
+#
+# @todo:修改召集榜数据
+# @author hxp
+# @date 2023-02-27
+# @version 1.0
+#
+# 详细描述: 修改召集榜数据
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2023-02-27 15:30"""
+#-------------------------------------------------------------------------------
+
+
+def runMyTest(exec_locals):
+    ''' 运行命令函数
+    @param exec_locals: GY_Query_GMTExecfile 模块中的 DoLogic 函数 locals()
+    
+    import 其他模块需要写在此函数里,不然无法引用到
+    '''
+    import PlayerControl
+    import PlayerBillboard
+    import ShareDefine
+    import GameWorld
+    import ChConfig
+    
+    orderId = exec_locals["orderId"]
+    cmdInfo = exec_locals["cmdInfo"]
+    curPlayer = exec_locals["curPlayer"]
+    resultDict = exec_locals["resultDict"] # 建议都进行更新结果字典记录详细处理信息,GY_Query_GMTExecfile 模块会统一写入流向
+    
+    ## ============== 命令配置 ================
+    zoneID = 1 # 分区ID
+    BuyOpenCountToday = 3 # 今日已购买次数
+    BuyOpenCountWeek = 3 # 本周已购买次数
+    ## ========================================
+    
+    playerID = curPlayer.GetPlayerID()
+    befBuyOpenCountToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Battlefield_BuyOpenCountToday)
+    befBuyOpenCountWeek = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Battlefield_BuyOpenCountWeek)
+    
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Battlefield_BuyOpenCountToday, BuyOpenCountToday)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Battlefield_BuyOpenCountWeek, BuyOpenCountWeek)
+    
+    aftBuyOpenCountToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Battlefield_BuyOpenCountToday)
+    aftBuyOpenCountWeek = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Battlefield_BuyOpenCountWeek)
+    
+    groupValue1 = zoneID
+    value1 = curPlayer.GetOfficialRank()
+    cmpValue = BuyOpenCountWeek
+    PlayerBillboard.UpdatePlayerCrossBillboard(curPlayer, ShareDefine.Def_CBT_BattlefieldWCall, groupValue1, cmpValue, value1=value1)
+    
+    GameWorld.Log("This is MameServer BattlefieldBuyOpen run %s. orderId=%s" % (cmdInfo, orderId), curPlayer.GetPlayerID())
+    resultDict.update({"befBuyOpenCountToday":befBuyOpenCountToday, "aftBuyOpenCountToday":aftBuyOpenCountToday,
+                       "befBuyOpenCountWeek":befBuyOpenCountWeek, "aftBuyOpenCountWeek":aftBuyOpenCountWeek,
+                       "PlayerID":playerID})
+    return
+
+exec_locals = locals()
+if exec_locals.get("cmdInfo"):
+    runMyTest(exec_locals)
+    
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py
index 5de75dc..ac3be22 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py
@@ -103,6 +103,14 @@
                       % (hour, minute, crossServerDateTime, endBuyDateTime), playerID)
         return
     
+    canBuyStartHour = 5
+    curServerTime = GameWorld.GetCurrentTime()
+    if crossServerDateTime.hour < canBuyStartHour or curServerTime.hour < canBuyStartHour:
+        PlayerControl.NotifyCode(curPlayer, "CrossBattlefieldBuyLimit")
+        GameWorld.Log("跨服服务器及本服服务器需超过%s点后可购买! crossServerHour=%s,curServerHour=%s" 
+                      % (canBuyStartHour, crossServerDateTime.hour, curServerTime.hour), playerID)
+        return
+    
     moneyBuyMaxCount, moneyType, moneyCount = 0, 0, 0
     todayBuyOpenCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Battlefield_BuyOpenCountToday)
     buyOpenMoneyInfo = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldBuyOpen", 1)

--
Gitblit v1.8.0