|
|
@ -39,6 +39,7 @@ export class TeenpattieGameProxySystem extends Component { |
|
|
|
Network.getInstance().registhandle(GameNetCode.PlayerJoin, this.onPlayerJoin.bind(this)); |
|
|
|
Network.getInstance().registhandle(GameNetCode.ForceSeeCard, this.ForceSeeCard.bind(this)); |
|
|
|
Network.getInstance().registhandle(GameNetCode.ForceCompare, this.ForceCompare.bind(this)); |
|
|
|
Network.getInstance().registhandle(GameNetCode.RoomWait,this.roomWait.bind(this)); |
|
|
|
|
|
|
|
Message.add(UIWindowMessage.CloseUI, this.onCloseUI, this); |
|
|
|
} |
|
|
@ -63,6 +64,7 @@ export class TeenpattieGameProxySystem extends Component { |
|
|
|
Network.getInstance().removehandle(GameNetCode.PlayerJoin, this.onPlayerJoin.bind(this)); |
|
|
|
Network.getInstance().removehandle(GameNetCode.ForceSeeCard, this.ForceSeeCard.bind(this)); |
|
|
|
Network.getInstance().removehandle(GameNetCode.ForceCompare, this.ForceCompare.bind(this)); |
|
|
|
Network.getInstance().removehandle(GameNetCode.RoomWait,this.roomWait.bind(this)); |
|
|
|
|
|
|
|
Message.remove(UIWindowMessage.CloseUI, this.onCloseUI, this); |
|
|
|
} |
|
|
@ -71,10 +73,11 @@ export class TeenpattieGameProxySystem extends Component { |
|
|
|
this.currChuPaiId = 0; |
|
|
|
} |
|
|
|
|
|
|
|
/**游戏等待开始倒计时 */ |
|
|
|
/**游戏等待开始 */ |
|
|
|
private onGameStart(value: any) { |
|
|
|
this.pkData = null; |
|
|
|
this.resData = null; |
|
|
|
Message.send(TeenPattieEventType.GameMatchTips,false); |
|
|
|
Message.send(TeenPattieEventType.NextGame); |
|
|
|
this.isForceCompare = false; |
|
|
|
TeenpattieGameProxySystem.upPlayer?.startCutDown(true,value.data); |
|
|
@ -97,17 +100,14 @@ export class TeenpattieGameProxySystem extends Component { |
|
|
|
private onPlayerJoinGame(value: any) { |
|
|
|
switch(value.code){ |
|
|
|
case gameErrorCode.NotRoom: |
|
|
|
window["Toast"]?.getInstance().showToast(Game10001Res.getInstance()?.getString(`game.net.code.status.5`)); |
|
|
|
Message.send(TeenPattieEventType.GameExit); |
|
|
|
this.exitTip("game.net.code.status.5") |
|
|
|
return |
|
|
|
case gameErrorCode.PlayerFilled: |
|
|
|
window["Toast"]?.getInstance().showToast(Game10001Res.getInstance()?.getString(`game.net.code.status.7`)); |
|
|
|
Message.send(TeenPattieEventType.GameExit); |
|
|
|
this.exitTip("game.net.code.status.7") |
|
|
|
return |
|
|
|
} |
|
|
|
if(value.code != 0){ |
|
|
|
window["Toast"]?.getInstance().showToast(Game10001Res.getInstance()?.getString(`game.net.code.status.5`)); |
|
|
|
Message.send(TeenPattieEventType.GameExit); |
|
|
|
this.exitTip("game.net.code.status.5") |
|
|
|
return; |
|
|
|
} |
|
|
|
if(!this.isReconnect) return; |
|
|
@ -150,7 +150,8 @@ export class TeenpattieGameProxySystem extends Component { |
|
|
|
|
|
|
|
|
|
|
|
if(value.data.data.curPlayerSeat <= 0 && value.data.data.gameRound <= 0 && value.data.data.time > 0){ |
|
|
|
TeenpattieGameProxySystem.upPlayer?.startCutDown(true,value.data.data.time); |
|
|
|
// TeenpattieGameProxySystem.upPlayer?.startCutDown(true,value.data.data.time);
|
|
|
|
Message.send(TeenPattieEventType.GameMatchTips,true); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -363,4 +364,21 @@ export class TeenpattieGameProxySystem extends Component { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/**等待开始倒计时 */ |
|
|
|
private roomWait(value:any){ |
|
|
|
const isStartCountTime:boolean = value.data == 0 ? true : false; |
|
|
|
if(!isStartCountTime){ |
|
|
|
this.exitTip("game.net.code.status.4"); |
|
|
|
return; |
|
|
|
} |
|
|
|
Message.send(TeenPattieEventType.GameMatchTips,isStartCountTime); |
|
|
|
} |
|
|
|
|
|
|
|
private exitTip(str:string){ |
|
|
|
let param:any={} |
|
|
|
param.msg="kickout"; |
|
|
|
param.language=Game10001Res.getInstance().getString(str) |
|
|
|
Message.send(TeenPattieEventType.GameExit,param); |
|
|
|
} |
|
|
|
|
|
|
|
} |