From d5e9bbcf96cf98d767ba073774b1ee287569659d Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 24 十一月 2018 18:20:13 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/SnxxServerCode
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py | 42 ++++++++++++++++++++++++++----------------
1 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py
index 4eaa6fd..8a9cca4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py
@@ -65,25 +65,37 @@
resultLineID = -1 # 结果lineID
gameWorldManager = GameWorld.GetGameWorld()
- maxPlayerCount = FBLogic.GetFBLineMaxPlayerCount(tagMapID)
+ maxPlayerCount = FBLogic.GetFBLineMaxPlayerCount(tagMapID, tagMapLineID)
- GameWorld.Log(" DoLogic() tagMapID=%s,maxPlayerCount=%s" % (tagMapID, maxPlayerCount))
- for index in range(gameWorldManager.GetGameWorldCount()):
+ GameWorld.Log(" DoLogic() tagMapID=%s,tagMapLineID=%s,maxPlayerCount=%s" % (tagMapID, tagMapLineID,maxPlayerCount))
+ firstEmptyGameWorld = None
+ sameLineGameWorldList = []
+ for index in xrange(gameWorldManager.GetGameWorldCount()):
gameWorld = IPY_GameWorld.IPY_GameWorld(index)
playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index)
propertyID = gameWorld.GetPropertyID()
- GameWorld.Log(" DoLogic() check gameworld index=%s,propertyID=%s,playerCount=%s" \
- % (index, propertyID, playerManager.GetPlayerCount()))
+ curPlayerCnt = playerManager.GetPlayerCount()
+# GameWorld.Log(" DoLogic() check gameworld index=%s,propertyID=%s,playerCount=%s" \
+# % (index, propertyID, curPlayerCnt))
+ if propertyID == 0 and not firstEmptyGameWorld:
+ firstEmptyGameWorld = gameWorld
# 如果不是同一线路属性的,则跳过
# 如果当前人数超过额定人数,则跳过
- if propertyID == 0 or (propertyID == tagMapPropertyID \
- and playerManager.GetPlayerCount() < maxPlayerCount):
- gameWorld.SetPropertyID(tagMapPropertyID)
- if propertyID == 0:
- gameWorld.SetFBFirstOpen(1) # 开启副本
- resultLineID = gameWorld.GetLineID()
- GameWorld.Log(" DoLogic() check ok!resultLineID=%s" % (resultLineID))
- break
+ if propertyID == tagMapPropertyID and curPlayerCnt < maxPlayerCount:
+ sameLineGameWorldList.append([gameWorld, curPlayerCnt])
+ findGameWorld = None
+ if sameLineGameWorldList:
+ sameLineGameWorldList.sort(key=lambda asd:asd[1])
+ findGameWorld = sameLineGameWorldList[0][0]
+ elif firstEmptyGameWorld:
+ findGameWorld = firstEmptyGameWorld
+ if findGameWorld:
+ if findGameWorld.GetPropertyID() == 0:
+ findGameWorld.SetFBFirstOpen(1) # 开启副本
+ findGameWorld.SetPropertyID(tagMapPropertyID)
+ resultLineID = findGameWorld.GetLineID()
+ GameWorld.Log(" DoLogic() check ok!resultLineID=%s" % (resultLineID))
+
#===================================================================================================
# # 战盟家园
@@ -137,9 +149,7 @@
resultLineID = -1 # 结果lineID
gameWorldManager = GameWorld.GetGameWorld()
- maxPlayerCount = FBLogic.GetFBLineMaxPlayerCount(tagMapID)
-
- GameWorld.Log(" DoLogic() tagMapID=%s,maxPlayerCount=%s" % (tagMapID, maxPlayerCount))
+ GameWorld.Log(" DoLogic() tagMapID=%s,tagMapLineID=%s" % (tagMapID, tagMapLineID))
findGameWord = None
for index in range(gameWorldManager.GetGameWorldCount()):
gameWorld = IPY_GameWorld.IPY_GameWorld(index)
--
Gitblit v1.8.0