Przeglądaj źródła

创建账号的时候初始化所有的英雄

cyzhao 1 rok temu
rodzic
commit
3492a3203a

+ 41 - 4
Gameserver/App/base/CmdCode.php

@@ -121,11 +121,9 @@ class CmdCode {
      * 领取成就奖励
      */
     const cmd_task_getAchieveReward = 6203;
+     // </editor-fold>
+    //     
     
-    // <editor-fold defaultstate="collapsed" desc="邮件操作码 - 63xx">
-
-    const cmd_email_questEmailList = 6301;
-    // </editor-fold>
     // <editor-fold defaultstate="collapsed" desc="背包操作码 - 64xx">
 
     const cmd_store_put = 6401;
@@ -215,6 +213,45 @@ class CmdCode {
     
     //
 // </editor-fold>
+ 
+    // <editor-fold defaultstate="collapsed" desc="邮件操作码 - 67xx">
+
+    const cmd_email_questEmailList = 6701;
+    
+    /**
+     * [6702]读取/打开一封邮件
+     */
+    const cmd_email_readAEmail = 6702;
+
+    /**
+     * [6703] 邮件 - 领取附件
+     */
+    const cmd_email_DrawReward = 6703;
+
+    /**
+     * [6704] 邮件 - 领取全部附件奖励
+     */
+    const cmd_email_DrawAllRewards = 6704;
+
+    /**
+     * [6705] 删除邮件——所有已读(不包含已读未领取状态的邮件)
+     */
+    const cmd_mail_delMailReaded = 6705;
+
+    /**
+     * [6706] 请求邮件未处理的数量(未打开邮件时检查邮件图标应该提示啥)
+     */
+    const cmd_mail_notReadMailNum = 6706;
+
+    /**
+     * [6707] 发送测试用道具
+     */
+    const cmd_mail_sendTestItems = 6707;
+    // </editor-fold>
+    //
+    
+    
+    
     // <editor-fold defaultstate="collapsed" desc="战斗操作码 - 68xx">
 
     const cmd_fight_settle = 6801;

+ 29 - 10
Gameserver/App/model/User/Info_Heros.php

@@ -27,16 +27,35 @@ class Info_Heros extends Object_ext {
     public $Dic = null;
 
     public function initialize() {
-        $curHeroId = 1; //临时
-        $this->CurrentHeroId = $curHeroId;
-        $this->Dic = new \stdClass();
-        $insHero = new Ins_Hero();
-        $insHero->Id = $curHeroId;
-        $this->Dic->$curHeroId = $insHero;
-        $id2 = 2;
-        $ins2 = new Ins_Hero();
-        $ins2->Id = 2;
-        $this->Dic->$id2 = $ins2;
+        $heroConf = GameConfig::hero();
+        
+        foreach ($heroConf as $heroId => $mo) {
+            if(!StlUtil::dictHasProperty($this->Dic, $heroId) ){
+                $insHero = new Ins_Hero();
+                $insHero->Id = $heroId;
+                $insHero->isUnlock = 0;
+                if($heroId == 1 && $heroId == 2){
+                    $insHero->isUnlock = 1;
+                }
+                
+                $this->Dic->$heroId = $insHero;
+            }
+            
+        }
+        
+        if($this->CurrentHeroId == 0){
+            $this->CurrentHeroId = 1;
+        }
+//        $curHeroId = 1; //临时
+//        $this->CurrentHeroId = $curHeroId;
+//        $this->Dic = new \stdClass();
+//        $insHero = new Ins_Hero();
+//        $insHero->Id = $curHeroId;
+//        $this->Dic->$curHeroId = $insHero;
+//        $id2 = 2;
+//        $ins2 = new Ins_Hero();
+//        $ins2->Id = 2;
+//        $this->Dic->$id2 = $ins2;
     }
 
     public function __construct($arg = null) {