UNPKG

gameguard-client

Version:

The client-side companion to the GameGuard that communicates with the server to manage the player and their data.

53 lines (41 loc) 2.96 kB
'use strict'; /** * The structure of a message sent between the GameGuardClient and GameGuard. */ Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Message = /** * The type of message the message is. * * @property {string} */ /** * The contents of the message. * * @property {string} */ /** * The timestamp of when the message was created. * * @property {number} */ /** * @param {string} type The type of message that is being sent. * @param {string} contents The actual contents of the message. */ function Message(type, contents) { _classCallCheck(this, Message); _defineProperty(this, "type", void 0); _defineProperty(this, "contents", void 0); _defineProperty(this, "timestamp", void 0); this.type = type; this.contents = contents; this.timestamp = +new Date(); }; exports["default"] = Message; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9NZXNzYWdlLnRzIl0sIm5hbWVzIjpbIk1lc3NhZ2UiLCJ0eXBlIiwiY29udGVudHMiLCJ0aW1lc3RhbXAiLCJEYXRlIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUVBOzs7Ozs7Ozs7Ozs7O0lBR3FCQSxPO0FBQ25COzs7Ozs7QUFPQTs7Ozs7O0FBT0E7Ozs7OztBQU9BOzs7O0FBSUEsaUJBQVlDLElBQVosRUFBMEJDLFFBQTFCLEVBQTRDO0FBQUE7O0FBQUE7O0FBQUE7O0FBQUE7O0FBQzFDLE9BQUtELElBQUwsR0FBWUEsSUFBWjtBQUNBLE9BQUtDLFFBQUwsR0FBZ0JBLFFBQWhCO0FBQ0EsT0FBS0MsU0FBTCxHQUFpQixDQUFFLElBQUlDLElBQUosRUFBbkI7QUFDRCxDIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY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