mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
修复bug
This commit is contained in:
parent
fbb8c862e9
commit
c46230a22c
@ -28,14 +28,14 @@ import AppAction from "./AppAction";
|
|||||||
import { Asset } from "cc";
|
import { Asset } from "cc";
|
||||||
import { Component } from "cc";
|
import { Component } from "cc";
|
||||||
|
|
||||||
// let APIPath = `http://localhost:8080`
|
let APIPath = `http://localhost:8080`
|
||||||
// let WsPath = `ws://localhost:8080/websocket`
|
let WsPath = `ws://localhost:8080/websocket`
|
||||||
// let APIPath = `http://192.168.1.23:8080`
|
// let APIPath = `http://192.168.1.23:8080`
|
||||||
// let WsPath = `ws://192.168.1.23:8080/websocket`
|
// let WsPath = `ws://192.168.1.23:8080/websocket`
|
||||||
// let APIPath = `http://192.168.0.116:8080`
|
// let APIPath = `http://192.168.0.116:8080`
|
||||||
// let WsPath = `ws://192.168.0.116:8080/websocket`
|
// let WsPath = `ws://192.168.0.116:8080/websocket`
|
||||||
let APIPath = `https://api.pet.jisol.cn`
|
// let APIPath = `https://api.pet.jisol.cn`
|
||||||
let WsPath = `wss://api.pet.jisol.cn/websocket`
|
// let WsPath = `wss://api.pet.jisol.cn/websocket`
|
||||||
|
|
||||||
//重写UI
|
//重写UI
|
||||||
class JNGLayer extends JNLayer{
|
class JNGLayer extends JNLayer{
|
||||||
|
@ -63,9 +63,6 @@ export default class GBattleModeManager extends Singleton {
|
|||||||
//默认模式
|
//默认模式
|
||||||
default:BattleMode = BattleMode.OnHook; //默认无限模式
|
default:BattleMode = BattleMode.OnHook; //默认无限模式
|
||||||
|
|
||||||
//当前帧不切换模式
|
|
||||||
frameNoSwitch:boolean = false;
|
|
||||||
|
|
||||||
//模式数据
|
//模式数据
|
||||||
data:any;
|
data:any;
|
||||||
|
|
||||||
@ -97,10 +94,6 @@ export default class GBattleModeManager extends Singleton {
|
|||||||
// res 资源加载列表 (因为是帧同步所以打开模式前必须提前加载可能使用的资源)
|
// res 资源加载列表 (因为是帧同步所以打开模式前必须提前加载可能使用的资源)
|
||||||
async Open(mode:BattleMode = null,isAuto:boolean = false,data:any = this.data){
|
async Open(mode:BattleMode = null,isAuto:boolean = false,data:any = this.data){
|
||||||
|
|
||||||
this.Close();
|
|
||||||
|
|
||||||
this.data = data;
|
|
||||||
|
|
||||||
if(!this.current && mode == null){
|
if(!this.current && mode == null){
|
||||||
//裁决员不允许默认模式
|
//裁决员不允许默认模式
|
||||||
if(EnvCurrent == Env.Server) return;
|
if(EnvCurrent == Env.Server) return;
|
||||||
@ -109,7 +102,11 @@ export default class GBattleModeManager extends Singleton {
|
|||||||
}else if(mode == null){
|
}else if(mode == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.current = mode;
|
this.current = mode;
|
||||||
|
this.Close();
|
||||||
|
this.current = mode;
|
||||||
|
this.data = data;
|
||||||
this.setAuto(isAuto);
|
this.setAuto(isAuto);
|
||||||
|
|
||||||
//加载资源
|
//加载资源
|
||||||
@ -120,18 +117,16 @@ export default class GBattleModeManager extends Singleton {
|
|||||||
await BattleResource.loadResource(mode,data);
|
await BattleResource.loadResource(mode,data);
|
||||||
console.log("[GBattleModeManager] 加载结束",loadingIndex,this.loadingIndex);
|
console.log("[GBattleModeManager] 加载结束",loadingIndex,this.loadingIndex);
|
||||||
if(this.loadingIndex == loadingIndex){
|
if(this.loadingIndex == loadingIndex){
|
||||||
|
//资源加载完成则显示世界
|
||||||
|
app.sync.onReset();
|
||||||
this.isLoadingResource = false;
|
this.isLoadingResource = false;
|
||||||
app.event.emit(GBattleModeEvent.EndLoadingResource);
|
app.event.emit(GBattleModeEvent.EndLoadingResource);
|
||||||
|
app.sync.onStart();
|
||||||
}else{
|
}else{
|
||||||
//如果加载中途切换了模式则直接返回
|
//如果加载中途切换了模式则直接返回
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//资源加载完成则显示世界
|
|
||||||
app.sync.onReset();
|
|
||||||
game.step();
|
|
||||||
app.sync.onStart();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//重置当前模式
|
//重置当前模式
|
||||||
@ -147,7 +142,6 @@ export default class GBattleModeManager extends Singleton {
|
|||||||
app.sync.onReset();
|
app.sync.onReset();
|
||||||
let current = this.current;
|
let current = this.current;
|
||||||
this.current = null;
|
this.current = null;
|
||||||
this.frameNoSwitch = true;
|
|
||||||
|
|
||||||
//结束通知
|
//结束通知
|
||||||
app.event.emit(GBattleModeEvent.Close,current,data);
|
app.event.emit(GBattleModeEvent.Close,current,data);
|
||||||
@ -195,10 +189,9 @@ export default class GBattleModeManager extends Singleton {
|
|||||||
this.onAutoFrame(dt);
|
this.onAutoFrame(dt);
|
||||||
|
|
||||||
//如果当前模式是空则默认模式
|
//如果当前模式是空则默认模式
|
||||||
if(this.current == null && !this.frameNoSwitch){
|
if(this.current == null){
|
||||||
this.Open();
|
this.Open();
|
||||||
}
|
}
|
||||||
this.frameNoSwitch = false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ export const GAPI = {
|
|||||||
//切换游戏
|
//切换游戏
|
||||||
GOnHookSetMap : async (mapId) => RData(await app.api.post(`/game/mode/onHook/setMapId/${mapId}`)) as ModeOnHookOV,
|
GOnHookSetMap : async (mapId) => RData(await app.api.post(`/game/mode/onHook/setMapId/${mapId}`)) as ModeOnHookOV,
|
||||||
//生成野怪
|
//生成野怪
|
||||||
GOnHookSpawnCreeps : async () => RProto(await app.api.get(`/game/mode/onHook/onSpawnCreeps`,{responseType:'arraybuffer'}),GActionType.GOnHookPets) as GOnHookPets,
|
GOnHookSpawnCreeps : async () => RProto(await app.api.get(`/game/mode/onHook/onSpawnCreeps`,{responseType:'arraybuffer'},true),GActionType.GOnHookPets) as GOnHookPets,
|
||||||
//捕捉野怪
|
//捕捉野怪
|
||||||
GOnHookCatchCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onCatchCreeps/${creepId}`)) as PlayerPetOV,
|
GOnHookCatchCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onCatchCreeps/${creepId}`)) as PlayerPetOV,
|
||||||
//出售野怪
|
//出售野怪
|
||||||
|
@ -22,6 +22,8 @@ export enum GOnHookManagerEvent{
|
|||||||
//游戏模式 OnHook 管理器
|
//游戏模式 OnHook 管理器
|
||||||
export default class GOnHookManager extends Singleton{
|
export default class GOnHookManager extends Singleton{
|
||||||
|
|
||||||
|
isSpawn:boolean = false;
|
||||||
|
|
||||||
//野怪列表
|
//野怪列表
|
||||||
_sreeps:Map<string,GOnHookPet> = new Map();
|
_sreeps:Map<string,GOnHookPet> = new Map();
|
||||||
get sreeps(){
|
get sreeps(){
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 34f12bac5650f7782074cd6b369f77fa3e814641
|
Subproject commit e05dfeef697c7c803221b2d8b2fc721b73fca7d3
|
@ -4,8 +4,8 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
username: pet_jisol_cn
|
username: pet_jisol_cn
|
||||||
password: sThsBwjfDcaw2wJR
|
password: sThsBwjfDcaw2wJR
|
||||||
# url: jdbc:mysql://kyu.jisol.cn:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
|
url: jdbc:mysql://kyu.jisol.cn:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
|
||||||
url: jdbc:mysql://localhost:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://localhost:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
jackson:
|
jackson:
|
||||||
serialization:
|
serialization:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user