123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <?php
- /**
- * Game.php UTF-8
- * 游戏信息
- *
- * @date : 2018/1/19 15:21
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : wuyonghong <wyh@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace huolib\queue\request;
- class Game extends Request {
- private $pkg_name = ''; /* 游戏包名 */
- private $app_ver = ''; /* 游戏版本 */
- private $h_ver = 0; /* 聚合SDK版本编号 */
- private $sdk_ver = ''; /* 客户端渠道SDK版本编号 */
- private $h_app_id = 0; /* 游戏ID */
- public function __construct($data = []) {
- if (!empty($data)) {
- $this->setData($data);
- }
- }
- /**
- * 设置数据
- *
- * @param array $data
- */
- public function setData($data = []) {
- if (empty($data)) {
- return;
- }
- $this->setPkgName(get_val($data, 'pkg_name', ''));
- $this->setAppVer(get_val($data, 'app_ver', ''));
- $this->setHVer(get_val($data, 'h_ver', 0));
- $this->setSdkVer(get_val($data, 'sdk_ver', ''));
- $this->setHAppId(get_val($data, 'h_app_id', 0));
- }
- /**
- * 变量转数组
- *
- * @return array
- */
- public function toArray() {
- $_data = [
- 'pkg_name' => $this->getPkgName(),
- 'app_ver' => $this->getAppVer(),
- 'h_ver' => $this->getHVer(),
- 'sdk_ver' => $this->getSdkVer(),
- 'app_id' => $this->getHAppId(),
- ];
- return $_data;
- }
- /**
- * 校验参数合法性
- */
- public function check() {
- // TODO: wuyonghong 2018/5/30 校验游戏参数合法性
- return true;
- }
- /**
- * @return string
- */
- public function getPkgName() {
- return $this->pkg_name;
- }
- /**
- * @param string $pkg_name
- */
- public function setPkgName($pkg_name) {
- $this->pkg_name = $pkg_name;
- }
- /**
- * @return string
- */
- public function getAppVer() {
- return $this->app_ver;
- }
- /**
- * @param string $app_ver
- */
- public function setAppVer($app_ver) {
- $this->app_ver = $app_ver;
- }
- /**
- * @return int
- */
- public function getHVer() {
- return $this->h_ver;
- }
- /**
- * @param int $h_ver
- */
- public function setHVer($h_ver) {
- $this->h_ver = $h_ver;
- }
- /**
- * @return string
- */
- public function getSdkVer() {
- return $this->sdk_ver;
- }
- /**
- * @param string $sdk_ver
- */
- public function setSdkVer($sdk_ver) {
- $this->sdk_ver = $sdk_ver;
- }
- /**
- * @return int
- */
- public function getHAppId() {
- return $this->h_app_id;
- }
- /**
- * @param int $h_app_id
- */
- public function setHAppId($h_app_id) {
- $this->h_app_id = $h_app_id;
- }
- }
|