| | |
| | |
|
| | | import DBDataMgr
|
| | | import GameWorld
|
| | | import PyMongoMain
|
| | | import PlayerFamily
|
| | | import IpyGameDataPY
|
| | | import IPY_GameWorld
|
| | | import PlayerEventCounter
|
| | | import PlayerViewCache
|
| | | import PlayerControl
|
| | | import NetPackCommon
|
| | | import PlayerOnline
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import ItemCommon
|
| | | import BattleObj
|
| | | import ChPlayer
|
| | | import ObjPool
|
| | |
| | | #调用该函数时,C++已经设置好区服,如果改变区服需重启
|
| | | def StartDB(tick):
|
| | | #初始化数据库, 恢复备档(按区服记录), 加载静态表
|
| | | from PyMongoDB import PyMongoMain
|
| | | #from PyMongoDB import PyMongoMain
|
| | | PyMongoMain.StartDB()
|
| | | InitGameWorld(tick)
|
| | | return
|
| | |
| | | serverID = GameWorld.GetGameWorld().GetServerID()
|
| | | GameWorld.Log("服务器启动初始化InitGameWorld: serverID=%s" % serverID)
|
| | | DBDataMgr.OnServerStart() # 优先加载公共数据
|
| | | ItemCommon.InitPyItem()
|
| | | LoadDBPlayer()
|
| | | PlayerViewCache.LoadRobot()
|
| | | PyGameData.g_initGameTime = int(time.time()) # 放到加载数据之后
|
| | |
|
| | | #初始话开服时间、星期几
|
| | |
| | | CheckCloseMapOK()
|
| | | return
|
| | |
|
| | | PyMongoMain.GetUserCtrlDB().onSecondProcess()
|
| | | |
| | | OnMinute(tick)
|
| | |
|
| | | # 其他逻辑
|