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

colyseus.js

Package Overview
Dependencies
Maintainers
1
Versions
261
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colyseus.js - npm Package Compare versions

Comparing version 0.7.1 to 0.7.2-rc1

1

lib/Client.d.ts

@@ -17,2 +17,3 @@ import { Signal } from "signals.js";

constructor(url: string);
protected createConnection(colyseusid: string): void;
join<T>(roomName: string, options?: any): Room<T>;

@@ -19,0 +20,0 @@ /**

@@ -8,2 +8,6 @@ "use strict";

var Connection_1 = require("./Connection");
// use AsyncStorage on react-native environment.
if (typeof (localStorage) === "undefined") {
localStorage = global.AsyncStorage;
}
var Client = /** @class */ (function () {

@@ -18,4 +22,16 @@ function Client(url) {

this.rooms = {};
this.id = localStorage.getItem('colyseusid') || "";
this.hostname = url;
var colyseusid = localStorage.getItem('colyseusid') || "";
if (!(colyseusid instanceof Promise)) {
// browser has synchronous return
this.createConnection(colyseusid);
}
else {
// react-native is asynchronous
colyseusid.then(function (id) { return _this.createConnection(id); });
}
}
Client.prototype.createConnection = function (colyseusid) {
var _this = this;
this.id = colyseusid;
this.connection = new Connection_1.Connection(this.hostname + "/?colyseusid=" + this.id);

@@ -31,3 +47,3 @@ this.connection.onmessage = this.onMessageCallback.bind(this);

};
}
};
Client.prototype.join = function (roomName, options) {

@@ -34,0 +50,0 @@ if (options === void 0) { options = {}; }

2

package.json
{
"name": "colyseus.js",
"version": "0.7.1",
"version": "0.7.2-rc1",
"description": "Multiplayer Game Client for the Browser",

@@ -5,0 +5,0 @@ "keywords": [

@@ -5,3 +5,3 @@ {

"module": "commonjs",
"lib": ["dom", "es5"],
"lib": ["dom", "es6"],
"allowSyntheticDefaultImports": true,

@@ -8,0 +8,0 @@ "noImplicitAny": false,

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