UNPKG

@colyseus/core

Version:

Multiplayer Framework for Node.js.

126 lines (124 loc) 3.87 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/core/src/errors/RoomExceptions.ts var RoomExceptions_exports = {}; __export(RoomExceptions_exports, { OnAuthException: () => OnAuthException, OnCreateException: () => OnCreateException, OnDisposeException: () => OnDisposeException, OnDropException: () => OnDropException, OnJoinException: () => OnJoinException, OnLeaveException: () => OnLeaveException, OnMessageException: () => OnMessageException, OnReconnectException: () => OnReconnectException, SimulationIntervalException: () => SimulationIntervalException, TimedEventException: () => TimedEventException }); module.exports = __toCommonJS(RoomExceptions_exports); var OnCreateException = class extends Error { constructor(cause, message, options) { super(message, { cause }); this.name = "OnCreateException"; this.options = options; } }; var OnAuthException = class extends Error { constructor(cause, message, client, options) { super(message, { cause }); this.name = "OnAuthException"; this.client = client; this.options = options; } }; var OnJoinException = class extends Error { constructor(cause, message, client, options, auth) { super(message, { cause }); this.name = "OnJoinException"; this.client = client; this.options = options; this.auth = auth; } }; var OnLeaveException = class extends Error { constructor(cause, message, client, consented) { super(message, { cause }); this.name = "OnLeaveException"; this.client = client; this.consented = consented; } }; var OnDropException = class extends Error { constructor(cause, message, client, code) { super(message, { cause }); this.name = "OnDropException"; this.client = client; this.code = code; } }; var OnReconnectException = class extends Error { constructor(cause, message, client) { super(message, { cause }); this.name = "OnReconnectException"; this.client = client; } }; var OnDisposeException = class extends Error { constructor(cause, message) { super(message, { cause }); this.name = "OnDisposeException"; } }; var OnMessageException = class extends Error { constructor(cause, message, client, payload, type) { super(message, { cause }); this.name = "OnMessageException"; this.client = client; this.payload = payload; this.type = type; } isType(type) { return this.type === type; } }; var SimulationIntervalException = class extends Error { constructor(cause, message) { super(message, { cause }); this.name = "SimulationIntervalException"; } }; var TimedEventException = class extends Error { constructor(cause, message, ...args) { super(message, { cause }); this.name = "TimedEventException"; this.args = args; } }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { OnAuthException, OnCreateException, OnDisposeException, OnDropException, OnJoinException, OnLeaveException, OnMessageException, OnReconnectException, SimulationIntervalException, TimedEventException });