update comments
This commit is contained in:
@@ -144,6 +144,7 @@ export function processMessage(
|
|||||||
messageString: string,
|
messageString: string,
|
||||||
config: typeof defaultConfig
|
config: typeof defaultConfig
|
||||||
): void {
|
): void {
|
||||||
|
// MESSAGE ID
|
||||||
// check id
|
// check id
|
||||||
const messageObject: WebSocketMessage = parseMessage(messageString);
|
const messageObject: WebSocketMessage = parseMessage(messageString);
|
||||||
if (!messageObject.uuid) {
|
if (!messageObject.uuid) {
|
||||||
@@ -156,7 +157,7 @@ export function processMessage(
|
|||||||
// remember message
|
// remember message
|
||||||
knownMessageIds.add(messageObject.uuid);
|
knownMessageIds.add(messageObject.uuid);
|
||||||
|
|
||||||
// subscriptions
|
// SUBSCRIPTIONS
|
||||||
doIfIsString(messageObject.subscribeChannel, (subscribeChannel) => {
|
doIfIsString(messageObject.subscribeChannel, (subscribeChannel) => {
|
||||||
trackSubscription(ws, subscribeChannel);
|
trackSubscription(ws, subscribeChannel);
|
||||||
});
|
});
|
||||||
@@ -164,13 +165,13 @@ export function processMessage(
|
|||||||
forgetSubscription(ws, unsubscribeChannel);
|
forgetSubscription(ws, unsubscribeChannel);
|
||||||
});
|
});
|
||||||
|
|
||||||
// message
|
// MESSAGE
|
||||||
doIfIsString(messageObject.messageChannel, (messageChannel) => {
|
doIfIsString(messageObject.messageChannel, (messageChannel) => {
|
||||||
if (messageObject.messageBody == undefined) return;
|
if (messageObject.messageBody == undefined) return;
|
||||||
sendMessage(messageChannel, messageObject.messageBody, messageObject.uuid!);
|
sendMessage(messageChannel, messageObject.messageBody, messageObject.uuid!);
|
||||||
});
|
});
|
||||||
|
|
||||||
// other server
|
// OTHER SERVER
|
||||||
if (messageObject.requestingServerConnection == true) {
|
if (messageObject.requestingServerConnection == true) {
|
||||||
clientsConnected.delete(ws);
|
clientsConnected.delete(ws);
|
||||||
serversConnectedAsClient.add(ws);
|
serversConnectedAsClient.add(ws);
|
||||||
|
|||||||
Reference in New Issue
Block a user