Ejemplo n.º 1
0
def init(serverInfo,is_fan):
    playerId = serverInfo['playerId']
    sns_id = serverInfo['sns_id']

    #add weekly reward
    daily_reward.getWeeklyReward(playerId)
    #add daily reward (notice: update last_login_time)
    dailyReward = daily_reward.getDailyReward(playerId,is_fan);
    #add festival reward
    festivalDailyReward = daily_reward.getFestivalDailyReward(playerId)
    
    #get player info
    player = db_tool.__getPlayerById(playerId)
    if not player:
        return {'status':0,'msg':'player not exist'}
    
    time_now = int(time.time())

    player_module.__updateEnergy(player)
    
    returnVal = {'status':1}
    returnVal['player'] = player
    #returnVal['map'] = db_tool.getMapsbyPlayerId(playerId)
    returnVal['map_level'] = item.getHabitatInfo(playerId)
    returnVal['searcher'] = search_team.getSearchTeamDetail(playerId)
    returnVal['bag'] = db_tool.getAllProp(playerId)
    returnVal['bagMax'] = prop.getBagCapacity(playerId)
    returnVal['collection'] = collection.getCollection(playerId)
    returnVal['time_now']=time_now
    returnVal['box_status']=user_box.getUserBoxStatus(sns_id)
    returnVal['daily_reward']=dailyReward
    returnVal['festival_daily_reward']=festivalDailyReward
    returnVal['daily_task']=daily_task.getTaskInfo(playerId)
    returnVal['level_task']=level_task.getLevelTaskInfo(playerId)
    returnVal['produce']=produce.getProduceInfo(playerId)
    returnVal['invite_info']=invite.getInviteInfo(sns_id)
    returnVal['system_reward']=system_reward.getSystemRewardInfo(playerId)
    returnVal['auctionStatus'] = player_module.getAuctionStatus(playerId)
    returnVal['alchemy']=alchemy.getAlchemyInfo(playerId)
    returnVal['event_num']=interaction_event.getEventCount(playerId)
    returnVal['exchange_task']=exchange_task.getExchangeTaskInfo(playerId)
    returnVal['explore_start']=explore_team.isExploreStart(playerId)
    returnVal['life_tree'] = life_tree.getLifeTreeInfo(playerId)
    returnVal['interval_box'] = interval_box.getIntervalBoxInfo(playerId)
    
    return returnVal
Ejemplo n.º 2
0
def getUserInfo(id):
    player = db_tool.__getPlayerById(id)
    if player:
        returnVal = {}
        returnVal['status'] = 1
        returnVal['player'] = player
        #returnVal['map'] = db_tool.getMapsbyPlayerId(id)
        returnVal['map_level'] = item_module.getHabitatInfo(id)
        #添加拍卖行状态(是否有拍卖或求购信息)
        returnVal['auctionStatus'] = getAuctionStatus(id)
        #添加炼化信息
        returnVal['alchemyInfo'] = alchemy_module.getAlchemyInfo(id)
        #添加生产信息
        returnVal['produce'] = produce_module.getProduceInfo(id)
        #添加搜索信息
        returnVal['searcher'] = search_module.getSearchTeamDetail(id)
        #是否已经组队
        returnVal['explore_start']=explore_team.isExploreStart(id)
        #生命树
        returnVal['life_tree'] = life_tree.getLifeTreeInfo(id)
        
        return returnVal
    else:
        return {'status':0,'error_type':13,'msg':'can not find the friend by id :'+str(id)}