@nsshunt/stsuxvue 1.0.55 → 1.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stsuxvue.mjs +384 -12
- package/dist/stsuxvue.mjs.map +1 -1
- package/dist/stsuxvue.umd.js +382 -10
- package/dist/stsuxvue.umd.js.map +1 -1
- package/package.json +12 -12
package/dist/stsuxvue.mjs
CHANGED
|
@@ -2,13 +2,13 @@ import { defineStore } from "pinia";
|
|
|
2
2
|
import _cloneDeep from "lodash.clonedeep";
|
|
3
3
|
import { defineComponent, defineAsyncComponent, ref, createElementBlock, openBlock, createVNode, unref, reactive, computed, watch, resolveComponent, createBlock, withCtx, createTextVNode, toDisplayString, createElementVNode, createCommentVNode, Fragment, renderList, onMounted, onBeforeUnmount, resolveDynamicComponent, isRef } from "vue";
|
|
4
4
|
import { Gauge, ObservabilitySocketIOSubscriber, ObservabilityRESTAPISubscriber, ObservabilitySubscriptionManager, SubscriptionTopic } from "@nsshunt/stsobservability";
|
|
5
|
-
import { defaultLogger } from "@nsshunt/stsutils";
|
|
5
|
+
import { Sleep, defaultLogger } from "@nsshunt/stsutils";
|
|
6
6
|
import { io } from "socket.io-client";
|
|
7
|
-
import "socket.io";
|
|
8
|
-
import "ioredis";
|
|
7
|
+
import { Server } from "socket.io";
|
|
8
|
+
import { Redis } from "ioredis";
|
|
9
9
|
import require$$0$2 from "node:cluster";
|
|
10
10
|
import require$$1$2 from "socket.io-adapter";
|
|
11
|
-
import "@socket.io/redis-streams-adapter";
|
|
11
|
+
import { createAdapter } from "@socket.io/redis-streams-adapter";
|
|
12
12
|
var _estate = /* @__PURE__ */ ((_estate2) => {
|
|
13
13
|
_estate2["IDLE"] = "idle";
|
|
14
14
|
_estate2["STARTING"] = "starting";
|
|
@@ -9996,7 +9996,61 @@ function v4(options, buf, offset) {
|
|
|
9996
9996
|
return _v4(options);
|
|
9997
9997
|
}
|
|
9998
9998
|
const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
|
|
9999
|
-
|
|
9999
|
+
var tinyEmitter$1 = { exports: {} };
|
|
10000
|
+
var hasRequiredTinyEmitter$1;
|
|
10001
|
+
function requireTinyEmitter$1() {
|
|
10002
|
+
if (hasRequiredTinyEmitter$1) return tinyEmitter$1.exports;
|
|
10003
|
+
hasRequiredTinyEmitter$1 = 1;
|
|
10004
|
+
function E() {
|
|
10005
|
+
}
|
|
10006
|
+
E.prototype = {
|
|
10007
|
+
on: function(name, callback, ctx) {
|
|
10008
|
+
var e = this.e || (this.e = {});
|
|
10009
|
+
(e[name] || (e[name] = [])).push({
|
|
10010
|
+
fn: callback,
|
|
10011
|
+
ctx
|
|
10012
|
+
});
|
|
10013
|
+
return this;
|
|
10014
|
+
},
|
|
10015
|
+
once: function(name, callback, ctx) {
|
|
10016
|
+
var self = this;
|
|
10017
|
+
function listener() {
|
|
10018
|
+
self.off(name, listener);
|
|
10019
|
+
callback.apply(ctx, arguments);
|
|
10020
|
+
}
|
|
10021
|
+
listener._ = callback;
|
|
10022
|
+
return this.on(name, listener, ctx);
|
|
10023
|
+
},
|
|
10024
|
+
emit: function(name) {
|
|
10025
|
+
var data = [].slice.call(arguments, 1);
|
|
10026
|
+
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
|
10027
|
+
var i = 0;
|
|
10028
|
+
var len = evtArr.length;
|
|
10029
|
+
for (i; i < len; i++) {
|
|
10030
|
+
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
|
10031
|
+
}
|
|
10032
|
+
return this;
|
|
10033
|
+
},
|
|
10034
|
+
off: function(name, callback) {
|
|
10035
|
+
var e = this.e || (this.e = {});
|
|
10036
|
+
var evts = e[name];
|
|
10037
|
+
var liveEvents = [];
|
|
10038
|
+
if (evts && callback) {
|
|
10039
|
+
for (var i = 0, len = evts.length; i < len; i++) {
|
|
10040
|
+
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
|
|
10041
|
+
liveEvents.push(evts[i]);
|
|
10042
|
+
}
|
|
10043
|
+
}
|
|
10044
|
+
liveEvents.length ? e[name] = liveEvents : delete e[name];
|
|
10045
|
+
return this;
|
|
10046
|
+
}
|
|
10047
|
+
};
|
|
10048
|
+
tinyEmitter$1.exports = E;
|
|
10049
|
+
tinyEmitter$1.exports.TinyEmitter = E;
|
|
10050
|
+
return tinyEmitter$1.exports;
|
|
10051
|
+
}
|
|
10052
|
+
var tinyEmitterExports$1 = requireTinyEmitter$1();
|
|
10053
|
+
class SocketIoClient extends tinyEmitterExports$1.TinyEmitter {
|
|
10000
10054
|
#agentManager;
|
|
10001
10055
|
#logger;
|
|
10002
10056
|
#name;
|
|
@@ -10005,6 +10059,7 @@ class SocketIoClient {
|
|
|
10005
10059
|
#authToken;
|
|
10006
10060
|
#socket;
|
|
10007
10061
|
constructor(name) {
|
|
10062
|
+
super();
|
|
10008
10063
|
this.#name = name;
|
|
10009
10064
|
}
|
|
10010
10065
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -10072,13 +10127,15 @@ class SocketIoClient {
|
|
|
10072
10127
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10073
10128
|
ErrorCallBack(error) {
|
|
10074
10129
|
}
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10130
|
+
/*
|
|
10131
|
+
emit<Ev extends EventNames<ClientToServerEvents>>(ev: Ev, ...args: EventParams<ClientToServerEvents, Ev>): Socket<ServerToClientEvents, ClientToServerEvents> {
|
|
10132
|
+
if (this.#socket) {
|
|
10133
|
+
return this.#socket!.emit(ev, ...args);
|
|
10134
|
+
} else {
|
|
10135
|
+
throw new Error('SocketIoClient:emit(): Error: [socket instance not defined.]');
|
|
10136
|
+
}
|
|
10081
10137
|
}
|
|
10138
|
+
*/
|
|
10082
10139
|
#EstablishSocketConnect() {
|
|
10083
10140
|
if (this.#socket !== void 0) {
|
|
10084
10141
|
if (this.#socket.connected === true) {
|
|
@@ -10746,7 +10803,322 @@ function requireDist() {
|
|
|
10746
10803
|
}
|
|
10747
10804
|
return dist;
|
|
10748
10805
|
}
|
|
10749
|
-
requireDist();
|
|
10806
|
+
var distExports = requireDist();
|
|
10807
|
+
class SocketIoServer extends tinyEmitterExports$1.TinyEmitter {
|
|
10808
|
+
namespace;
|
|
10809
|
+
socketionamespace;
|
|
10810
|
+
//protected socketionamespace?: Namespace<ClientToServerEvents, ServerToClientEvents, InterServerEvents>
|
|
10811
|
+
logger;
|
|
10812
|
+
io;
|
|
10813
|
+
//#redisClient: RedisClientType | Redis | null = null;
|
|
10814
|
+
redisClient;
|
|
10815
|
+
listenPort;
|
|
10816
|
+
socketIoCustomPath;
|
|
10817
|
+
ioRedisMessageProcessorUrl;
|
|
10818
|
+
serverClusterMode;
|
|
10819
|
+
rooms;
|
|
10820
|
+
constructor() {
|
|
10821
|
+
super();
|
|
10822
|
+
}
|
|
10823
|
+
LogErrorMessage(message) {
|
|
10824
|
+
if (this.logger) {
|
|
10825
|
+
this.logger.error(`${this.namespace}: ${message}`);
|
|
10826
|
+
}
|
|
10827
|
+
}
|
|
10828
|
+
LogDebugMessage(message) {
|
|
10829
|
+
if (this.logger) {
|
|
10830
|
+
this.logger.debug(`${this.namespace}: ${message}`);
|
|
10831
|
+
}
|
|
10832
|
+
}
|
|
10833
|
+
LogInfoMessage(message) {
|
|
10834
|
+
if (this.logger) {
|
|
10835
|
+
this.logger.info(`${this.namespace}: ${message}`);
|
|
10836
|
+
}
|
|
10837
|
+
}
|
|
10838
|
+
LogWarnMessage(message) {
|
|
10839
|
+
if (this.logger) {
|
|
10840
|
+
this.logger.warn(`${this.namespace}: ${message}`);
|
|
10841
|
+
}
|
|
10842
|
+
}
|
|
10843
|
+
// https://socket.io/docs/v4/middlewares/
|
|
10844
|
+
// https://socket.io/docs/v4/server-socket-instance/#sockethandshake
|
|
10845
|
+
// https://socket.io/docs/v4/server-socket-instance/#socket-middlewares
|
|
10846
|
+
// Use this middleward to check every incomming connection
|
|
10847
|
+
SetupConnectionMiddleware = () => {
|
|
10848
|
+
};
|
|
10849
|
+
// Use this middleware to check every packet being received
|
|
10850
|
+
SetupMessageMiddleware = (socket) => {
|
|
10851
|
+
};
|
|
10852
|
+
SocketConnectCallBack = (socket) => {
|
|
10853
|
+
};
|
|
10854
|
+
SocketEventsCallBack = (socket) => {
|
|
10855
|
+
};
|
|
10856
|
+
GetConfig = (socketIoServeroptions) => {
|
|
10857
|
+
const options = {
|
|
10858
|
+
transports: ["websocket"]
|
|
10859
|
+
// or [ "websocket", "polling" ] (to use long-poolling. Note that the order matters)
|
|
10860
|
+
};
|
|
10861
|
+
if (socketIoServeroptions.ioRedisMessageProcessorUrl && socketIoServeroptions.ioRedisMessageProcessorUrl !== "") {
|
|
10862
|
+
this.redisClient = new Redis(socketIoServeroptions.ioRedisMessageProcessorUrl);
|
|
10863
|
+
options.adapter = createAdapter(this.redisClient);
|
|
10864
|
+
} else if (socketIoServeroptions.serverClusterMode && socketIoServeroptions.serverClusterMode === true) {
|
|
10865
|
+
options.adapter = distExports.createAdapter();
|
|
10866
|
+
}
|
|
10867
|
+
if (socketIoServeroptions.wssCustomPath && socketIoServeroptions.wssCustomPath.localeCompare("") !== 0) {
|
|
10868
|
+
options.path = socketIoServeroptions.wssCustomPath;
|
|
10869
|
+
}
|
|
10870
|
+
return options;
|
|
10871
|
+
};
|
|
10872
|
+
SetEngineEvents = () => {
|
|
10873
|
+
if (this.io) {
|
|
10874
|
+
this.io.engine.on("connection_error", (err) => {
|
|
10875
|
+
this.LogInfoMessage(err.req);
|
|
10876
|
+
this.LogInfoMessage(err.code);
|
|
10877
|
+
this.LogInfoMessage(err.message);
|
|
10878
|
+
this.LogInfoMessage(err.context);
|
|
10879
|
+
});
|
|
10880
|
+
}
|
|
10881
|
+
};
|
|
10882
|
+
WithLogger = (logger) => {
|
|
10883
|
+
this.logger = logger;
|
|
10884
|
+
return this;
|
|
10885
|
+
};
|
|
10886
|
+
WithExistingServer = (server) => {
|
|
10887
|
+
if (this.io) {
|
|
10888
|
+
throw new Error(`SocketIoServer:AttachServer(): Error: [Server already attached]`);
|
|
10889
|
+
}
|
|
10890
|
+
this.io = server;
|
|
10891
|
+
return this;
|
|
10892
|
+
};
|
|
10893
|
+
WithListenPort = (listenPort) => {
|
|
10894
|
+
this.listenPort = listenPort;
|
|
10895
|
+
return this;
|
|
10896
|
+
};
|
|
10897
|
+
WithSocketIoCustomPath = (socketIoCustomPath) => {
|
|
10898
|
+
this.socketIoCustomPath = socketIoCustomPath;
|
|
10899
|
+
return this;
|
|
10900
|
+
};
|
|
10901
|
+
WithIoRedisMessageProcessorUrl = (ioRedisMessageProcessorUrl) => {
|
|
10902
|
+
this.ioRedisMessageProcessorUrl = ioRedisMessageProcessorUrl;
|
|
10903
|
+
return this;
|
|
10904
|
+
};
|
|
10905
|
+
WithClusterMode = (serverClusterMode) => {
|
|
10906
|
+
this.serverClusterMode = serverClusterMode;
|
|
10907
|
+
return this;
|
|
10908
|
+
};
|
|
10909
|
+
WithRooms = (rooms) => {
|
|
10910
|
+
this.rooms = rooms;
|
|
10911
|
+
return this;
|
|
10912
|
+
};
|
|
10913
|
+
WithNamespace = (namespace) => {
|
|
10914
|
+
this.namespace = namespace;
|
|
10915
|
+
return this;
|
|
10916
|
+
};
|
|
10917
|
+
StartServer = async () => {
|
|
10918
|
+
if (!this.namespace) {
|
|
10919
|
+
throw new Error(`SocketIoServer:StartServer(): Error: [namespace not specified]`);
|
|
10920
|
+
}
|
|
10921
|
+
if (!this.io) {
|
|
10922
|
+
if (!this.listenPort) {
|
|
10923
|
+
throw new Error(`SocketIoServer:StartServer(): Error: [listenPort not specified]`);
|
|
10924
|
+
}
|
|
10925
|
+
const options = {
|
|
10926
|
+
transports: ["websocket"]
|
|
10927
|
+
// or [ "websocket", "polling" ] (to use long-poolling. Note that the order matters)
|
|
10928
|
+
};
|
|
10929
|
+
if (this.ioRedisMessageProcessorUrl && this.ioRedisMessageProcessorUrl !== "") {
|
|
10930
|
+
this.redisClient = new Redis(this.ioRedisMessageProcessorUrl);
|
|
10931
|
+
options.adapter = createAdapter(this.redisClient);
|
|
10932
|
+
} else if (this.serverClusterMode && this.serverClusterMode === true) {
|
|
10933
|
+
options.adapter = distExports.createAdapter();
|
|
10934
|
+
}
|
|
10935
|
+
if (this.socketIoCustomPath && this.socketIoCustomPath.localeCompare("") !== 0) {
|
|
10936
|
+
options.path = this.socketIoCustomPath;
|
|
10937
|
+
}
|
|
10938
|
+
this.io = new Server(this.listenPort, options);
|
|
10939
|
+
this.SetEngineEvents();
|
|
10940
|
+
await Sleep(500);
|
|
10941
|
+
}
|
|
10942
|
+
let autoJoinRooms;
|
|
10943
|
+
let rooms;
|
|
10944
|
+
if (this.rooms && this.rooms.length > 0) {
|
|
10945
|
+
autoJoinRooms = true;
|
|
10946
|
+
rooms = [...this.rooms];
|
|
10947
|
+
} else {
|
|
10948
|
+
autoJoinRooms = false;
|
|
10949
|
+
rooms = [];
|
|
10950
|
+
}
|
|
10951
|
+
this.SetupNamespace(rooms, autoJoinRooms);
|
|
10952
|
+
return this;
|
|
10953
|
+
};
|
|
10954
|
+
AttachServer = async (server) => {
|
|
10955
|
+
if (this.io) {
|
|
10956
|
+
throw new Error(`SocketIoServer:AttachServer(): Error: [Server already attached]`);
|
|
10957
|
+
}
|
|
10958
|
+
this.io = server;
|
|
10959
|
+
};
|
|
10960
|
+
StopServer = async () => {
|
|
10961
|
+
if (this.io) {
|
|
10962
|
+
await this.CloseNamespaceAdaptors();
|
|
10963
|
+
this.DisconnectNamespaceSockets();
|
|
10964
|
+
await this.io.of("/").adapter.close();
|
|
10965
|
+
if (this.redisClient) {
|
|
10966
|
+
await this.redisClient.disconnect();
|
|
10967
|
+
await Sleep(50);
|
|
10968
|
+
}
|
|
10969
|
+
this.io.disconnectSockets();
|
|
10970
|
+
this.io = void 0;
|
|
10971
|
+
}
|
|
10972
|
+
};
|
|
10973
|
+
LeaveRoom = (socket, room) => {
|
|
10974
|
+
this.LogDebugMessage(`Leaving room [${room}]`);
|
|
10975
|
+
socket.leave(room);
|
|
10976
|
+
};
|
|
10977
|
+
JoinRoom = (socket, room) => {
|
|
10978
|
+
this.LogDebugMessage(`Socket joining room [${room}], ID: [${socket.id}]`);
|
|
10979
|
+
socket.join(room);
|
|
10980
|
+
};
|
|
10981
|
+
SetupStandardEvents = (socket) => {
|
|
10982
|
+
socket.on("disconnect", (reason) => {
|
|
10983
|
+
this.LogDebugMessage(`socket disconnect, ID: [${socket.id}] [${reason}]`);
|
|
10984
|
+
});
|
|
10985
|
+
socket.on("disconnecting", (reason) => {
|
|
10986
|
+
this.LogDebugMessage(`socket disconnecting, ID: [${socket.id}] [${reason}]`);
|
|
10987
|
+
});
|
|
10988
|
+
socket.on("error", (error) => {
|
|
10989
|
+
this.LogDebugMessage(`socket error, ID: [${socket.id}] [${error}]`);
|
|
10990
|
+
});
|
|
10991
|
+
socket.on("__STSdisconnect", (reason) => {
|
|
10992
|
+
this.LogDebugMessage(`__STSdisconnect: socket disconnect, ID: [${socket.id}] [${reason}]`);
|
|
10993
|
+
});
|
|
10994
|
+
socket.on("__STSdisconnecting", (reason, callBackResult) => {
|
|
10995
|
+
this.LogDebugMessage(`__STSdisconnecting: socket disconnecting, ID: [${socket.id}] [${reason}]`);
|
|
10996
|
+
callBackResult("__STSdisconnecting accepted by server.");
|
|
10997
|
+
});
|
|
10998
|
+
socket.on("__STSjoinRoom", (rooms) => {
|
|
10999
|
+
rooms.forEach((room) => {
|
|
11000
|
+
this.JoinRoom(socket, room);
|
|
11001
|
+
});
|
|
11002
|
+
});
|
|
11003
|
+
socket.on("__STSleaveRoom", (rooms) => {
|
|
11004
|
+
rooms.forEach((room) => {
|
|
11005
|
+
this.LeaveRoom(socket, room);
|
|
11006
|
+
});
|
|
11007
|
+
});
|
|
11008
|
+
socket.on("__STSsendToRoom", (rooms, payload) => {
|
|
11009
|
+
rooms.forEach((room) => {
|
|
11010
|
+
if (this.socketionamespace) {
|
|
11011
|
+
this.LogDebugMessage(`socket.on: __STSsendToRoom: Sending to room [${room}], ID: [${socket.id}]`);
|
|
11012
|
+
this.socketionamespace.to(room).emit(payload.command, payload);
|
|
11013
|
+
}
|
|
11014
|
+
});
|
|
11015
|
+
});
|
|
11016
|
+
socket.on("__STSsendToRoomWithCallback", (room, timeout, payload, cb) => {
|
|
11017
|
+
if (this.socketionamespace) {
|
|
11018
|
+
this.socketionamespace.to(room).timeout(timeout).emit(payload.command, payload, (err, dataResponse) => {
|
|
11019
|
+
if (err) {
|
|
11020
|
+
console.error(err);
|
|
11021
|
+
const errorResponse = {
|
|
11022
|
+
error: true,
|
|
11023
|
+
errorName: err.name,
|
|
11024
|
+
errorMessage: err.message
|
|
11025
|
+
//errorCause: err.cause,
|
|
11026
|
+
//errorStack: err.stack
|
|
11027
|
+
};
|
|
11028
|
+
this.LogErrorMessage(`__STSsendToRoomWithCallback broadcast (error): [${JSON.stringify(errorResponse)}]`);
|
|
11029
|
+
cb(errorResponse);
|
|
11030
|
+
} else {
|
|
11031
|
+
this.LogDebugMessage(`__STSsendToRoomWithCallback broadcast: [${JSON.stringify(dataResponse)}]`);
|
|
11032
|
+
cb(dataResponse);
|
|
11033
|
+
}
|
|
11034
|
+
});
|
|
11035
|
+
}
|
|
11036
|
+
});
|
|
11037
|
+
socket.on("__STSsendToRoomsWithCallback", (rooms, timeout, payload, cb) => {
|
|
11038
|
+
const responses = [];
|
|
11039
|
+
const timeoutForComplete = setTimeout(() => {
|
|
11040
|
+
responses.push({
|
|
11041
|
+
room: "",
|
|
11042
|
+
responses: {
|
|
11043
|
+
error: true,
|
|
11044
|
+
errorName: "timeout",
|
|
11045
|
+
errorMessage: `__STSsendToRoomsWithCallback timeout: [${timeout}] before all responses received`
|
|
11046
|
+
}
|
|
11047
|
+
});
|
|
11048
|
+
cb(responses);
|
|
11049
|
+
}, timeout).unref();
|
|
11050
|
+
rooms.forEach((room) => {
|
|
11051
|
+
if (this.socketionamespace) {
|
|
11052
|
+
this.socketionamespace.to(room).timeout(timeout).emit(payload.command, payload, (err, dataResponse) => {
|
|
11053
|
+
if (err) {
|
|
11054
|
+
console.error(err);
|
|
11055
|
+
const errorResponse = {
|
|
11056
|
+
error: true,
|
|
11057
|
+
errorName: err.name,
|
|
11058
|
+
errorMessage: err.message
|
|
11059
|
+
//errorCause: err.cause,
|
|
11060
|
+
//errorStack: err.stack
|
|
11061
|
+
};
|
|
11062
|
+
this.LogErrorMessage(`__STSsendToRoomWithCallback broadcast (error): [${JSON.stringify(errorResponse)}]`);
|
|
11063
|
+
responses.push({
|
|
11064
|
+
room,
|
|
11065
|
+
responses: errorResponse
|
|
11066
|
+
});
|
|
11067
|
+
} else {
|
|
11068
|
+
this.LogDebugMessage(`__STSsendToRoomWithCallback broadcast: [${JSON.stringify(dataResponse)}]`);
|
|
11069
|
+
responses.push({
|
|
11070
|
+
room,
|
|
11071
|
+
responses: dataResponse
|
|
11072
|
+
});
|
|
11073
|
+
}
|
|
11074
|
+
if (responses.length === rooms.length) {
|
|
11075
|
+
clearTimeout(timeoutForComplete);
|
|
11076
|
+
cb(responses);
|
|
11077
|
+
}
|
|
11078
|
+
});
|
|
11079
|
+
}
|
|
11080
|
+
});
|
|
11081
|
+
});
|
|
11082
|
+
};
|
|
11083
|
+
SetupNamespace = (rooms, autoJoinRooms) => {
|
|
11084
|
+
if (this.io) {
|
|
11085
|
+
this.socketionamespace = this.io.of(`/${this.namespace}/`);
|
|
11086
|
+
this.SetupConnectionMiddleware();
|
|
11087
|
+
this.socketionamespace.on("connection", (socket) => {
|
|
11088
|
+
this.LogDebugMessage(`Socket connected, ID: [${socket.id}]`);
|
|
11089
|
+
this.LogDebugMessage(`Authentication Handshake (auth): [${JSON.stringify(socket.handshake.auth)}]`);
|
|
11090
|
+
this.LogDebugMessage(`Authentication Handshake (host): [${JSON.stringify(socket.handshake.headers.host)}]`);
|
|
11091
|
+
this.LogDebugMessage(`Authentication Handshake (url): [${JSON.stringify(socket.handshake.url)}]`);
|
|
11092
|
+
this.LogDebugMessage(`Authentication Handshake: [${JSON.stringify(socket.handshake)}]`);
|
|
11093
|
+
this.SetupMessageMiddleware(socket);
|
|
11094
|
+
if (autoJoinRooms) {
|
|
11095
|
+
rooms.map((room) => {
|
|
11096
|
+
this.JoinRoom(socket, room);
|
|
11097
|
+
});
|
|
11098
|
+
}
|
|
11099
|
+
this.SetupStandardEvents(socket);
|
|
11100
|
+
setTimeout(() => {
|
|
11101
|
+
this.SocketConnectCallBack(socket);
|
|
11102
|
+
}, 0);
|
|
11103
|
+
this.SocketEventsCallBack(socket);
|
|
11104
|
+
});
|
|
11105
|
+
} else {
|
|
11106
|
+
throw new Error("SocketIoServer:SetupNamespace(): Error: [No server attached");
|
|
11107
|
+
}
|
|
11108
|
+
return this;
|
|
11109
|
+
};
|
|
11110
|
+
CloseNamespaceAdaptors = async () => {
|
|
11111
|
+
if (this.socketionamespace) {
|
|
11112
|
+
await this.socketionamespace.adapter.close();
|
|
11113
|
+
}
|
|
11114
|
+
};
|
|
11115
|
+
DisconnectNamespaceSockets = () => {
|
|
11116
|
+
if (this.socketionamespace) {
|
|
11117
|
+
this.socketionamespace.disconnectSockets();
|
|
11118
|
+
this.socketionamespace = void 0;
|
|
11119
|
+
}
|
|
11120
|
+
};
|
|
11121
|
+
}
|
|
10750
11122
|
var tinyEmitter = { exports: {} };
|
|
10751
11123
|
var hasRequiredTinyEmitter;
|
|
10752
11124
|
function requireTinyEmitter() {
|