Skip to content

Commit

Permalink
Automatically close connection of on tsoding.github.io
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Aug 15, 2024
1 parent 103ebc2 commit ba43753
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions game.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,8 @@ export async function createGame() {
};
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const ws = new WebSocket(`${protocol}//${window.location.hostname}:${SERVER_PORT}`);
if (window.location.hostname === 'tsoding.github.io')
ws.close();
const me = {
id: 0,
position: new Vector2(),
Expand Down
1 change: 1 addition & 0 deletions game.mts
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@ export async function createGame(): Promise<Game> {
};
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const ws = new WebSocket(`${protocol}//${window.location.hostname}:${SERVER_PORT}`);
if (window.location.hostname === 'tsoding.github.io') ws.close();
const me = {
id: 0,
position: new Vector2(),
Expand Down

0 comments on commit ba43753

Please sign in to comment.