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-alpha.25 to 0.16.0-alpha.26

8

build/MatchMaker.js

@@ -138,6 +138,12 @@ var __create = Object.create;

await concurrentJoinOrCreateRoomLock(handler, concurrencyKey, async (roomId) => {
room = roomId ? await driver.findOne({ roomId }) : await findOneRoomAvailable(roomName, clientOptions);
if (roomId) {
room = await driver.findOne({ roomId });
}
if (!room) {
room = await findOneRoomAvailable(roomName, clientOptions);
}
if (!room) {
room = await createRoom(roomName, clientOptions);
presence.lpush(`l:${handler.name}:${concurrencyKey}`, room.roomId);
presence.expire(`l:${handler.name}:${concurrencyKey}`, import_Utils.MAX_CONCURRENT_CREATE_ROOM_WAIT_TIME * 2);
}

@@ -144,0 +150,0 @@ return room;

@@ -28,2 +28,3 @@ import { EventEmitter } from 'events';

setex(key: string, value: string, seconds: number): void;
expire(key: string, seconds: number): void;
get(key: string): string | number;

@@ -30,0 +31,0 @@ del(key: string): void;

5

build/presence/LocalPresence.js

@@ -96,6 +96,9 @@ var __create = Object.create;

setex(key, value, seconds) {
this.keys[key] = value;
this.expire(key, seconds);
}
expire(key, seconds) {
if (this.timeouts[key]) {
clearTimeout(this.timeouts[key]);
}
this.keys[key] = value;
this.timeouts[key] = setTimeout(() => {

@@ -102,0 +105,0 @@ delete this.keys[key];

@@ -56,2 +56,9 @@ /**

/**
* Expire the key in seconds.
*
* @param key - Identifier.
* @param seconds - Seconds to expire the key.
*/
expire(key: string, seconds: number): any;
/**
* Get the value of key.

@@ -58,0 +65,0 @@ *

{
"name": "@colyseus/core",
"version": "0.16.0-alpha.25",
"version": "0.16.0-alpha.26",
"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

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