Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@colyseus/core

Package Overview
Dependencies
Maintainers
0
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@colyseus/core - npm Package Compare versions

Comparing version 0.16.0-preview.20 to 0.16.0-preview.21

11

build/MatchMaker.d.ts

@@ -26,3 +26,2 @@ import { Deferred } from './utils/Utils';

export declare let selectProcessIdToCreateRoom: SelectProcessIdCallback;
export declare let isGracefullyShuttingDown: boolean;
export declare let onReady: Deferred;

@@ -115,4 +114,12 @@ export declare enum MatchMakerState {

export declare function handleCreateRoom(roomName: string, clientOptions: ClientOptions, restoringRoomId?: string): Promise<RoomListingData>;
export declare function getRoomById(roomId: string): Room<any, any, any, any>;
/**
* Get room data by roomId.
* This method does not return the actual room instance, use `getLocalRoomById` for that.
*/
export declare function getRoomById(roomId: string): import("./matchmaker/driver").QueryHelpers<RoomListingData<any>>;
/**
* Get local room instance by roomId. (Can return "undefined" if the room is not available on this process)
*/
export declare function getLocalRoomById(roomId: string): Room<any, any, any, any>;
/**
* Disconnects every client on every room in the current process.

@@ -119,0 +126,0 @@ */

16

build/MatchMaker.js

@@ -37,2 +37,3 @@ var __create = Object.create;

getHandler: () => getHandler,
getLocalRoomById: () => getLocalRoomById,
getRoomById: () => getRoomById,

@@ -45,3 +46,2 @@ getRoomClass: () => getRoomClass,

healthCheckProcessId: () => healthCheckProcessId,
isGracefullyShuttingDown: () => isGracefullyShuttingDown,
join: () => join,

@@ -87,3 +87,2 @@ joinById: () => joinById,

let selectProcessIdToCreateRoom;
let isGracefullyShuttingDown;
let onReady = new import_Utils.Deferred();

@@ -101,3 +100,2 @@ var MatchMakerState = /* @__PURE__ */ ((MatchMakerState2) => {

}
isGracefullyShuttingDown = false;
state = 0 /* INITIALIZING */;

@@ -356,2 +354,5 @@ presence = _presence || new import_LocalPresence.LocalPresence();

function getRoomById(roomId) {
return driver.findOne({ roomId });
}
function getLocalRoomById(roomId) {
return rooms[roomId];

@@ -372,6 +373,5 @@ }

async function gracefullyShutdown() {
if (isGracefullyShuttingDown) {
if (state === 2 /* SHUTTING_DOWN */) {
return Promise.reject("already_shutting_down");
}
isGracefullyShuttingDown = true;
state = 2 /* SHUTTING_DOWN */;

@@ -539,4 +539,4 @@ onReady = void 0;

async function disposeRoom(roomName, room) {
(0, import_Debug.debugMatchMaking)("disposing '%s' (%s) on processId '%s' (graceful shutdown: %s)", roomName, room.roomId, processId, isGracefullyShuttingDown);
if (!isGracefullyShuttingDown) {
(0, import_Debug.debugMatchMaking)("disposing '%s' (%s) on processId '%s' (graceful shutdown: %s)", roomName, room.roomId, processId, state === 2 /* SHUTTING_DOWN */);
if (state !== 2 /* SHUTTING_DOWN */) {
stats.local.roomCount--;

@@ -575,2 +575,3 @@ stats.persist();

getHandler,
getLocalRoomById,
getRoomById,

@@ -583,3 +584,2 @@ getRoomClass,

healthCheckProcessId,
isGracefullyShuttingDown,
join,

@@ -586,0 +586,0 @@ joinById,

@@ -73,4 +73,7 @@ var __defProp = Object.defineProperty;

import_schema.encode.utf8Write(sendBuffer, serializerId, it);
handshake.copy(sendBuffer, it.offset, 0, handshake.byteLength);
return sendBuffer.subarray(0, it.offset + handshake.byteLength);
let handshakeLength = handshake?.byteLength || 0;
if (handshakeLength > 0) {
handshake.copy(sendBuffer, it.offset, 0, handshakeLength);
}
return sendBuffer.subarray(0, it.offset + handshakeLength);
},

@@ -77,0 +80,0 @@ [11 /* ERROR */]: (code, message = "") => {

@@ -119,3 +119,3 @@ var __create = Object.create;

async gracefullyShutdown(exit = true, err) {
if (matchMaker.isGracefullyShuttingDown) {
if (matchMaker.state === matchMaker.MatchMakerState.SHUTTING_DOWN) {
return;

@@ -179,3 +179,3 @@ }

async handleMatchMakeRequest(req, res) {
if (matchMaker.isGracefullyShuttingDown) {
if (matchMaker.state === matchMaker.MatchMakerState.SHUTTING_DOWN) {
res.writeHead(503, {});

@@ -182,0 +182,0 @@ res.end();

@@ -52,3 +52,3 @@ var __create = Object.create;

const recreatedRoomListing = await (0, import_MatchMaker.handleCreateRoom)(roomHistory.roomName, roomHistory.clientOptions, roomId);
const recreatedRoom = (0, import_MatchMaker.getRoomById)(recreatedRoomListing.roomId);
const recreatedRoom = (0, import_MatchMaker.getLocalRoomById)(recreatedRoomListing.roomId);
import_Logger.logger.debug(`\u{1F504} room '${roomId}' has been restored.`);

@@ -55,0 +55,0 @@ if (roomHistory.hasOwnProperty("state")) {

{
"name": "@colyseus/core",
"version": "0.16.0-preview.20",
"version": "0.16.0-preview.21",
"description": "Multiplayer Framework for Node.js.",

@@ -5,0 +5,0 @@ "input": "./src/index.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc