Parcourir la source

添加首次通关解锁英雄相关逻辑

gwang il y a 5 ans
Parent
commit
c939182286

+ 1207 - 0
Gameserver/Amfphp/model/Const/GameConfig.php

@@ -0,0 +1,1207 @@
+<?php
+
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2020-01-20 11:20:51
+////////////////////
+
+/**
+ * 常量配置数据 
+ */
+class GameConfig {
+// <editor-fold defaultstate="collapsed" desc="  基础代码 ">    
+    /**
+     * 是否启用codegen 
+     */
+    private static function isCG()  {
+        return defined('CodeGen_Enabled') && CodeGen_Enabled; 
+    }
+    /**
+     * @var bool 分区是否使用独立的常量配置数据
+     */
+    private static $useZoneId = false;
+    /**
+     * 追加分区列表字符串
+     * @return string
+     */
+    private static function zoneid()
+    {
+        global $zoneid;
+        return self::$useZoneId ? "-zone$zoneid" : "";
+    }
+    /**
+     * 初始化指定变量, 非null的情况下直接跳出
+     * 可能从文件中或者redis中获取原始数据对变量进行初始化
+     * @param mixed $a 变量
+     * @param string $modelName 用来初始化变量的资源名称
+     * @param bool $isHash 数据是否采用hash结构(否:普通字符串)
+     */
+    static private function initValue(&$a, $modelName, $isHash = true)
+    {
+        $key = 'gamecfg-' . $modelName . self::zoneid();
+        if (is_null($a)) {
+            if (self::isCG()) {
+                $a = include $key . '.php';
+            } else {
+                $a = $isHash ? gMem()->hgetall($key) : gMem()->get($key);
+            }
+        }
+        return $a;
+    }
+    /** 
+     * 获取hash结构的一个item
+     * @param string $modelName 模块名称
+     * @param mixed/string/int $itemId 索引
+     * @return mixed
+     */
+    private static function get_hash_item($modelName, $itemId)
+    {
+        if (self::isCG()) {
+            $data = self::$modelName();
+            if (property_exists($data, $itemId)) {
+                return $data->$itemId;
+            }
+        } else {
+            $key = 'gamecfg-' . $modelName . self::zoneid();
+            return gMem()->hget($key, $itemId);
+        }
+        return null;
+    }
+// </editor-fold>
+    /**
+    * 全局参数
+    * @return \globalsettings
+    */
+    public static function globalsettings()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'globalsettings');
+    }
+    /**
+    * 英雄模块
+    * @return \hero
+    */
+    public static function hero()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'hero');
+    }
+    /**
+    * @return \sm_hero hero item数据 
+    */
+    public static function hero_getItem($itemid)
+    { 
+        return self::get_hash_item('hero', $itemid);
+    }
+    /**
+    * 英雄的升级(属性加成)
+    * @return \heroextra_level
+    */
+    public static function heroextra_level()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'heroextra_level');
+    }
+    /**
+    * @return \sm_heroextra_level heroextra_level item数据 
+    */
+    public static function heroextra_level_getItem($heroId, $quality)
+    { 
+        return self::get_hash_item('heroextra_level', $heroId)->$quality;
+    }
+    /**
+    * 开服七天活动
+    * @return \day7
+    */
+    public static function day7()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'day7');
+    }
+    /**
+    * @return \sm_day7 day7 item数据 
+    */
+    public static function day7_getItem($itemid)
+    { 
+        return self::get_hash_item('day7', $itemid);
+    }
+    /**
+    * 
+    * @return \item
+    */
+    public static function item()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'item');
+    }
+    /**
+    * @return \sm_item item item数据 
+    */
+    public static function item_getItem($itemid)
+    { 
+        return self::get_hash_item('item', $itemid);
+    }
+    /**
+    * 
+    * @return \itemlevel
+    */
+    public static function itemlevel()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'itemlevel');
+    }
+    /**
+    * @return \sm_itemlevel itemlevel item数据 
+    */
+    public static function itemlevel_getItem($itemid)
+    { 
+        return self::get_hash_item('itemlevel', $itemid);
+    }
+    /**
+    * 英雄的好感度提升(消耗金币)
+    * @return \heroextra_favor
+    */
+    public static function heroextra_favor()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'heroextra_favor');
+    }
+    /**
+    * @return \sm_heroextra_favor heroextra_favor item数据 
+    */
+    public static function heroextra_favor_getItem($itemid)
+    { 
+        return self::get_hash_item('heroextra_favor', $itemid);
+    }
+    /**
+    * 英雄的升级——每级成长消耗经验需求表
+    * @return \hero_levelexp
+    */
+    public static function hero_levelexp()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'hero_levelexp');
+    }
+    /**
+    * @return \sm_hero_levelexp hero_levelexp item数据 
+    */
+    public static function hero_levelexp_getItem($itemid)
+    { 
+        return self::get_hash_item('hero_levelexp', $itemid);
+    }
+    /**
+    * 英雄的升星(消耗金币+ 属性加成)
+    * @return \heroextra_star
+    */
+    public static function heroextra_star()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'heroextra_star');
+    }
+    /**
+    * @return \sm_heroextra_star heroextra_star item数据 
+    */
+    public static function heroextra_star_getItem($itemid)
+    { 
+        return self::get_hash_item('heroextra_star', $itemid);
+    }
+    /**
+    * 英雄的升阶(消耗金币+ 属性加成)
+    * @return \heroextra_dengjie
+    */
+    public static function heroextra_dengjie()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'heroextra_dengjie');
+    }
+    /**
+    * @return \sm_heroextra_dengjie heroextra_dengjie item数据 
+    */
+    public static function heroextra_dengjie_getItem($itemid)
+    { 
+        return self::get_hash_item('heroextra_dengjie', $itemid);
+    }
+    /**
+    * 关卡
+    * @return \gate
+    */
+    public static function gate()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate');
+    }
+    /**
+    * @return \sm_gate gate item数据 
+    */
+    public static function gate_getItem($itemid)
+    { 
+        return self::get_hash_item('gate', $itemid);
+    }
+    /**
+    * 关卡波茨数据
+    * @return \gatelevel
+    */
+    public static function gatelevel()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gatelevel');
+    }
+    /**
+    * @return \sm_gatelevel gatelevel item数据 
+    */
+    public static function gatelevel_getItem($itemid)
+    { 
+        return self::get_hash_item('gatelevel', $itemid);
+    }
+    /**
+    * 关卡—— 星级奖励
+    * @return \gate_starreward
+    */
+    public static function gate_starreward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate_starreward');
+    }
+    /**
+    * @return \sm_gate_starreward gate_starreward item数据 
+    */
+    public static function gate_starreward_getItem($itemid)
+    { 
+        return self::get_hash_item('gate_starreward', $itemid);
+    }
+    /**
+    * 任务
+    * @return \task
+    */
+    public static function task()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'task');
+    }
+    /**
+    * @return \sm_task task item数据 
+    */
+    public static function task_getItem($itemid)
+    { 
+        return self::get_hash_item('task', $itemid);
+    }
+    /**
+    * 
+    * @return \playerlevel
+    */
+    public static function playerlevel()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'playerlevel');
+    }
+    /**
+    * @return \sm_playerlevel playerlevel item数据 
+    */
+    public static function playerlevel_getItem($itemid)
+    { 
+        return self::get_hash_item('playerlevel', $itemid);
+    }
+    /**
+    * 言灵类道具
+    * @return \item_yanling
+    */
+    public static function item_yanling()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'item_yanling');
+    }
+    /**
+    * @return \sm_item_yanling item_yanling item数据 
+    */
+    public static function item_yanling_getItem($itemid)
+    { 
+        return self::get_hash_item('item_yanling', $itemid);
+    }
+    /**
+    * 技能升级消耗金币
+    * @return \skill_upgrade_cost
+    */
+    public static function skill_upgrade_cost()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'skill_upgrade_cost');
+    }
+    /**
+    * @return \sm_skill_upgrade_cost skill_upgrade_cost item数据 
+    */
+    public static function skill_upgrade_cost_getItem($itemid)
+    { 
+        return self::get_hash_item('skill_upgrade_cost', $itemid);
+    }
+    /**
+    * 商城
+    * @return \shop
+    */
+    public static function shop()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'shop');
+    }
+    /**
+    * @return \sm_shop shop item数据 
+    */
+    public static function shop_getItem($itemid)
+    { 
+        return self::get_hash_item('shop', $itemid);
+    }
+    /**
+    * 停服计划
+    * @return \service_schedule
+    */
+    public static function service_schedule()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'service_schedule');
+    }
+    /**
+    * @return \sm_service_schedule service_schedule item数据 
+    */
+    public static function service_schedule_getItem($itemid)
+    { 
+        return self::get_hash_item('service_schedule', $itemid);
+    }
+    /**
+    * 抽奖数据
+    * @return \choujiang
+    */
+    public static function choujiang()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'choujiang');
+    }
+    /**
+    * @return \sm_choujiang choujiang item数据 
+    */
+    public static function choujiang_getItem($itemid)
+    { 
+        return self::get_hash_item('choujiang', $itemid);
+    }
+    /**
+    * 无穷无尽关卡模式
+    * @return \gate_forever
+    */
+    public static function gate_forever()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate_forever');
+    }
+    /**
+    * @return \sm_gate_forever gate_forever item数据 
+    */
+    public static function gate_forever_getItem($itemid)
+    { 
+        return self::get_hash_item('gate_forever', $itemid);
+    }
+    /**
+    * 系统邮件
+    * @return \sysmail
+    */
+    public static function sysmail()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'sysmail');
+    }
+    /**
+    * @return \sm_sysmail sysmail item数据 
+    */
+    public static function sysmail_getItem($itemid)
+    { 
+        return self::get_hash_item('sysmail', $itemid);
+    }
+    /**
+    * 关卡【副本】
+    * @return \gate_carbon
+    */
+    public static function gate_carbon()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate_carbon');
+    }
+    /**
+    * @return \sm_gate_carbon gate_carbon item数据 
+    */
+    public static function gate_carbon_getItem($itemid)
+    { 
+        return self::get_hash_item('gate_carbon', $itemid);
+    }
+    /**
+    * pvp分段奖励
+    * @return \pvp_leaguereward
+    */
+    public static function pvp_leaguereward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'pvp_leaguereward');
+    }
+    /**
+    * @return \sm_pvp_leaguereward pvp_leaguereward item数据 
+    */
+    public static function pvp_leaguereward_getItem($itemid)
+    { 
+        return self::get_hash_item('pvp_leaguereward', $itemid);
+    }
+    /**
+    * pvp 百名榜单奖励
+    * @return \pvp_rankreward
+    */
+    public static function pvp_rankreward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'pvp_rankreward');
+    }
+    /**
+    * @return \sm_pvp_rankreward pvp_rankreward item数据 
+    */
+    public static function pvp_rankreward_getItem($itemid)
+    { 
+        return self::get_hash_item('pvp_rankreward', $itemid);
+    }
+    /**
+    * pvp_ 分数段
+    * @return \pvp_leaguescore
+    */
+    public static function pvp_leaguescore()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'pvp_leaguescore');
+    }
+    /**
+    * @return \sm_pvp_leaguescore pvp_leaguescore item数据 
+    */
+    public static function pvp_leaguescore_getItem($itemid)
+    { 
+        return self::get_hash_item('pvp_leaguescore', $itemid);
+    }
+    /**
+    * 熔炼实验室
+    * @return \smelting
+    */
+    public static function smelting()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'smelting');
+    }
+    /**
+    * @return \sm_smelting smelting item数据 
+    */
+    public static function smelting_getItem($itemid)
+    { 
+        return self::get_hash_item('smelting', $itemid);
+    }
+    /**
+    * 配置的关卡相关的战斗数据
+    * @return \gate_combat
+    */
+    public static function gate_combat()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate_combat');
+    }
+    /**
+    * @return \sm_gate_combat gate_combat item数据 
+    */
+    public static function gate_combat_getItem($itemid)
+    { 
+        return self::get_hash_item('gate_combat', $itemid);
+    }
+    /**
+    * 
+    * @return \gate_carbon_content
+    */
+    public static function gate_carbon_content()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate_carbon_content');
+    }
+    /**
+    * @return \sm_gate_carbon_content gate_carbon_content item数据 
+    */
+    public static function gate_carbon_content_getItem($itemid)
+    { 
+        return self::get_hash_item('gate_carbon_content', $itemid);
+    }
+    /**
+    * pvp活跃奖励数据
+    * @return \pvp_activityreward
+    */
+    public static function pvp_activityreward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'pvp_activityreward');
+    }
+    /**
+    * @return \sm_pvp_activityreward pvp_activityreward item数据 
+    */
+    public static function pvp_activityreward_getItem($itemid)
+    { 
+        return self::get_hash_item('pvp_activityreward', $itemid);
+    }
+    /**
+    * 抽奖保底数据
+    * @return \choujiang_baodi
+    */
+    public static function choujiang_baodi()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'choujiang_baodi');
+    }
+    /**
+    * @return \sm_choujiang_baodi choujiang_baodi item数据 
+    */
+    public static function choujiang_baodi_getItem($typeId, $cishu)
+    { 
+        return self::get_hash_item('choujiang_baodi', "$typeId-$cishu");
+    }
+    /**
+    * 英雄的升级——成长可消耗的道具表
+    * @return \hero_levelexp_costitem
+    */
+    public static function hero_levelexp_costitem()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'hero_levelexp_costitem');
+    }
+    /**
+    * @return \sm_hero_levelexp_costitem hero_levelexp_costitem item数据 
+    */
+    public static function hero_levelexp_costitem_getItem($itemid)
+    { 
+        return self::get_hash_item('hero_levelexp_costitem', $itemid);
+    }
+    /**
+    * 抽奖设置数据
+    * @return \choujiang_settings
+    */
+    public static function choujiang_settings()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'choujiang_settings');
+    }
+    /**
+    * @return \sm_choujiang_settings choujiang_settings item数据 
+    */
+    public static function choujiang_settings_getItem($itemid)
+    { 
+        return self::get_hash_item('choujiang_settings', $itemid);
+    }
+    /**
+    * 引导步骤
+    * @return \guide_step
+    */
+    public static function guide_step()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'guide_step');
+    }
+    /**
+    * @return \sm_guide_step guide_step item数据 
+    */
+    public static function guide_step_getItem($itemid)
+    { 
+        return self::get_hash_item('guide_step', $itemid);
+    }
+    /**
+    * 引导触发
+    * @return \guide_trigger
+    */
+    public static function guide_trigger()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'guide_trigger');
+    }
+    /**
+    * @return \sm_guide_trigger guide_trigger item数据 
+    */
+    public static function guide_trigger_getItem($itemid)
+    { 
+        return self::get_hash_item('guide_trigger', $itemid);
+    }
+    /**
+    * 成就任务
+    * @return \task_achi
+    */
+    public static function task_achi()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'task_achi');
+    }
+    /**
+    * @return \sm_task_achi task_achi item数据 
+    */
+    public static function task_achi_getItem($itemid)
+    { 
+        return self::get_hash_item('task_achi', $itemid);
+    }
+    /**
+    * 宝箱
+    * @return \box
+    */
+    public static function box()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'box');
+    }
+    /**
+    * @return \sm_box box item数据 
+    */
+    public static function box_getItem($itemid)
+    { 
+        return self::get_hash_item('box', $itemid);
+    }
+    /**
+    * 宝箱的奖池
+    * @return \boxpool
+    */
+    public static function boxpool()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'boxpool');
+    }
+    /**
+    * @return \sm_boxpool boxpool item数据 
+    */
+    public static function boxpool_getItem($itemid)
+    { 
+        return self::get_hash_item('boxpool', $itemid);
+    }
+    /**
+    * 英雄————神血系统
+    * @return \heroextra_godblood
+    */
+    public static function heroextra_godblood()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'heroextra_godblood');
+    }
+    /**
+    * @return \sm_heroextra_godblood heroextra_godblood item数据 
+    */
+    public static function heroextra_godblood_getItem($itemid)
+    { 
+        return self::get_hash_item('heroextra_godblood', $itemid);
+    }
+    /**
+    * 碎片
+    * @return \segment
+    */
+    public static function segment()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'segment');
+    }
+    /**
+    * @return \sm_segment segment item数据 
+    */
+    public static function segment_getItem($itemid)
+    { 
+        return self::get_hash_item('segment', $itemid);
+    }
+    /**
+    * 
+    * @return \gate_world
+    */
+    public static function gate_world()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate_world');
+    }
+    /**
+    * @return \sm_gate_world gate_world item数据 
+    */
+    public static function gate_world_getItem($itemid)
+    { 
+        return self::get_hash_item('gate_world', $itemid);
+    }
+    /**
+    * 
+    * @return \gate_city
+    */
+    public static function gate_city()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate_city');
+    }
+    /**
+    * @return \sm_gate_city gate_city item数据 
+    */
+    public static function gate_city_getItem($itemid)
+    { 
+        return self::get_hash_item('gate_city', $itemid);
+    }
+    /**
+    * 神秘商城道具表-by goodstype
+    * @return \secretshop_goodsType
+    */
+    public static function secretshop_goodsType()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'secretshop_goodsType');
+    }
+    /**
+    * @return \sm_secretshop_goodsType secretshop_goodsType item数据 
+    */
+    public static function secretshop_goodsType_getItem($itemid)
+    { 
+        return self::get_hash_item('secretshop_goodsType', $itemid);
+    }
+    /**
+    * 神秘商城刷新价格表
+    * @return \secretshop_refresh
+    */
+    public static function secretshop_refresh()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'secretshop_refresh');
+    }
+    /**
+    * @return \sm_secretshop_refresh secretshop_refresh item数据 
+    */
+    public static function secretshop_refresh_getItem($itemid)
+    { 
+        return self::get_hash_item('secretshop_refresh', $itemid);
+    }
+    /**
+    * 神秘商城道具表-by typeId
+    * @return \secretshop_typeId
+    */
+    public static function secretshop_typeId()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'secretshop_typeId');
+    }
+    /**
+    * @return \sm_secretshop_typeId secretshop_typeId item数据 
+    */
+    public static function secretshop_typeId_getItem($itemid)
+    { 
+        return self::get_hash_item('secretshop_typeId', $itemid);
+    }
+    /**
+    * 客户端版本信息
+    * @return \clientVersionHistory
+    */
+    public static function clientVersionHistory()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'clientVersionHistory');
+    }
+    /**
+    * @return \sm_clientVersionHistory clientVersionHistory item数据 
+    */
+    public static function clientVersionHistory_getItem($itemid)
+    { 
+        return self::get_hash_item('clientVersionHistory', $itemid);
+    }
+    /**
+    * 分区列表
+    * @return \zonelist
+    */
+    public static function zonelist()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'zonelist');
+    }
+    /**
+    * @return \sm_zonelist zonelist item数据 
+    */
+    public static function zonelist_getItem($itemid)
+    { 
+        return self::get_hash_item('zonelist', $itemid);
+    }
+    /**
+    * 兑换码礼包
+    * @return \tokenGift
+    */
+    public static function tokenGift()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'tokenGift');
+    }
+    /**
+    * @return \sm_tokenGift tokenGift item数据 
+    */
+    public static function tokenGift_getItem($itemid)
+    { 
+        return self::get_hash_item('tokenGift', $itemid);
+    }
+    /**
+    * 活动配置
+    * @return \activity
+    */
+    public static function activity()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activity');
+    }
+    /**
+    * @return \sm_activity activity item数据 
+    */
+    public static function activity_getItem($itemid)
+    { 
+        return self::get_hash_item('activity', $itemid);
+    }
+    /**
+    * 碎片融合的概率表
+    * @return \segment_ronghe
+    */
+    public static function segment_ronghe()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'segment_ronghe');
+    }
+    /**
+    * @return \sm_segment_ronghe segment_ronghe item数据 
+    */
+    public static function segment_ronghe_getItem($itemid)
+    { 
+        return self::get_hash_item('segment_ronghe', $itemid);
+    }
+    /**
+    * 碎片_按品质索引
+    * @return \segment_byPinzhi
+    */
+    public static function segment_byPinzhi()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'segment_byPinzhi');
+    }
+    /**
+    * @return \sm_segment_byPinzhi segment_byPinzhi item数据 
+    */
+    public static function segment_byPinzhi_getItem($quailty, $itemType)
+    { 
+        return self::get_hash_item('segment_byPinzhi', $quailty)->$itemType;
+    }
+    /**
+    * 宝箱经验卡掉落数据
+    * @return \boxJingYanCards
+    */
+    public static function boxJingYanCards()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'boxJingYanCards');
+    }
+    /**
+    * @return \sm_boxJingYanCards boxJingYanCards item数据 
+    */
+    public static function boxJingYanCards_getItem($itemid)
+    { 
+        return self::get_hash_item('boxJingYanCards', $itemid);
+    }
+    /**
+    * 活动: 在线礼包
+    * @return \activity_onlinegift
+    */
+    public static function activity_onlinegift()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activity_onlinegift');
+    }
+    /**
+    * @return \sm_activity_onlinegift activity_onlinegift item数据 
+    */
+    public static function activity_onlinegift_getItem($itemid)
+    { 
+        return self::get_hash_item('activity_onlinegift', $itemid);
+    }
+    /**
+    * GM号的UID
+    * @return \GM_uids
+    */
+    public static function GM_uids()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'GM_uids');
+    }
+    /**
+    * 活动, 全服注册礼包
+    * @return \activity_reggift
+    */
+    public static function activity_reggift()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activity_reggift');
+    }
+    /**
+    * @return \sm_activity_reggift activity_reggift item数据 
+    */
+    public static function activity_reggift_getItem($itemid)
+    { 
+        return self::get_hash_item('activity_reggift', $itemid);
+    }
+    /**
+    * 公会捐献卡牌奖励
+    * @return \guilddonatereward
+    */
+    public static function guilddonatereward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'guilddonatereward');
+    }
+    /**
+    * @return \sm_guilddonatereward guilddonatereward item数据 
+    */
+    public static function guilddonatereward_getItem($itemid)
+    { 
+        return self::get_hash_item('guilddonatereward', $itemid);
+    }
+    /**
+    * 公会等级相关数据
+    * @return \guildlevel
+    */
+    public static function guildlevel()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'guildlevel');
+    }
+    /**
+    * @return \sm_guildlevel guildlevel item数据 
+    */
+    public static function guildlevel_getItem($itemid)
+    { 
+        return self::get_hash_item('guildlevel', $itemid);
+    }
+    /**
+    * 公会礼包
+    * @return \guildlibao
+    */
+    public static function guildlibao()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'guildlibao');
+    }
+    /**
+    * @return \sm_guildlibao guildlibao item数据 
+    */
+    public static function guildlibao_getItem($itemid)
+    { 
+        return self::get_hash_item('guildlibao', $itemid);
+    }
+    /**
+    * 玩家初始化数据
+    * @return \primordial_data
+    */
+    public static function primordial_data()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'primordial_data');
+    }
+    /**
+    * 英雄技能升级的限定
+    * @return \heroextra_skill_lv_limit
+    */
+    public static function heroextra_skill_lv_limit()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'heroextra_skill_lv_limit');
+    }
+    /**
+    * @return \sm_heroextra_skill_lv_limit heroextra_skill_lv_limit item数据 
+    */
+    public static function heroextra_skill_lv_limit_getItem($itemid)
+    { 
+        return self::get_hash_item('heroextra_skill_lv_limit', $itemid);
+    }
+    /**
+    * 武器类道具
+    * @return \item_weapon
+    */
+    public static function item_weapon()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'item_weapon');
+    }
+    /**
+    * @return \sm_item_weapon item_weapon item数据 
+    */
+    public static function item_weapon_getItem($itemid)
+    { 
+        return self::get_hash_item('item_weapon', $itemid);
+    }
+    /**
+    * 礼包类道具
+    * @return \item_package
+    */
+    public static function item_package()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'item_package');
+    }
+    /**
+    * @return \sm_item_package item_package item数据 
+    */
+    public static function item_package_getItem($itemid)
+    { 
+        return self::get_hash_item('item_package', $itemid);
+    }
+    /**
+    * 强化类道具
+    * @return \item_stones
+    */
+    public static function item_stones()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'item_stones');
+    }
+    /**
+    * @return \sm_item_stones item_stones item数据 
+    */
+    public static function item_stones_getItem($itemid)
+    { 
+        return self::get_hash_item('item_stones', $itemid);
+    }
+    /**
+    * 药水类道具
+    * @return \item_pills
+    */
+    public static function item_pills()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'item_pills');
+    }
+    /**
+    * @return \sm_item_pills item_pills item数据 
+    */
+    public static function item_pills_getItem($itemid)
+    { 
+        return self::get_hash_item('item_pills', $itemid);
+    }
+    /**
+    * buff类道具
+    * @return \item_buffcard
+    */
+    public static function item_buffcard()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'item_buffcard');
+    }
+    /**
+    * @return \sm_item_buffcard item_buffcard item数据 
+    */
+    public static function item_buffcard_getItem($itemid)
+    { 
+        return self::get_hash_item('item_buffcard', $itemid);
+    }
+    /**
+    * 碎片类道具
+    * @return \item_segment
+    */
+    public static function item_segment()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'item_segment');
+    }
+    /**
+    * @return \sm_item_segment item_segment item数据 
+    */
+    public static function item_segment_getItem($itemid)
+    { 
+        return self::get_hash_item('item_segment', $itemid);
+    }
+    /**
+    * 道具通用字段表
+    * @return \item_base
+    */
+    public static function item_base()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'item_base');
+    }
+    /**
+    * @return \sm_item_base item_base item数据 
+    */
+    public static function item_base_getItem($itemid)
+    { 
+        return self::get_hash_item('item_base', $itemid);
+    }
+    /**
+    * 子技能表
+    * @return \subSkill
+    */
+    public static function subSkill()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'subSkill');
+    }
+    /**
+    * @return \sm_subSkill subSkill item数据 
+    */
+    public static function subSkill_getItem($itemid)
+    { 
+        return self::get_hash_item('subSkill', $itemid);
+    }
+    /**
+    * 宝箱类道具
+    * @return \item_box
+    */
+    public static function item_box()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'item_box');
+    }
+    /**
+    * @return \sm_item_box item_box item数据 
+    */
+    public static function item_box_getItem($itemid)
+    { 
+        return self::get_hash_item('item_box', $itemid);
+    }
+    /**
+    * 关卡-通关条件
+    * @return \gate_passCondition
+    */
+    public static function gate_passCondition()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate_passCondition');
+    }
+    /**
+    * @return \sm_gate_passCondition gate_passCondition item数据 
+    */
+    public static function gate_passCondition_getItem($itemid)
+    { 
+        return self::get_hash_item('gate_passCondition', $itemid);
+    }
+    /**
+    * 元素相克关系表
+    * @return \attack_relation
+    */
+    public static function attack_relation()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'attack_relation');
+    }
+    /**
+    * @return \sm_attack_relation attack_relation item数据 
+    */
+    public static function attack_relation_getItem($attack1, $attack2)
+    { 
+        return self::get_hash_item('attack_relation', "$attack1-$attack2");
+    }
+    /**
+    * 当前版本(时间戳)
+    * @return \ver
+    */
+    public static function ver()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'ver', false);
+    }
+    /**
+    * 客户端配置数据
+    * @return \client
+    */
+    public static function client()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'client', false);
+    }
+}
+

+ 1 - 1
Gameserver/Amfphp/model/Const/globalsettings.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2019-12-10 11:43:17
+ // 日期: 2020-01-15 16:10:12
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/primordial_data.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-01-02 17:58:51
+ // 日期: 2020-01-16 09:16:27
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_activity_onlinegift.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2019-10-18 14:10:08
+ // 日期: 2020-01-07 17:44:59
 ////////////////////
 
 

+ 33 - 0
Gameserver/Amfphp/model/Const/sm_attack_relation.php

@@ -0,0 +1,33 @@
+<?php
+
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2020-01-16 10:41:06
+////////////////////
+
+
+/**
+ * Static Model attack_relation 
+ */
+class sm_attack_relation
+{
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $attack1;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $attack2;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $effect;
+
+}
+

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_clientVersionHistory.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2019-10-18 14:10:11
+ // 日期: 2020-01-15 16:10:13
 ////////////////////
 
 

+ 87 - 7
Gameserver/Amfphp/model/Const/sm_gate.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-01-02 15:30:20
+ // 日期: 2020-01-20 11:18:18
 ////////////////////
 
 
@@ -24,6 +24,11 @@ class sm_gate
     */
     public $gateName;
 
+    /**
+    * @var String 预制体名称  
+    */
+    public $prefabName;
+
     /**
     * @var String 用途未知!!请到数据库中添加字段注释。  
     */
@@ -54,6 +59,16 @@ class sm_gate
     */
     public $tili3;
 
+    /**
+    * @var Int32 普通难度达到对应关卡解锁此关的精英难度 default(0) 
+    */
+    public $requireNormalLevel;
+
+    /**
+    * @var Int32 精英关卡达到对应关卡解锁此关的噩梦难度 default(0) 
+    */
+    public $requireHardLevel;
+
     /**
     * @var Int32 用途未知!!请到数据库中添加字段注释。  
     */
@@ -70,20 +85,35 @@ class sm_gate
     public $cishu3;
 
     /**
-    * @var String 用途未知!!请到数据库中添加字段注释。  
+    * @var String 关卡奖励字符串  
     */
     public $reward1;
 
     /**
-    * @var String 用途未知!!请到数据库中添加字段注释。  
+    * @var String 关卡奖励字符串(困难难度)  
     */
     public $reward2;
 
     /**
-    * @var String 用途未知!!请到数据库中添加字段注释。  
+    * @var String 关卡奖励字符串  
     */
     public $reward3;
 
+    /**
+    * @var String 首次通关奖励(普通难度)  
+    */
+    public $first_reward1;
+
+    /**
+    * @var String 首次通关奖励(困难难度)  
+    */
+    public $first_reward2;
+
+    /**
+    * @var String 首次通关奖励(噩梦难度)  
+    */
+    public $first_reward3;
+
     /**
     * @var Int32 掉落金币(普通难度) default(0) 
     */
@@ -100,19 +130,69 @@ class sm_gate
     public $gold3;
 
     /**
-    * @var Int32 掉落玩家经验(普通难度) default(0) 
+    * @var Int32 首次通关掉落的指挥官经验(普通难度) default(0) 
+    */
+    public $first_exp1;
+
+    /**
+    * @var Int32 首次通关掉落的指挥官经验(困难难度) default(0) 
+    */
+    public $first_exp2;
+
+    /**
+    * @var Int32 首次通关掉落的指挥官经验(噩梦难度) default(0) 
+    */
+    public $first_exp3;
+
+    /**
+    * @var Int32 首次通关解锁英雄ID(普通难度) default(0) 
+    */
+    public $first_hero1;
+
+    /**
+    * @var Int32 首次通关解锁英雄ID(困难难度) default(0) 
+    */
+    public $first_hero2;
+
+    /**
+    * @var Int32 首次通关解锁英雄ID(噩梦难度) default(0) 
+    */
+    public $first_hero3;
+
+    /**
+    * @var Int32 常规通关掉落玩家经验(普通难度) default(0) 
     */
     public $exp1;
 
     /**
-    * @var Int32 掉落玩家经验(困难难度) default(0) 
+    * @var Int32 常规通关掉落玩家经验(困难难度) default(0) 
     */
     public $exp2;
 
     /**
-    * @var Int32 掉落玩家经验(噩梦难度) default(0) 
+    * @var Int32 常规通关掉落玩家经验(噩梦难度) default(0) 
     */
     public $exp3;
 
+    /**
+    * @var Int32 掉落英雄经验(普通难度) default(0) 
+    */
+    public $heroExp1;
+
+    /**
+    * @var Int32 掉落英雄经验(困难难度) default(0) 
+    */
+    public $heroExp2;
+
+    /**
+    * @var Int32 掉落英雄经验(噩梦难度) default(0) 
+    */
+    public $heroExp3;
+
+    /**
+    * @var String 通关条件(逗号分隔通关条件的ID)  
+    */
+    public $passCondition;
+
 }
 

+ 28 - 3
Gameserver/Amfphp/model/Const/sm_gate_combat.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2019-12-31 17:16:07
+ // 日期: 2020-01-07 16:35:33
 ////////////////////
 
 
@@ -45,9 +45,34 @@ class sm_gate_combat
     public $level;
 
     /**
-    * @var String 波次ID(Gatelevel.id)  
+    * @var String 普通难度_波次ID(Gatelevel.id)  
     */
-    public $levels;
+    public $levels_normal;
+
+    /**
+    * @var String 困难难度_波次  
+    */
+    public $levels_hard;
+
+    /**
+    * @var String 噩梦难度_波次  
+    */
+    public $levels_elite;
+
+    /**
+    * @var Int32 普通难度推荐等级 default(0) 
+    */
+    public $recommendLevel_normal;
+
+    /**
+    * @var Int32 困难难度推荐等级 default(0) 
+    */
+    public $recommendLevel_hard;
+
+    /**
+    * @var Int32 噩梦难度推荐等级 default(0) 
+    */
+    public $recommendLevel_elite;
 
 }
 

+ 39 - 0
Gameserver/Amfphp/model/Const/sm_gate_passCondition.php

@@ -0,0 +1,39 @@
+<?php
+
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2020-01-08 08:38:16
+////////////////////
+
+
+/**
+ * Static Model gate_passCondition 
+ */
+class sm_gate_passCondition
+{
+
+    /**
+    * @var Int32 通关条件类型
+    *  1.通关时间
+    *  2.队伍中死亡人数
+    *  3.受击次数
+    *  4.指定角色
+    *  5.连击次数
+    *  6.释放必杀技次数 default(0) 
+    */
+    public $conditionType;
+
+    /**
+    * @var String 通关条件参数 default(0) 
+    */
+    public $conditionParas;
+
+    /**
+    * @var String 描述 default(0) 
+    */
+    public $desc;
+
+}
+

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_gatelevel.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2019-12-31 17:17:29
+ // 日期: 2020-01-07 16:37:25
 ////////////////////
 
 

+ 6 - 1
Gameserver/Amfphp/model/Const/sm_hero.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2019-12-31 17:13:43
+ // 日期: 2020-01-13 17:02:08
 ////////////////////
 
 
@@ -119,6 +119,11 @@ class sm_hero
     */
     public $hp;
 
+    /**
+    * @var Int32 每段血量值 (主要是boss) default(0) 
+    */
+    public $hp_len;
+
     /**
     * @var Int32 能量值(言能) default(0) 
     */

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_base.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-01-02 16:03:27
+ // 日期: 2020-01-09 16:17:01
 ////////////////////
 
 

+ 6 - 1
Gameserver/Amfphp/model/Const/sm_item_weapon.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-01-02 16:12:54
+ // 日期: 2020-01-03 09:30:46
 ////////////////////
 
 
@@ -29,6 +29,11 @@ class sm_item_weapon
     */
     public $star;
 
+    /**
+    * @var Int32 所属英雄的类型: 1 物理 2 魔法  
+    */
+    public $roleType;
+
     /**
     * @var Int32 【不改】附加生命 default(0) 
     */

+ 9 - 4
Gameserver/Amfphp/model/Const/sm_item_yanling.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-01-02 16:13:28
+ // 日期: 2020-01-06 11:28:57
 ////////////////////
 
 
@@ -29,6 +29,11 @@ class sm_item_yanling
     */
     public $position;
 
+    /**
+    * @var Int32 所属角色类型: 1 物理, 2 魔法 default(0) 
+    */
+    public $roleType;
+
     /**
     * @var Int32 武器初始星级  
     */
@@ -40,12 +45,12 @@ class sm_item_yanling
     public $hp;
 
     /**
-    * @var Int32 攻击 default(0) 
+    * @var Int32 【废弃2020年1月6日】攻击 default(0) 
     */
     public $atk;
 
     /**
-    * @var Int32 防御 default(0) 
+    * @var Int32 【废弃2020年1月6日】防御 default(0) 
     */
     public $def;
 
@@ -65,7 +70,7 @@ class sm_item_yanling
     public $phyDef;
 
     /**
-    * @var Int32 攻击速度 default(0) 
+    * @var Int32 【2020年1月6日】攻击速度 default(0) 
     */
     public $atkSpeed;
 

+ 6 - 1
Gameserver/Amfphp/model/Const/sm_playerlevel.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2019-10-18 14:10:17
+ // 日期: 2020-01-07 15:02:42
 ////////////////////
 
 
@@ -44,6 +44,11 @@ class sm_playerlevel
     */
     public $spar;
 
+    /**
+    * @var Int32 英雄最大等级 default(0) 
+    */
+    public $hero_max_level;
+
     /**
     * @var String 奖励宝箱ID  
     */

+ 86 - 6
Gameserver/Amfphp/model/Const/sm_subSkill.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2019-12-27 19:08:41
+ // 日期: 2020-01-16 21:37:17
 ////////////////////
 
 
@@ -29,6 +29,11 @@ class sm_subSkill
     */
     public $mainSkillId;
 
+    /**
+    * @var String 技能名称  
+    */
+    public $name;
+
     /**
     * @var Int32 子技能等级  
     */
@@ -137,11 +142,6 @@ class sm_subSkill
     */
     public $upgradeCost;
 
-    /**
-    * @var String 技能名称  
-    */
-    public $name;
-
     /**
     * @var String 技能描述  
     */
@@ -152,5 +152,85 @@ class sm_subSkill
     */
     public $icon;
 
+    /**
+    * @var Int32 初始能量值+  
+    */
+    public $nengliangzhi;
+
+    /**
+    * @var Single 移动速度± default(0) 
+    */
+    public $moveSpeed;
+
+    /**
+    * @var Single 攻击速度± default(0) 
+    */
+    public $atkSpeed;
+
+    /**
+    * @var Single 物攻± default(0) 
+    */
+    public $wuligongji;
+
+    /**
+    * @var Single 言攻± default(0) 
+    */
+    public $fashuqiangdu;
+
+    /**
+    * @var Int32 回复生命值 default(0) 
+    */
+    public $restoreHp;
+
+    /**
+    * @var Int32 回复言能 default(0) 
+    */
+    public $restoreMp;
+
+    /**
+    * @var Single 物攻伤害± default(0) 
+    */
+    public $phyatkDamage;
+
+    /**
+    * @var Single 言攻伤害± default(0) 
+    */
+    public $magatkDamage;
+
+    /**
+    * @var Single 额外物攻伤害± default(0) 
+    */
+    public $extraphyatkDamage;
+
+    /**
+    * @var Single 额外言攻伤害± default(0) 
+    */
+    public $extramagatkDamage;
+
+    /**
+    * @var Single 暴击几率± default(0) 
+    */
+    public $criticalProb;
+
+    /**
+    * @var Single 暴击伤害± default(0) 
+    */
+    public $criticalDamage;
+
+    /**
+    * @var Single 冷却时间± default(0) 
+    */
+    public $coolTime;
+
+    /**
+    * @var Single 固定伤害 default(0) 
+    */
+    public $damage;
+
+    /**
+    * @var Single 自身攻击力(物攻或言攻)百分比转换伤害 default(0) 
+    */
+    public $atkPercent;
+
 }
 

+ 10 - 18
Gameserver/Amfphp/model/User/UserGameHeroModel.php

@@ -13,8 +13,7 @@ namespace loyalsoft;
 /**
  * 玩家收集的英雄的卡牌集合
  */
-class UserGameHeroModel extends Object_ext
-{
+class UserGameHeroModel extends Object_ext {
 
     /**
      * 当前展示的英雄的UID
@@ -50,27 +49,20 @@ class UserGameHeroModel extends Object_ext
      *
      * @param CRedisUtil $mem
      */
-    public function InitializeHero()
-    {
+    public function InitializeHero() {
         $this->displayHeroUID = null;
         $this->firendSupportHeroUID = null;
         $this->maxCollectCount = glc()->Game_CollectHero_BasicMaxCount;
         $this->recordMaxUID = 0;
-
-        $this->collectHeros = ObjectInit();
-        # 设置初始英雄
-        $hids = GameConfig::primordial_data()->User_Heros;
+        $this->collectHeros = ObjectInit();                                     # 初始化英雄集合
+        $hids = GameConfig::primordial_data()->User_Heros;                      # 设置初始英雄
         foreach ($hids as $heroModelId) {
-            //1.检查是否存在这个英雄的模板
-            $heroCfg = GameConfig::hero_getItem($heroModelId);
-            if ($heroCfg) {
-                $uid = HeroProc::CreateNewGameHeroUID($this->collectHeros, $this->recordMaxUID);
-                $this->recordMaxUID = $uid;
-                $hero = HeroProc::getGameHeroModelInstance($heroCfg, $heroModelId, $uid);
-                $this->collectHeros->$uid = $hero;
-                $this->displayHeroUID = $uid;
-                $this->firendSupportHeroUID = $uid;
-            }
+            $uid = HeroProc::CreateNewGameHeroUID($this->collectHeros, $this->recordMaxUID);
+            $this->recordMaxUID = $uid;
+            $hero = HeroProc::getGameHeroModelInstance($heroModelId, $uid);
+            $this->collectHeros->$uid = $hero;
+            $this->displayHeroUID = $uid;
+            $this->firendSupportHeroUID = $uid;
         }
     }
 

+ 1 - 1
Gameserver/Amfphp/model/User/UserGameModel.php

@@ -251,7 +251,7 @@ class UserGameModel extends Object_ext {
      * @return bool 成功与否
      */
     static public function Consume_Cash($user, $amt) {
-        if ($amt > 0 && isset($user) && isset($user->cash)) {
+        if ($amt >= 0 && isset($user) && isset($user->cash)) {
             if ($user->cash - $amt >= 0) {
                 $user->cash -= $amt;
                 return true;

+ 11 - 12
Gameserver/Amfphp/process/FightProc/SweepGatesProc.php

@@ -194,10 +194,9 @@ class SweepGatesProc {
      */
     public static function Arenas_Fight($req) {
         list($gateId, $difficulty, $star, $TeamObj) = $req->paras;              # 提取参数: 挑战的关卡Id, 关卡难度(0,1,2), 几星, 队伍
-        DebugHelper::assert($gateId > 0, "关卡id非法");
+        my_Assert($gateId > 0, "关卡id非法");
         $isFirst = false;                                                       # 是否首次通关
-        self::recordFight($req, $gateId, $difficulty, $star, $isFirst);         # 更新挑战记录
-//        CLog::err($isFirst);
+        self::recordFight($req, $gateId, $difficulty, $star, $isFirst);         # 更新挑战记录 
         $smGate = GameConfig::gate_getItem($gateId);                            # 关卡配置数据
         $i = $difficulty + 1;                                                   # 按三个难度取不同的值.
 //        $tili = self::getProperty_n($smGate, "tili", $i);                     # 体力暂时未用上
@@ -206,28 +205,27 @@ class SweepGatesProc {
         $gold = self::getProperty_n($smGate, "gold", $i);
         $exp = self::getProperty_n($smGate, "exp", $i);
         $firstExp = self::getProperty_n($smGate, "first_exp", $i);
+        $firstHero = self::getProperty_n($smGate, "first_hero", $i);
         $heroExp = self::getProperty_n($smGate, "heroExp", $i);
         if ($isFirst) {                                                         # 是否首次通关切换奖励内容
             $exp = $firstExp;
             $rwdstr = $firstPassRewardStr;
+            if ($firstHero > 0) {                                               # 首次通关解锁英雄
+                HeroProc::AddHeroWithStar($req, $firstHero, 0);                 # 添加英雄
+            }
         }
-//        ActiveProc::ChangeTili(-$tili, $req);                                   # 扣减体力变化 
-//        UserGameModel::Add_Exp($req->mem, $req->userInfo->game, $tili);         # 老的增加玩家经验的去掉
-//        
+//        ActiveProc::ChangeTili(-$tili, $req);                                   # 扣减体力变化  
         foreach ($TeamObj as $heroUID) {
             if ($heroUID > 0) {
                 HeroProc::HeroAddEXP($heroUID, $heroExp);                       # 增加英雄经验 
             }
         }
 
-
-        $rewardArr = array();                                                   # 统计所获奖励物品
-        $rewardArr = array_merge($rewardArr, self::SetRewards($req, $rwdstr));  # 通关奖励
-
+        $rewardArr = array_merge($rewardArr, self::SetRewards($req, $rwdstr));  # 发通关奖励 
         UserGameModel::Add_Gold($req->userInfo->game, $gold);                   # 发金币
         UserGameModel::Add_Exp($req->userInfo->game, $exp);                     # 给玩家(指挥官)增加经验
 
-        UserProc::updateUserInfo();                                         # 回写玩家数据.
+        UserProc::updateUserInfo();                                             # 回写玩家数据.
 
         $result = array(
             'store' => $req->userInfo->game->store,
@@ -237,7 +235,8 @@ class SweepGatesProc {
             'time' => $req->userInfo->game->privateState->TiliTime,
             'gold' => $gold,
             'exp' => $exp,
-            'rewardstr' => implode(';', $rewardArr)
+            'rewardstr' => implode(';', $rewardArr),
+            'isFirst' => $isFirst,
         );
         return Resp::ok($result);
     }

+ 69 - 148
Gameserver/Amfphp/process/HeroProc.php

@@ -854,126 +854,73 @@ class HeroProc {
 
     /**
      * 6321 购买英雄 消耗碎片
-     * @param type $req
+     * @param req $req
      */
     static function BuyHeroByCostPieces($req) {
+        list($heroModelId, $costType, $costMoneyNum, $piecesId, $piecesNum) = $req->paras; # 提取参数
         $user = $req->userInfo->game;                                           # user引用
-        $heroModelId = $req->paras[0];
-        $costType = $req->paras[1];
-        $costMoneyNum = $req->paras[2];
-        $piecesId = $req->paras[3];
-        $piecesNum = $req->paras[4];
-
         $collectHeros = $user->heros->collectHeros;
-        if (!$collectHeros) {
-            $collectHeros = ObjectInit();
-        }
-        foreach ($collectHeros as $key => $value) {
-            isEditor() and $value = new UserHeroModel();
-            if ($value->typeId == $heroModelId) {                               # 检查玩家是否已经拥有此类英雄
-                Err(ErrCode::hero_existSameHero_err);
-            }
-        }
-        $heroCfg = GameConfig::hero_getItem($heroModelId);                      # 检查账户余额是否充足
-        if (!$heroCfg) {
-            Err(ErrCode::hero_const_no_err);
-        }
-        if ($heroCfg->isCanBuy == 0) {
-            Err(ErrCode::paras_err);
+        my_default_Obj($collectHeros);
+        foreach ($collectHeros as $key => $value) {                             # 检查玩家是否已经拥有此类英雄
+            my_Assert($value->typeId != $heroModelId, ErrCode::hero_existSameHero_err);
         }
+        $heroCfg = GameConfig::hero_getItem($heroModelId);                      # 英雄模板数据
+        my_Assert(null != $heroCfg, ErrCode::hero_const_no_err);
+        my_Assert($heroCfg->isCanBuy != 0, ErrCode::paras_err);                 # 是否可以直接购买
         $piecesCfg = GameConfig::segment_getItem($piecesId);                    # 检查需要消耗的碎片的常量配置是否存在
-        if (!$piecesCfg) {
-            Err(ErrCode::err_store_itemnoconst);
-        }
-        $myPacketItems = $user->store->segement;
+        my_Assert(null != $piecesCfg, ErrCode::err_store_itemnoconst);
+        $myPacketItems = $user->store->items;
         $requirePiecesNum = $piecesCfg->mergePrototypeNeedNum;
-        if ($heroModelId == $piecesCfg->prototypeData && $requirePiecesNum == $piecesNum) {
-            if (!CommUtil::isPropertyExists($myPacketItems, $piecesId)#
-                    || $myPacketItems->$piecesId < $requirePiecesNum) {         # 检查碎片道具数量是否充足
-                Err(ErrCode::hero_godblood_notengoughitem);
-            }
-        } else {
-            Err(ErrCode::paras_err, "error pieces para" . "req" . $piecesId . "_" .
-                    $requirePiecesNum . "/" . $piecesId . "_" . $piecesNum);
-        }
-        $bDeal = false;                                                         # 成交
-        if ($costType == "cash") {
-            $realPrice = $heroCfg->cashPrice;
-            if ($realPrice != $costMoneyNum) {
-                Err(ErrCode::paras_err, "costCASH error! server need:" . $realPrice);
-            }
-            if ($costMoneyNum > 0) {
-                if ($user->cash < $costMoneyNum) {
-                    Err(ErrCode::err_msg_cashnotenough);
-                } else {
-                    $bDeal = UserGameModel::Consume_Cash($user, $costMoneyNum);
-                }
-            } else if ($costMoneyNum == 0) {
-                $bDeal = true;
-            } else {
-                Err(ErrCode::paras_err);
-            }
-        } else if ($costType == "gold") {
-            $realPrice = $heroCfg->goldPrice;
-            if ($realPrice != $costMoneyNum) {
-                Err(ErrCode::paras_err, "costGold error! server need:" . $realPrice);
-            }
-            if ($costMoneyNum > 0) {
-                if ($user->gold < $costMoneyNum) {
-                    Err(ErrCode::err_msg_goldnotenough);
-                }
-                $bDeal = UserGameModel::Consume_Gold($user, $costMoneyNum);
-            } else if ($costMoneyNum == 0) {
-                $bDeal = true;
-            } else {
-                Err(ErrCode::paras_err);
-            }
-        }
-        # 4.消耗来获得英雄
-        if ($bDeal) {
-            $myPacketItems->$piecesId -= $requirePiecesNum;                     # 消耗道具
-            if ($myPacketItems->$piecesId < 0) {
-                $myPacketItems->$piecesId = 0;
-            }
-            $req->userInfo->game->store->segement = $myPacketItems;
-            UserProc::updateUserInfo();                                         # 回写数据
-            $resp = HeroProc::GetHero($req);
-            SystemProc::GetHero($req->zoneid, $user, $heroModelId);
+        my_Assert($heroModelId == $piecesCfg->prototypeData && $requirePiecesNum == $piecesNum, ErrCode::paras_err);
+        my_Assert(CommUtil::isPropertyExists($myPacketItems, $piecesId), ErrCode::hero_godblood_notengoughitem);
+        my_Assert($myPacketItems->$piecesId > $requirePiecesNum, ErrCode::hero_godblood_notengoughitem);       # 检查碎片道具数量是否充足
+
+        switch ($costType) {
+            case "cash":
+                $realPrice = $heroCfg->cashPrice;
+                my_Assert($realPrice == $costMoneyNum, ErrCode::paras_err);
+                my_Assert($costMoneyNum >= 0, ErrCode::paras_err);
+                my_Assert(UserGameModel::Consume_Cash($user, $costMoneyNum), ErrCode::err_msg_cashnotenough);
+                break;
+            case "gold":
+                $realPrice = $heroCfg->goldPrice;
+                my_Assert($realPrice == $costMoneyNum, ErrCode::paras_err);
+                my_Assert($costMoneyNum >= 0, ErrCode::paras_err);
+                my_Assert(UserGameModel::Consume_Gold($user, $costMoneyNum), ErrCode::err_msg_goldnotenough);
+                break;
+            default :
+                Err(ErrCode::paras_err, "参数错误: [costType] " . $costType);
         }
+
+        # 4.消耗来获得英雄 
+        $myPacketItems->$piecesId -= $requirePiecesNum;                         # 消耗道具 
+        $req->userInfo->game->store->items = $myPacketItems;                    # 回存背包
+        UserProc::updateUserInfo();                                             # 回写数据
+        $resp = HeroProc::GetHero($req);
+        SystemProc::GetHero($req->zoneid, $user, $heroModelId);                 # 插入系统广播消息
         return $resp;
     }
 
     /**
      * 购买玩家可以收集的英雄的数量上限
-     * @param type $req
+     * @param req $req
      * @return type
      */
     static function BuyHeroMaxCountLimt($req) {
+        list($buyNum, $costCash) = $req->paras;                                 # 提取参数: 数量, 花费钻石
         $g = glc();
         $user = $req->userInfo->game;                                           # user引用
         if (!CommUtil::isPropertyExists($user->heros, "maxCollectCount")) {
             $user->heros->maxCollectCount = $g->Game_CollectHero_BasicMaxCount;
         }
-        $buyNum = $req->paras[0];
-        $costCash = $req->paras[1];
-
         $index = ceil(($user->heros->maxCollectCount - $g->Game_CollectHero_BasicMaxCount) #
                 / $g->Game_CollectHero_OneBuyLimtNum);
         $arr = explode(",", $g->Game_CollectHero_BasicMaxPrice);
-        my_Assert($index < count($arr), "yi da shang xian");
-
+        my_Assert($index < count($arr), "已达上限");
         $realCost = $arr[$index];
-
-        if ($realCost != $costCash) {
-            Err(ErrCode::paras_err, "costCash error! server need:" . $realCost);
-        }
-        if ($costCash <= 0) {
-            Err(ErrCode::paras_err);
-        }
-        if ($user->cash < $costCash) {
-            Err(ErrCode::notenough_spar);
-        }
-        UserGameModel::Consume_Cash($user, $costCash);                          # 扣除宝石
+        my_Assert($realCost == $costCash, ErrCode::paras_err);                  # 参数错误
+        my_Assert($costCash >= 0, ErrCode::paras_err);
+        my_Assert(UserGameModel::Consume_Cash($user, $costCash), ErrCode::err_msg_goldnotenough); # 扣除宝石
         $user->heros->maxCollectCount += $buyNum;                               # 修改上限
         UserProc::updateUserInfo();
         return Resp::ok(array(
@@ -983,13 +930,13 @@ class HeroProc {
 
     /**
      * 获得英雄(测试已经OK)
-     * @param type $req
+     * @param req $req
      */
     static function GetHero($req) {
-        $heroModelId = $req->paras[0];                                          // 英雄的模板ID 
-        $heroCfg = GameConfig::hero_getItem($heroModelId);                      // 1.检查是否存在这个英雄的模板
+        $heroModelId = $req->paras[0];                                          # 英雄的模板ID 
+        $heroCfg = GameConfig::hero_getItem($heroModelId);                      # 1.检查是否存在这个英雄的模板
         my_Assert(null != $heroCfg, ErrCode::hero_const_no_err);
-        $hero = self::AddHeroTFromStore($req, $heroModelId);
+        $hero = self::AddHeroTFromStore($req, $heroModelId);                    # 创建英雄
         UserProc::updateUserInfo();
         $result = array('result' => "succeed", 'heros' => $hero);               #  4. 设置返回值
         return Resp::ok($result);
@@ -1040,67 +987,49 @@ class HeroProc {
      */
     static function AddHeroWithStar(&$req, $heromodelId, $star) {
         $user = $req->userInfo->game;
-        if (!$user) {
-            return null;
-        }
-        $heroCfg = GameConfig::hero_getItem($heromodelId);                      # 检查是否存在这个英雄的模板
-        if (!$heroCfg) {                                                        # 这里能不能附加错误信息给外面
-            return null;
-        }
+        my_Assert(null != $user, ErrCode::err_innerfault);
         $collectHeros = $user->heros->collectHeros;
         $uid = self::CreateNewGameHeroUID($collectHeros, $user->heros->recordMaxUID); # 先生成一个hero的UID
         $user->heros->recordMaxUID = $uid;
-        $hero = self::getGameHeroModelInstance($heroCfg, $heromodelId, $uid);
-        $hero->curStar = $star;                                                 # 设定star
+        $hero = self::getGameHeroModelInstance($heromodelId, $uid);
+        if ($star > 0) {
+            $hero->curStar = $star;                                               # 设定star
+        }
         $collectHeros->$uid = $hero;                                            # 回写
         $user->heros->collectHeros = $collectHeros;                             # 回写 
-        if (!CommUtil::isPropertyExists($user, "heroManual")) {
-            $user->heroManual = new HeroManualModel();
-            $user->heroManual->initInstance();
-        }
-        $manual = $user->heroManual;
-        self::tryNewManual($manual, $hero);                                     # 更新 图鉴
         return $hero;                                                           # 返回
     }
 
     /**
-     * 获得一个英雄
-     * @param type $req
-     * @param type $heromodelId
+     * 获得一个英雄(实例)
+     * @param req $req
+     * @param int $heromodelId
      * @return type
      */
     static function AddHeroTFromStore(&$req, $heromodelId) {
-        $gamedata = $req->userInfo->game;
-//        if (!CommUtil::isPropertyExists($gamedata, "heroManual")) {
-//            $gamedata->heroManual = new HeroManualModel();
-//            $gamedata->heroManual->initInstance();
-//        }
-//        $manual = $gamedata->heroManual;
-        $heroCfg = GameConfig::hero_getItem($heromodelId);                      // 1.检查是否存在这个英雄的模板
-        if (!$heroCfg) {
-            return Resp::err(ErrCode::hero_const_no_err);
-        }
-        $collectHeros = $gamedata->heros->collectHeros;                         // 2.存在的话,先生成一个UID
-        $uid = self::CreateNewGameHeroUID($collectHeros, $gamedata->heros->recordMaxUID);
-        $gamedata->heros->recordMaxUID = $uid;
-        $hero = self::getGameHeroModelInstance($heroCfg, $heromodelId, $uid);   // 3.创建英雄实例
+        $user = $req->userInfo->game;                                           # 玩家数据
+        $collectHeros = $user->heros->collectHeros;                             # 
+        my_default_Obj($collectHeros);
+        $uid = self::CreateNewGameHeroUID($collectHeros, $user->heros->recordMaxUID); # 先生成一个UID
+        $user->heros->recordMaxUID = $uid;                                      # 更新最大编号记录
+        $hero = self::getGameHeroModelInstance($heromodelId, $uid);             # 3.创建英雄实例
         $collectHeros->$uid = $hero;
-        $gamedata->heros->collectHeros = $collectHeros;
-//        self:: tryNewManual($req->mem, $manual, $hero);                         // 更新图鉴 
+        $user->heros->collectHeros = $collectHeros;
         return $hero;
     }
 
     /**
-     * 根据一个英雄的模板id,来获得一个英雄的实例数据
-     * @param \sm_hero $heroCfg 模板数据
+     * 根据一个英雄的模板id,来获得一个英雄的实例数据 
      * @param string $heroModelId 模板数据ID
      * @param string $uid 唯一ID
      * @return UserHeroModel
      */
-    static function getGameHeroModelInstance($heroCfg, $heroModelId, $uid) {
+    static function getGameHeroModelInstance($heroModelId, $uid) {
+        $heroCfg = GameConfig::hero_getItem($heroModelId);
+        my_Assert(null != $heroCfg, ErrCode::err_const_no);                     # 检查是否存在这个英雄的模板
         $hero = new UserHeroModel();
 //        $hero->strengthLevel = $heroCfg->dengjie;
-//        $hero->curStar = $heroCfg->xingji;
+        $hero->curStar = $heroCfg->xingji;
         $hero->typeId = $heroCfg->heroId;
         $hero->uid = $uid;
         $hero->xp = 0;
@@ -1110,7 +1039,7 @@ class HeroProc {
         //  取可用武器中第一个初始化 -- 策划要求初始英雄要带有武器 -- 王刚 2020年1月
         $wp = null;
         foreach (GameConfig::item_weapon() as $id => $mo) {
-            isEditor() and $mo = new \sm_item_weapon();
+//            isEditor() and $mo = new \sm_item_weapon();
             if ($mo->hero_id == $hero->typeId) {
                 $wp = $mo;
                 break;
@@ -1133,21 +1062,13 @@ class HeroProc {
      */
     static function CreateNewGameHeroUID($collectHeros, $oldMaxUID) {
         $maxID = 10000;
-        if ($collectHeros == null) {
-            $collectHeros = ObjectInit();
-        }
-
+        my_default_Obj($collectHeros);
         foreach ($collectHeros as $itemId => $hero) {
             if ($itemId > $maxID) {
                 $maxID = $itemId;
             }
         }
-        $max = $maxID;
-        if ($oldMaxUID < $maxID) {
-            $max = $maxID;
-        } else {
-            $max = $oldMaxUID;
-        }
+        $max = max($maxID, $oldMaxUID);
         return $max + 1;
     }