mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-14 12:29:15 +00:00
Check that the message is proper before trying to put an id inside it
Stops a crash when running BCX, as it uses an object as a dictionary instead of an array.
This commit is contained in:
parent
1a185e0318
commit
2f7accdf20
1 changed files with 5 additions and 3 deletions
|
@ -323,9 +323,11 @@ function ServerSendQueueProcess() {
|
|||
if (item) {
|
||||
if (item.Message === "ChatRoomChat") {
|
||||
const [data] = item.args;
|
||||
data.Dictionary = data?.Dictionary ?? [];
|
||||
data.Dictionary.push({ Tag: "MsgId", MsgId: CommonGenerateUniqueID() });
|
||||
}
|
||||
if (["Chat", "Emote", "Whisper"].includes(data?.Type) && (CommonIsArray(data.Dictionary) || data.Dictionary === undefined)) {
|
||||
data.Dictionary = data?.Dictionary ?? [];
|
||||
data.Dictionary.push({ Tag: "MsgId", MsgId: CommonGenerateUniqueID() });
|
||||
}
|
||||
}
|
||||
ServerSocket.emit(item.Message, ...item.args);
|
||||
ServerSendRateLimitTimes.push(Date.now());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue