Hinzufügen der Spiel-Logik: Implementierung von Benutzerverlassen, Spielende-Logik und Protokollierung
This commit is contained in:
@@ -5,8 +5,10 @@ class ServerConnectionManager {
|
||||
|
||||
this.basicSetup();
|
||||
|
||||
this.socket.on("waitForStart", (data) => {this.waitForStart(data)});
|
||||
this.socket.on("randomTest", (data) => {this.randomTest(data)});
|
||||
this.socket.on("waitForStart", (data) => { this.waitForStart(data) });
|
||||
this.socket.on("randomTest", (data) => { this.randomTest(data) });
|
||||
|
||||
this.socket.on("gameEnd", (msg) => { this.gameEnd(msg) });
|
||||
}
|
||||
|
||||
waitForStart(data) {
|
||||
@@ -16,6 +18,12 @@ class ServerConnectionManager {
|
||||
randomTest(data) {
|
||||
document.getElementById("rd").innerText = data;
|
||||
}
|
||||
|
||||
gameEnd(msg){
|
||||
this.socket.disconnect();
|
||||
confirm(msg)
|
||||
window.location.pathname = "/dashboard";
|
||||
}
|
||||
|
||||
basicSetup() {
|
||||
this.socket.emit("hereForGame");
|
||||
|
||||
Reference in New Issue
Block a user