aotrautils 0.0.514 → 0.0.516

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 (22/02/2023-01:15:55)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (07/03/2023-00:40:50)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4866,7 +4866,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4866
4866
 
4867
4867
 
4868
4868
 
4869
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (22/02/2023-01:15:55)»*/
4869
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (07/03/2023-00:40:50)»*/
4870
4870
  /*-----------------------------------------------------------------------------*/
4871
4871
  /* ## Utility global methods in a browser (htmljs) client environment.
4872
4872
  *
@@ -13078,7 +13078,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
13078
13078
  };
13079
13079
 
13080
13080
 
13081
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (22/02/2023-01:15:55)»*/
13081
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (07/03/2023-00:40:50)»*/
13082
13082
  /*-----------------------------------------------------------------------------*/
13083
13083
 
13084
13084
 
@@ -14306,7 +14306,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14306
14306
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14307
14307
 
14308
14308
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14309
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (22/02/2023-01:15:55)»*/
14309
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (07/03/2023-00:40:50)»*/
14310
14310
  /*-----------------------------------------------------------------------------*/
14311
14311
 
14312
14312
 
@@ -14546,7 +14546,7 @@ WebsocketImplementation={
14546
14546
 
14547
14547
  // COMMON METHODS
14548
14548
  /*private static*/isInRoom(clientSocket, clientsRoomsTag){
14549
- return !clientsRoomsTag || empty(clientsRoomsTag) || contains(clientsRoomsTag, clientSocket.clientRoomTag);
14549
+ return (!clientsRoomsTag || empty(clientsRoomsTag) || contains(clientsRoomsTag, clientSocket.clientRoomTag));
14550
14550
  },
14551
14551
 
14552
14552
 
@@ -14902,12 +14902,12 @@ WebsocketImplementation={
14902
14902
  clientSocket.isConnectionAlive=false;
14903
14903
 
14904
14904
  // DBG
14905
- //lognow("(SERVER) SENDING PING");
14905
+ lognow("(SERVER) DEBUG : SENDING PING");
14906
14906
 
14907
14907
  if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.ping();
14908
14908
  // OLD :
14909
14909
  // else clientSocket.emit("ping");
14910
- else nodeServerInstance.send("protocol",{type:"ping"});
14910
+ else nodeServerInstance.send("protocol",{type:"ping"}, null, clientSocket);
14911
14911
 
14912
14912
 
14913
14913
  }, nodeServerInstance.clientPingIntervalMillis);
@@ -15295,10 +15295,9 @@ WebsocketImplementation={
15295
15295
 
15296
15296
  // We add a message id :
15297
15297
  const messageId=getUUID();
15298
-
15299
15298
  data.messageId=messageId;
15300
- browserInstance.send(channelNameParam, data, clientsRoomsTag);
15301
15299
 
15300
+ // 1) We prepare the reception :
15302
15301
  const resultPromise={
15303
15302
  clientsRoomsTag:clientsRoomsTag,
15304
15303
  messageId:messageId,
@@ -15307,6 +15306,8 @@ WebsocketImplementation={
15307
15306
 
15308
15307
  browserInstance.receive(channelNameForResponse, (dataLocal, clientSocket)=>{
15309
15308
 
15309
+
15310
+ // We check if the message matches the condition :
15310
15311
  if(listenerConfig.condition && !listenerConfig.condition(dataLocal, clientSocket)) return ;
15311
15312
 
15312
15313
  // We check if we have the same message id:
@@ -15321,6 +15322,9 @@ WebsocketImplementation={
15321
15322
  return resultPromise;
15322
15323
  }
15323
15324
  };
15325
+
15326
+ // 2) We send the data :
15327
+ browserInstance.send(channelNameParam, data, clientsRoomsTag);
15324
15328
 
15325
15329
 
15326
15330
  return resultPromise;
@@ -15431,16 +15435,6 @@ WebsocketImplementation={
15431
15435
 
15432
15436
 
15433
15437
 
15434
- if(WebsocketImplementation.useSocketIOImplementation){
15435
- browserInstance.receive("protocol",(message)=>{
15436
- if(message.type!=="ping") return;
15437
- browserInstance.send("protocol",{type:"pong"});
15438
-
15439
- // DBG
15440
- lognow("DEBUG : CLIENT : Pong sent.");
15441
- });
15442
- }
15443
-
15444
15438
 
15445
15439
  return browserInstance;
15446
15440
  },
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.514",
3
+ "version": "0.0.516",
4
4
  "main": "aotrautils.build.js",
5
5
  "description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",