rate limit socket connections

This commit is contained in:
AlecM33
2022-03-01 21:11:26 -05:00
parent 07ec22820e
commit cd76cd0a1a
8 changed files with 61 additions and 14 deletions

View File

@@ -34,9 +34,15 @@ const game = () => {
UserUtility.validateAnonUserSignature(res.content)
);
});
socket.on("connect_error", (err) => {
toast('Connection error: ' + err, 'error', true, false);
});
socket.on('disconnect', () => {
toast('Disconnected. Attempting reconnect...', 'error', true, false);
});
socket.emit('hey');
socket.emit('hey');
socket.emit('hey');
setClientSocketHandlers(stateBucket, gameStateRenderer, socket, timerWorker, gameTimerManager);
}).catch((res) => {
toast(res.content, 'error', true);

View File

@@ -68,6 +68,13 @@ img[src='../images/logo_cropped.gif'] {
margin: 3em 0 1em 0;
}
#logo-container {
max-width: 400px;
width: 63vw;
min-width: 250px;
margin: 3em 0 1em 0;
}
form > div {
margin: 15px 0;
}

View File

@@ -24,7 +24,9 @@
<div id="mobile-menu-background-overlay"></div>
<div id="navbar"></div>
<div id="home-page-top-section">
<img src="../images/logo_cropped.gif"/>
<!-- <div id="logo-container">-->
<img src="../images/logo_cropped.gif" alt="logo"/>
<!-- </div>-->
<h3>A tool to run werewolf when not in-person, or in any setting without a deck of cards.</h3>
<a href="/create">
<button id="home-create-button" class="app-button">Create A Game</button>