This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-11-23 02:39:12 +08:00
parent e3781116dc
commit e99fc3929c
9 changed files with 35 additions and 10 deletions

View File

@@ -1,9 +1,10 @@
import { _decorator, Component, director, instantiate, Node, Prefab } from 'cc';
import { app } from './App';
import { Env, JNGame } from '../../extensions/ngame/assets/ngame/JNGame';
import { JNGame } from '../../extensions/ngame/assets/ngame/JNGame';
import { JNSyncAction } from '../../extensions/ngame/assets/ngame/sync/JNSyncAction';
import { GOnHookPets } from '../../extensions/ngame/assets/ngame/message/proto';
import { EnvCurrent } from './Env';
import { Env, EnvCurrent } from './Env';
import { GAction } from './consts/GAction';
const { ccclass, property } = _decorator;
window['GUser'] = "100000";
@@ -34,6 +35,11 @@ export class Main extends Component {
// 创建世界
director.getScene().addChild(instantiate(this.WorldPrefab));
if(EnvCurrent == Env.Server){
//发送就绪
app.socket.Send(GAction.CR_REFEREE_READY);
}
}
}

View File

@@ -19,6 +19,7 @@ export enum GAction {
/*************** 裁决 *********************/
CR_REFEREE_READY = 4000, //裁决就绪
CR_REFEREE_PVP_MODE = 4001, //裁决PVP模式
CR_REFEREE_PVP_END = 4002, //裁决PVP结束

View File

@@ -27,7 +27,7 @@ export class MainView extends JNGLayerBase {
//更新UI界面
onUpdateView(){
this.playerNameLabel.string = PlayerData.getIns().getInfo().playerName;
this.playerNameLabel.string = `${PlayerData.getIns().getInfo().playerId}`;
}
//打开Demo页面