aotrautils 0.0.294 → 0.0.295

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-21:10:44)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (27/11/2022-22:10:56)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4827,7 +4827,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4827
4827
 
4828
4828
 
4829
4829
 
4830
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (27/11/2022-21:10:44)»*/
4830
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (27/11/2022-22:10:56)»*/
4831
4831
  /*-----------------------------------------------------------------------------*/
4832
4832
  /* ## Utility global methods in a browser (htmljs) client environment.
4833
4833
  *
@@ -12948,7 +12948,7 @@ createOritaMicroClient=function(url, port, isNode=false){
12948
12948
  };
12949
12949
 
12950
12950
 
12951
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (27/11/2022-21:10:44)»*/
12951
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (27/11/2022-22:10:56)»*/
12952
12952
  /*-----------------------------------------------------------------------------*/
12953
12953
 
12954
12954
 
@@ -14176,7 +14176,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14176
14176
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14177
14177
 
14178
14178
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14179
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (27/11/2022-21:10:44)»*/
14179
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (27/11/2022-22:10:56)»*/
14180
14180
  /*-----------------------------------------------------------------------------*/
14181
14181
 
14182
14182
 
@@ -14553,56 +14553,42 @@ WebsocketImplementation={
14553
14553
  // With «ws» library we have no choive than register message events inside a «connection» event !
14554
14554
  // nodeServerInstance.onConnectionToClient((serverParam, clientSocketParam)=>{
14555
14555
 
14556
- // TODO : Find a way to remove this !
14557
- const doOnMessage=(eventOrMessage)=>{
14558
-
14559
-
14560
- // DBG
14561
- lognow("(SERVER) RECEIVED SOMETHING FROM CLIENT...");
14562
-
14563
- // dataWrapped=JSON.parse(dataWrapped);
14564
- // dataWrapped=getAt(dataWrapped,0);// We get the root element
14565
-
14566
-
14567
- const dataWrapped=WebsocketImplementation.getMessageDataBothImplementations(eventOrMessage);
14568
14556
 
14569
14557
 
14570
- // DBG
14571
- lognow("(SERVER) dataWrapped.channelName:",dataWrapped.channelName);
14572
- lognow("(SERVER) receptionEntryPoint.channelName:",receptionEntryPoint.channelName);
14573
-
14574
-
14575
- // Channel information is stored in exchanged data :
14576
- if(dataWrapped.channelName!==receptionEntryPoint.channelName) return;
14577
-
14578
-
14579
- const clientSocket=clientSocketParam;
14580
-
14581
-
14582
-
14583
- // TODO : FIXME : Use one single interface !
14584
- // Room information is stored in client socket object :
14585
- const isClientInRoom=WebsocketImplementation.isInRoom(clientSocket, receptionEntryPoint.clientsRoomsTag);
14586
-
14587
- // DBG
14588
- lognow("(SERVER) isClientInRoom:",isClientInRoom);
14589
-
14590
- if(!isClientInRoom) return;
14558
+ // DBG
14559
+ lognow("(SERVER) RECEIVED SOMETHING FROM CLIENT...");
14560
+
14561
+ // dataWrapped=JSON.parse(dataWrapped);
14562
+ // dataWrapped=getAt(dataWrapped,0);// We get the root element
14563
+
14591
14564
 
14592
- // DBG
14593
- lognow("(SERVER) doOnIncomingMessage:",doOnIncomingMessage);
14594
-
14595
- doOnIncomingMessage(dataWrapped.data, clientSocket);
14596
-
14597
- };
14565
+ const dataWrapped=WebsocketImplementation.getMessageDataBothImplementations(eventOrMessage);
14566
+
14567
+
14568
+ // DBG
14569
+ lognow("(SERVER) dataWrapped.channelName:",dataWrapped.channelName);
14570
+ lognow("(SERVER) receptionEntryPoint.channelName:",receptionEntryPoint.channelName);
14571
+
14598
14572
 
14599
-
14573
+ // Channel information is stored in exchanged data :
14574
+ if(dataWrapped.channelName!==receptionEntryPoint.channelName) return;
14575
+
14576
+
14577
+ const clientSocket=clientSocketParam;
14578
+
14600
14579
 
14601
- if(!WebsocketImplementation.useSocketIOImplementation) clientSocketParam.addEventListener("message", doOnMessage);
14602
- else clientSocketParam.on(channelName, doOnMessage);
14580
+ // TODO : FIXME : Use one single interface !
14581
+ // Room information is stored in client socket object :
14582
+ const isClientInRoom=WebsocketImplementation.isInRoom(clientSocket, receptionEntryPoint.clientsRoomsTag);
14603
14583
 
14584
+ // DBG
14585
+ lognow("(SERVER) isClientInRoom:",isClientInRoom);
14604
14586
 
14587
+ if(!isClientInRoom) return;
14605
14588
 
14589
+ // DBG
14590
+ lognow("(SERVER) doOnIncomingMessage:",doOnIncomingMessage);
14591
+ if(doOnIncomingMessage) doOnIncomingMessage(dataWrapped.data, clientSocket);
14606
14592
 
14607
14593
 
14608
14594
  },
@@ -14705,15 +14691,38 @@ WebsocketImplementation={
14705
14691
  // console.log("nodeServerInstance.receptionEntryPoints.length:",nodeServerInstance.receptionEntryPoints.length);
14706
14692
 
14707
14693
 
14708
-
14709
- // We execute the events registration listeners entry points:
14710
- foreach(nodeServerInstance.receptionEntryPoints,(receptionEntryPoint,i)=>{
14711
-
14712
- // // DBG
14713
- // console.log("ENTRY POINT ["+i+"] !");
14714
-
14715
- receptionEntryPoint.execute(clientSocket);
14716
- });
14694
+
14695
+
14696
+ ////
14697
+
14698
+ doOnMessage=()=>{
14699
+
14700
+
14701
+
14702
+ // We execute the events registration listeners entry points:
14703
+ foreach(nodeServerInstance.receptionEntryPoints,(receptionEntryPoint,i)=>{
14704
+
14705
+ // DBG
14706
+ console.log("(SERVER) ENTRY POINT ["+i+"] is executed !");
14707
+
14708
+ receptionEntryPoint.execute(clientSocket);
14709
+ });
14710
+
14711
+ };
14712
+
14713
+
14714
+ if(!WebsocketImplementation.useSocketIOImplementation) clientSocketParam.addEventListener("message", doOnMessage);
14715
+ else clientSocketParam.on(channelName, doOnMessage);
14716
+
14717
+
14718
+
14719
+
14720
+
14721
+
14722
+
14723
+
14724
+
14725
+
14717
14726
 
14718
14727
 
14719
14728
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.294",
3
+ "version": "0.0.295",
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)",