Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Feb 9, 2022
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
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
1 change: 0 additions & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
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