Merge branch 'master' of bitbucket.org:LuckyLaszlo/ft_transcendence
This commit is contained in:
@@ -80,6 +80,10 @@ export class GameSession {
|
|||||||
|
|
||||||
s.pause();
|
s.pause();
|
||||||
|
|
||||||
|
if (!s.matchEnded) {
|
||||||
|
s._matchEnd(en.PlayerSide.noSide, true);
|
||||||
|
}
|
||||||
|
|
||||||
s.spectatorsMap.forEach((client) => {
|
s.spectatorsMap.forEach((client) => {
|
||||||
clientTerminate(client);
|
clientTerminate(client);
|
||||||
});
|
});
|
||||||
@@ -224,7 +228,6 @@ export class GameSession {
|
|||||||
{
|
{
|
||||||
if (this.playersMap.size !== 2)
|
if (this.playersMap.size !== 2)
|
||||||
{
|
{
|
||||||
this.matchEnded = true;
|
|
||||||
if (this.playersMap.size != 0) {
|
if (this.playersMap.size != 0) {
|
||||||
this._forfeit();
|
this._forfeit();
|
||||||
}
|
}
|
||||||
@@ -237,7 +240,6 @@ export class GameSession {
|
|||||||
}
|
}
|
||||||
private _forfeit()
|
private _forfeit()
|
||||||
{
|
{
|
||||||
this.matchEnded = true;
|
|
||||||
console.log("Forfeit Ending");
|
console.log("Forfeit Ending");
|
||||||
const gc = this.components;
|
const gc = this.components;
|
||||||
const luckyWinner: ClientPlayer = this.playersMap.values().next().value;
|
const luckyWinner: ClientPlayer = this.playersMap.values().next().value;
|
||||||
@@ -307,8 +309,11 @@ export class GameSession {
|
|||||||
if (winner === en.PlayerSide.left) {
|
if (winner === en.PlayerSide.left) {
|
||||||
console.log("Player Left WIN");
|
console.log("Player Left WIN");
|
||||||
}
|
}
|
||||||
else {
|
else if (winner === en.PlayerSide.right) {
|
||||||
console.log("Player Right WIN");
|
console.log("Player Right WIN");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
console.log("Match end Draw");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user