Skip to content
This repository was archived by the owner on Jul 31, 2020. It is now read-only.
Closed
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
1 change: 1 addition & 0 deletions examples/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function makeControls(amount: number): IControlData[] {
client.open({
authToken: process.argv[2],
versionId: parseInt(process.argv[3], 10),
url: process.argv[4] || null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not push 'weirdness' to a public example for functionality that's only useful for internal testing.

}).then(() => {
// Now we can create the controls, We need to add them to a scene though.
// Every Interactive Experience has a "default" scene so we'll add them there there.
Expand Down
2 changes: 1 addition & 1 deletion src/GameClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class GameClient extends Client {
.then(endpoints => {
return super.open({
authToken: options.authToken,
url: endpoints[0].address,
url: options.url || endpoints[0].address,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably avoid the external HTTP call here.

if(options.url) { proimse.resolve().then(....)

maybe?

Copy link
Contributor

@connor4312 connor4312 May 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, actually. Running the standalone service it exposes a "fake" discovery endpoint which discovers itself. So alternately the option could be passed as an API base URL, which could be reused later if, for example, shortcode OAuth support is integrated into the library. (The standalone tetrisd service also exposes fake shortcode endpoints)

extraHeaders: {
'X-Interactive-Version': options.versionId,
},
Expand Down