Skip to content

Commit

Permalink
修改IOS约战情况,不能正常出牌问题
Browse files Browse the repository at this point in the history
  • Loading branch information
songwei committed Jul 24, 2018
1 parent 76b09ea commit 43a200e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
matchvs_wx/matchvs.min.js
matchvs_wx/matchvs.min.js
matchvs_wx/matchvs.js
matchvs_wx/matchvs.d.ts
matchvs/matchvs.min.js
Expand Down Expand Up @@ -426,3 +426,4 @@ framework/Basic/libs/*
framework/Basic_wxgame/*
framework/Basic/bin-release/*

framework/Basic/updateTime.json
4 changes: 2 additions & 2 deletions framework/Basic/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"bin-debug/logic/game/Prompt.js",
"bin-debug/logic/game/Prompt2.js",
"bin-debug/logic/game/SendCard.js",
"bin-debug/utils/WxUtils.js",
"bin-debug/Config.js",
"bin-debug/logic/network/BattleMessage.js",
"bin-debug/logic/network/BattleMsgEvent.js",
"bin-debug/logic/network/NetworkStateCheck.js",
Expand Down Expand Up @@ -73,6 +73,6 @@
"bin-debug/utils/MatchDialog.js",
"bin-debug/utils/MD5.js",
"bin-debug/utils/Toast.js",
"bin-debug/Config.js"
"bin-debug/utils/WxUtils.js"
]
}
25 changes: 13 additions & 12 deletions framework/Basic/src/logic/battle/BattleStageControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,13 @@ module battle {
*/
private getPlayerForSeatNo(seatNo):Player{
let player = null;
this._playerList.forEach((value)=>{
console.info("getPlayerForSeatNo "+value.seatNo);
if(value.seatNo == seatNo){
player = value;
for(let i = 0; i < this._playerList.length; i++){
if(this._playerList[i].seatNo == seatNo){
player = this._playerList[i];
console.info("getPlayerForSeatNo ",this._playerList[i]);
return this._playerList[i];
}
});
}
return player;
}

Expand Down Expand Up @@ -518,7 +519,10 @@ module battle {
let Crushed:number = 1;
let isnew = this._tablelistdata == null; //是否出完一轮,新出牌
//移除牌,玩家的牌
//player.removeCards(clist);
player.removeCards(clist);
console.info("myPlayer",this._myOwner, " sendCardPlayer:", player)
//界面显示牌
this._stage.ShowPlay(player, clist, (player.userID == this._myOwner.userID) , "");

if (this._tableCardList == null || this._tableCardList.length == 0) {
let yasplayer:Player = this.getPlayerEnemy(player);
Expand All @@ -536,9 +540,6 @@ module battle {
this._lastSendCardPlayer = player;
}

//界面显示牌
this._stage.ShowPlay(player, clist, (player.userID == this._myOwner.userID) , "");


//获取下一个出牌的人
player = this.getNextPlayerPoint(player.seatNo);
Expand All @@ -548,9 +549,9 @@ module battle {
this._tableCardList = [];
this._lastSendCardPlayer = null;
}
console.info("轮到该玩家出牌 isnew:", isnew);
console.info("轮到该玩家出牌 player:", player);
console.info("轮到该玩家出牌 _tableCardList:", this._tableCardList);
console.info("新的一轮 isnew:", isnew);
console.info("下一个出牌人 player:", player);
console.info("当前桌上牌 _tableCardList:", this._tableCardList);
//轮流出牌
this._stage.TurnPlayCard(player, (player.userID == this._myOwner.userID), isnew, this._tableCardList, BattleStageControl.Delay_ShowCard, false);
}
Expand Down
10 changes: 7 additions & 3 deletions framework/Basic/src/logic/battle/MyCardControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ module battle {
this._tableList=clist;
}
//发送完成,返回消息
public SendOver():void
public SendOver(list ?:Array<number>):void
{
this.setCard();
this.setCard(list);
}

//获取点选的牌
Expand Down Expand Up @@ -467,15 +467,19 @@ module battle {
}
}

private setCard() {
private setCard(lt?:Array<number>) {
var rlen:number = this._cardVlist.length;
var ri:number = 0;
for (ri = 0; ri < rlen; ri++) {
var card:CardUI = this._cardVlist[ri];
card.Release();
}
this._cardVlist = [];
if(lt){
this._player.removeCards(lt)
}
var clist:Array<number> = this._player.cardList;
console.info("MyCardControl setCard length:", this._player.cardNumber);
clist.sort(function (a:number, b:number) {
if (a % 100 == b % 100) {
if (a > b) {
Expand Down
3 changes: 2 additions & 1 deletion framework/Basic/src/scene/BattleStageUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,10 @@ class BattleStageUI extends eui.Component implements eui.UIComponent{
*/
public ShowPlay(player: battle.Player, clist: Array<number>, isme: boolean, timestr: string){
this._battleControl.UpdateAllCardNum();
console.info("BattleStageUI ShowPlay isme:",isme);
if (isme) {
//如果出牌人是我,更新我的牌数量
this._myCardControl.SendOver();
this._myCardControl.SendOver(clist);
}
if (clist != null && clist.length > 0) {
this._tablecardControl.ShowTableCard(player.LocalTableId, clist);
Expand Down

0 comments on commit 43a200e

Please sign in to comment.