@colyseus/redis-driver
Version:
<div align="center"> <a href="https://github.com/colyseus/colyseus"> <img src="media/logo.svg?raw=true" width="60%" height="300" /> </a> <br> <br> <a href="https://npmjs.com/package/colyseus"> <img src="https://img.shields.io/npm/dm/coly
61 lines (59 loc) • 1.98 kB
JavaScript
;
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/drivers/redis-driver/src/RoomData.ts
var RoomData_exports = {};
__export(RoomData_exports, {
RoomData: () => RoomData
});
module.exports = __toCommonJS(RoomData_exports);
var import_core = require("@colyseus/core");
var import_ioredis = require("ioredis");
var RoomData = class {
constructor(initialValues, client) {
this.clients = 0;
this.locked = false;
this.private = false;
this.maxClients = Infinity;
this.unlisted = false;
this.#client = client;
this.createdAt = initialValues && initialValues.createdAt ? new Date(initialValues.createdAt) : /* @__PURE__ */ new Date();
for (const field in initialValues) {
if (initialValues.hasOwnProperty(field)) {
this[field] = initialValues[field];
}
}
}
#client;
toJSON() {
return {
clients: this.clients,
createdAt: this.createdAt,
maxClients: this.maxClients,
metadata: this.metadata,
name: this.name,
publicAddress: this.publicAddress,
processId: this.processId,
roomId: this.roomId
};
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
RoomData
});