| | |
| | | serverOnly = clientData.ServerOnly
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | | GameWorld.DebugLog("跨服服务器无法发起匹配!", playerID)
|
| | | GameWorld.DebugLog("跨服服务器无法发起!", playerID)
|
| | | return
|
| | |
|
| | | if not CrossRealmPlayer.IsCrossServerOpen():
|
| | | PlayerControl.NotifyCode(curPlayer, "CrossMatching18")
|
| | | return
|
| | |
|
| | | if faction not in [ChConfig.CampType_Justice, ChConfig.CampType_Evil]:
|
| | | GameWorld.DebugLog("没有该战场阵营选择! faction=%s" % faction, playerID)
|
| | | return
|
| | | |
| | | callOpenHMList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldOpen", 2)
|
| | | if [hour, minute] not in callOpenHMList:
|
| | | GameWorld.Log("非可召集的战场场次! hour=%s,minute=%s,callOpenHMList=%s" % (hour, minute, callOpenHMList), playerID)
|
| | | return
|
| | | |
| | | closeBuyMinute = IpyGameDataPY.GetFuncCfg("CrossBattlefieldOpen", 4) # 开启前X分钟后关闭购买
|
| | | crossServerTimeStr = GameWorld.GetCrossServerTimeStr()
|
| | | crossServerDateTime = GameWorld.ChangeStrToDatetime(crossServerTimeStr)
|
| | | |
| | | startTimeStr = "%s-%s-%s %s:%s:00" % (crossServerDateTime.year, crossServerDateTime.month, crossServerDateTime.day, hour, minute)
|
| | | startDateTime = GameWorld.ChangeStrToDatetime(startTimeStr)
|
| | | endBuyDateTime = startDateTime + datetime.timedelta(minutes= -closeBuyMinute)
|
| | | if crossServerDateTime >= endBuyDateTime:
|
| | | GameWorld.Log("该时间点战场已关闭召集,不能再召集! hour=%s,minute=%s,crossServerDateTime(%s) >= endBuyDateTime(%s)" |
| | | % (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
|
| | | |
| | | sysOpenHMList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldOpen", 1)
|
| | | if [hour, minute] in sysOpenHMList:
|
| | | if PlayerControl.GetCrossMapID(curPlayer) != ChConfig.Def_FBMapID_CrossBattlefield:
|
| | | GameWorld.DebugLog("系统场次召集只能在跨服战场地图时可召集! CrossMapID=%s" % PlayerControl.GetCrossMapID(curPlayer), playerID)
|
| | | return
|
| | | else:
|
| | | if faction not in [ChConfig.CampType_Justice, ChConfig.CampType_Evil]:
|
| | | GameWorld.DebugLog("没有该战场阵营选择! faction=%s" % faction, playerID)
|
| | | return
|
| | | |
| | | callOpenHMList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldOpen", 2)
|
| | | if [hour, minute] not in callOpenHMList:
|
| | | GameWorld.Log("非可召集的战场场次! hour=%s,minute=%s,callOpenHMList=%s" % (hour, minute, callOpenHMList), playerID)
|
| | | return
|
| | | |
| | | closeBuyMinute = IpyGameDataPY.GetFuncCfg("CrossBattlefieldOpen", 4) # 开启前X分钟后关闭购买
|
| | | crossServerTimeStr = GameWorld.GetCrossServerTimeStr()
|
| | | crossServerDateTime = GameWorld.ChangeStrToDatetime(crossServerTimeStr)
|
| | | |
| | | startTimeStr = "%s-%s-%s %s:%s:00" % (crossServerDateTime.year, crossServerDateTime.month, crossServerDateTime.day, hour, minute)
|
| | | startDateTime = GameWorld.ChangeStrToDatetime(startTimeStr)
|
| | | endBuyDateTime = startDateTime + datetime.timedelta(minutes= -closeBuyMinute)
|
| | | if crossServerDateTime >= endBuyDateTime:
|
| | | GameWorld.Log("该时间点战场已关闭召集,不能再召集! hour=%s,minute=%s,crossServerDateTime(%s) >= endBuyDateTime(%s)" |
| | | % (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)
|