From 7473f41b83c2921add6c7e41ff2459bb9260a8d7 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 27 四月 2019 17:18:59 +0800
Subject: [PATCH] 6628 【2.0】【后端】查看玩家装备和查看玩家战力功能(定期删除过期查看玩家缓存,暂定30天未登录更新数据且不在榜上的删除)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBourseTube.py |   48 +++++++++++++++++++++++++++++-------------------
 1 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBourseTube.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBourseTube.py
index d566788..4d30f4b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBourseTube.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBourseTube.py
@@ -31,6 +31,7 @@
 import PlayerVip
 import PlayerSuccess
 import IpyGameDataPY
+import EventShell
 
 #------------------------------------------------------------------------------ 
 #// B5 01 交易所玩家上架物品#tagCMPYPlayerSellBourseItem
@@ -64,7 +65,12 @@
     if clientData.PriceCount <= 0:
         GameWorld.DebugLog("Bourse### PlayerSellBourseItem PriceCount <= 0"%itemIndex)
         return  
-
+    if clientData.Count > curItem.GetCount():
+        GameWorld.Log('    Bourse### 客户端发的物品数量大于实际数量!!')
+    sellCount = min(clientData.Count, curItem.GetCount())
+    if sellCount <= 0:
+        return
+        
     password = clientData.Pwd
     #判断vip权限
     if password and not PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_BoursePwd):
@@ -75,7 +81,7 @@
     sendPack = ChMapToGamePyPack.tagMGCheckAddPlayerBourseItem()
     sendPack.PlayerID = curPlayer.GetPlayerID()
     sendPack.ItemIndex = itemIndex
-    sendPack.Count = clientData.Count
+    sendPack.Count = sellCount
     sendPack.PriceType = clientData.PriceType
     sendPack.PriceCount = clientData.PriceCount
     sendPack.Pwd = password
@@ -145,6 +151,9 @@
     ItemCommon.DelItem(curPlayer, curItem, curPackData.Count, True, ChConfig.ItemDel_AddBourseItem, isForceDR=True)
     
     GameWorld.DebugLog('Bourse### GMCheckAddPlayerBourseItemResult out  1 ItemGUID=%s'%sendPack.ItemGUID)
+    
+    #上架物品任务接口
+    EventShell.EventRespons_AddBourseItem(curPlayer)
     return
 
 
@@ -206,7 +215,6 @@
     ItemControler.SetItemCount(curCreateItem, curPackData.Count)
     
     if curCreateItem.GetPackCount() == 1:
-        ItemControler.SetItemIsBind(curCreateItem, False)
         ItemCommon.SetEquipGearScore(curCreateItem, curPackData.EquipGS)
         curCreateItem.SetUserData(curPackData.UserData, curPackData.UserDataLen)
         
@@ -231,7 +239,7 @@
         return
     GameWorld.DebugLog('发送补偿邮件 物品售出 钱发给玩家')
 
-    PlayerControl.SendMailByKey('BourseSell', [curPlayer.GetPlayerID()], [], [itemName, priceCount, taxMoney, giveMoney], giveMoney)
+    PlayerControl.SendMailByKey('BourseSellVip' if curPlayer.GetVIPLv() else 'BourseSell', [curPlayer.GetPlayerID()], [], [itemName, priceCount, taxMoney, giveMoney], giveMoney)
 #    
 #    addDataDict = {ChConfig.Def_Give_Reason_SonKey:"Gains"}
 #    PlayerControl.GiveMoney(curPlayer, moneyType, giveMoney, ChConfig.Def_GiveMoney_Bourse, addDataDict) 
@@ -319,35 +327,37 @@
 #  @return None
 def OnGMCheckBuyBourseItemResult(curPackData, tick):
     GameWorld.DebugLog("Bourse### GMCheckBuyBourseItemResult in, PlayerID %s"%curPackData.PlayerID)
+    
+    playerName = __CheckBuyBourseItemResult(curPackData)
+    #//02 04 玩家确认购买交易所物品#tagMGBuyBourseItemSure
+    sendPack = ChMapToGamePyPack.tagMGBuyBourseItemSure()
+    sendPack.PlayerID = curPackData.PlayerID
+    sendPack.PlayerName = playerName #发空代表购买失败
+    sendPack.ItemGUID = curPackData.ItemGUID
+    NetPackCommon.SendPyPackToGameServer(sendPack)
+    GameWorld.DebugLog("Bourse### GMCheckBuyBourseItemResult out,  PriceCount %s"%curPackData.PriceCount)
+    return
+
+def __CheckBuyBourseItemResult(curPackData):
     curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(curPackData.PlayerID)
     if not curPlayer:
         GameWorld.DebugLog("Bourse### GMCheckBuyBourseItemResult , PlayerID %s no found "%curPackData.PlayerID)
-        return
+        return ''
    
     if curPackData.PriceCount != 0:
         if not PlayerControl.HaveMoney(curPlayer, curPackData.PriceType, curPackData.PriceCount):
             GameWorld.DebugLog("Bourse### GMCheckBuyBourseItemResult , ItemGUID %s  no enough money %s"%(curPackData.ItemGUID, curPackData.PriceCount))
-            return
+            return ''
         if curPackData.PriceType == IPY_GameWorld.TYPE_Price_Gold_Money:
             if not PlayerControl.HaveMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney, curPackData.PriceCount):
                 curBourseMoney = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
                 GameWorld.Log("Bourse### GMCheckBuyBourseItemResult , ItemGUID %s no enough bourse money! priceCount=%s,curBourseMoney=%s" 
                               % (curPackData.ItemGUID, curPackData.PriceCount, curBourseMoney), curPlayer.GetPlayerID())
-                return
+                return ''
         #先付钱再给卖家收益
         infoDict = {"ItemGUID":curPackData.ItemGUID}
         PlayerControl.PayMoney(curPlayer, curPackData.PriceType, curPackData.PriceCount, ChConfig.Def_Cost_BourseBuy, infoDict)
-        
-        #//02 04 玩家确认购买交易所物品#tagMGBuyBourseItemSure
-        sendPack = ChMapToGamePyPack.tagMGBuyBourseItemSure()
-        sendPack.PlayerID = curPackData.PlayerID
-        sendPack.PlayerName = curPlayer.GetPlayerName()
-        sendPack.ItemGUID = curPackData.ItemGUID
-        NetPackCommon.SendPyPackToGameServer(sendPack)
-    
-    GameWorld.DebugLog("Bourse### GMCheckBuyBourseItemResult out,  PriceCount %s"%curPackData.PriceCount)
-    return
-
-
+        return curPlayer.GetPlayerName()
+    return ''
     
 

--
Gitblit v1.8.0