fix:local, fix:timer, fix:evt rdyEnd
This commit is contained in:
parent
b5c80d649e
commit
adb89aecbe
5 changed files with 27 additions and 14 deletions
|
|
@ -230,15 +230,15 @@ function pongClient(_url: string, _args: RouteHandlerParams): RouteHandlerReturn
|
|||
set_pretty(batRight, playerR, playerL, SELF_COLOR);
|
||||
} else
|
||||
showError("couldn't find your id in game");
|
||||
|
||||
rdy_btn.classList.remove('hidden');
|
||||
rdy_btn.innerText = ReadyState.readyUp;
|
||||
|
||||
setTimeout(() => {
|
||||
rdy_btn.classList.add('hidden');}, 2000); // 1500 : pong.CONCEDED_TIMEOUT
|
||||
});
|
||||
socket.on('rdyEnd', () => {
|
||||
rdy_btn.classList.add('hidden');
|
||||
});
|
||||
|
||||
socket.on("gameEnd", (winner) => {
|
||||
rdy_btn.classList.remove('hidden');
|
||||
queueBtn.innerHTML = QueueState.Iddle;
|
||||
queueBtn.style.color = 'white';
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ export interface ClientToServer {
|
|||
export interface ServerToClient {
|
||||
forceDisconnect: (reason: string) => void;
|
||||
queueEvent: (msg: 'registered' | 'unregistered') => void;
|
||||
rdyEnd:() => void,
|
||||
updateInformation: (info: UpdateInfo) => void,
|
||||
newGame: (initState: GameUpdate) => void, // <- consider this the gameProc eg not start of game but wait for client to "ready up"
|
||||
gameUpdate: (state: GameUpdate) => void,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue