From b1bb52bb7c6e5c36471140bf383be02d35fe92d4 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 11 一月 2019 22:34:21 +0800
Subject: [PATCH] 2857 【BUG】【1.5】采集被打断问题

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py
index 545f7bd..6509b9c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py
@@ -24,6 +24,7 @@
 import CrossRealmPlayer
 import FunctionNPCCommon
 import DataRecordPack
+import PlayerWeekParty
 import IPY_GameWorld
 import ItemControler
 import ItemCommon
@@ -32,10 +33,10 @@
 
 ## 是否匹配中
 def SetIsCrossPKMatching(curPlayer, isMatching):
-    curPlayer.SetDict(ChConfig.Def_PlayerKey_IsCrossPKMatching, isMatching)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_IsCrossPKMatching, isMatching)
     return
-def GetIsCrossPKMatching(curPlayer): 
-    return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_IsCrossPKMatching) and IsCrossRealmPKMatchState()
+def GetIsCrossPKMatching(curPlayer):
+    return curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_IsCrossPKMatching) and IsCrossRealmPKMatchState()
 
 def DoPlayerOnDay(curPlayer):
     if GameWorld.IsCrossServer():
@@ -308,6 +309,7 @@
             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayWinCount, todayWinCount)
             GameWorld.Log("    增加今日已获胜次数: todayWinCount=%s" % todayWinCount, playerID)
         PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_CrossReamPK)
+        PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_CrossPK, 1)
     else:
         GameWorld.Log("    不同天的PK结算不增加今日PK次数! ", playerID)
         
@@ -342,6 +344,12 @@
 def OnCrossRealmPKBuy(index, clientData, tick):
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
     playerID = curPlayer.GetPlayerID()
+    if not CrossRealmPlayer.IsCrossServerOpen():
+        PlayerControl.NotifyCode(curPlayer, "CrossMatching18")
+        return
+    if not IsCrossRealmPKMatchState():
+        GameWorld.DebugLog("跨服匹配未开启,不可进行购买次数!", playerID)
+        return
     dayFreeMatchCountMax = IpyGameDataPY.GetFuncCfg("CrossRealmPKMatchCount", 1)
     if not dayFreeMatchCountMax:
         GameWorld.DebugLog("每日匹配次数没有限制,不需要购买次数!", playerID)
@@ -487,6 +495,9 @@
     for itemID, itemCnt, isBind in awardItemList:
         ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem])
         
+    if awardType == 3:
+        PlayerControl.WorldNotify(0, "CrossMatching22", [curPlayer.GetPlayerName(), awardDanLV])
+        
     DR_GetCrossPKAward(curPlayer, zoneID, seasonID, eventName, False, drDataDict)
     return
 
@@ -536,7 +547,8 @@
 
 def DoGetPKSeasonAward(curPlayer, eventName, zoneID, seasonID, order, danLV, isMail):
     ## 执行发放赛季结算奖励,名次奖励与最高段位奖励互斥,优先名次奖励
-    
+    isNotify = not isMail
+    notifyKey = ""
     awardItemList = []
     seasonAwardLV = danLV
     playerID = curPlayer.GetPlayerID()
@@ -561,6 +573,7 @@
                 seasonAwardLV = maxDanLV + (len(awardOrderList) - i)
                 GameWorld.Log("获得排名奖励, 更新奖励等级: awardOrderList=%s,i=%s,maxDanLV=%s,seasonAwardLV=%s" % (awardOrderList, i, maxDanLV, seasonAwardLV), playerID)
                 mailTypeKey = "CrossServer4"
+                notifyKey = "CrossMatching23"
                 mailParamList = [seasonID, fromOrder, toOrder]
                 break
             fromOrder = awardOrder + 1
@@ -572,6 +585,7 @@
             return
         awardItemList = danLVIpyData.GetSeasonDanLVAwardList()
         mailTypeKey = "CrossServer5"
+        notifyKey = "CrossMatching24"
         mailParamList = [seasonID, danLV]
         
     if not awardItemList:
@@ -603,6 +617,9 @@
     GameWorld.Log("领取成功! awardItemList=%s" % (awardItemList), playerID)
     drDataDict = {"awardItemList":awardItemList, "order":order, "danLV":danLV, "seasonAwardLV":seasonAwardLV, "isMail":isMail}
     DR_GetCrossPKAward(curPlayer, zoneID, seasonID, eventName, isMail, drDataDict)
+    
+    if isNotify and notifyKey:
+        PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName()] + mailParamList + [awardItemList[0][0]])
     return
 
 def SyncCrossRealmPKPlayerInfo(curPlayer):

--
Gitblit v1.8.0