| | |
| | | import PlayerControl
|
| | | import FamilyRobBoss
|
| | | import NPCCustomRefresh
|
| | | import EventShell
|
| | | import FBLogic
|
| | | import FBCommon
|
| | | import EventReport
|
| | |
| | | GameWorld.Log("发送未拾取的物品给玩家: %s" % mailItemList, ownerID)
|
| | | if isCrossServer:
|
| | | serverGroupID = playerServerGroupIDDict.get(ownerID, 0)
|
| | | PlayerControl.SendCrossMail(serverGroupID, "ItemNoPickUp", [ownerID], mailItemList, [gameWorld.GetMapID()])
|
| | | # 删除旧版发送邮件,如果功能还有需要,可使用新版本发送邮件 PlayerMail
|
| | | else:
|
| | | PlayerControl.SendMailByKey("ItemNoPickUp", [ownerID], mailItemList, [gameWorld.GetMapID()])
|
| | |
|
| | |
| | | if playerExistTime < existTime / 2:
|
| | | #这个玩家存在时间过短, 不能触发副本结束的事件
|
| | | continue
|
| | |
|
| | | #副本时间到了, 调用时间到响应
|
| | | EventShell.EventResponse_OnFBTimeOut(curPlayer)
|
| | | |
| | | |
| | | #输出调试信息
|
| | | GameWorld.Log('__ProcessTimeKickPlayer! LineID = %s, openState = %s'%(gameWorld.GetLineID(), gameWorld.GetOpenState()))
|
| | |
|
| | |
| | | def InitGameWorld(tick):
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | ItemCommon.InitPyItem()
|
| | | EventShell.DoReloadRefresh()
|
| | | #处理副本逻辑
|
| | | FBLogic.OnInit(tick)
|
| | | #初始化地图时钟
|
| | |
| | | gameWorld.BalanceServer_MapServerInitOK()
|
| | | return
|
| | |
|
| | | ## 初始化共享表(原c++表)
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | def ReadShareData(tick):
|
| | | from PyMongoDB import PyMongoMain
|
| | | PyMongoMain.GetUserCtrlDB().OnGetGameData()
|
| | | return
|
| | |
|
| | |
|
| | | def GameServer_CommMapServerInitOK(gameWorld):
|
| | | '''
|
| | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | |
|
| | | ## 初始化共享表(原c++表)
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | def ReadShareData(tick):
|
| | | #读取静态表,与数据库无关 不要调用UserCtrlDB
|
| | | from PyMongoDB.Collections import DataServerGameData
|
| | | from PyMongoDB.DBCommon import (GlobalFunctions, CommonDefine, error)
|
| | | from PyMongoDB.Common import (CommFunc, )
|
| | | import NetPackCommon
|
| | | import os
|
| | | import zlib
|
| | | sysData = DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagChinNPC,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagChinNPC.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagNPCRefresh,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagNPCRefresh.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagChinSkill,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagChinSkill.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagChinExp,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagChinExp.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagChinItem,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagChinItem.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagTransportRefresh,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagTransportRefresh.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagChinShopItem,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagChinShopItem.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagBornRefresh,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagBornRefresh.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagChinMixItem,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagChinMixItem.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagBuildEquip,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagBuildEquip.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagSuiteActivation,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagSuiteActivation.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagSuiteEffect,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagSuiteEffect.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagRepeatEvent,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagRepeatEvent.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagEffectRefresh,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagEffectRefresh.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagChinMap,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagChinMap.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagDBStoreItem,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagDBStoreItem.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagOnMissionDelete,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagOnMissionDelete.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagPet,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagPet.txt')) |
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagPetGrade,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagPetGrade.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagPetFriendliness,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagPetFriendliness.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagPetExp,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagPetExp.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagNPC_Item_Pet,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagNPC_Item_Pet.txt'))
|
| | | sysData += DataServerGameData.sysDBLoadFromFile(DataServerGameData.tagFlyObjBaseInfo,
|
| | | os.path.join(GlobalFunctions.getServerConfigPath(),
|
| | | CommonDefine.SYSDB_PATH,
|
| | | 'tagFlyObjBaseInfo.txt'))
|
| | |
|
| | |
|
| | | #压缩
|
| | | try:
|
| | | compressSysData = zlib.compress(sysData, 9) #最大压缩
|
| | | |
| | | #回发地图
|
| | | data = ''
|
| | | data = CommFunc.WriteBYTE(data, CommonDefine.dgGameData) #1
|
| | | data = CommFunc.WriteString(data, len(compressSysData), compressSysData)
|
| | | |
| | | GameWorld.Log('Load game sys data for len = %s - %s ok!'%(len(compressSysData), len(data)))
|
| | | NetPackCommon.SendPyPackToMapServerSelf(data, len(data))
|
| | | except:
|
| | | msg = error.formatMsg('fatal', error.ERROR_NO_53, 'Compress game sys data failed!error = \n%s'%traceback.format_exc())
|
| | | GameWorld.ErrLog(msg)
|
| | | return |