]> git.cworth.org Git - lmno-server/commitdiff
Rename player-register/player-deregister to player-join/player-leave
authorCarl Worth <cworth@cworth.org>
Sun, 10 May 2020 16:54:39 +0000 (09:54 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 10 May 2020 16:54:39 +0000 (09:54 -0700)
This brings the server into compliance with protocol version 0.3.

server.js

index 7ea999aa71372a6be41c927e24cd4542b5a6eb9d..7bb29e5fe47f1e656ff54524f9abe8dc3ba1d8d2 100644 (file)
--- a/server.js
+++ b/server.js
@@ -28,14 +28,14 @@ class Game {
       object from new_player with just the subset of fields that we
       want. */
     const player_string = JSON.stringify((({id, name}) => ({id, name}))(new_player));
-    this.broadcast_event("player-register", player_string);
+    this.broadcast_event("player-join", player_string);
   }
 
   remove_player(id) {
     const index = this._players.findIndex(player => player.id === id);
     this._players.splice(index, 1);
 
-    this.broadcast_event("player-deregister", `{"id": ${id}}`);
+    this.broadcast_event("player-leave", `{"id": ${id}}`);
   }
 
   remove_all_players() {