UNPKG

gameguard-client

Version:

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

38 lines (33 loc) 766 B
'use strict' /** * The structure of a message sent between the GameGuardClient and GameGuard. */ export default class Message { /** * The type of message the message is. * * @property {string} */ type: string; /** * The contents of the message. * * @property {string} */ contents: string; /** * The timestamp of when the message was created. * * @property {number} */ timestamp: number; /** * @param {string} type The type of message that is being sent. * @param {string} contents The actual contents of the message. */ constructor(type: string, contents: string) { this.type = type; this.contents = contents; this.timestamp = + new Date(); } }