|
@@ -204,9 +204,9 @@ public class GDRoom extends Room {
|
|
|
}
|
|
|
|
|
|
// 60秒未开始添加机器人
|
|
|
-// if (this.time >= 60 && this.data.type != 1) {
|
|
|
-// RobotService.getInstance().joinRoom(this);
|
|
|
-// }
|
|
|
+ if (this.time >= 60 && this.data.type != 1) {
|
|
|
+ RobotService.getInstance().joinRoom(this);
|
|
|
+ }
|
|
|
|
|
|
// 120秒未开始直接解散
|
|
|
// if (this.time >= 120 && this.type != 1) {
|
|
@@ -256,35 +256,33 @@ public class GDRoom extends Room {
|
|
|
// }
|
|
|
} else {
|
|
|
// 随机一个时间
|
|
|
-// int opTime = RandomUtil.getRandomInt(3, 6);
|
|
|
-// if (this.time >= opTime) {
|
|
|
-// // 庄家出牌
|
|
|
-// Player zhuangPlayer = this.data.playerMap[this.data.zhuangPos];
|
|
|
-// if (zhuangPlayer != null && this.data.currentPlayer != null
|
|
|
-// && zhuangPlayer.getId().equals(this.data.currentPlayer.getId())
|
|
|
-// && this.data.currentPlayer.data.isRobot) {
|
|
|
-// RobotService.getInstance().robotDisCard(this, this.data.jieFengPlayer);
|
|
|
-// this.flag = true;
|
|
|
-// this.time = 0;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 机器人接风
|
|
|
-// if (this.data.jieFengPlayer != null && this.data.jieFengPlayer.data.isRobot) {
|
|
|
-// RobotService.getInstance().robotDisCard(this, this.data.jieFengPlayer);
|
|
|
-// this.flag = true;
|
|
|
-// this.time = 0;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 机器人操作过
|
|
|
-// if (this.data.currentPlayer != null && this.data.currentPlayer.data.isRobot) {
|
|
|
-// RobotService.getInstance().robotPass(this, this.data.currentPlayer);
|
|
|
-// this.flag = true;
|
|
|
-// this.time = 0;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if (this.data.currentPlayer.data.isRobot) {
|
|
|
+
|
|
|
+ if (this.time >= this.data.currentPlayer.data.robotOpTime) {
|
|
|
+ Player zhuangPlayer = this.data.playerMap[this.data.zhuangPos];
|
|
|
+ if (zhuangPlayer != null && zhuangPlayer.getId().equals(this.data.currentPlayer.getId())) {
|
|
|
+ // 庄家出牌
|
|
|
+ RobotService.getInstance().robotDisCard(this, this.data.currentPlayer);
|
|
|
+ this.flag = true;
|
|
|
+ this.time = 0;
|
|
|
+ break;
|
|
|
+ } else if (this.data.jieFengPlayer != null && this.data.jieFengPlayer.data.isRobot) {
|
|
|
+ // 机器人接风
|
|
|
+ RobotService.getInstance().robotDisCard(this, this.data.jieFengPlayer);
|
|
|
+ this.flag = true;
|
|
|
+ this.time = 0;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 机器人操作过
|
|
|
+ if (this.data.currentPlayer != null && this.data.currentPlayer.data.isRobot) {
|
|
|
+ RobotService.getInstance().robotPass(this, this.data.currentPlayer);
|
|
|
+ this.flag = true;
|
|
|
+ this.time = 0;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 20秒未操作,强制过
|
|
|
// if (this.time >= 20) {
|
|
@@ -556,6 +554,8 @@ public class GDRoom extends Room {
|
|
|
this.data.result.clear();
|
|
|
}
|
|
|
}
|
|
|
+ // todo 测试代码
|
|
|
+// this.data.curLevelPoint = 14;
|
|
|
// 发牌
|
|
|
this.doSendCard();
|
|
|
// 进还贡数据
|
|
@@ -1112,6 +1112,9 @@ public class GDRoom extends Room {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ this.flag = true;
|
|
|
+ this.time = 0;
|
|
|
+
|
|
|
boolean isGameOver = false;
|
|
|
|
|
|
// 4人房2人一队手牌出完,直接结算
|
|
@@ -1274,6 +1277,9 @@ public class GDRoom extends Room {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ this.flag = true;
|
|
|
+ this.time = 0;
|
|
|
+
|
|
|
// 记录游戏回放
|
|
|
Map<String, Object> data = this.roomToPlayBack(this.data.currentPlayer);
|
|
|
this.playBack.put(Long.toString(System.currentTimeMillis()), data);
|