|
@@ -23,10 +23,91 @@ class MapProc {
|
|
|
return self::UpdateExplorationProgress();
|
|
|
case CmdCode::map_UnlockMap: # [7504] 解锁据点
|
|
|
return self::UnlockMap();
|
|
|
+// case CmdCode::map_getUnlockInfoList: # [7505] 获取mapid下已经解锁的列表
|
|
|
+// return self::getUnlockInfoList();
|
|
|
+ case CmdCode::map_unlockInfoSva: # [7505] 保存mapid下已经解锁的
|
|
|
+ return self::unlockInfoSva();
|
|
|
+ case CmdCode::map_reviceExplorerReward: # [7506] 领取探索奖励
|
|
|
+ return self::reviceExplorerReward();
|
|
|
default: # err: 未知的命令码
|
|
|
return Resp::err(ErrCode::cmd_err);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @return Resp
|
|
|
+ */
|
|
|
+ public static function reviceExplorerReward(){
|
|
|
+ $mapid = req()->paras[0]; # 提取参数
|
|
|
+ $newMap = req()->userInfo->game->newMap();
|
|
|
+
|
|
|
+ $newMap->unlockedFootholds->$mapid->exploreRewardGeted = true;
|
|
|
+
|
|
|
+ StoreProc::AddMultiItemInStore(GameConfig::map_scene_getItem($mapid)->exploreReward);
|
|
|
+ req()->userInfo->game->newMap = $newMap;
|
|
|
+
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok($newMap);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 7505
|
|
|
+ * @return Resp
|
|
|
+ */
|
|
|
+ public static function unlockInfoSva() {
|
|
|
+ $unlockStr = req()->paras[0]; # 提取参数
|
|
|
+ $newMap = req()->userInfo->game->newMap();
|
|
|
+ if(!StlUtil::dictHasProperty($newMap, 'unlockMapTypeList')){
|
|
|
+ $newMap->unlockMapTypeList = new \stdClass();
|
|
|
+ }
|
|
|
+
|
|
|
+ $mapid = explode('_', $unlockStr)[0];
|
|
|
+ if(!StlUtil::dictHasProperty($newMap->unlockMapTypeList,$mapid)){
|
|
|
+ $newMap->unlockMapTypeList->$mapid = array();
|
|
|
+ }
|
|
|
+ $newMap->unlockMapTypeList->$mapid[]= $unlockStr;
|
|
|
+
|
|
|
+ $explorerNum = self::countFootHoldExplorerNum($mapid, $newMap);
|
|
|
+ $newMap->unlockedFootholds->$mapid->curExploreProgress = $explorerNum;
|
|
|
+
|
|
|
+ $type = explode('_', $unlockStr)[1];
|
|
|
+ if($type == 6 && $newMap->unlockedFootholds->$mapid->transmissionIsOk == false){//临时代码,6代表传送带
|
|
|
+ $newMap->unlockedFootholds->$mapid->transmissionIsOk = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ req()->userInfo->game->newMap = $newMap;
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok($newMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 计算探索度值
|
|
|
+ */
|
|
|
+ public static function countFootHoldExplorerNum($mapid,$newMap) {
|
|
|
+ $explorer = 0;
|
|
|
+ if (StlUtil::dictHasProperty($newMap->unlockMapTypeList,$mapid))
|
|
|
+ {
|
|
|
+ $list = $newMap->unlockMapTypeList->$mapId;
|
|
|
+ $mapList = GameConfig::map_explorer_getItemArray($mapid);
|
|
|
+ if ($mapList != null)
|
|
|
+ {
|
|
|
+ foreach ($map as $item) {
|
|
|
+ $cmd = $item->cmd;
|
|
|
+ $parasList = explode(',', $item->paras);
|
|
|
+ foreach ($list as $para){
|
|
|
+ $strList = explode('_', $para);
|
|
|
+ if ($strList[1] == $cmd && $strList[2] == $parasList[0])
|
|
|
+ {
|
|
|
+ $explorer += $parasList[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return intval($explorer/100);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 7504 解锁据点
|