aotrautils 0.0.214 → 0.0.217

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.0.0.000 (19/07/2022-04:19:44)»*/
3
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (22/07/2022-00:54:19)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4828
4828
 
4829
4829
 
4830
4830
 
4831
- /*utils CLIENT library associated with aotra version : «1.0.0.000 (19/07/2022-04:19:44)»*/
4831
+ /*utils CLIENT library associated with aotra version : «1.0.0.000 (22/07/2022-00:54:19)»*/
4832
4832
  /*-----------------------------------------------------------------------------*/
4833
4833
  /* ## Utility global methods in a browser (htmljs) client environment.
4834
4834
  *
@@ -11678,7 +11678,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
11678
11678
 
11679
11679
 
11680
11680
 
11681
- /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (19/07/2022-04:19:44)»*/
11681
+ /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (22/07/2022-00:54:19)»*/
11682
11682
  /*-----------------------------------------------------------------------------*/
11683
11683
 
11684
11684
 
@@ -12884,7 +12884,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
12884
12884
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
12885
12885
 
12886
12886
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
12887
- /*utils SERVER library associated with aotra version : «1.0.0.000 (19/07/2022-04:19:44)»*/
12887
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (22/07/2022-00:54:19)»*/
12888
12888
  /*-----------------------------------------------------------------------------*/
12889
12889
 
12890
12890
 
@@ -13403,7 +13403,6 @@ WebsocketImplementation={
13403
13403
  if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.terminate();
13404
13404
  else clientSocket.emit("endConnection");
13405
13405
 
13406
- // TODO : FIXME : DUPLICATED CODE :
13407
13406
  if(!empty(nodeServerInstance.onClientLostListeners))
13408
13407
  foreach(nodeServerInstance.onClientLostListeners,l=>{l.execute(clientSocket);});
13409
13408
 
@@ -13413,31 +13412,13 @@ WebsocketImplementation={
13413
13412
  }
13414
13413
 
13415
13414
  clientSocket.isConnectionAlive=false;
13416
- // try{
13417
13415
 
13418
- // OLD :
13419
- // if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.ping();
13420
- // else clientSocket.emit("ping");
13416
+ // OLD :
13417
+ // if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.ping();
13418
+ // else clientSocket.emit("ping");
13421
13419
 
13422
13420
  nodeServerInstance.send("protocol",{type:"ping"});
13423
13421
 
13424
-
13425
- // }catch(error){
13426
- // lognow("ERROR : A problem occurred when tried to ping client socket : ",error);
13427
- // // We effectively end the client connection to this server :
13428
- //
13429
- // // TODO : FIXME : DUPLICATED CODE :
13430
- // // TODO : FIXME : Use one single interface !
13431
- // if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.terminate();
13432
- // else clientSocket.emit("endConnection");
13433
- //
13434
- // // TODO : FIXME : DUPLICATED CODE :
13435
- // if(!empty(nodeServerInstance.onClientLostListeners))
13436
- // foreach(nodeServerInstance.onClientLostListeners,l=>{l.execute(clientSocket);});
13437
- //
13438
- // return;
13439
- // }
13440
-
13441
13422
 
13442
13423
  }, nodeServerInstance.clientTimeoutMillis);
13443
13424
 
@@ -13610,7 +13591,7 @@ WebsocketImplementation={
13610
13591
 
13611
13592
  send:(channelName, data, clientsRoomsTag=null)=>{
13612
13593
 
13613
- let clientSocket=nodeClientInstance.clientSocket;
13594
+ const clientSocket=nodeClientInstance.clientSocket;
13614
13595
 
13615
13596
 
13616
13597
  // // DBG
@@ -13662,15 +13643,19 @@ WebsocketImplementation={
13662
13643
  if(nodeClientInstance.hasConnectEventFired) return;
13663
13644
  nodeClientInstance.hasConnectEventFired=true;
13664
13645
 
13665
- let clientSocket=nodeClientInstance.clientSocket;
13646
+ const clientSocket=nodeClientInstance.clientSocket;
13647
+
13648
+ // DBG
13649
+ clientSocket.clientId=getUUID();
13666
13650
 
13667
13651
  doOnConnection(nodeClientInstance, clientSocket);
13668
13652
 
13669
- // We execute the listeners entry points:
13653
+ // We execute the listeners entry points registration :
13670
13654
  foreach(nodeClientInstance.receptionEntryPoints,(receptionEntryPoint)=>{
13671
13655
  receptionEntryPoint.execute(clientSocket);
13672
13656
  });
13673
13657
 
13658
+
13674
13659
  };
13675
13660
 
13676
13661
  if(!WebsocketImplementation.useSocketIOImplementation) nodeClientInstance.clientSocket.addEventListener("open",doAllOnConnection);
@@ -13770,7 +13755,7 @@ WebsocketImplementation={
13770
13755
 
13771
13756
  send:(channelName, data, clientsRoomsTag=null)=>{
13772
13757
 
13773
- let clientSocket=browserInstance.clientSocket;
13758
+ const clientSocket=browserInstance.clientSocket;
13774
13759
 
13775
13760
 
13776
13761
  // // DBG
@@ -13813,13 +13798,24 @@ WebsocketImplementation={
13813
13798
 
13814
13799
 
13815
13800
  onConnectionToServer:(doOnConnection)=>{
13801
+ const doAllOnConnection=()=>{
13802
+
13803
+ // To avoid triggering this event several times, depending on the implementation :
13804
+ if(browserInstance.hasConnectEventFired) return;
13805
+ browserInstance.hasConnectEventFired=true;
13806
+
13807
+ const clientSocket=browserInstance.clientSocket;
13808
+
13809
+ // DBG
13810
+ clientSocket.clientId=getUUID();
13811
+
13812
+ doOnConnection(browserInstance, clientSocket);
13813
+
13814
+
13815
+ };
13816
13816
 
13817
- // To avoid triggering this event several times, depending on the implementation :
13818
- if(browserInstance.hasConnectEventFired) return;
13819
- browserInstance.hasConnectEventFired=true;
13820
-
13821
- if(!WebsocketImplementation.useSocketIOImplementation) browserInstance.clientSocket.addEventListener("open",doOnConnection);
13822
- else browserInstance.clientSocket.on("connect",doOnConnection);
13817
+ if(!WebsocketImplementation.useSocketIOImplementation) browserInstance.clientSocket.addEventListener("open",doAllOnConnection);
13818
+ else browserInstance.clientSocket.on("connect",doAllOnConnection);
13823
13819
 
13824
13820
 
13825
13821
  },
@@ -14281,7 +14277,8 @@ class ListManager{
14281
14277
  if(!this.isSessionActive()) return false;
14282
14278
  const clientPosition=this.getItemPosition(clientId);
14283
14279
  //CAUTION : Client position starts at 1 !
14284
- const result=((clientPosition-1)<=this.maxItemsNumber && (clientPosition-1)<=this.simultaneousItemsNumber);
14280
+ const clientIndex=(clientPosition-1);
14281
+ const result=(clientIndex<=this.maxItemsNumber && clientIndex<=this.simultaneousItemsNumber);
14285
14282
 
14286
14283
  return result;
14287
14284
  }
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.214",
3
+ "version": "0.0.217",
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)",