From 505cdb2fcc7bdcc722dcae7a05616d8d1d83ecc7 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 9 Jan 2022 23:40:42 +0100 Subject: Create a Messages enumeration This enumeration contains all of the different Messages that can be communicated between the clients and the server. The enum names should make the meaning of each obvious enough, but they still have comments besides them explaining who sends the message to who, and what the message actually entails. --- draughts/public/javascripts/messages.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 draughts/public/javascripts/messages.js diff --git a/draughts/public/javascripts/messages.js b/draughts/public/javascripts/messages.js new file mode 100644 index 0000000..f532d58 --- /dev/null +++ b/draughts/public/javascripts/messages.js @@ -0,0 +1,5 @@ +(function (exports) { + exports.START = 0 // Server -> Client :: The game has started + exports.RESIGN = 1 // Server -> Client :: The opponent resigned + exports.DISCONNECT = 2 // Server -> Client :: The opponent disconnected +})(typeof(exports) == "undefined" ? (this.Messages = {}) : exports) -- cgit v1.2.3