| | |
| | | import time
|
| | | import random
|
| | | import copy
|
| | | import urllib
|
| | | #import psyco
|
| | | #---------------------------------------------------------------------
|
| | | GameWorldData = IPY_GameServer.IPY_GameWorld()
|
| | |
| | |
|
| | | return defValue
|
| | |
|
| | | ## 从列表中产生物品,[[权重, object], ....]
|
| | | # @param weightList 待选列表
|
| | | def GetResultByWeightList(weightList):
|
| | | randList = []
|
| | | weight = 0
|
| | | for info in weightList:
|
| | | weight += info[0]
|
| | | randList.append([weight, info[1] if len(info) == 2 else info[1:]])
|
| | | if not randList:
|
| | | return
|
| | | rate = random.randint(1, randList[-1][0])
|
| | | return GetResultByRiseList(randList, rate)
|
| | |
|
| | | ## 根据字典key获取value值
|
| | | # @return
|
| | | def GetDictValueByKey(attrDict, findKey, defaultValue=None):
|
| | |
| | | getUrl = ReadChConfig.GetPyMongoConfig("EventReport", "OpenStateUrl")
|
| | | groupID = ReadChConfig.GetPyMongoConfig("platform", "GroupID")
|
| | | userDBName = ReadChConfig.GetPyMongoConfig("connect", "USER_DB_NAME")
|
| | | getUrl = getUrl + "?Type=GameWarning&groupID=%s&userDBName=%s&MsgInfo=%s"%(groupID, userDBName, msgInfo)
|
| | | getUrl = getUrl + "?Type=GameWarning&groupID=%s&userDBName=%s&MsgInfo=%s"%(groupID, userDBName, urllib.quote_plus(msgInfo))
|
| | |
|
| | | GetGameWorld().EventReport_EventReport("", "", "", "", 0, getUrl)
|
| | | |