10196 【越南】【香港】【主干】【砍树】增加地图数量开启警告
| | |
| | | import CrossChampionship
|
| | | import GameWorldMineArea
|
| | | import GameWorship
|
| | | import os
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | if not GameWorld.GetGameWorld().GetDictByKey(ChConfig.Def_WorldKey_IsGameWorldInit):
|
| | | GameWorld.Log("AllMapServerInitOK时GameServer还未启动好!")
|
| | | return
|
| | | __CheckAllMapInitOK()
|
| | | #通知所有地图服务器初始化成功, 同步时间
|
| | | GameWorld.GetGameWorld().Notify_AllMapServerInitOK(GameWorld.GetCurrentDataTimeStr())
|
| | |
|
| | |
| | | GameWorld.GetGameWorld().EventReport_EventReport("", "", "", "", 0, getUrl)
|
| | | return
|
| | |
|
| | | def __CheckAllMapInitOK():
|
| | | ## 检查所有地图是否启动成功
|
| | | rootPath = ChConfig.GetServerRootPath()
|
| | | mapIDTxtPath = os.path.join(rootPath, "ZoneServerGroup\map1_8G\MapServer\MapServerData\Map\MapID.txt")
|
| | | if not os.path.isfile(mapIDTxtPath):
|
| | | GameWorld.ErrLog("MapID.txt不存在: %s" % mapIDTxtPath)
|
| | | return
|
| | | fileObj = open(mapIDTxtPath, 'rb')
|
| | | content = fileObj.read()
|
| | | fileObj.close()
|
| | | |
| | | mapInfoDict = {}
|
| | | mapInfoList = content.split('\r\n')
|
| | | for info in mapInfoList:
|
| | | mapInfo = info.split('\t')
|
| | | if len(mapInfo) < 3:
|
| | | continue
|
| | | mapInfoDict[GameWorld.ToIntDef(mapInfo[1])] = mapInfo[2]
|
| | | |
| | | gameMapManager = GameWorld.GetGameWorld().GetGameMapManager()
|
| | | for i in range(0, gameMapManager.GetCount()):
|
| | | curMap = gameMapManager.GetAt(i)
|
| | | mapID = curMap.GetID()
|
| | | state = curMap.GetState()
|
| | | if mapID in mapInfoDict and state == IPY_GameServer.mssRunning:
|
| | | mapInfoDict.pop(mapID)
|
| | | |
| | | if not mapInfoDict:
|
| | | #GameWorld.Log("都启动成功了")
|
| | | return
|
| | | # 汇报没有启动启动成功的地图ID信息
|
| | | errorMapIDList = mapInfoDict.keys()
|
| | | GameWorld.SendGameError("AllMapInitError", "未启动成功地图:%s" % (str(errorMapIDList)))
|
| | | return
|
| | |
|
| | | ## 服务器合服首次启动数据加载处理
|
| | | # @param None
|
| | | # @return None
|
| | |
| | |
|
| | | serverInfo = dbname.split('GameUser_')[1]
|
| | |
|
| | | message = MIMEText('%s' % mailText, 'plain', 'gbk')
|
| | | message['From'] = Header("%s %s" % (serverInfo, subject), 'gbk')
|
| | | message['To'] = Header("运维", 'gbk') # 不发送的话会被记录为垃圾邮件
|
| | | message['Subject'] = Header(subject, 'gbk')
|
| | | if SMTPServer == "qq":
|
| | | message = MIMEText('%s' % mailText, 'plain', 'gbk')
|
| | | message['From'] = mail_user
|
| | | message['To'] = Header("运维", 'gbk') # 不发送的话会被记录为垃圾邮件
|
| | | message['Subject'] = Header("%s%s" % (serverInfo, subject), 'gbk')
|
| | | else:
|
| | | message = MIMEText('%s' % mailText, 'plain', 'gbk')
|
| | | message['From'] = Header("%s %s" % (serverInfo, subject), 'gbk')
|
| | | message['To'] = Header("运维", 'gbk') # 不发送的话会被记录为垃圾邮件
|
| | | message['Subject'] = Header(subject, 'gbk')
|
| | |
|
| | | if SSL == 1:
|
| | | smtpObj = smtplib.SMTP_SSL(mail_host)
|