# gamemaster

> networking lib to keep a game world synchronized between server-clients

Latest version **0.0.0** (published 2013-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install gamemaster
pnpm add gamemaster
yarn add gamemaster
bun add gamemaster
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2013-08-06 |
| First published | 2013-08-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Viclib |
| Maintainers | viclib |
| Keywords | gamemaster, javascript, html5, livescript, socket.io |

## Links

- npm: https://www.npmjs.com/package/gamemaster
- Repository: http://github.com/viclib/gamemaster
- npm.io page: https://npm.io/package/gamemaster

## Dependencies (2)

- [socket.io](https://npm.io/package/socket.io.md) 0.9.16
- [socket.io-client](https://npm.io/package/socket.io-client.md) 0.9.16

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.0 (latest) — 2013-08-06

## README

This lib allows you to share a game-world between a server and several clients without having
to worry about manually messing with sockets. Just tell the system which objects each client can see and the
system will automatically keep care of keeping them synchronized using the least bandwidth possible.

Install:
-

	npm install gamemaster


Usage:
-

Server:

	players = gamemaster.init 7171 ->
		@commands =
			move_left: ~> @x += 1 

		@x = 0

		for player in players
			player.watch @, ["x"]
			@watch player, ["x"]
			
Client:

	world = gamemaster.connect window.location.origin
	setInterval (-> world.send "move_left"), 500

And that's it! On the server side, "players" is an array containing all players connected to the game. On the client slide, "world" is an object containing all objects that the client can see. You can make a player watch any JavaScript object.

---
_Source: https://npm.io/package/gamemaster · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
