| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 | <?php/** * Mem.php UTF-8 * 玩家事件处理 * * @date    : 2018/5/30 16:46 * * @license 这不是一个自由软件,未经授权不许任何使用和传播。 * @author  : wuyonghong <wyh@huosdk.com> * @version : HUOSDK 8.0 */namespace huo\controller\queue;use huo\controller\request\Channel;use huo\controller\request\Device;use huo\controller\request\Game;use huo\controller\request\Mem as MemRq;use huolib\queue\constant\EventConst;class Mem extends SdkQueue {    /**     * 玩家创建     * 记录玩家创建账户的日志,在该账户首次生成时调用。     * http://doc.1tsdk.com/138?page_id=3379     *     * @param Device  $device_rq     * @param Game    $game_rq     * @param Channel $agent_rq     * @param MemRq   $mem_rq     *     * @return array     */    public function create(Device $device_rq, Game $game_rq, Channel $agent_rq, MemRq $mem_rq) {        $this->param['event'] = EventConst::EVENT_MEM_REG;        $this->setParamDevice($device_rq);        $this->setParamGame($game_rq);        $this->setParamChannel($agent_rq);        $this->setParamMem($mem_rq);        $this->param['ts'] = $mem_rq->getRegTime();        return $this->pushQueue();    }    /**     * 玩家登陆     * 记录玩家账号登录的日志,输入账户和密码后,进入到“选择服务器”界面即可调用。     * http://doc.1tsdk.com/138?page_id=3380     *     * @param Device  $device_rq     * @param Game    $game_rq     * @param Channel $agent_rq     * @param MemRq   $mem_rq     *     * @return array     */    public function online(Device $device_rq, Game $game_rq, Channel $agent_rq, MemRq $mem_rq) {        $this->param['event'] = EventConst::EVENT_MEM_LOGIN;        $this->setParamDevice($device_rq);        $this->setParamGame($game_rq);        $this->setParamChannel($agent_rq);        $this->setParamMem($mem_rq);        $this->param['ts'] = $mem_rq->getLoginTime();        return $this->pushQueue();    }    /**     * 玩家登出     * 记录玩家登出游戏的日志,执行“切换账户”、“退出游戏”操作时调用。     * http://doc.1tsdk.com/138?page_id=3382     *print_r($_rs);     * @param Device  $device_rq     * @param Game    $game_rq     * @param Channel $agent_rq     * @param MemRq   $mem_rq     *     * @return array     */    public function offline(Device $device_rq, Game $game_rq, Channel $agent_rq, MemRq $mem_rq) {        $this->param['event'] = EventConst::EVENT_MEM_LOGOUT;        $this->setParamDevice($device_rq);        $this->setParamGame($game_rq);        $this->setParamChannel($agent_rq);        $this->setParamMem($mem_rq);        return $this->pushQueue();    }}
 |