From 8fcae373642468002964725c5d59c4b7facda823 Mon Sep 17 00:00:00 2001 From: 0xmugen Date: Thu, 10 Oct 2024 07:15:34 +0200 Subject: [PATCH 1/5] feat: fix joining sesison --- client/src/lib/game.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/lib/game.ts b/client/src/lib/game.ts index 3b698b41..6baadf76 100644 --- a/client/src/lib/game.ts +++ b/client/src/lib/game.ts @@ -9,7 +9,7 @@ export async function joinSession(session: any) { if (get(account)) { console.log('Joining session', session.value) await client.start.join({ account: get(account), session_id: session.value }) - window.location.href = `/game/${session.value}` + window.location.href = `${get(env)}/game/${session.value}` } else { console.error('No active account found') } From c9a60c223791dca37c7124df40bd66502cd84f79 Mon Sep 17 00:00:00 2001 From: 0xmugen Date: Thu, 10 Oct 2024 07:16:38 +0200 Subject: [PATCH 2/5] feat: fix joining sesison --- client/src/lib/game.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/lib/game.ts b/client/src/lib/game.ts index 6baadf76..4986d8fa 100644 --- a/client/src/lib/game.ts +++ b/client/src/lib/game.ts @@ -9,7 +9,7 @@ export async function joinSession(session: any) { if (get(account)) { console.log('Joining session', session.value) await client.start.join({ account: get(account), session_id: session.value }) - window.location.href = `${get(env)}/game/${session.value}` + window.location.href = `/${get(env)}/game/${session.value}` } else { console.error('No active account found') } From 26cf1d21235031d374f317dae9595585d4ce6373 Mon Sep 17 00:00:00 2001 From: 0xmugen Date: Thu, 10 Oct 2024 07:45:27 +0200 Subject: [PATCH 3/5] fix: spawn function called correclty now --- client/src/lib/ui/StartGame.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/lib/ui/StartGame.svelte b/client/src/lib/ui/StartGame.svelte index 2186d13c..9739268f 100644 --- a/client/src/lib/ui/StartGame.svelte +++ b/client/src/lib/ui/StartGame.svelte @@ -17,11 +17,11 @@ } } - // On mount, if the game state is equals to 1 and you are the new player that just joined (player 2), spawn the characters. - $: if ($gameState === 1 && $currentPlayerId === 2) { + $: if ($gameState === 1 && $currentPlayerId === 2 && $account) { console.log('Spawning characters') spawn() } + {#if $gameState == 1} From 18164c46ee4745126ecd79bd260c9c839f7e4d4c Mon Sep 17 00:00:00 2001 From: 0xmugen Date: Fri, 11 Oct 2024 07:34:03 +0200 Subject: [PATCH 4/5] feat: when already connectd doen't ask to connect again --- client/src/routes/+page.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/routes/+page.svelte b/client/src/routes/+page.svelte index 4085ec67..ead9cd40 100644 --- a/client/src/routes/+page.svelte +++ b/client/src/routes/+page.svelte @@ -5,6 +5,7 @@ import { playSoundEffectLoop } from '$lib/3d/utils/audioUtils'; import { onMount } from 'svelte'; import { connect } from '$lib/controller'; + import { account } from '$stores/account'; import { env } from '$stores/network'; import { initializeStore } from '$stores/dojoStore' @@ -20,7 +21,9 @@ async function connectAndGoto(config: string) { env.set(config as "mainnet" | "slot"); await initStore(); - await connect(config); + if (!$account) { + await connect(config); + } goto(`${config}/client/games/openGames`); } From dda445e35e6e65aee1f6ebeb4d56a44d4b887502 Mon Sep 17 00:00:00 2001 From: 0xmugen Date: Sun, 13 Oct 2024 09:56:09 +0200 Subject: [PATCH 5/5] fix overlays for slot --- .../manifests/slot/deployment/manifest.json | 42 +++++++++++++++++-- .../manifests/slot/deployment/manifest.toml | 42 +++++++++++++++++-- contracts/overlays/slot/actions.toml | 11 +++++ contracts/overlays/slot/mapmaker.toml | 11 +++++ contracts/overlays/slot/spawn.toml | 11 +++++ contracts/overlays/slot/start.toml | 13 ++++++ 6 files changed, 122 insertions(+), 8 deletions(-) create mode 100644 contracts/overlays/slot/actions.toml create mode 100644 contracts/overlays/slot/mapmaker.toml create mode 100644 contracts/overlays/slot/spawn.toml create mode 100644 contracts/overlays/slot/start.toml diff --git a/contracts/manifests/slot/deployment/manifest.json b/contracts/manifests/slot/deployment/manifest.json index ab1ea937..6c825fdf 100644 --- a/contracts/manifests/slot/deployment/manifest.json +++ b/contracts/manifests/slot/deployment/manifest.json @@ -1557,7 +1557,15 @@ } ], "reads": [], - "writes": [], + "writes": [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-TurnData" + ], "init_calldata": [], "tag": "octoguns-actions", "systems": [ @@ -1818,7 +1826,15 @@ } ], "reads": [], - "writes": [], + "writes": [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-Global" + ], "init_calldata": [], "tag": "octoguns-mapmaker", "systems": [ @@ -2063,7 +2079,15 @@ } ], "reads": [], - "writes": [], + "writes": [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-Player" + ], "init_calldata": [], "tag": "octoguns-spawn", "systems": [ @@ -2381,7 +2405,17 @@ } ], "reads": [], - "writes": [], + "writes": [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-Global", + "octoguns-Player", + "octoguns-SessionPrimitives" + ], "init_calldata": [], "tag": "octoguns-start", "systems": [ diff --git a/contracts/manifests/slot/deployment/manifest.toml b/contracts/manifests/slot/deployment/manifest.toml index 4e634eb2..3a47abdf 100644 --- a/contracts/manifests/slot/deployment/manifest.toml +++ b/contracts/manifests/slot/deployment/manifest.toml @@ -29,7 +29,15 @@ original_class_hash = "0x27fa0d39964487211324e94f5fd3a876d30a699a1ad749247b5f500 base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/slot/deployment/abis/contracts/octoguns-actions-3f08332a.json" reads = [] -writes = [] +writes = [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-TurnData", +] init_calldata = [] tag = "octoguns-actions" systems = ["move"] @@ -43,7 +51,15 @@ original_class_hash = "0x3ee32958b958017c667501bb85bb2411e2dd5c1e11bc2230fb947a7 base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/slot/deployment/abis/contracts/octoguns-mapmaker-14c58c7d.json" reads = [] -writes = [] +writes = [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-Global", +] init_calldata = [] tag = "octoguns-mapmaker" systems = [ @@ -60,7 +76,15 @@ original_class_hash = "0x29601d131c2a760259e8a670150e74fd5c7c88dd0613b894d1670fd base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/slot/deployment/abis/contracts/octoguns-spawn-1acb0980.json" reads = [] -writes = [] +writes = [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-Player", +] init_calldata = [] tag = "octoguns-spawn" systems = ["spawn"] @@ -74,7 +98,17 @@ original_class_hash = "0x623bd6af3f6a90aa5a1bb9d7f7a18819afbee64365cc8ba95f683f5 base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/slot/deployment/abis/contracts/octoguns-start-5506b80f.json" reads = [] -writes = [] +writes = [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-Global", + "octoguns-Player", + "octoguns-SessionPrimitives", +] init_calldata = [] tag = "octoguns-start" systems = [ diff --git a/contracts/overlays/slot/actions.toml b/contracts/overlays/slot/actions.toml new file mode 100644 index 00000000..f312b828 --- /dev/null +++ b/contracts/overlays/slot/actions.toml @@ -0,0 +1,11 @@ +tag = "octoguns-actions" +writes = [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-TurnData", + +] diff --git a/contracts/overlays/slot/mapmaker.toml b/contracts/overlays/slot/mapmaker.toml new file mode 100644 index 00000000..925c186e --- /dev/null +++ b/contracts/overlays/slot/mapmaker.toml @@ -0,0 +1,11 @@ +tag = "octoguns-mapmaker" +writes = [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-Global", + +] \ No newline at end of file diff --git a/contracts/overlays/slot/spawn.toml b/contracts/overlays/slot/spawn.toml new file mode 100644 index 00000000..403e23c5 --- /dev/null +++ b/contracts/overlays/slot/spawn.toml @@ -0,0 +1,11 @@ +tag = "octoguns-spawn" +writes = [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-Player" + +] diff --git a/contracts/overlays/slot/start.toml b/contracts/overlays/slot/start.toml new file mode 100644 index 00000000..8f0e0448 --- /dev/null +++ b/contracts/overlays/slot/start.toml @@ -0,0 +1,13 @@ +tag = "octoguns-start" +writes = [ + "octoguns-CharacterPosition", + "octoguns-CharacterModel", + "octoguns-Map", + "octoguns-Session", + "octoguns-SessionMeta", + "octoguns-Bullet", + "octoguns-Global", + "octoguns-Player", + "octoguns-SessionPrimitives" + +]