aotrautils-srv 0.0.291 → 0.0.293
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (27/11/2022-22:
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (27/11/2022-22:30:56)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -4827,7 +4827,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4827
4827
|
|
|
4828
4828
|
|
|
4829
4829
|
|
|
4830
|
-
/*utils SERVER library associated with aotra version : «1_29072022-2359 (27/11/2022-22:
|
|
4830
|
+
/*utils SERVER library associated with aotra version : «1_29072022-2359 (27/11/2022-22:30:56)»*/
|
|
4831
4831
|
/*-----------------------------------------------------------------------------*/
|
|
4832
4832
|
|
|
4833
4833
|
|
|
@@ -5198,7 +5198,7 @@ WebsocketImplementation={
|
|
|
5198
5198
|
const receptionEntryPoint={
|
|
5199
5199
|
channelName:channelName,
|
|
5200
5200
|
clientsRoomsTag:clientsRoomsTag,
|
|
5201
|
-
execute:(clientSocketParam)=>{
|
|
5201
|
+
execute:(clientSocketParam, eventOrMessage)=>{
|
|
5202
5202
|
|
|
5203
5203
|
|
|
5204
5204
|
// With «ws» library we have no choive than register message events inside a «connection» event !
|
|
@@ -5225,12 +5225,11 @@ WebsocketImplementation={
|
|
|
5225
5225
|
if(dataWrapped.channelName!==receptionEntryPoint.channelName) return;
|
|
5226
5226
|
|
|
5227
5227
|
|
|
5228
|
-
const clientSocket=clientSocketParam;
|
|
5229
5228
|
|
|
5230
5229
|
|
|
5231
5230
|
// TODO : FIXME : Use one single interface !
|
|
5232
5231
|
// Room information is stored in client socket object :
|
|
5233
|
-
const isClientInRoom=WebsocketImplementation.isInRoom(
|
|
5232
|
+
const isClientInRoom=WebsocketImplementation.isInRoom(clientSocketParam, receptionEntryPoint.clientsRoomsTag);
|
|
5234
5233
|
|
|
5235
5234
|
// DBG
|
|
5236
5235
|
lognow("(SERVER) isClientInRoom:",isClientInRoom);
|
|
@@ -5239,7 +5238,7 @@ WebsocketImplementation={
|
|
|
5239
5238
|
|
|
5240
5239
|
// DBG
|
|
5241
5240
|
lognow("(SERVER) doOnIncomingMessage:",doOnIncomingMessage);
|
|
5242
|
-
if(doOnIncomingMessage) doOnIncomingMessage(dataWrapped.data,
|
|
5241
|
+
if(doOnIncomingMessage) doOnIncomingMessage(dataWrapped.data, clientSocketParam);
|
|
5243
5242
|
|
|
5244
5243
|
|
|
5245
5244
|
},
|
|
@@ -5346,8 +5345,7 @@ WebsocketImplementation={
|
|
|
5346
5345
|
|
|
5347
5346
|
////
|
|
5348
5347
|
|
|
5349
|
-
doOnMessage=()=>{
|
|
5350
|
-
|
|
5348
|
+
doOnMessage=(eventOrMessage)=>{
|
|
5351
5349
|
|
|
5352
5350
|
|
|
5353
5351
|
// We execute the events registration listeners entry points:
|
|
@@ -5356,14 +5354,14 @@ WebsocketImplementation={
|
|
|
5356
5354
|
// DBG
|
|
5357
5355
|
console.log("(SERVER) ENTRY POINT ["+i+"] is executed !");
|
|
5358
5356
|
|
|
5359
|
-
receptionEntryPoint.execute(clientSocket);
|
|
5357
|
+
receptionEntryPoint.execute(clientSocket, eventOrMessage);
|
|
5360
5358
|
});
|
|
5361
5359
|
|
|
5362
5360
|
};
|
|
5363
5361
|
|
|
5364
5362
|
|
|
5365
|
-
if(!WebsocketImplementation.useSocketIOImplementation)
|
|
5366
|
-
else
|
|
5363
|
+
if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.addEventListener("message", doOnMessage);
|
|
5364
|
+
else clientSocket.on(channelName, doOnMessage);
|
|
5367
5365
|
|
|
5368
5366
|
|
|
5369
5367
|
|
aotrautils-srv/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.293",
|
|
4
4
|
"main": "aotrautils-srv.build.js",
|
|
5
5
|
"description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
|
|
6
6
|
"author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",
|