aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <thomasvoss@live.com> 2022-01-09 23:40:42 +0100
committerThomas Voss <thomasvoss@live.com> 2022-01-09 23:40:42 +0100
commit505cdb2fcc7bdcc722dcae7a05616d8d1d83ecc7 (patch)
tree3a13913cd368a534b364647694d98a386f3b4e2c
parent8844e79abe3d0b30b43739ff5d85917eff178073 (diff)
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.
-rw-r--r--draughts/public/javascripts/messages.js5
1 files changed, 5 insertions, 0 deletions
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)