Added U Game system
This commit is contained in:
parent
62705c4a7e
commit
96cfbef642
15 changed files with 56 additions and 93 deletions
|
|
@ -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, {
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
};
|
||||
|
|
@ -235,7 +235,7 @@ if (!window.__state._routingHandler) {
|
|||
|
||||
if (sameOrigin) {
|
||||
e.preventDefault();
|
||||
navigateTo(url.pathname);
|
||||
navigateTo(`${url.pathname}${url.search}`);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue