From 278fa30bb771deab0cc22c3390c2581c004de178 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 21 五月 2025 14:38:45 +0800
Subject: [PATCH] 15 卡牌服务端搭建 1. 增加地图关闭接口 CloseMap,必须调用处理保存后,地图才能关闭 2. 玩家登录流程在PlayerLogin统一处理,不再需要等待客户端回报

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py
index 293d8de..9ef6384 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py
@@ -20,6 +20,7 @@
 import GameWorld
 import ShareDefine
 import PlayerControl
+import PyMongoMain
 import DBDataMgr
 import ChConfig
 import DBComm
@@ -430,9 +431,14 @@
         self.__familyList.sort(key=lambda f: (f.GetFightPowerTotal(), f.GetLV()), reverse=True)
         return
     
-    def AddFamily(self, familyID, familyName, serverID):
+    def AddFamily(self, familyName, serverID, familyID=None):
         ## 创建新仙盟
         newFamily = None
+        if familyID == None:
+            familyID = PyMongoMain.GetUserCtrlDB().GetNewFamilyID()
+            if familyID <= 0:
+                GameWorld.ErrLog("创建仙盟时生成新ID异常!")
+                return newFamily
         if familyID in self.__familyIDDict:
             GameWorld.ErrLog("创建仙盟时ID已存在! familyID=%s" % familyID)
             return newFamily
@@ -478,6 +484,8 @@
                 self.__familyList.remove(family)
             family.OnDelete()
         self.__familyIDDict.pop(familyID, None)
+        if familyID > ShareDefine.FackFamilyIDMax:
+            PyMongoMain.GetUserCtrlDB().FreeFamilyID(familyID) # 归还仙盟ID,重复使用
         return family
     
     def DelAllFamily(self):
@@ -628,9 +636,10 @@
             action = self.__actionMgr.GetFamilyAction(familyID, actionType)
             action.InitActionInstance(dbData)
             
+        PyMongoMain.GetUserCtrlDB().OnFamilyIDInit(self.__familyIDDict.keys())
         return pos
     
-def OnMinute(curMinute):
+def OnMinute():
     
     familyMgr = DBDataMgr.GetFamilyMgr()
     # 每分钟刷新下仙盟战力排序

--
Gitblit v1.8.0