matchmaking OK

This commit is contained in:
LuckyLaszlo
2022-11-21 21:04:41 +01:00
parent add08c216f
commit 04203f4f9d
4 changed files with 52 additions and 51 deletions

View File

@@ -1,5 +1,4 @@
import { ClientPlayer } from "./Client";
import {gameUpdate} from "../gameUpdate.js"
import { GameComponents } from "../../shared_js/class/GameComponents.js";
import { clientInputListener } from "../wsServer.js";
import * as c from "../constants.js"
@@ -106,8 +105,8 @@ class GameSession {
private _newRound(s: GameSession) {
const gc = s.components;
// https://fr.wikipedia.org/wiki/Tennis_de_table#Nombre_de_manches
if (gc.scoreLeft >= 11
|| gc.scoreRight >= 11)
if (gc.scoreLeft >= 11 || gc.scoreRight >= 11)
// if (gc.scoreLeft >= 2 || gc.scoreRight >= 2) // WIP: for testing
{
if (Math.abs(gc.scoreLeft - gc.scoreRight) >= 2)
{