ensure that channel is being looked up with reservation_no
This commit is contained in:
parent
66b8ef945f
commit
8ee1c6551f
@ -30,16 +30,16 @@ class XhrListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public relayEvent(event: string, archMsg: ArchimedesMessage): boolean {
|
public relayEvent(event: string, archMsg: ArchimedesMessage): boolean {
|
||||||
logger.debugLog.info(`XhrListener:relayEvent(event: ${event}, channel: ${archMsg.examId})`);
|
logger.debugLog.info(`XhrListener:relayEvent(event: ${event}, channel: ${archMsg.reservation_no})`);
|
||||||
for (let c of this.#cm.channels) {
|
for (let c of this.#cm.channels) {
|
||||||
if (archMsg.examId === c.id) {
|
if (archMsg.reservation_no === c.id) {
|
||||||
let dmCount: number = 0;
|
let dmCount: number = 0;
|
||||||
for (let client of c.clients) {
|
for (let client of c.clients) {
|
||||||
let nonce: string = crypto.randomBytes(4).toString("hex");
|
let nonce: string = crypto.randomBytes(4).toString("hex");
|
||||||
// TODO: verify the nonce against the received reply, which we currently ignore
|
// TODO: verify the nonce against the received reply, which we currently ignore
|
||||||
client.directMessage(JSON.stringify({
|
client.directMessage(JSON.stringify({
|
||||||
message_type: "broadcast",
|
message_type: "broadcast",
|
||||||
message: { event_type: event, seq_id: nonce, reservation_no: archMsg.reservation_no }
|
message: { event_type: event, seq_id: nonce, examId: archMsg.examId }
|
||||||
}));
|
}));
|
||||||
dmCount++;
|
dmCount++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user