@colyseus/core
Advanced tools
Comparing version 0.14.29 to 0.14.30
@@ -36,3 +36,3 @@ /// <reference types="node" /> | ||
hset(key: string, field: string, value: string): void; | ||
hincrby(key: string, field: string, value: number): void; | ||
hincrby(key: string, field: string, value: number): number; | ||
hget(key: string, field: string): Promise<string>; | ||
@@ -44,6 +44,6 @@ hgetall(key: string): Promise<{ | ||
hlen(key: string): Promise<number>; | ||
incr(key: string): Promise<string | number>; | ||
decr(key: string): Promise<string | number>; | ||
incr(key: string): Promise<number>; | ||
decr(key: string): Promise<number>; | ||
shutdown(): void; | ||
} | ||
export {}; |
@@ -120,3 +120,5 @@ 'use strict'; | ||
const previousValue = Number(this.hash[key][field] || '0'); | ||
this.hash[key][field] = (previousValue + value).toString(); | ||
var incrby = (previousValue + value); | ||
this.hash[key][field] = incrby.toString(); | ||
return incrby; | ||
} | ||
@@ -123,0 +125,0 @@ async hget(key, field) { |
@@ -16,3 +16,3 @@ export interface Presence { | ||
hset(key: string, field: string, value: string): any; | ||
hincrby(key: string, field: string, value: number): any; | ||
hincrby(key: string, field: string, value: number): number | Promise<number>; | ||
hget(key: string, field: string): Promise<string>; | ||
@@ -19,0 +19,0 @@ hgetall(key: string): Promise<{ |
@@ -35,5 +35,7 @@ var __create = Object.create; | ||
var import_nanoid = __toESM(require("nanoid")); | ||
var import_msgpackr = require("msgpackr"); | ||
var import_Debug = require("../Debug"); | ||
var import_events = require("events"); | ||
var import_Logger = require("../Logger"); | ||
var import_schema = require("@colyseus/schema"); | ||
const REMOTE_ROOM_SHORT_TIMEOUT = Number(process.env.COLYSEUS_PRESENCE_SHORT_TIMEOUT || 2e3); | ||
@@ -216,2 +218,12 @@ function generateId(length = 9) { | ||
} | ||
(0, import_msgpackr.addExtension)({ | ||
Class: import_schema.Schema, | ||
type: 0, | ||
read(datum) { | ||
return datum; | ||
}, | ||
write(instance) { | ||
return instance.toJSON(); | ||
} | ||
}); | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -218,0 +230,0 @@ 0 && (module.exports = { |
{ | ||
"name": "@colyseus/core", | ||
"version": "0.14.29", | ||
"version": "0.14.30", | ||
"description": "Multiplayer Framework for Node.js.", | ||
@@ -47,3 +47,3 @@ "input": "./src/index.ts", | ||
}, | ||
"gitHead": "320a0325f01eff3cd7afa8fb2efa80077ebdbf4a" | ||
"gitHead": "81d40fa9a61b94f2eae34dd57c52da4b588ec6b2" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
571368
5997
0