Skip to content

Commit

Permalink
Next (#16)
Browse files Browse the repository at this point in the history
* chore(release): 2.0.7-next.3 [skip ci]

# [@hastearcade/web-v2.0.7-next.3](https://github.com/playhaste/haste-sdk/compare/@hastearcade/web-v2.0.7-next.2...@hastearcade/web-v2.0.7-next.3) (2022-01-31)

### Bug Fixes

* **web:** remove console logs for debugging ([2655595](2655595))

* feat(web): changing build interface to ignore client id

Updating the interface to no longer require client id from game client. All game clients will be
moved to use the Haste Arcade application to better support SSO across games.

BREAKING CHANGE: updating the build interface to no longer require client id

* chore(release): 3.0.0-next.1 [skip ci]

# [@hastearcade/web-v3.0.0-next.1](https://github.com/playhaste/haste-sdk/compare/@hastearcade/web-v2.0.7-next.3...@hastearcade/web-v3.0.0-next.1) (2022-02-02)

### Features

* **web:** changing build interface to ignore client id ([2e827b3](2e827b3))

### BREAKING CHANGES

* **web:** updating the build interface to no longer require client id

* Remove separate developer game client from flow and instead use Haste Arcade by default (#15)

* feat(web): working to remove the need for separate game clients

work in progress

* feat(web): added new type of logout

will need to remove hardcoded url

* feat(web): removing auth0 and hardcoded values

* refactor(web): removed domain and client id

since the web client no longer uses auth0, the domain and client id are irrelevant and handled by
authclient

* fix(web): updated to force build

* chore(release): 3.0.0-next.2 [skip ci]

# [@hastearcade/web-v3.0.0-next.2](https://github.com/playhaste/haste-sdk/compare/@hastearcade/web-v3.0.0-next.1...@hastearcade/web-v3.0.0-next.2) (2022-02-09)

### Bug Fixes

* **web:** updated to force build ([8b87151](8b87151))

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
  • Loading branch information
foundrium and semantic-release-bot committed Feb 17, 2022
1 parent adfba33 commit c233b31
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 176 deletions.
94 changes: 4 additions & 90 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/haste-game-client/src/game/hasteGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export class HasteGame extends Phaser.Game {
// and server, a JWT from the haste game is leveraged. This JWT will
// contain the necessary information necessary to validate the client
// to the server, and contain the player id from the user metadata
async setupSocket(hasteClient: HasteClient) {
setupSocket(hasteClient: HasteClient) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const details = await hasteClient.getTokenDetails();
const details = hasteClient.getTokenDetails();
const serverUrl = `${process.env.SERVER_PROTOCOL}://${process.env.SERVER_HOST}:${process.env.SERVER_PORT}`;
this.socketManager = new SocketManager(serverUrl, details.token);

Expand Down
12 changes: 6 additions & 6 deletions packages/haste-game-client/src/scenes/bootScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ export class BootScene extends Phaser.Scene {
this.hasteClient.login();
}

async init(): Promise<void> {
this.hasteClient = HasteClient.build(process.env.HASTE_GAME_CLIENT_ID, process.env.AUTH_URL, process.env.LOGIN_URL);
const details = await this.hasteClient.getTokenDetails();
await this.handleLoggedInUser(details);
init(): void {
this.hasteClient = HasteClient.build(process.env.LOGIN_URL);
const details = this.hasteClient.getTokenDetails();
this.handleLoggedInUser(details);
}

async handleLoggedInUser(hasteAuth: HasteAuthentication) {
handleLoggedInUser(hasteAuth: HasteAuthentication) {
this.isAuthenticated = hasteAuth.isAuthenticated;
if (hasteAuth.isAuthenticated) {
const hasteGame = this.game as HasteGame;
await hasteGame.setupSocket(this.hasteClient);
hasteGame.setupSocket(this.hasteClient);

hasteGame.socketManager.gameGetLevelsCompletedEvent.on((data: Leaderboard[]) => {
hasteGame.leaderboards = data;
Expand Down
1 change: 1 addition & 0 deletions packages/haste-game-client/webpack.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ if (fs.existsSync(path)) {
});
},
host: '0.0.0.0',
disableHostCheck: true,
},
plugins: [new DefinePlugin(envKeys)],
});
Expand Down
3 changes: 1 addition & 2 deletions packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hastearcade/web",
"version": "2.0.7",
"version": "3.0.0-next.2",
"description": "The client sdk to be used to empower developers to leverage the Haste Arcade. The client SDK is intended to be used in client side code alongside the developers game logic.",
"contributors": [
"Keith LaForce <keith@hastearcade.com>",
Expand Down Expand Up @@ -43,7 +43,6 @@
"payout"
],
"dependencies": {
"@auth0/auth0-spa-js": "^1.18.0",
"@hastearcade/models": "^1.3.0",
"@types/axios": "^0.14.0",
"@types/uuid": "^8.3.3",
Expand Down
Loading

0 comments on commit c233b31

Please sign in to comment.