cyzhao преди 1 година
родител
ревизия
c9a74240cc

Файловите разлики са ограничени, защото са твърде много
+ 427 - 0
DevOps/flscfg/sqlback/jzhj2023_cfg20231013155441.sql


+ 6 - 0
Gameserver/App/base/CmdCode.php

@@ -190,6 +190,12 @@ class CmdCode {
      * 解锁英雄
      */
     const hero_unlock = 6602;
+    
+    /**
+     * 购买角色
+     */
+    const hero_buy = 6603;
+    
     //
 // </editor-fold>
     // <editor-fold defaultstate="collapsed" desc="战斗操作码 - 68xx">

+ 17 - 0
Gameserver/App/model/User/Enum_AchieveType.php

@@ -0,0 +1,17 @@
+<?php
+namespace loyalsoft;
+/*
+ * 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 Enum_AchieveType
+ *
+ * @author c'y'zhao
+ */
+class Enum_AchieveType extends Enum {
+    const equiplevel_one = 101;       //单件装备等级达到X级               101 
+    const accumulateCostCash = 102;  //
+}

+ 0 - 9
Gameserver/App/model/User/Enum_TaskCmdType.php

@@ -23,13 +23,4 @@ const DailyShopBuyNum = 104; //每日商店购买物品1次          103 每日
 //任意充值1次                  109 任意充值1次  num 1
 //参与每日挑战1次              110  参与每日挑战1次 num 1
     
-}
-
-class Enum_AchieveType extends Enum { 
-
-
-const equiplevel_one = 101;       //单件装备等级达到X级               101 
-const accumulateCostCash = 102;  //
-
-    
 }

+ 2 - 2
Gameserver/App/model/User/Ins_Achieve.php

@@ -13,7 +13,7 @@ namespace loyalsoft;
  *
  * @author c'y'zhao
  */
-class Ins_Achieve {   
+class Ins_Achieve extends Object_ext{   
     
     public $typeId = 0;
     
@@ -41,7 +41,7 @@ class Ins_Achieve {
      */
     public $cmd = 0;
     
-    public function __construct($args) {
+    public function __construct($args = null) {
         if ($args != null) {
            parent::__construct($args); 
         } 

+ 14 - 1
Gameserver/App/model/User/Ins_Hero.php

@@ -20,7 +20,20 @@ class Ins_Hero extends Object_ext {
      * @var type
      */
     public $Id = 0;
-     
+    
+    /**
+     * 角色未解锁 0 角色已经解锁 1:
+     * @var int
+     */
+    public $isUnlock = 1;
+    
+    /**
+     * 通关的关卡记录
+     * @var type
+     */
+    public $passGates = array();
+
+
     public function __construct($arg = null) {
         if($arg == null){         
         } else {

+ 15 - 0
Gameserver/App/process/HeroProc.php

@@ -26,10 +26,25 @@ class HeroProc {
                 return HeroProc::SwithHero();
             case CmdCode::hero_unlock:                                          # 6602 解锁英雄
                 return self::UnlockHero();
+            case CmdCode::hero_buy:
+                return self::BuyHero();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
+    
+    /**
+     * 购买角色
+     * @return type
+     */
+    private static function BuyHero(){
+        list($heroId) = req()->paras;                                        # 切换英雄id
+        my_Assert(GameConfig::hero_getItem($heroId) != null, "找不到英雄配置数据!");
+       
+        ctx()->heros->Dic->$heroId->isUnlock = 1;
+
+        return Resp::ok();
+    }
 
     /**
      * 6602 解锁英雄

+ 1 - 0
Gameserver/App/process/UserProc.php

@@ -267,6 +267,7 @@ class UserProc {
         ShopProc::DailyShopItemRand();
         ShopProc::ShopDailyClear();
         //FightProc::FightDailyClear();
+        TaskProc::initAchieveData();
     }
 
 // <editor-fold defaultstate="collapsed" desc="创建新用户">

Някои файлове не бяха показани, защото твърде много файлове са промени