Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Here we use a BinaryEncoder to communicate in binary over websocket, with the pr

```javascript
import Server from 'netcode/src/server/Server';
import BinaryEncoder from 'netcode/src/server/BinaryEncoder';
import BinaryEncoder from 'netcode/src/encoder/BinaryEncoder';
import events from './envents';

// Listen on localhost:8080
Expand All @@ -77,7 +77,7 @@ Now we write a client, for the browser, that connects to our running server on `

```javascript
import Client from 'netcode/src/client/Client';
import BinaryEncoder from 'netcode/src/client/BinaryEncoder';
import BinaryEncoder from 'netcode/src/encoder/BinaryEncoder';
import events from './envents';

const client = new Client('ws://localhost:8080', new BinaryEncoder(events))
Expand Down
1 change: 0 additions & 1 deletion demo-client.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

window.addEventListener('load', () => {
const { Client, BinaryEncoder, Codec, Int8Codec, Int16Codec, LongIntCodec, BooleanCodec, StringCodec } = netcode;

Expand Down
3 changes: 2 additions & 1 deletion demo-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const encoder = new BinaryEncoder([
]);

// Create the server
const server = new Server(process.argv[2], 'localhost', encoder);
const port = process.argv[2];
const server = new Server(port, 'localhost', encoder, 10);

// Listen for new clients
server.on('client:join', client => {
Expand Down
4 changes: 2 additions & 2 deletions doc/packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Now you can import source file from _netcode_ directly in your sources and it wi
```javascript
// src/server.js
import Server from 'netcode/src/server/Server';
import BinaryEncoder from 'netcode/src/server/BinaryEncoder'; // Import from src/server!
import BinaryEncoder from 'netcode/src/encoder/BinaryEncoder';
import { BooleanCodec } from 'netcode/src/encoder/codec';

new Server(
Expand All @@ -77,7 +77,7 @@ new Server(
```javascript
// src/client.js
import Client from 'netcode/src/client/Client';
import BinaryEncoder from 'netcode/src/client/BinaryEncoder'; // Import from src/client!
import BinaryEncoder from 'netcode/src/encoder/BinaryEncoder';
import { BooleanCodec } from 'netcode/src/encoder/codec';

new Client(
Expand Down
Loading