Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite inappropriate names #283

Merged
merged 3 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/multiplayer/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ socket.onmessage = function (event) {
switch (data.type) {
case 'error':
socket.close(3000);
alert(data.error);
window.location.href = '/multiplayer';
break;

Expand Down
27 changes: 23 additions & 4 deletions server/banned-usernames.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// source: https://gist.github.com/theskumar/54be20713e53d418bf02
// can add to this list in the future

const banList1 = [
export const reservedNames = [
'about', 'access', 'account', 'accounts', 'add', 'address', 'adm', 'admin', 'administration', 'adult', 'advertising', 'affiliate', 'affiliates', 'ajax', 'analytics', 'android', 'anon', 'anonymous', 'api', 'app', 'apps', 'archive', 'atom', 'auth', 'authentication', 'avatar',
'backup', 'banner', 'banners', 'bin', 'billing', 'blog', 'blogs', 'board', 'bot', 'bots', 'business',
'chat', 'cache', 'cadastro', 'calendar', 'campaign', 'careers', 'cgi', 'client', 'cliente', 'code', 'comercial', 'compare', 'config', 'connect', 'contact', 'contest', 'create', 'code', 'compras', 'css',
Expand All @@ -28,10 +28,29 @@ const banList1 = [
'yourusername', 'yoursite', 'yourdomain',
];

const banList2 = [
'anal', 'anus', 'arse', 'ass', 'ballsack', 'balls', 'bastard', 'bitch', 'biatch', 'bloody', 'blowjob', 'bollock', 'bollok', 'boner', 'boob', 'bugger', 'bum', 'butt', 'buttplug', 'clitoris', 'cock', 'coon', 'crap', 'cunt', 'damn', 'dick', 'dildo', 'dyke', 'fag', 'feck', 'fellate', 'fellatio', 'felching', 'fuck', 'fudgepacker', 'fudge', 'packer', 'flange', 'Goddamn', 'God', 'damn', 'hell', 'homo', 'jerk', 'jizz', 'knobend', 'knob', 'end', 'labia', 'lmao', 'lmfao', 'muff', 'nigger', 'nigga', 'omg', 'penis', 'piss', 'poop', 'prick', 'pube', 'pussy', 'queer', 'scrotum', 'sex', 'shit', 'sh1t', 'slut', 'smegma', 'spunk', 'tit', 'tosser', 'turd', 'twat', 'vagina', 'wank', 'whore', 'wtf', '',
export const inappropriateNames = [
'alpha', 'anal', 'anus', 'arse', 'ass',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alpha isn't a curse word

'ballsack', 'balls', 'bastard', 'bbc',
'bitch', 'biatch', 'bloody', 'blowjob',
'bollock', 'bollok', 'boner', 'boob',
'bugger', 'bum', 'butt', 'buttplug',
'clitoris', 'cock', 'coon', 'crap', 'cum',
'cunt', 'damn', 'dick', 'dildo', 'dyke',
'edge', 'fag', 'feck', 'fellate', 'fellatio',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edge has an appropriate definiton (the outside limit of an object, area, or surface; a place or part farthest away from the center of something)

'felching', 'fuck', 'fudgepacker', 'fudge',
'packer', 'flange', 'Goddamn', 'God', 'gyat',
'hell', 'homo', 'horn', 'jerk', 'jizz',
'knobend', 'knob', 'end', 'labia', 'lmao',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End is not inappropriate

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also lmao should be fine imo

'lmfao', 'mew', 'muff', 'nigg', 'niqq', 'omg',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, but mew is appropriate (maybe there should be a seperate cringeNames list?)

'penis', 'piss', 'poop', 'prick', 'pube',
'pussy', 'queer', 'rizz', 'scrotum', 'sex',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, rizz is not an inappropriate word, as annoying as it may be

'sigma', 'shit', 'sh1t', 'slut', 'smegma',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigma is appropriate

'spunk', 'tiktok', 'tit', 'toilet', 'tosser',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiktok is not inappropriate

'turd', 'twat', 'vagina', 'wank', 'whore',
'wtf',
];

const banList = banList1.concat(banList2);
const banList = reservedNames.concat(inappropriateNames);
banList.push('');

export default banList;
6 changes: 6 additions & 0 deletions server/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dotenv/config';

import { inappropriateNames } from './banned-usernames.js';
import { ipFilterMiddleware, ipFilterError } from './ip-filter.js';
import { createAndReturnRoom } from './TossupRoom.js';

Expand Down Expand Up @@ -41,6 +42,11 @@ wss.on('connection', (ws, req) => {
isPrivate = (isPrivate === 'true');
userId = (userId === 'unknown') ? uuid.v4() : userId;

if (inappropriateNames.some((name) => roomName.toLowerCase().includes(name.toLowerCase()))) return ws.send(JSON.stringify({
type: 'error',
error: 'The room name contains an inappropriate word',
}));

const room = createAndReturnRoom(roomName, isPrivate);
if (room.settings.lock === false) {
room.connection(ws, userId, username);
Expand Down
Loading