todo:清空房间加入锁机制,修复加入房间报错问题(疑似红中不准备)

master
zhouwei 2026-03-04 17:12:59 +08:00
parent 302f5d22bd
commit 4ccc1f3382
1 changed files with 9 additions and 0 deletions

View File

@ -42,6 +42,8 @@ public class EXRoom extends Room {
public int fengdingScore = 0; public int fengdingScore = 0;
private boolean closeWinCallBack = false;
public EXRoom(String roomid, Map<String, String> redis_room_map) { public EXRoom(String roomid, Map<String, String> redis_room_map) {
super(roomid, redis_room_map); super(roomid, redis_room_map);
card = new RoomCard(this); card = new RoomCard(this);
@ -592,9 +594,13 @@ public class EXRoom extends Room {
} }
public void winCallback(EXPlayer owner, int card) { public void winCallback(EXPlayer owner, int card) {
if (closeWinCallBack)
return;
boolean qiangkong_niao = config.getBoolean(Config.ROOM_CONFIG_QIANGKONG_NIAO); boolean qiangkong_niao = config.getBoolean(Config.ROOM_CONFIG_QIANGKONG_NIAO);
if (this.winCount >= this.actionList.size()) { if (this.winCount >= this.actionList.size()) {
closeWinCallBack = true;
if (actionList.size() > 1) { if (actionList.size() > 1) {
this.bankerSeat = this.activeSeat; this.bankerSeat = this.activeSeat;
if (owner.winType == 1 && qiangkong_niao) if (owner.winType == 1 && qiangkong_niao)
@ -610,6 +616,7 @@ public class EXRoom extends Room {
} }
this.endGame(); this.endGame();
closeWinCallBack = false;
} }
} }
@ -694,9 +701,11 @@ public class EXRoom extends Room {
public void clear() { public void clear() {
super.clear(); super.clear();
this.liuju = false; this.liuju = false;
this.closeWinCallBack = false;
this.activeSeat = this.lastDiscardSeat = this.currenDiscardSeat = 0; this.activeSeat = this.lastDiscardSeat = this.currenDiscardSeat = 0;
this.winCount = this.piaoNiaoCount = 0; this.winCount = this.piaoNiaoCount = 0;
this.niao.clear(); this.niao.clear();
this.actionList.clear();
} }
} }