Added U Game system

This commit is contained in:
NigeParis 2026-01-12 13:32:56 +01:00
parent 62705c4a7e
commit 96cfbef642
15 changed files with 56 additions and 93 deletions

View file

@ -43,6 +43,14 @@ declare module "ft_state" {
}
}
class DivPrivate extends HTMLElement {
constructor() {
super();
}
}
customElements.define("div-private", DivPrivate);
export function getSocket(): Socket {
if (window.__state.chatSock === undefined)
window.__state.chatSock = io(window.location.host, {

View file

@ -13,6 +13,5 @@ import { addMessage } from './addMessage';
export function inviteToPlayPong(profil: ClientProfil, senderSocket: Socket) {
profil.SenderName = getUser()?.name ?? '';
if (profil.SenderName === profil.user) return;
addMessage(`You invited to play: ${profil.user}🏓`)
senderSocket.emit('inviteGame', JSON.stringify(profil));
};

View file

@ -235,7 +235,7 @@ if (!window.__state._routingHandler) {
if (sameOrigin) {
e.preventDefault();
navigateTo(url.pathname);
navigateTo(`${url.pathname}${url.search}`);
}
});