mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-14 12:29:15 +00:00
Merge branch 'fix/msgid-crash' into 'master'
Check that the message is proper before trying to put an id inside it See merge request BondageProjects/Bondage-College!5498
This commit is contained in:
commit
11f498ce26
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