예제 #1
0
파일: main.py 프로젝트: flycare/kaka_world
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
예제 #2
0
def init(serverInfo,is_fan):
    playerId = serverInfo['playerId']
    sig = serverInfo['sig']
    session_key = serverInfo['session_key']
    sns_id = serverInfo['sns_id']

    #add daily reward
    dailyReward = daily_reward.getDailyReward(playerId,is_fan);
    
    #get player info
    player = db_tool.__getPlayerById(playerId)
    if not player:
        db_tool.__insertNewPlayer(sns_id)
        player = db_tool.__getPlayer(sns_id)
    
    time_now = int(time.time())

    db_tool.__updateEnergy(player)
    #snsObj = getSnsObj(sig,session_key,sns_id)
    #snsInfo = snsObj.getUserInfo()
    #player['name']=snsInfo['name']
    #player['tinyurl']=snsInfo['tinyurl']
    
    returnVal = {'status':1}
    
    returnVal['player'] = player
    #friends = db_tool.__getFriends(snsObj)
    #returnVal['friends'] = friends
    returnVal['map'] = db_tool.getMapsbyPlayerId(playerId)
    returnVal['searcher'] = search_team.getSearchTeamInfo(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['daily_task']=daily_task.getTaskInfo(playerId)
    returnVal['level_task']=level_task.getLevelTaskInfo(playerId)
    returnVal['produce']=produce.getProduceList(playerId)
    returnVal['invite_info']=invite.getInviteInfo(sns_id)
    returnVal['system_reward']=system_reward.getSystemRewardInfo(playerId)
    returnVal['alchemy']=alchemy.getAlchemyInfo(playerId)
    return returnVal