deploy on cloud
This commit is contained in:
@@ -12,10 +12,8 @@ export class State {
|
||||
turn = $state(-1); // -1 not my turn, 0 might be, 1 is
|
||||
socket: Socket;
|
||||
|
||||
constructor(hostname: string) {
|
||||
// let session = sessionStorage.getItem('session');
|
||||
|
||||
this.socket = io(`ws://${hostname}:3000/`, {
|
||||
constructor() {
|
||||
this.socket = io(`wss://battleship.icyground-d91964e0.centralindia.azurecontainerapps.io`, {
|
||||
transports: ['websocket'],
|
||||
auth: { session: sessionStorage.getItem('session') }
|
||||
});
|
||||
|
@@ -5,8 +5,7 @@
|
||||
import { State } from '$lib/state.svelte';
|
||||
import { Users } from 'lucide-svelte';
|
||||
|
||||
const hostname = window.location.hostname;
|
||||
let gameState = new State(hostname);
|
||||
let gameState = new State();
|
||||
</script>
|
||||
|
||||
<div class="min-h-screen bg-base-300 py-8 px-4 sm:px-6 lg:px-8">
|
||||
@@ -43,7 +42,7 @@
|
||||
class="btn btn-error text-xl"
|
||||
onclick={() => {
|
||||
gameState.socket.emit('leave');
|
||||
gameState = new State(window.location.hostname);
|
||||
gameState = new State();
|
||||
}}>Leave</button
|
||||
>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user