mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 10:16:14 +00:00
修复PVP 切换地图重置数据
This commit is contained in:
@@ -29,10 +29,8 @@ import org.springframework.retry.annotation.Retryable;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(value = "JNGameDemo - API", tags = {"无尽模式 - API"})
|
||||
@RestController
|
||||
@@ -89,6 +87,8 @@ public class GOnHookController {
|
||||
ModeOnHook data = this.getInfo(player).data;
|
||||
data.setOnHookMap(mapId);
|
||||
modeOnHookService.saveOrUpdate(data);
|
||||
//切换地图 清理历史野怪
|
||||
CREEPS.put(player.getPlayerId(),new HashMap<>());
|
||||
return NewsContext.onSuccess("成功",data);
|
||||
}
|
||||
|
||||
@@ -112,8 +112,10 @@ public class GOnHookController {
|
||||
//获取可生成的最大数量
|
||||
int max = Integer.parseInt(TD.DATA.getTbGOnHookGlobal().get(GlobalId.MODE_ON_HOOK_SPAWN_NUM).args);
|
||||
|
||||
//获取配置表全部宠物
|
||||
ArrayList<TbGRole> tdPets = TD.DATA.getTbGRole().getDataList();
|
||||
//获取玩家所在当前地图可生成的宠物
|
||||
ModeOnHook info = this.getInfo(player).data;
|
||||
TbGOnHookMaps mapInfo = TD.DATA.getTbGOnHookMaps().get(info.getOnHookMap());
|
||||
List<TbGRole> tdPets = Arrays.stream(mapInfo.petIds).mapToObj(petId -> TD.DATA.getTbGRole().get(petId)).collect(Collectors.toList());
|
||||
|
||||
//如果小于最大数量则生成
|
||||
while (creeps.size() < max){
|
||||
|
@@ -6,9 +6,9 @@ option java_package = "cn.jisol.ngame.proto";
|
||||
//PVP 开始
|
||||
message GPVPStart {
|
||||
string leftTactical = 1; //左边的布阵
|
||||
map<int64, string> leftPets = 2; //左边的宠物 key:宠物Id value 宠物配置Id
|
||||
map<int64, string> leftPets = 2; //左边的宠物 key:宠物Id value PlayerPet JSON
|
||||
string rightTactical = 3; //右边的布阵
|
||||
map<int64, string> rightPets = 4; //右边的宠物 key:宠物Id value 宠物配置Id
|
||||
map<int64, string> rightPets = 4; //右边的宠物 key:宠物Id value PlayerPet JSON
|
||||
int64 leftPlayerId = 5; //左边的玩家Id
|
||||
int64 rightPlayerId = 6; //右边的玩家Id
|
||||
}
|
||||
@@ -22,6 +22,4 @@ message GPVPText {
|
||||
message GPVPRefereeInfo{
|
||||
//获胜玩家Id
|
||||
int64 winnerId = 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -18,7 +18,6 @@
|
||||
"mapImage": "ui/map/魔法镇_图片/spriteFrame",
|
||||
"mapId": 60002,
|
||||
"petIds": [
|
||||
10003,
|
||||
10004
|
||||
],
|
||||
"sign": "",
|
||||
|
Reference in New Issue
Block a user