Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

Commit

Permalink
chore(changelog): prepare 2.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ProbablePrime committed Mar 6, 2018
1 parent 277b22d commit 97d2293
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 2.x

### 2.7.1
- Fix a small typo in one of the examples (#93)
- Fix websocket authentication when used in browsers (#95)

### 2.7
- Add world update methods (#94)
- Adjust prettier config to Mixer standard and did a pass
Expand Down
40 changes: 40 additions & 0 deletions examples/ready.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* tslint:disable:no-console */
import * as WebSocket from 'ws';

import {
GameClient,
IButton,
IParticipant,
setWebSocket,
} from '../lib';

import { makeControls } from './util';

if (process.argv.length < 4) {
console.log('Usage gameClient.exe <token> <versionId>');
process.exit();
}
// We need to tell the interactive client what type of websocket we are using.
setWebSocket(WebSocket);

// As we're on the Streamer's side we need a "GameClient" instance
const client = new GameClient();

// Log when we're connected to interactive
client.on('open', () => console.log('Connected to interactive'));

// These can be un-commented to see the raw JSON messages under the hood
client.on('message', (err: any) => console.log('<<<', err));
client.on('send', (err: any) => console.log('>>>', err));
// client.on('error', (err: any) => console.log(err));

// Now we open the connection passing in our authentication details and an experienceId.
client.open({
authToken: process.argv[2],
versionId: parseInt(process.argv[3], 10),
}).then(() => {
// Controls don't appear unless we tell Interactive that we are ready!
return client.ready(true);
});

/* tslint:enable:no-console */

0 comments on commit 97d2293

Please sign in to comment.