mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
move UI stuff around, add message sound
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,8 +5,8 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>webui</title>
|
||||
<script type="module" crossorigin src="/assets/index-DuG6d4XG.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BH17i8qZ.css">
|
||||
<script type="module" crossorigin src="/assets/index-Bw29mQyW.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-vVHPhuT9.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -11,7 +11,7 @@ const RATE_LIMIT_WINDOW_MS = 8000;
|
||||
const RATE_LIMIT_MAX = 5;
|
||||
const rateBuckets = new Map(); // socketId -> [timestamps]
|
||||
|
||||
const PROFANITY_LIST = ['fuck', 'shit', 'bitch', 'cunt', 'nigger', 'nigga', 'asshole', 'dick'];
|
||||
const PROFANITY_LIST = ['bitch', 'cunt', 'nigger', 'nigga', 'asshole', 'dick'];
|
||||
const DUPLICATE_WINDOW_MS = 15000;
|
||||
const lastMessageBySocket = new Map(); // socketId -> { text, ts }
|
||||
|
||||
@@ -95,10 +95,10 @@ function handleIncoming({ text } = {}, socket, cb = () => {}) {
|
||||
cb({ error: 'Message blocked' });
|
||||
return;
|
||||
}
|
||||
if (isDuplicate(socket.id, clean)) {
|
||||
cb({ error: 'Duplicate message' });
|
||||
return;
|
||||
}
|
||||
// if (isDuplicate(socket.id, clean)) {
|
||||
// cb({ error: 'Duplicate message' });
|
||||
// return;
|
||||
// }
|
||||
if (isKeymash(clean)) {
|
||||
cb({ error: 'Message looks like spam' });
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user