<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace loyalsoft;

/**
 * Description of StatisticsProc
 *
 * @author cyzhao
 */
class StatisticsProc {
    
    /**
     * 玩家自己任务完成统计
     * @param type $id
     */
    static function SelfTaskDataCollect($taskId) {           
        $task = $taskId."-".time();
        
        $arr = array();
        $arr[] = $task;
        
        $num = gMem()->rpush("SelfTaskDataCollect-".req()->uid."-". req()->zoneid, $arr);    
    }
    
    /**
     * 统计当前服下uid的最新的任务id
     * @param type $taskId
     */
    static function TaskDataCollect($taskId) {
        $taskMo = GameConfig::item_taskcard_getItem($taskId);
        if($taskMo->type != 1){
            return;
        }
        
        $key = "TaskDataCollect-".req()->zoneid;           
        gMem()->hset($key, req()->uid, $taskId);                 
    }
    
    /*
     * 统计玩家最新解锁建筑
     */
    static function unlockBuild($buildId) {  
        $key = "unlockBuild-".req()->zoneid;           
        gMem()->hset($key, req()->uid, $buildId);                 
    }
    
    /**
     * 统计玩家最新解锁关卡
     * @param type $gateId
     */
    static function unlockGate($gateId) {  
        $key = "unlockGate-".req()->zoneid;           
        gMem()->hset($key, req()->uid, $gateId);                 
    }
    
    
    
}
