[EN/PT-BR] Horizon Forge: Updates of version v1.1

ChatGPT Image 29 de abr. de 2026, 13_09_24.pngChatgpt

divisor.jpeg

Improvements v1.1

Before finalizing the part about playing HF on mobile, I managed to make some more improvements and corrections. Below is what I changed and what is already in production.



Through snaps, @angeluxx asked a great question! It was something I had noted down to review later, but I wanted to implement a solution right away because, after all, security is security!

"Hey, lots of new information! I'd like to try the game, but could you tell me about the security when logging in with passwords?"

I asked Claude to review it, and she implemented a solution:

Problem fixed: The Keychain signature was being discarded — anyone could forge a session in sessionStorage and impersonate any player.

Implemented solution (4 files):

api/server.js:

POST /api/auth/verify — receives {username, memo, signature}, retrieves the public key from the account on the Hive blockchain, cryptographically verifies that the signature matches the memo using @hiveio/dhive, and issues an HMAC-SHA256 token valid for 24 hours. Middleware Socket.io (io.use) — validates the token in the handshake of each connection and populates socket.data.username. join_queue and rejoin_match — now use socket.data.username (defined by the middleware), completely ignoring the username sent by the client.

public/js/index.js:

After the Keychain signs, it POSTs to /api/auth/verify with {username, memo, signature: resp.result}. Only saves the session in sessionStorage if the server confirms — and includes the returned token. public/js/lobby.js:

Pass auth: { token: session.token } in the socket connection. Remove username from the join_queue payload (the server no longer accepts it).

public/js/battle.js:

Pass auth: { token: window._HF_SESSION?.token } in the PvP socket connection. Remove username from the rejoin_match payload.

What to add to the .env file:

XXXXXX=a_long_random_string_here

Without this, the server generates an ephemeral secret — it works, but tokens are invalidated upon restart. With AUTH_SECRET defined, sessions survive restarts.

With this, while battling I still encountered a small error, which I was able to correct later with Claude's help, plus some modified files, and with that I managed to fix it.

image.png


After that, I made sure to test the PVP mode with an alt account of mine and I noticed that some changes I had made in the bot mode were not reflected in the PVP mode, so I needed to fix that as well.

That button for "Battle 2" doesn't actually exist anymore; now the rounds advance automatically, except for the last round, which is when the final log opens, showing some battle information, such as damage dealt, combinations made, and things like that.

image.png

This timer during the battle was also incorrect. The 2-minute timer only appears at the beginning of each round, during the hero recruitment phase (buying cards/spending gold), so after confirming by clicking the "Battle!" button for the round to begin its combat phase, this timer is not necessary.

image.png

Finally, I also corrected the effect of the paladin's skill, which grants a bonus to the maximum HP of adjacent allies. For the logged-in player, the visual effect and a floating text indicating how much maximum HP was added to their allies appeared, but for the opponent, whether bot or not, only the green glow occurred. So I corrected that as well.

divisor.jpeg

All of this, as mentioned, is already in production; now I need to focus as soon as possible on the mobile version. My idea is to create a stable version of everything, which would be the browser version (PC, notebook, etc.) and the mobile version, which is the biggest challenge.

This version is the famous "make it work" version, meaning making the basic mechanics work on both sides. Entering the game, creating a deck, starting and progressing through a battle, and finally, finishing with the summary screen and transactions if Hive has bet between players.

After that, it's about adding more heroes, improving the mechanics, and making the game more beautiful and polished if possible. It will be a long road until then, but I'm sure everything will work out, especially if we have the community's support.

So that's it, until next time everyone!

X/Twitter: https://x.com/horizonforge_

Game link: https://horizonforge-production.up.railway.app/

sun_divisor.webp

ChatGPT Image 29 de abr. de 2026, 13_09_24.pngChatgpt

divisor.jpeg

Melhorias v1.1

Antes de finalizar a parte referente a jogar o HF no celular, consegui fazer mais algumas melhorias e correções. Segue abaixo o que alterei e que já está em produção.



Pelos snaps, @angeluxx fez uma ótima pergunta! Era algo que eu tinha anotado para rever depois, mas já quis aplicar uma solução porque afinal, segurança é segurança!

"Ei, muitas informações novas! Gostaria de experimentar o jogo, mas poderia me falar sobre a segurança ao fazer login com as senhas?"

Pedi para a Claude fazer essa revisão e assim, aplicou uma solução:

Problema corrigido:
A assinatura da Keychain era descartada — qualquer um podia forjar uma sessão no sessionStorage e se passar por qualquer jogador.

Solução implementada (4 arquivos):

api/server.js:

POST /api/auth/verify — recebe {username, memo, signature}, busca a chave Posting pública da conta na blockchain Hive, verifica criptograficamente que a assinatura bate com o memo usando @hiveio/dhive, e emite um token HMAC-SHA256 válido por 24h Middleware Socket.io (io.use) — valida o token no handshake de cada conexão e preenche socket.data.username join_queue e rejoin_match — passaram a usar socket.data.username (definido pelo middleware), ignorando completamente o username que o cliente envia

public/js/index.js:

Após a Keychain assinar, faz POST para /api/auth/verify com {username, memo, signature: resp.result} Só salva a sessão no sessionStorage se o servidor confirmar — e inclui o token retornado 

public/js/lobby.js:

Passa auth: { token: session.token } na conexão do socket
Remove username do payload do join_queue (o servidor não aceita mais) 

public/js/battle.js:

Passa auth: { token: window._HF_SESSION?.token } na conexão do socket PvP Remove username do payload do rejoin_match 

O que adicionar no .env

XXXXXX=uma_string_longa_e_aleatoria_aqui

Sem isso o servidor gera um segredo efêmero — funciona, mas tokens são invalidados ao reiniciar. Com AUTH_SECRET definido, sessões sobrevivem a restarts.

Com isso, ao batalhar ainda encontrei um pequeno erro, que logo depois consegui corrigir também com a ajuda da Claude, mais alguns arquivos modificados e com isso consegui corrigir.

image.png


Depois disso, fiz questão de testar o modo PVP com uma conta alt minha e já vi que algumas alterações que havia feito no modo contra BOT, não foram refletidas no modo PVP, com isso, precisei arrumar isso também.

Esse botão para a "Battle 2", na verdade não existe mais, agora as rodadas avançam automaticamente, exceto na ultima rodada, que é quando vai abrir o log final, mostrando algumas informações da batalha, como dano causado, combinações realizadas, essas coisas.

image.png

Esse timer também enquanto acontece a batalha estava errado. O timer de 2 minutos aparece apenas no começo de cada rodada, na fase de recrutamento dos heróis (compra de suas cartas/gasto do ouro), então após confirmar clicando no botão "Battle!" para a rodada começar a sua fase de combate, não precisa de ter esse timer.

image.png

Por fim, fiz a correção também do efeito da habilidade do paladino, que concede um bônus no HP máximo dos aliados adjacentes, no caso, para o jogador que fez o login acontece o efeito visual e um floating text indicando quanto de HP máximo foi adicionado ao seus aliados, mas para o oponente, seja bot ou não, apenas ocorria o brilho na cor verde, então corrigi isso também.

divisor.jpeg

Tudo isso como dito, já está em produção, agora preciso focar o quanto antes na versão mobile. A minha ideia é criar uma versão estável de tudo, que seria a versão para navegador (PC, notebook, etc.) e mobile que é o grande desafio.

Essa versão é a famosa "faz funcionar", ou seja, fazer o básico das mecânicas funcionar em ambos. Entrar no jogo, criar o deck, iniciar e progredir em uma batalha e por fim, finalizar com a tela do resumo e as transações caso tenha Hive apostado entre os jogadores.

Depois disso, é adicionar mais heróis, melhorar as mecânicas e deixar o jogo mais bonito e polido se possivel. Até lá será um longo caminho, mas tenho certeza que tudo dará certo, principalmente se tivermos o apoio da comunidade.

Então é isso, até a próxima pessoal!

X/Twitter: https://x.com/horizonforge_

Link do jogo: https://horizonforge-production.up.railway.app/

divisor.jpeg

banner_hiver_br_01.png


Enter in the Horizon Forge >>Discord<<

🔥Please, consider helping by using my reference links🔥

Post To EarnDePINWin SATSWin SATSHave Fun To Earn
Publish0xHoneygainSliceZBDRumble Arcade
0.23479335 BEE
1 comments

This post was curated by @hive-br team!

banner_hiver_br_01.png

Delegate your HP to the hive-br.voter account and earn Hive daily!

🔹 Follow our Curation Trail and don't miss voting! 🔹

0.00000000 BEE