|
@@ -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 解锁英雄
|