* @version : HUOSDK 8.0 */ namespace huo\controller\app; use huo\controller\common\Base; use huo\controller\request\Channel; use huo\controller\request\Crash; use huo\controller\request\Device; use huo\controller\request\Event; use huo\controller\request\Game as GameRq; use huo\controller\request\Mem; use huo\model\log\CrashLogModel; use huo\model\log\EventLogModel; use huo\model\log\OnlineLogModel; class App extends Base { /** * 事件上报记录 * * @param Event $event * @param GameRq $game_rq * @param Channel $channel * @param Device $device * * @return bool|mixed */ public function insertLog(Event $event, GameRq $game_rq, Channel $channel, Device $device) { $_data['agent_id'] = $channel->getAgentId(); $_data['agent_game'] = $channel->getAgentGame(); $_data['app_id'] = $game_rq->getHAppId(); $_data['device_id'] = $device->getDeviceId(); $_data['mac'] = $device->getMac(); $_data['ip'] = $device->getIp(); $_data['brand'] = $device->getBrand(); $_data['model'] = $device->getModel(); $_data['os'] = $device->getOs(); $_data['os_version'] = $device->getOsVersion(); $_data['screen'] = $device->getScreen(); $_data['net'] = $device->getNet(); $_data['imsi'] = $device->getImsi(); $_data['longitude'] = $device->getLongitude(); $_data['latitude'] = $device->getLatitude(); $_data['userua'] = $device->getUserua(); $_data['from'] = $device->getFrom(); $_data['open_cnt'] = $device->getOpenCnt(); $_data['event'] = $event->getEvent(); $_data['status'] = $event->getStatus(); $_data['context'] = $event->getContext(); $_event_model = new EventLogModel(); return $_event_model->insertLog($_data); } /** * 插入奔溃记录 * * @param Crash $crash * @param GameRq $game_rq * @param Channel $channel * @param Device $device * * @return bool|mixed */ public function insertCrashLog(Crash $crash, GameRq $game_rq, Channel $channel, Device $device) { $_data['agent_id'] = $channel->getAgentId(); $_data['agent_game'] = $channel->getAgentGame(); $_data['app_id'] = $game_rq->getHAppId(); $_data['device_id'] = $device->getDeviceId(); $_data['mac'] = $device->getMac(); $_data['ip'] = $device->getIp(); $_data['brand'] = $device->getBrand(); $_data['model'] = $device->getModel(); $_data['os'] = $device->getOs(); $_data['os_version'] = $device->getOsVersion(); $_data['screen'] = $device->getScreen(); $_data['net'] = $device->getNet(); $_data['imsi'] = $device->getImsi(); $_data['longitude'] = $device->getLongitude(); $_data['latitude'] = $device->getLatitude(); $_data['userua'] = $device->getUserua(); $_data['from'] = $device->getFrom(); $_data['open_cnt'] = $device->getOpenCnt(); $_data['active'] = $crash->getActive(); $_data['msg'] = $crash->getMsg(); $_crash_model = new CrashLogModel(); return $_crash_model->insertLog($_data); } public function insertHeartLog(GameRq $game_rq, Channel $channel, Device $device, Mem $member) { $_data['mem_id'] = $member->getMemId(); $_data['agent_id'] = $channel->getAgentId(); $_data['agent_game'] = $channel->getAgentGame(); $_data['app_id'] = $game_rq->getHAppId(); $_data['device_id'] = $device->getDeviceId(); $_data['mac'] = $device->getMac(); $_data['ip'] = $device->getIp(); $_data['brand'] = $device->getBrand(); $_data['model'] = $device->getModel(); $_data['os'] = $device->getOs(); $_data['os_version'] = $device->getOsVersion(); $_data['screen'] = $device->getScreen(); $_data['net'] = $device->getNet(); $_data['imsi'] = $device->getImsi(); $_data['longitude'] = $device->getLongitude(); $_data['latitude'] = $device->getLatitude(); $_data['userua'] = $device->getUserua(); $_data['from'] = $device->getFrom(); $_data['open_cnt'] = $device->getOpenCnt(); $_heart_model = new OnlineLogModel(); return $_heart_model->insertLog($_data); } }