diff options
author | Kyle Gunger <corechg@gmail.com> | 2020-02-28 02:21:30 -0500 |
---|---|---|
committer | Kyle Gunger <corechg@gmail.com> | 2020-02-28 02:21:30 -0500 |
commit | a4d0d1190b74cd1bfb596b8a02a2deacce3ad86c (patch) | |
tree | b46f341f3e57102ee9e20d352cfc4f0dd5b48cad /scripts/message.js | |
parent | 87ce9d1c162ac9606a9b4d817a5f3b486889a46f (diff) |
Fix mobile + Lobby omments
Diffstat (limited to 'scripts/message.js')
-rw-r--r-- | scripts/message.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/message.js b/scripts/message.js new file mode 100644 index 0000000..5e821c4 --- /dev/null +++ b/scripts/message.js @@ -0,0 +1,14 @@ +function Message(type, data){ + this.t = type; + this.d = data; +} + +Message.prototype = { + stringify: function(){ + var dat = this.d + if(typeof dat !== "string"){ + dat = JSON.stringify(dat); + } + return JSON.stringify({type: this.t, data: dat}); + } +}; |