diff --git a/DataTables/Datas/副本系统/副本表.xlsx b/DataTables/Datas/副本系统/副本表.xlsx index 9dc13354..1b944757 100644 Binary files a/DataTables/Datas/副本系统/副本表.xlsx and b/DataTables/Datas/副本系统/副本表.xlsx differ diff --git a/DataTables/Datas/宠物系统/宠物升级/角色升级属性成长.xlsx b/DataTables/Datas/宠物系统/宠物升级/角色升星属性成长.xlsx similarity index 100% rename from DataTables/Datas/宠物系统/宠物升级/角色升级属性成长.xlsx rename to DataTables/Datas/宠物系统/宠物升级/角色升星属性成长.xlsx diff --git a/DataTables/Datas/宠物系统/宠物升级/角色升级消耗表.xlsx b/DataTables/Datas/宠物系统/宠物升级/角色升级消耗表( 抛弃 ).xlsx similarity index 100% rename from DataTables/Datas/宠物系统/宠物升级/角色升级消耗表.xlsx rename to DataTables/Datas/宠物系统/宠物升级/角色升级消耗表( 抛弃 ).xlsx diff --git a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab index 5352eb1f..4bdf9de6 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab @@ -8180,7 +8180,7 @@ "b": 255, "a": 255 }, - "_string": "宠物", + "_string": "副本", "_horizontalAlign": 1, "_verticalAlign": 1, "_actualFontSize": 24, diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index 0d0af841..5b024b25 100644 --- a/JisolGameCocos/assets/script/App.ts +++ b/JisolGameCocos/assets/script/App.ts @@ -32,8 +32,8 @@ import { Component } from "cc"; // let WsPath = `ws://localhost:8080/websocket` // let APIPath = `http://192.168.1.23:8080` // let WsPath = `ws://192.168.1.23:8080/websocket` -let APIPath = `http://192.168.0.119:8080` -let WsPath = `ws://192.168.0.119:8080/websocket` +let APIPath = `http://192.168.0.118:8080` +let WsPath = `ws://192.168.0.118:8080/websocket` // let APIPath = `https://api.pet.jisol.cn` // let WsPath = `wss://api.pet.jisol.cn/websocket` diff --git a/JisolGameCocos/assets/script/AppData.ts b/JisolGameCocos/assets/script/AppData.ts index 5576283c..3672b84c 100644 --- a/JisolGameCocos/assets/script/AppData.ts +++ b/JisolGameCocos/assets/script/AppData.ts @@ -17,12 +17,12 @@ export class AppData extends SystemBase{ loadings:BaseData[] = [ PlayerData.getIns(), //玩家信息 + PetEquipData.getIns(), //宠物装备数据类 PlayerPetData.getIns(), //玩家宠物信息 ChatData.getIns(), //聊天 PlayerTacticalData.getIns(), //阵法 ResourceData.getIns(), //玩家资源 GOnHookData.getIns(), //无限模式信息类 (无限模式是游戏基础模式玩法 需要默认信息) - PetEquipData.getIns(), //宠物装备数据类 GBattleData.getIns(), //战斗数据(永远最后) ]; diff --git a/JisolGameCocos/assets/script/data/PlayerPetData.ts b/JisolGameCocos/assets/script/data/PlayerPetData.ts index fee31b0d..79bec062 100644 --- a/JisolGameCocos/assets/script/data/PlayerPetData.ts +++ b/JisolGameCocos/assets/script/data/PlayerPetData.ts @@ -3,6 +3,7 @@ import { API, PlayerInfoOV, PlayerPetOV } from "../consts/API"; import BaseData from "./BaseData"; import { GBattleDataEnum } from "./GBattleData"; import GOnHookData from "./GOnHookData"; +import PetEquipData, { PetEquipDataEnum } from "./PetEquipData"; import PlayerTacticalData from "./PlayerTacticalData"; import { ResourceUpdateType } from "./ResourceData"; @@ -23,6 +24,16 @@ export default class PlayerPetData extends BaseData{ //更新玩家宠物 await this.UpdatePlayerPet(); + + app.event.on(PetEquipDataEnum.UPDATE_FORGING_INFO,this.onUpdateForgingInfo,this); + + } + + //更新锻造等级 (宠物等级) + onUpdateForgingInfo(){ + + this.datas.forEach(item => item.petLevel = PetEquipData.getIns().getForgingBenchPetLevel(item.petId)); + app.event.emit(PlayerPetEvent.UPDATE) } @@ -49,7 +60,10 @@ export default class PlayerPetData extends BaseData{ //更新玩家宠物 async UpdatePlayerPet(){ //获取全部宠物 - this.datas = await API.GetPlayerPets(); + let datas = await API.GetPlayerPets(); + + datas.forEach(item => item.petLevel = PetEquipData.getIns().getForgingBenchPetLevel(item.petId)); + this.datas = datas; app.event.emit(GBattleDataEnum.UPDARE_ATTRIBUTE); //刷新属性 } @@ -68,12 +82,15 @@ export default class PlayerPetData extends BaseData{ //添加宠物 addPet(pet:PlayerPetOV){ + pet.petLevel = PetEquipData.getIns().getForgingBenchPetLevel(pet.petId); this.datas.push(pet); } //刷新返回宠物 onUpdateOV(operation:number,resource:PlayerPetOV){ + resource.petLevel = PetEquipData.getIns().getForgingBenchPetLevel(resource.petId); + //如果没有刷新的宠物 则 返回 if(!resource) return; diff --git a/JisolGameCocos/assets/script/ui/Consts/Pet/PetIcon.ts b/JisolGameCocos/assets/script/ui/Consts/Pet/PetIcon.ts index 1eceeb5e..7ab6d552 100644 --- a/JisolGameCocos/assets/script/ui/Consts/Pet/PetIcon.ts +++ b/JisolGameCocos/assets/script/ui/Consts/Pet/PetIcon.ts @@ -60,7 +60,8 @@ export class PetIcon extends Component { } //设置宠物等级 - this.levelLabel.string = `Lv ${PetEquipData.getIns().getForgingBenchPetLevel(this.info.petId)}` + // this.levelLabel.string = `Lv ${PetEquipData.getIns().getForgingBenchPetLevel(this.info.petId)}` + this.levelLabel.string = `Lv ${this.info.petLevel}` } diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GNoviceController.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GNoviceController.java index 33e108fd..cf2ba5d6 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GNoviceController.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GNoviceController.java @@ -51,7 +51,7 @@ public class GNoviceController { return NewsContext.onFail("你已经有宠物了!"); }else{ //选择宠物 - if (playerPetService.save(PlayerPet.builder().petPlayerId(player.getPlayerId()).petTbId(petId).petLevel(0).build())){ + if (playerPetService.save(PlayerPet.builder().petPlayerId(player.getPlayerId()).petTbId(petId).build())){ return NewsContext.onSuccess("选择宠物成功"); }else{ return NewsContext.onSuccess("选择宠物失败"); diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GPlayerPetController.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GPlayerPetController.java index 4b94bd12..ef043f5e 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GPlayerPetController.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GPlayerPetController.java @@ -124,40 +124,40 @@ public class GPlayerPetController { } - //提升宠物等级 - @ApiImplicitParams({}) - @ApiOperation(value = "提升宠物等级") - @PostMapping("/up/level/{petId}") - @Transactional - public NewsResource onUpLevel(@PathVariable Integer petId, @CurrentPlayer Player player){ - - - //获取需要升级的宠物 - PlayerPet pet = playerPetService.getById(petId); - if(Objects.isNull(pet) || !Objects.equals(pet.getPetPlayerId(), player.getPlayerId())){ - return NewsResource.onFail("你未拥有这个宠物"); - } - - TbGRoleUpLevel resource = TD.DATA.getTbGRoleUpLevel().get(pet.getPetLevel() + 1); - - if(Objects.isNull(resource)) return NewsResource.onFail("无法升级"); - - //星级不够则 无法升级 - if(pet.getPetStar() * 10 <= pet.getPetLevel()){ - return NewsResource.onFail("突破星级 可升级"); - } - //扣除玩家材料 - ArrayList resources = new ArrayList<>(resourceService.deduct(player, resource.materials)); - - //升级 - pet.setPetLevel(pet.getPetLevel() + 1); - - //保存 - if(!playerPetService.updateById(pet)) throw new RetryException(""); - resources.add(ResourceUpdateOV.onPet(ResourceUpdateOV.ResourceUpdateType.UPDATE,pet)); //刷新宠物 - - return NewsResource.onSuccess("升级成功",pet,resources.toArray(new ResourceUpdateOV[0])); - - } +// //提升宠物等级 +// @ApiImplicitParams({}) +// @ApiOperation(value = "提升宠物等级") +// @PostMapping("/up/level/{petId}") +// @Transactional +// public NewsResource onUpLevel(@PathVariable Integer petId, @CurrentPlayer Player player){ +// +// +// //获取需要升级的宠物 +// PlayerPet pet = playerPetService.getById(petId); +// if(Objects.isNull(pet) || !Objects.equals(pet.getPetPlayerId(), player.getPlayerId())){ +// return NewsResource.onFail("你未拥有这个宠物"); +// } +// +// TbGRoleUpLevel resource = TD.DATA.getTbGRoleUpLevel().get(pet.getPetLevel() + 1); +// +// if(Objects.isNull(resource)) return NewsResource.onFail("无法升级"); +// +// //星级不够则 无法升级 +// if(pet.getPetStar() * 10 <= pet.getPetLevel()){ +// return NewsResource.onFail("突破星级 可升级"); +// } +// //扣除玩家材料 +// ArrayList resources = new ArrayList<>(resourceService.deduct(player, resource.materials)); +// +// //升级 +// pet.setPetLevel(pet.getPetLevel() + 1); +// +// //保存 +// if(!playerPetService.updateById(pet)) throw new RetryException(""); +// resources.add(ResourceUpdateOV.onPet(ResourceUpdateOV.ResourceUpdateType.UPDATE,pet)); //刷新宠物 +// +// return NewsResource.onSuccess("升级成功",pet,resources.toArray(new ResourceUpdateOV[0])); +// +// } } diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java index 6780fef5..27e0b780 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java @@ -247,7 +247,7 @@ public class GOnHookController { } //捕捉 - PlayerPet pet = PlayerPet.builder().petPlayerId(player.getPlayerId()).petTbId(onHookPet.getPetTbId()).petLevel(0).build(); + PlayerPet pet = PlayerPet.builder().petPlayerId(player.getPlayerId()).petTbId(onHookPet.getPetTbId()).build(); if(playerPetService.save(pet)){ return NewsContext.onSuccess("捕捉成功",pet); }else{ diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/table/PlayerPet.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/table/PlayerPet.java index d91df6b0..98b3cbef 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/table/PlayerPet.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/table/PlayerPet.java @@ -18,7 +18,6 @@ public class PlayerPet { private Long petId; //宠物唯一Id private Long petPlayerId; //宠物的玩家Id private Integer petTbId; //宠物配置表Id - private Integer petLevel; //宠物等级 private Integer petStar; //宠物星级 private Integer petStarExp; //宠物星级经验 @Version diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/service/impl/ResourceServiceImpl.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/service/impl/ResourceServiceImpl.java index 4d13d5a8..57f7be3b 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/service/impl/ResourceServiceImpl.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/service/impl/ResourceServiceImpl.java @@ -16,6 +16,7 @@ import cn.jisol.ngame.util.spring.SpringBeanUtils; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.retry.RetryException; import org.springframework.stereotype.Service; import java.lang.reflect.Array; @@ -64,7 +65,7 @@ public class ResourceServiceImpl extends ServiceImpl i try{ res = this.initResource(playerId,type,value); }catch (Exception e){ - return this.addResourceValue(playerId,type,value); + throw new RetryException("服务器忙碌啦"); } }else{ throw new ResourceNotException("资源不够"); diff --git a/JisolGameServer/Main/src/main/resources/application.yml b/JisolGameServer/Main/src/main/resources/application.yml index 26fc9772..c9a856f9 100644 --- a/JisolGameServer/Main/src/main/resources/application.yml +++ b/JisolGameServer/Main/src/main/resources/application.yml @@ -4,8 +4,8 @@ spring: datasource: username: pet_jisol_cn password: sThsBwjfDcaw2wJR -# url: jdbc:mysql://kyu.jisol.cn:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&allowMultiQueries=true - url: jdbc:mysql://localhost:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&allowMultiQueries=true + url: jdbc:mysql://kyu.jisol.cn:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&allowMultiQueries=true +# url: jdbc:mysql://localhost:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&allowMultiQueries=true driver-class-name: com.mysql.cj.jdbc.Driver jackson: serialization: