* @version : HUOSDK 8.0 */ namespace huo\controller\queue; use huo\controller\request\Channel; use huo\controller\request\Crash; use huo\controller\request\Device; use huo\controller\request\Game; use huolib\queue\constant\EventConst; class App extends SdkQueue { /** * app激活 * 记录客户端被激活日志,用户下载APP后第一次打开客户端时调用。 * http://doc.1tsdk.com/138?page_id=3375 * * @param Device $device_rq * @param Game $game_rq * @param Channel $agent_rq * * @return array */ public function activation(Device $device_rq, Game $game_rq, Channel $agent_rq) { $this->param['event'] = EventConst::EVENT_APP_ACTIVATION; $this->setParamDevice($device_rq); $this->setParamGame($game_rq); $this->setParamChannel($agent_rq); return $this->pushQueue(); } /** * app启动 * 记录客户端被启动日志,用户激活客户端后,每次跳转到SDK登录界面时调用。 * * http://doc.1tsdk.com/138?page_id=3376 * @param Device $device_rq * @param Game $game_rq * @param Channel $agent_rq * * @return array */ public function startup(Device $device_rq, Game $game_rq, Channel $agent_rq) { $this->param['event'] = EventConst::EVENT_APP_STARTUP; $this->setParamDevice($device_rq); $this->setParamGame($game_rq); $this->setParamChannel($agent_rq); return $this->pushQueue(); } /** * app崩溃 * 记录客户端异常的日志,用户激活无法跳转到SDK登录界面、闪退等异常情况时调用。 * http://doc.1tsdk.com/138?page_id=3377 * * @param Device $device_rq * @param Game $game_rq * @param Channel $agent_rq * @param Crash $crash_rq * * @return array */ public function crash(Device $device_rq, Game $game_rq, Channel $agent_rq, Crash $crash_rq) { $this->param['event'] = EventConst::EVENT_APP_CRASH; $this->setParamDevice($device_rq); $this->setParamGame($game_rq); $this->setParamChannel($agent_rq); $this->param['crash'] = [ 'active' => $crash_rq->getActive(), 'msg' => $crash_rq->getMsg(), ]; return $this->pushQueue(); } /** * app心跳 * 客户端每2分钟上报一次客户端活跃状态的事件 * http://doc.1tsdk.com/138?page_id=3378 * * @param Device $device_rq * @param Game $game_rq * @param Channel $agent_rq * * @return array */ public function heartbeat(Device $device_rq, Game $game_rq, Channel $agent_rq) { $this->param['event'] = EventConst::EVENT_APP_HEARTBEAT; $this->setParamDevice($device_rq); $this->setParamGame($game_rq); $this->setParamChannel($agent_rq); return $this->pushQueue(); } }