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

JavaScript client for Colyseus Multiplayer Game Server

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.1K
decreased by-18.27%
Maintainers
1
Weekly downloads
 
Created
Source

colyseus.js for the browser

Join the chat at https://gitter.im/gamestdio/colyseus Build Status

JavaScript/TypeScript client for Colyseus - a Minimalist Multiplayer Game Server for Node.js.

Usage

import * as Colyseus from "colyseus.js";

var client = new Colyseus.Client('ws://localhost:2657');
var roomName = "room_name"
var room = client.join(roomName)

// successfully joined the room
room.onJoin.add(function() {
  console.log(client.id, "joined", roomName)
})

// patches comming from the server
room.onUpdate.add(function(patches) {
  console.log(roomName, "patches comming:", patches)
})

// patches comming from the server
room.onPatch.add(function(patches) {
  console.log(roomName, "will apply these changes:", patches)
})

// the server sent data directly for this client
room.onData.add(function(data) {
  console.log(client.id, "received on", roomName, data)
})

// oops, some error happened in the server!
room.onError.add(function() {
  console.log(client.id, "couldn't join", roomName)
})

// client left the room.
room.onLeave.add(function() {
  console.log(client.id, "left", roomName)
})

License

MIT

Keywords

FAQs

Package last updated on 17 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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