Browse Source

代码整理

王刚 3 years ago
parent
commit
2a8d600522

+ 21 - 0
Gameserver/Amfphp/base/Req.php

@@ -102,6 +102,27 @@ class Req extends Object_ext {
         return $str;
     }
 
+    /**
+     * 获得用户的平台字符串
+     * @return string
+     */
+    function getPlatStr() {
+        switch (PLAT) {
+            case 'web':                                                         # web版
+                return 'qzone';                                                 # only QQ空间
+            case 'ios':                                                         # ios版
+                return 'ios';                                                   # only ios
+            case 'and':                                                         # 安卓版/默认
+            default :
+                return substr($this->uid, 0, strrpos($this->uid, '-'));         # 提取平台字符串
+            //PS. substr() 函数返回字符串的一部分 strrpos() 函数查找字符串在另一字符串中最后一次出现的位置。
+        }
+    }
+
+    /**
+     * 将要进行存储的数据
+     * @return UserInfoMo
+     */
     public function storage() {
         $clone = clone $this;
         if (!$clone->userInfoChanged) {

+ 0 - 17
Gameserver/Amfphp/model/User/UserInfoMo.php

@@ -15,21 +15,4 @@ class UserInfoMo {
      */
     public $game;
 
-    /**
-     * 获得用户的平台字符串
-     * @return string
-     */
-    function getPlatStr() {
-        switch (PLAT) {
-            case 'web':                                                         # web版
-                return 'qzone';                                                 # only QQ空间
-            case 'ios':                                                         # ios版
-                return 'ios';                                                   # only ios
-            case 'and':                                                         # 安卓版/默认
-            default :
-                return substr(req()->uid, 0, strrpos(req()->uid, '-'));         # 提取平台字符串
-            //substr() 函数返回字符串的一部分 strrpos() 函数查找字符串在另一字符串中最后一次出现的位置。
-        }
-    }
-
 }

+ 0 - 128
Gameserver/Amfphp/model/User/del_Info_MissInfo.php

@@ -1,128 +0,0 @@
-<?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.
- */
-
-/**
- * Description of UserMissEx
- * 
- * @author jgao
- */
-class Info_MissInfo {
-    //put your code here
-
-    /**
-     * 正在进行中的任务
-     * @var MisStatus 
-     */
-    public $ingMissions = null;
-    /// <summary>
-    /// 已经完成的任务
-    /// </summary>
-    public $overMissions = null;
-
-    /**
-     * 未完待续的任务
-     * @var type 
-     */
-    public $contMissions = null;
-
-    /**
-     * 构造函数 
-     */
-    function __construct() {
-        $this->ingMissions = new stdClass();
-        $this->overMissions = new stdClass();
-        $this->contMissions = new stdClass();
-    }
-
-    function initialize($value) {
-        CommUtil::loadObject($value, $this);
-        foreach ($this->ingMissions as $id => $val) { // 强类型化
-            $ing = new MisStatus();
-            $ing->initialize($val);
-            $this->ingMissions->$id = $ing;
-        }
-    }
-
-    /// <summary>
-    /// 设置任务数据
-    /// </summary>
-    /// <param name="id"></param>
-    /// <param name="mo"></param>
-    public function setMission($id, $ing) {
-        if ($id == 0)
-            return;
-        $this->ingMissions->$id = $ing;
-    }
-
-    /**
-     * 
-     * @param type $id
-     * @return MisStatus
-     */
-    public function GetMission($id) {
-        if (dict_exists($this->ingMissions, $id)) {
-            return $this->ingMissions->$id;
-        }
-        return null;
-    }
-
-    /// <summary>
-    /// 新增触发任务
-    /// </summary>
-    /// <param name="id"></param>
-    public function addMission($id) {
-        if ($id == 0) {
-            return null;
-        }
-        $mo = dataCenter()->getMissionConst($id);
-        $status = MisStatus::initFromMo($mo);
-        $this->setMission($id, $status);
-        return $status;
-    }
-
-    /// <summary>
-    /// 是否挂载某个任务
-    /// </summary>
-    /// <param name="id"></param>
-    /// <returns></returns>
-    public function hasMission($id) {
-        return dict_exists($this->ingMissions, $id);
-    }
-
-    /// <summary>
-    /// 删除某个任务
-    /// </summary>
-    /// <param name="id"></param>
-    public function delMission($id) {
-        if ($this->hasMission($id)) {
-            dict_remove($this->ingMissions, $id);
-        }
-    }
-
-    /// <summary>
-    /// 某任务是否曾经完成过
-    /// </summary>
-    /// <param name="id"></param>
-    /// <returns></returns>
-    public function onceFinished($id) {
-        return dict_exists($this->overMissions, $id);
-    }
-
-    /// <summary>
-    /// 完成某个任务
-    /// </summary>
-    /// <param name="id"></param>
-    /// <param name="suc"></param>
-    public function finishMission($id) {
-        if ($this->hasMission($id)) {
-            $this->delMission($id);
-            $this->overMissions->$id = "ok";
-        }
-    }
-
-}

+ 0 - 64
Gameserver/Amfphp/model/User/del_Ins_MisCardIns.php

@@ -1,64 +0,0 @@
-<?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.
- */
-
-/**
- * Description of MisCardIns
- * 任务卡实例
- * @author jgao
- */
-class MisCardIns {
-    //put your code here
-    
-    /**
-     * 实例id
-     * @var type 
-     */
-    public $id = 0;
-    
-    /**
-     * 模板id
-     * @var type 
-     */
-    public $tid = 0;
-    
-    /**
-     * 任务卡状态
-     * @var type 
-     */
-    public $state = 0;
-    
-    /**
-     * 当前时间戳
-     * @var type 
-     */
-    public $ts = 0;
-    
-    /**
-     * 任务卡状态
-     */
-    public function getState(){
-        if($this->state != MissionCardStateType::ing){
-            return $this->state;
-        }
-        $mo = dataCenter()->getMissionCardData($this->tid);
-        $misslist = strsplit_raw($mo->misslist);
-        $missInfo = usrInfo()->missInfo();
-        $bSign = true;
-        foreach ($misslist as $missId){
-            if(!$missInfo->onceFinished($missId)){
-                $bSign = false;
-                break;
-            }
-        }
-        if($bSign){
-            $this->state = MissionCardStateType::finish;
-        }
-        return $this->state;
-    }
-    
-}

+ 0 - 159
Gameserver/Amfphp/model/User/del_Ins_MisStatus.php

@@ -1,159 +0,0 @@
-<?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.
- */
-
-/**
- * Description of MisStatus
- * 任务状态信息
- * @author jgao
- */
-class MisStatus {
-
-    //put your code here
-    /// <summary>
-    /// id
-    /// </summary>
-    public $id = 0;
-    /// <summary>
-    /// 类型
-    /// </summary>
-    public $type = 0;
-    /// <summary>
-    /// 命令码
-    /// </summary>
-    public $cmd = 0;
-    /// <summary>
-    /// 参数集
-    /// </summary>
-    public $paras = array();
-    /// <summary>
-    /// 当前计数
-    /// </summary>
-    public $cur = 0;
-    /// <summary>
-    /// 最大计数
-    /// </summary>
-    public $max = 0;
-    /// <summary>
-    /// 触发任务
-    /// </summary>
-    public $next = 0;
-    /// <summary>
-    /// 最低等级
-    /// </summary>
-    public $minlv = 0;
-    
-    /**
-     * 所属任务卡
-     * @var type 
-     */
-    public $card = 0;
-    
-    /**
-     * 扩展数据
-     * @var type 
-     */
-    public $exdatas = array();
-
-    function initialize($value) {
-        CommUtil::loadObject($value, $this);
-    }
-
-    /// <summary>
-    /// 是否完成
-    /// </summary>
-    public function isFinish() {
-        return $this->cur >= $this->max;
-    }
-
-    /// <summary>
-    /// 由原始模型执行初始化
-    /// </summary>
-    /// <param name="mo"></param>
-    /// <returns></returns>
-    public static function initFromMo($mo) {
-        $mis = new MisStatus();
-        $mis->id = $mo->id;
-        $mis->type = $mo->type;
-        $mis->cmd = $mo->cmd;
-        $mis->paras = strsplit($mo->paras);
-        $mis->cur = self::calcStatusCur($mo);
-        $mis->max = $mo->num;
-        $mis->next = $mo->next;
-        $mis->minlv = $mo->minlv;
-
-        return $mis;
-    }
-
-    /**
-     * 是否状态型任务
-     * @param type $cmd
-     */
-    static function isStatusType($cmd) {
-        return
-                $cmd == MissEventCode::Evn_User_Levelup ||
-                $cmd == MissEventCode::SEvn_Habitat_Own ||
-                $cmd == MissEventCode::SEvn_Farm_Own ||
-                $cmd == MissEventCode::SEvn_Build_Own ||
-                $cmd == MissEventCode::SEvn_Pet ||
-                $cmd == MissEventCode::SEvn_Explore_GridOwn;
-    }
-
-    /**
-     * 自动对齐可能出现统计失误的状态型任务计数
-     */
-    function autoCalcStatusCur() {
-        if (self::isStatusType($this->cmd)) {
-            $mo = dataCenter()->getMissionConst($this->id);
-            if ($mo != null) {
-                $cur = self::calcStatusCur($mo);
-                if ($this->cur < $cur) {
-                    $this->cur = $cur;
-                }
-                if ($this->max > $mo->num) {
-                    $this->max = $mo->num;
-                }
-            }
-        }
-    }
-
-    static function calcStatusCur($mo) {
-        $paras = strsplit($mo->paras);
-        $para0 = "";
-        $para1 = "";
-        $para2 = "";
-
-        if (array_count($paras) >= 1) {
-            $para0 = $paras[0];
-        }
-
-        if (array_count($paras) >= 2) {
-            $para1 = $paras[1];
-        }
-
-        if (array_count($paras) >= 3) {
-            $para2 = $paras[2];
-        }
-
-        switch ($mo->cmd) {
-            case MissEventCode::Evn_User_Levelup: // 第一个状态事件
-                return usrInfo()->baseInfo()->level;
-            case MissEventCode::SEvn_Habitat_Own:
-                return MissProc::GetBuildingNum(INIT_HABITID, $para0, $para1);
-            case MissEventCode:: SEvn_Farm_Own:
-                return MissProc::GetBuildingNum(INIT_Farm, $para0, $para1);
-            case MissEventCode:: SEvn_Build_Own:
-                return MissProc::GetBuildingNum($para0, $para1, $para2);
-            case MissEventCode:: SEvn_Pet:
-                return MissProc::GetPetNum($para0, $para1, $para2);
-            case MissEventCode:: SEvn_Explore_GridOwn:
-                return MissProc::GetExlporeGridNum($para0);
-        }
-        return 0;
-    }
-
-}

+ 0 - 386
Gameserver/Amfphp/model/User/del_Ins_MissEventCode.php

@@ -1,386 +0,0 @@
-<?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.
- */
-
-/**
- * Description of MissEventCode
- *
- * @author jgao
- */
-class MissEventCode {
-
-    //put your code here
-
-    const isServerLogic = true;
-
-    //#region ----------->玩家事件
-
-    /**
-     * [状态] 玩家升级事件
-     * 无参数
-     * 计数:目标等级
-     */
-    const Evn_User_Levelup = 101;
-
-    /**
-     * 玩家食物发生变化
-     * 参数一:特定食物类型,无限定填0
-     *  计数:要求数目
-     */
-    const Evn_User_Food = 102;
-
-    //#endregion
-    //#region -----------> 领地事件
-
-    /**
-     * 建造一个领地    /    建造一个指定领地	
-     * 参数一:特定建筑ID,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Habitat_Build = 201;
-
-    /**
-     * 拥有一个领地     /     拥有一个指定领地	/ 拥有一个特定 等级领地
-     * 
-     * 参数一:特定栖息地类型(金木水火土),无限定填0
-     * 
-     * 参数二:特定等级,无限定填0
-     * 计数:要求数目
-     */
-    const SEvn_Habitat_Own = 251;
-
-    /**
-     *  升级一个领地	/    升级一个指定领地
-     * 
-     * 参数一:特定建筑ID,无限定填0
-     * 参数二:特定目标等级,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Habitat_LevelUp = 202;
-
-    /**
-     * 收取一次金币操作   
-     * 【行为的计数 】
-     * 
-     * 参数一:特定领地类型,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Habitat_CollectGold = 203;
-
-    /**
-     * 栖息地 金币收集累计  
-     * 【金币的计数 】
-     * 
-     * 参数一:特定领地类型,无限定填0
-     * 计数:要求数目
-     */
-    const SEvn_Habitat_CollectGold = 253;
-
-    //#endregion
-    //#region ----------->农田
-
-    /**
-     * 建造一个农田	
-     * 参数一:特定建筑ID,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Farm_Build = 301;
-
-    /**
-     * 拥有一个农田   /   拥有一个指定农田	/拥有一个指定等级的农田
-     * 
-     * 参数一:特定类型,无限定填0 (万一农田以后出其他类型呢) 
-     * 
-     * 参数二:特定等级,无限定填0
-     * 
-     * 计数:要求数目
-     */
-    const SEvn_Farm_Own = 351;
-
-    /**
-     * 升级一个农田	 
-     * 参数一:特定建筑ID,无限定填0
-     * 参数二:特定目标等级,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Farm_LevelUp = 302;
-
-    /**
-     * 种植一次作物	/   种植一次指定作物
-     * 参数一:特定作物类型,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Farm_PlantFood = 303;
-
-    /**
-     * 收获一次作物	/   收获一次指定作物 
-     * 【行为统计】
-     * 参数一:特定果实类型,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Farm_CollectFood = 304;
-
-    /**
-     * 收获一次作物	/   收获一次指定作物
-     * 【果实数量统计】
-     * 参数一:特定果实类型,无限定填0
-     * 计数:要求数目
-     */
-    const SEvn_Farm_CollectFood = 354;
-
-    //#endregion
-    //#region ----------->建筑事件
-
-    /**
-     * 建造一个建筑   /   建造一个指定建筑
-     * 参数一:特定建筑ID,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Build_Construct = 401;
-
-    /**
-     * 拥有一个建筑	/   拥有一个指定建筑 / 拥有指定等级的建筑
-     * 
-     * 参数一:特定建筑  一级大类 类型,无限定填0
-     * 参数二:特定建筑  二级小类 类型,无限定填0
-     * 参数二:特定等级,无限定填0
-     * 
-     * 计数:要求数目
-     */
-    const SEvn_Build_Own = 451;
-
-    /**
-     * 升级一个建筑   /  升级一个指定建筑	
-     * 
-     * 参数一:特定建筑ID,无限定填0
-     * 
-     * 参数二:特定等级,无限定填0
-     * 
-     * 计数:要求数目
-     */
-    const Evn_Build_LevelUp = 402;
-
-    /**
-     * 铲除 一个建筑   /  铲除一个指定建筑	    
-     * 参数一:特定建筑ID,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Build_Remove = 403;
-
-    /**
-     * 招募   一次    
-     * 参数一:特定神兽类型,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Build_PubEmploy = 404;
-
-    /**
-     * 培育一次    /  培育出指定神兽一次	获得兽蛋  
-     * 参数一:特定兽蛋类型,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Build_Breed = 405;
-
-    /**
-     * 孵化
-     * 参数一:特定兽蛋类型,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Build_EggHatch = 406;
-
-    /**
-     * 采矿场 打工一次
-     * 参数一:特定工作神兽类型,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Build_QuarryWork = 407;
-
-    /**
-     * 采矿场 结果收取一次
-     * 【累计神兽的工作次数】    
-     * 参数一:特定工作神兽类型,无限定填0    
-     * 计数:要求数目
-     */
-    const Evn_Build_QuarryResult = 408;
-
-    /**
-     * 采矿场 结果收取一次
-     * [累计道具的收取始数量]
-     * 参数一:特定采矿成果道具ID, 无限定填0  
-     * 计数:要求数目
-     */
-    const SEvn_Build_QuarryResult = 458;
-
-    /**
-     * 加工厂 打工一次
-     * 参数一:特定工作神兽类型,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Build_ProcessWork = 409;
-
-    /**
-     * 加工厂 结果收取一次
-     * 【累计哪个神兽加工工作次数】
-     * 参数一:特定工作神兽类型,无限定填0       
-     * 计数:要求数目
-     */
-    const Evn_Build_ProcessResult = 410;
-
-    /**
-     * 加工厂 结果收取
-     * [累计道具的收取始数量]
-     * 参数一:特定成果道具ID, 无限定填0  
-     * 计数:要求数目
-     */
-    const SEvn_Build_ProcessResult = 460;
-
-    /**
-     * 收取建造的建筑的经验值    
-     * 参数一:特定建筑ID,无限定填0       
-     * 计数:要求数目
-     */
-    const Evn_Build_CollectExp = 411;
-
-    /**
-     * 酒馆配置上阵神兽    
-     * 计数:配置次数
-     */
-    const Evn_Build_PubTeamConfig = 412;
-
-    //#endregion
-    //#region ----------->神兽事件
-
-    /**
-     * 拥有一只神兽	/ 拥有一只指定神兽
-     * 	
-     * 参数一:特定神兽类型,无限定填0
-     * 
-     * 参数二:特定等级,无限定填0
-     * 
-     * 参数三:特定星级,无限定填0
-     * 
-     * 计数:要求数目
-     */
-    const SEvn_Pet = 551;
-
-    /**
-     * 喂养一次神兽  /   喂养一次指定神兽	
-     * 参数一:特定神兽类型,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Pet_Feed = 501;
-
-    /*     * Mi
-     * 升级一次神兽	/ 升级一次指定神兽	
-     * 参数一:特定神兽类型,无限定填0
-     * 参数二:特定等级,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Pet_LevelUp = 502;
-
-    /**
-     * 升级技能一次神兽	/ 升级一次指定神兽	的技能
-     * 参数一:特定神兽类型,无限定填0
-     * 参数二:特定技能ID,无限定填0
-     * 参数三:特定技能等级,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Pet_Skill = 503;
-
-    /**
-     * 升星一次神兽 / 升星一次指定神兽
-     * 参数一:特定神兽类型,无限定填0
-     * 参数二:特定星级,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Pet_Star = 504;
-
-    //#endregion
-    //#region ----------->探索事件
-
-    /**
-     * 进入一次探索地图	
-     * 计数:要求数目
-     */
-    const Evn_Explore_EnterMap = 601;
-
-    /**
-     * 进行一次占领(动作,不考虑结果)
-     * 计数:要求数目
-     */
-    const Evn_Explore_GridCapture = 602;
-
-    /**
-     * 占领一块领地 / 占领一块指定领地或者或者中立建筑
-     * 参数一:特定领地类型,无限定填0
-     * 计数:要求数目
-     */
-    const Evn_Explore_GridCaptureSucced = 603;
-    
-    /**
-     * 拥有N块领地 / 拥有N块指定领地或者中立建筑
-     * 参数一:特定领地类型,无限定填0
-     * 计数:要求数目
-     */
-    const SEvn_Explore_GridOwn = 653;
-
-    /**
-     * 执行一次队伍调动(派遣战队进入探索地图)
-     * 计数:要求数目
-     */
-    const Evn_Explore_ArmyDeploy = 604;
-    
-    /**
-     * 和制定NPC对话
-     * 参数一:地图id(必填)
-     * 参数二:地点坐标(必填,格式为 x_y)
-     * 计数:固定为1
-     */
-    const Evn_Explore_TalkToMissNpc = 605;
-    
-    /**
-     * 打败多个指定坐标的NPC(多个)
-     * 参数一:地图id(必填)
-     * 参数二:地点列表(必填,格式为 x_y|x_y|x_y ...)
-     * 计数:地点总个数
-     */
-    const Evn_Explore_FightToMissNpc = 606;
-    
-    
-    //#endregion
-    //#region ----------->其他事件
-
-    /**
-     * 	加速一次	/   加速一次指定操作
-     * 参数一:加速类型(建造 /种植 /孵化/铲除障碍物),无限定填0
-     * 
-     * 计数:要求数目
-     * 
-     */
-    const Evn_SpeedUp = 701;
-
-    /**
-     * 岛屿解锁
-     * 计数:要求数目
-     */
-    const Evn_MapIsLand = 702;
-
-    /**
-     * 岛屿阴影解锁
-     * 计数:要求数目
-     */
-    const Evn_MapShadow = 703;
-
-    /**
-     * 新手引导
-     * 参数一:特定步骤ID,无限定填0
-     * 计数:目标步骤
-     */
-    const Evn_Guide = 704;
-
-    //#endregion
-}

+ 0 - 54
Gameserver/Amfphp/model/User/del_Ins_MissEventInfo.php

@@ -1,54 +0,0 @@
-<?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.
- */
-
-/**
- * Description of MissEventInfo
- *
- * @author jgao
- */
-class MissEventInfo {
-    //put your code here
-    
-    /**
-     * 事件码
-     * @var type 
-     */
-    public $evnCode = 0;
-
-    /**
-     * 操作模式
-     * @var type 
-     */
-    public $ope = "set";
-
-    /**
-     * 计数值
-     * @var type 
-     */
-    public $val = 0;
-
-    /**
-     * 参数集
-     * @var type 
-     */
-    public $paras = array();
-
-    /**
-     * 构造方法
-     * @param type $evn 事件码
-     * @param type $ope 操作模式(inc递增;add增加;set设置;max取最大值)
-     * @param type $val 数值
-     * @param array $paras 参数表
-     */
-    public function __construct($evn, $ope, $val, $paras=array()) {
-        $this->evnCode = $evn;
-        $this->ope = $ope;
-        $this->val = $val;
-        $this->paras = $paras;
-    }
-}

+ 3 - 3
Gameserver/Amfphp/process/ActiveProc.php

@@ -670,7 +670,7 @@ class ActiveProc {
         $activeCode = CipheredBase32::Decode($codestring);                      # 解码
         $codePlatStr = GameConstants::GetPlatStringByActivteCode($activeCode);  # platstr
         my_Assert(GameConstants::AllPlatStr == $codePlatStr #                   # 忽略全平台礼包
-                || req()->userInfo->getPlatStr() == $codePlatStr, #              # 平台字符串必须相符
+                || req()->getPlatStr() == $codePlatStr, #                       # 平台字符串必须相符
                 ErrCode::active_activecode_plat); #                             # 平台错误
 
         my_Assert(is_int($activeCode->number) #                                 # 编号为int值
@@ -819,8 +819,8 @@ class ActiveProc {
         $startDay = totalDays($ac->startts);
         $newLoginDays = array_filter(req()->userInfo->game->privateState->LoginDays, # 剔除不符合时间的登录记录
                 function ($tsday)use ($startDay) {
-            return $startDay <= $tsday;
-        }
+                    return $startDay <= $tsday;
+                }
         );
         req()->userInfo->game->privateState->LoginDays = $newLoginDays;          #
         if (count(req()->userInfo->game->privateState->LoginDays) < 7) {

+ 1 - 1
Gameserver/Amfphp/process/UserProc.php

@@ -274,7 +274,7 @@ class UserProc {
         $rolename = "No." . sprintf("%03d", req()->zoneid) . sprintf("%07d", $id); # 生成编号
         if (self::checkRoleNameNotExist($rolename)) {                           # 记录玩家
             $userinfo = self::createUser($rolename, $gender, $profile_img);
-            if (1 == self::regRole(req()->zoneid, $userID, $rolename, $gender, $profile_img, $userinfo->getPlatStr())) {
+            if (1 == self::regRole(req()->zoneid, $userID, $rolename, $gender, $profile_img, req()->getPlatStr())) {
                 StatisticsProc::TargetStatistics(Enum_TargetStatistics::registerUserNum); //注册人数统计
                 StatisticsProc::dailyTaskInit();