Ejemplo n.º 1
0
def getSearchTeamDetail(playerId):
    searchInfo = getSearchTeamById(playerId)
    returnVal = {}
    if searchInfo:

        searchTypeId = searchInfo["type"]
        areaId = searchInfo["area"]
        searchStartTime = searchInfo["last_start_time"]
        blueBox = searchInfo["blue_box"]
        number = searchInfo["number"]

        needTime = SEARCH_TYPE[searchTypeId]["time"] * 3600
        time_now = int(time.time())

        returnVal["index"] = searchTypeId
        returnVal["areaID"] = areaId
        returnVal["startTime"] = searchStartTime
        returnVal["blue_box"] = blueBox
        returnVal["number"] = number

        if searchInfo["friends"]:
            returnVal["friends"] = db_tool.__auctionStringToDict(searchInfo["friends"])
        else:
            returnVal["friends"] = {}

        if (searchStartTime + needTime) <= time_now:
            if blueBox == 0:
                blueBox = 1
                updateInfo = {}
                updateInfo["blue_box"] = blueBox
                updateSearchTeamInfo(playerId, updateInfo)

                returnVal["blue_box"] = blueBox

    return returnVal
Ejemplo n.º 2
0
def getGiftEventLog(db,conn,playerId):
    db.execute("SELECT * FROM gift_event_log WHERE player_id = %s order by create_time desc limit 30",(playerId,))
    info = []
    
    try:
        logs = db.fetchall()
    except:
        return info
    
    for log in logs:
        temp = db_tool.__auctionStringToDict(log['info'])
        temp['time'] = log['create_time']
        temp['status'] = log['status']
        info.append(temp)
    
    return info
Ejemplo n.º 3
0
def getExploreEventLog(db,conn,leaderId):
    db.execute("SELECT * FROM explore_event_log WHERE leader_id = %s order by create_time desc limit 30",(leaderId,))
    eventInfo = []
    try:
        logs = db.fetchall()
    except:
        return eventInfo
    for log in logs:
        info = db_tool.__auctionStringToDict(log['info'])
        temp = {}
        temp['time'] = log['create_time']
        temp['type'] = log['type']
        temp['info'] = info
        temp['status'] = log['status']
        eventInfo.append(temp)
    
    return eventInfo