texas-poker-core 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/Controller/index.js +1 -1
- package/dist/Room/index.js +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/Controller/index.js
CHANGED
|
@@ -370,7 +370,7 @@ var Controller = /*#__PURE__*/function () {
|
|
|
370
370
|
value: function end() {
|
|
371
371
|
if (this.status !== 'on') this.reportError(new _error.default(2100, '游戏不在进行中, 无法结束'));
|
|
372
372
|
this.clearTimer();
|
|
373
|
-
_classPrivateFieldSet(_status, this, '
|
|
373
|
+
_classPrivateFieldSet(_status, this, 'end');
|
|
374
374
|
this.resetActivePlayer();
|
|
375
375
|
}
|
|
376
376
|
}, {
|
package/dist/Room/index.js
CHANGED
|
@@ -255,7 +255,11 @@ var Room = /*#__PURE__*/function () {
|
|
|
255
255
|
if (_classPrivateFieldGet(_private, this) && _classPrivateFieldGet(_privateKey, this) !== key) this.reportError(new _error.default(2003, '私密房间不可加入'));
|
|
256
256
|
if (!_classPrivateFieldGet(_allowPlayersToWatch, this) && this.playersCountOnSeat === _classPrivateFieldGet(_maximumCountOfPlayers, this)) this.reportError(new _error.default(2003, '房间设置了不可观战,并且玩家已满,不可加入'));
|
|
257
257
|
if (!_classPrivateFieldGet(_allowPlayersToWatch, this) && player.lowestBetAmount < _classPrivateFieldGet(_lowestBetAmount, this)) this.reportError(new _error.default(2003, '房间设置了不可观战, 并且您的余额小于房间的最底下注,无法加入'));
|
|
258
|
-
|
|
258
|
+
|
|
259
|
+
// 人数已满 或者 游戏不在准备阶段, 都直接到观战席
|
|
260
|
+
// 要注意一点, 游戏也会在end阶段持续几秒, 这个时候也需要到观战席
|
|
261
|
+
// 防止在结算过程中,玩家加入坐席导致交互问题
|
|
262
|
+
var seatStatus = this.playersCountOnSeat === _classPrivateFieldGet(_maximumCountOfPlayers, this) || _classPrivateFieldGet(_controller, this).status !== 'waiting' ? 'hang' : 'on-set';
|
|
259
263
|
if (seatStatus === 'hang') {
|
|
260
264
|
_classPrivateFieldGet(_playersHang, this).add(player);
|
|
261
265
|
} else {
|
|
@@ -283,6 +287,7 @@ var Room = /*#__PURE__*/function () {
|
|
|
283
287
|
}, {
|
|
284
288
|
key: "seat",
|
|
285
289
|
value: function seat(player) {
|
|
290
|
+
if (_classPrivateFieldGet(_controller, this).status !== 'waiting') this.reportError(new _error.default(2003, '游戏还未结束, 无法入座'));
|
|
286
291
|
if (!player || !_classPrivateFieldGet(_idToPlayerMap, this).has(player.getUserInfo().id)) this.reportError(new _error.default(2003, '您不在房间中,无法入座'));
|
|
287
292
|
if (this.getPlayerSeatStatus(player) === 'on-set') this.reportError(new _error.default(2003, '您已在坐席中,请勿重复操作'));
|
|
288
293
|
if (this.playersCountOnSeat === _classPrivateFieldGet(_maximumCountOfPlayers, this)) this.reportError(new _error.default(2003, '位置已满,无法加入坐席'));
|
|
@@ -298,6 +303,7 @@ var Room = /*#__PURE__*/function () {
|
|
|
298
303
|
}, {
|
|
299
304
|
key: "watch",
|
|
300
305
|
value: function watch(player) {
|
|
306
|
+
if (_classPrivateFieldGet(_controller, this).status !== 'waiting') this.reportError(new _error.default(2003, '游戏正在进行中, 无法加入观战席'));
|
|
301
307
|
if (!player || !_classPrivateFieldGet(_idToPlayerMap, this).has(player.getUserInfo().id)) this.reportError(new _error.default(2003, '您不在房间中,无法观战'));
|
|
302
308
|
if (this.getPlayerSeatStatus(player) === 'hang') this.reportError(new _error.default(2003, '您已在观战席中,请勿重复操作'));
|
|
303
309
|
_classPrivateFieldGet(_playersHang, this).add(player);
|