Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
23 changes: 11 additions & 12 deletions src/ettServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export class ETTServer {
},
commonpacks: (player: Player, room: Room, command: string, params: string[]) => {
const commonPacks = room.commonPacks();
if (commonPacks.length > 0) room.sendChat(`Common packs: ${commonPacks.join(',')}`);
if (commonPacks.length > 0) room.sendChat(`Common packs: ${commonPacks.join(', ')}`);
else room.sendChat(`No pack in common between the players in the room :(`);
},
countdown: (player: Player, room: Room, command: string, params: string[]) => {
Expand Down Expand Up @@ -490,11 +490,11 @@ export class ETTServer {
this.sendAll(makeMessage('deleteroom', { room: room.serialize() }));
} else {
// send notice to players in room that someone left
room.sendChat(`${systemPrepend}${player.user} left`);
room.sendChat(`${systemPrepend}${player.user} left.`);
this.updateRoom(room);
}
player.send(makeMessage('leaveroom')); // So the client can exit the room when kicked
player.sendChat(LOBBY_MESSAGE, `${systemPrepend}Left room ${room.name}`);
player.sendChat(LOBBY_MESSAGE, `${systemPrepend}Left room ${room.name}.`);
}

resendAllRooms() {
Expand Down Expand Up @@ -587,8 +587,7 @@ export class ETTServer {
if (ws.readyState === 1) {
ws.tmpaux(str);
} else {
logger.debug(`Connection closed so msg not
ent: ${str}`);
logger.debug(`Connection closed so msg not ent: ${str}`);
Comment thread
Ulti-FD marked this conversation as resolved.
Outdated
}
};
}
Expand Down Expand Up @@ -724,7 +723,7 @@ ent: ${str}`);

onStartChart(player: Player, message: ChartMsg) {
if (!player.room) {
player.sendPM(`${systemPrepend}You're not in a room`);
player.sendPM(`${systemPrepend}You're not in a room.`);
return;
}
if (!player.room.canSelect(player)) {
Expand Down Expand Up @@ -961,7 +960,7 @@ ent: ${str}`);
static onMissingChart(player: Player) {
if (!player.user || !player.room) return;
if (player.room) {
player.room.sendChat(`${systemPrepend}${player.user} doesnt have the chart`);
player.room.sendChat(`${systemPrepend}${player.user} doesnt have the chart.`);
}
}

Expand All @@ -971,7 +970,7 @@ ent: ${str}`);
}

if (!message.name) {
player.sendChat(LOBBY_MESSAGE, `${systemPrepend}Cannot use empty room name`);
player.sendChat(LOBBY_MESSAGE, `${systemPrepend}Cannot use empty room name.`);
return;
}

Expand All @@ -990,7 +989,7 @@ ent: ${str}`);
player.readystate = false;
} else {
player.send(makeMessage('createroom', { created: false }));
player.sendChat(LOBBY_MESSAGE, `${systemPrepend}Room name already in use`);
player.sendChat(LOBBY_MESSAGE, `${systemPrepend}Room name already in use.`);
}
}

Expand All @@ -1013,7 +1012,7 @@ ent: ${str}`);
this.enterRoom(player, room);
} else {
player.send(makeMessage('enterroom', { entered: false }));
player.sendChat(LOBBY_MESSAGE, `${systemPrepend}Incorrect password`);
player.sendChat(LOBBY_MESSAGE, `${systemPrepend}Incorrect password.`);
}
else {
player.readystate = false;
Expand Down Expand Up @@ -1096,7 +1095,7 @@ ent: ${str}`);
if (!player.room || player.room.name !== message.tab) {
player.sendChat(
ROOM_MESSAGE,
`${systemPrepend}You're not in the room ${message.tab}`,
`${systemPrepend}You're not in the room ${message.tab}.`,
message.tab
);
return;
Expand Down Expand Up @@ -1141,7 +1140,7 @@ ent: ${str}`);
if (!this.userHasPemission(player, 'chartRequesting')) {
player.sendChat(
PRIVATE_MESSAGE,
`${systemPrepend}You are not allowed to send chart requests. Contact a server admin`
`${systemPrepend}You are not allowed to send chart requests. Contact a server admin.`
);
return;
}
Expand Down
18 changes: 9 additions & 9 deletions src/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ export class Room {
if (this.isOperatorOrOwner(player)) {
if (this.forcestart === true) {
this.forcestart = false;
this.sendChat(`${systemPrepend} force start disabled.`);
this.sendChat(`${systemPrepend} Force start disabled.`);
} else {
this.forcestart = true;
this.sendChat(`${systemPrepend} force start enabled for this song.`);
this.sendChat(`${systemPrepend} Force start enabled for this song.`);
}
} else {
unauthorizedChat(player, true);
Expand Down Expand Up @@ -150,7 +150,7 @@ export class Room {

const selectionMode: (ch: Chart) => any = selectionModes[this.selectionMode];
if (!selectionMode) {
this.sendChat(`${systemPrepend}Invalid selection mode`);
this.sendChat(`${systemPrepend}Invalid selection mode.`);
return {};
}

Expand Down Expand Up @@ -314,7 +314,7 @@ export class Room {
this.players.push(player);

player.send(makeMessage('enterroom', { entered: true }));
this.sendChat(`${systemPrepend}${player.user} joined`);
this.sendChat(`${systemPrepend}${player.user} joined.`);

player.state = READY;

Expand Down Expand Up @@ -422,7 +422,7 @@ export class Room {
if (this.isOperatorOrOwner(player)) {
this.free = !this.free;
this.sendChat(
`${systemPrepend}The room is now ${this.free ? '' : 'not '}in free song picking mode`
`${systemPrepend}The room is ${this.free ? 'now' : 'no longer'} in free song picking mode.`
);
} else {
unauthorizedChat(player, true);
Expand All @@ -433,7 +433,7 @@ export class Room {
if (this.isOperatorOrOwner(player)) {
this.freerate = !this.freerate;

this.sendChat(`${systemPrepend}The room is now ${this.freerate ? '' : 'not'} rate free mode`);
this.sendChat(`${systemPrepend}The room is ${this.freerate ? 'now' : 'no longer'} in rate free mode.`);
} else {
unauthorizedChat(player, true);
}
Expand All @@ -446,7 +446,7 @@ export class Room {
if (!selectionMode) {
player.sendChat(
1,
`${systemPrepend}Invalid selection mode. Valid ones are:\n
`${systemPrepend}Invalid selection mode. Valid ones are:
${JSON.stringify(selectionModeDescriptions, null, 4).replace(/[{}]/g, '')}`,
this.name
);
Expand Down Expand Up @@ -483,10 +483,10 @@ export class Room {

if (!this.ops.find(x => x === params[0])) {
this.ops.push(params[0]);
this.sendChat(`${systemPrepend}${params[0]} is now a room operator`);
this.sendChat(`${systemPrepend}${params[0]} is now a room operator.`);
} else {
this.ops = this.ops.filter(x => x !== params[0]);
this.sendChat(`${systemPrepend}${params[0]} is no longer a room operator`);
this.sendChat(`${systemPrepend}${params[0]} is no longer a room operator.`);
}
} else {
unauthorizedChat(player);
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ export function unauthorizedChat(player: Player, operator: boolean = false) {
} else if (operator) {
player.sendChat(1, `${systemPrepend}You are not room owner or operator.`, player.room.name);
} else {
player.sendChat(1, `${systemPrepend}You are not room owner`, player.room.name);
player.sendChat(1, `${systemPrepend}You are not room owner.`, player.room.name);
}
}