From 93367a2607db214ec6dda86bd796c1291bc06a49 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 27 三月 2019 15:29:05 +0800
Subject: [PATCH] 3167 【BUG】【2.0】拍卖,消耗了仙玉没获得拍品
---
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py | 2 +-
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/AuctionHouse.py | 31 ++++++++++++++++++++++++-------
2 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/AuctionHouse.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/AuctionHouse.py
index 704c142..0b4fe85 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/AuctionHouse.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/AuctionHouse.py
@@ -53,6 +53,18 @@
AuctionType_World = 0
AuctionType_Family = 1
+'''
+竞价流程:
+1. MapServer 先验证价格是否够
+2. GameServer 验证是否可以竞价
+3. MapServer 扣除玩家货币
+4. GameServer 进行竞价,变更下次竞价价格
+
+基于以上流程,所以玩家竞价时需先锁定物品,防止竞价流程未完结时其他玩家请求竞价同一拍品判断竞价价格错误
+锁定时长同样适用于拍品竞价时间结束时的保护时间
+'''
+BiddingQueryLockTick = 10000
+
#拍卖行状态开关
def GetAuctionHouseState(): return PlayerBourse.GetOpenState()
@@ -278,8 +290,9 @@
return
bidTime = GameWorld.ChangeTimeStrToNum(auctionItem.BiddingTime)
endTime = bidTime + IpyGameDataPY.GetFuncCfg("AuctionHouse", 4)
- if endTime < auctionItem.EndTime:
+ if endTime <= auctionItem.EndTime:
return
+ GameWorld.DebugLog("拍品加时: EndTime=%s,updEndTime=%s" % (auctionItem.EndTime, endTime))
auctionItem.EndTime = endTime
return True
@@ -304,21 +317,25 @@
## 仙盟拍卖中的拍品列表
return PyDataManager.GetAuctionItemManager().familyAuctionItemDict.get(familyID, [])
-def OnAuctionItemTimeProcess(curTime):
+def OnAuctionItemTimeProcess(curTime, tick):
## 拍卖行拍品定时处理,每秒触发一次
allAuctionItemByEndTimeList = PyDataManager.GetAuctionItemManager().allAuctionItemByEndTimeList
if not allAuctionItemByEndTimeList:
return
+ index = 0
endItemList = [] # 结束竞价的拍品列表
moveToWorldItemList = [] # 转移到全服拍卖的仙盟拍品列表
doCount = len(allAuctionItemByEndTimeList)
while doCount > 0 and allAuctionItemByEndTimeList:
doCount -= 1
- auctionItem = allAuctionItemByEndTimeList[0]
- if curTime < auctionItem.EndTime:
+ auctionItem = allAuctionItemByEndTimeList[index]
+ if curTime <= auctionItem.EndTime:
break
- allAuctionItemByEndTimeList.pop(0)
+ if auctionItem.BiddingQueryTick and tick - auctionItem.BiddingQueryTick < BiddingQueryLockTick:
+ index += 1
+ continue
+ allAuctionItemByEndTimeList.pop(index)
# 没有人竞价的仙盟拍品
if not auctionItem.BidderPrice and auctionItem.FamilyID and auctionItem.AuctionType == AuctionType_Family:
@@ -795,7 +812,7 @@
% (itemGUID, itemID, itemFamilyID, playerFamilyID), playerID)
errInfo = "is family auction item"
return itemID, errInfo
- if curTime >= auctionItem.EndTime:
+ if curTime > auctionItem.EndTime:
GameWorld.ErrLog("拍品已结束竞价! itemGUID=%s,itemID=%s,addTimeStr=%s" % (itemGUID, itemID, addTimeStr), playerID)
errInfo = "end bid"
return itemID, errInfo
@@ -811,7 +828,7 @@
if isOnlyCheck:
queryTick = auctionItem.BiddingQueryTick
- if queryTick and tick - queryTick < 10000:
+ if queryTick and tick - queryTick < BiddingQueryLockTick:
# 有玩家正在竞价,请稍等
PlayerControl.NotifyCode(curPlayer, "Paimai1")
errInfo = "other player bidding"
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
index e2e204c..f85ecec 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
@@ -302,7 +302,7 @@
PlayerDBOper.PyDBProccess(tick)
#拍卖行
- AuctionHouse.OnAuctionItemTimeProcess(curTime)
+ AuctionHouse.OnAuctionItemTimeProcess(curTime, tick)
#每整分钟处理一次
curDateTime = datetime.datetime.today()
--
Gitblit v1.8.0