colyseus.js
Advanced tools
Comparing version 0.4.2 to 0.4.4
@@ -7,2 +7,3 @@ var Room = require('colyseus').Room | ||
super(options) | ||
this.setState({}) | ||
console.log("BattleRoom created!", options) | ||
@@ -9,0 +10,0 @@ } |
@@ -10,3 +10,3 @@ var Room = require('colyseus').Room | ||
this.setPatchRate( 1000 ) | ||
this.setPatchRate(1000 / 192); | ||
@@ -27,2 +27,3 @@ this.setState({ messages: [] }) | ||
onLeave (client) { | ||
this.state.messages.push("Left!"); | ||
// console.log("ChatRoom:", client.id, "disconnected") | ||
@@ -29,0 +30,0 @@ } |
@@ -35,8 +35,8 @@ 'use strict'; | ||
function Colyseus(url) { | ||
var protocols = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; | ||
var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; | ||
var protocols = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
_classCallCheck(this, Colyseus); | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Colyseus).call(this, url, protocols, options)); | ||
var _this = _possibleConstructorReturn(this, (Colyseus.__proto__ || Object.getPrototypeOf(Colyseus)).call(this, url, protocols, options)); | ||
@@ -75,3 +75,3 @@ _this.binaryType = "arraybuffer"; | ||
return _get(Object.getPrototypeOf(Colyseus.prototype), 'send', this).call(this, _msgpackLite2.default.encode(data)); | ||
return _get(Colyseus.prototype.__proto__ || Object.getPrototypeOf(Colyseus.prototype), 'send', this).call(this, _msgpackLite2.default.encode(data)); | ||
} else { | ||
@@ -78,0 +78,0 @@ |
@@ -30,3 +30,3 @@ 'use strict'; | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Room).call(this)); | ||
var _this = _possibleConstructorReturn(this, (Room.__proto__ || Object.getPrototypeOf(Room)).call(this)); | ||
@@ -93,4 +93,3 @@ _this.id = null; | ||
jsonpatch.apply(this.state, patches); | ||
this.state = newState; | ||
this.emit('update', this.state, patches); | ||
@@ -97,0 +96,0 @@ } |
{ | ||
"name": "colyseus.js", | ||
"version": "0.4.2", | ||
"version": "0.4.4", | ||
"description": "JavaScript client for Colyseus Multiplayer Game Server", | ||
@@ -23,3 +23,4 @@ "keywords": [ | ||
"watch": "babel src -d lib -w", | ||
"prepublish": "babel src -d lib" | ||
"prepublish": "babel src -d lib", | ||
"test": "mocha test/" | ||
}, | ||
@@ -31,3 +32,3 @@ "engines": { | ||
"clock.js": "^1.1.0", | ||
"fast-json-patch": "^0.5.4", | ||
"fast-json-patch": "^1.0.0", | ||
"fossil-delta": "^0.2.5", | ||
@@ -40,10 +41,12 @@ "msgpack-lite": "^0.1.20", | ||
"babel-preset-es2015": "^6.1.2", | ||
"babelify": "^7.2.0", | ||
"browserify": "^12.0.1", | ||
"babelify": "^7.2.0", | ||
"uglify-js": "^2.6.1", | ||
"chai": "^3.5.0", | ||
"colyseus": "^0.4.0", | ||
"express": "^4.13.3", | ||
"mocha": "^3.1.0", | ||
"nodemon": "^1.7.1", | ||
"uglify-js": "^2.6.1", | ||
"watchify": "^3.6.1" | ||
} | ||
} |
@@ -1,5 +0,9 @@ | ||
# colyseus.js for the browser [![Join the chat at https://gitter.im/gamestdio/colyseus](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gamestdio/colyseus?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
colyseus.js for the browser | ||
=== | ||
[![Join the chat at https://gitter.im/gamestdio/colyseus](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gamestdio/colyseus?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Build Status](https://secure.travis-ci.org/gamestdio/colyseus.js.png?branch=master)](http://travis-ci.org/gamestdio/colyseus.js) | ||
JavaScript client for [colyseus](https://github.com/gamestdio/colyseus) - a | ||
Minimalistic MMO Game Server for Node.js. | ||
Minimalist Multiplayer Game Server for Node.js. | ||
@@ -6,0 +10,0 @@ ## Usage |
@@ -69,4 +69,3 @@ var EventEmitter = require('events').EventEmitter | ||
jsonpatch.apply(this.state, patches) | ||
this.state = newState; | ||
this.emit('update', this.state, patches) | ||
@@ -73,0 +72,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1484241
39
6817
46
11
+ Addedfast-json-patch@1.2.2(transitive)
- Removedfast-json-patch@0.5.7(transitive)
Updatedfast-json-patch@^1.0.0