aotrautils 0.0.294 → 0.0.296

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:25:48)»*/
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:25:48)»*/
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:25:48)»*/
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:25:48)»*/
14180
14180
  /*-----------------------------------------------------------------------------*/
14181
14181
 
14182
14182
 
@@ -14553,56 +14553,41 @@ 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
+
14600
14578
 
14601
- if(!WebsocketImplementation.useSocketIOImplementation) clientSocketParam.addEventListener("message", doOnMessage);
14602
- else clientSocketParam.on(channelName, doOnMessage);
14579
+ // TODO : FIXME : Use one single interface !
14580
+ // Room information is stored in client socket object :
14581
+ const isClientInRoom=WebsocketImplementation.isInRoom(clientSocketParam, receptionEntryPoint.clientsRoomsTag);
14603
14582
 
14583
+ // DBG
14584
+ lognow("(SERVER) isClientInRoom:",isClientInRoom);
14604
14585
 
14586
+ if(!isClientInRoom) return;
14605
14587
 
14588
+ // DBG
14589
+ lognow("(SERVER) doOnIncomingMessage:",doOnIncomingMessage);
14590
+ if(doOnIncomingMessage) doOnIncomingMessage(dataWrapped.data, clientSocketParam);
14606
14591
 
14607
14592
 
14608
14593
  },
@@ -14705,15 +14690,38 @@ WebsocketImplementation={
14705
14690
  // console.log("nodeServerInstance.receptionEntryPoints.length:",nodeServerInstance.receptionEntryPoints.length);
14706
14691
 
14707
14692
 
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
- });
14693
+
14694
+
14695
+ ////
14696
+
14697
+ doOnMessage=()=>{
14698
+
14699
+
14700
+
14701
+ // We execute the events registration listeners entry points:
14702
+ foreach(nodeServerInstance.receptionEntryPoints,(receptionEntryPoint,i)=>{
14703
+
14704
+ // DBG
14705
+ console.log("(SERVER) ENTRY POINT ["+i+"] is executed !");
14706
+
14707
+ receptionEntryPoint.execute(clientSocket);
14708
+ });
14709
+
14710
+ };
14711
+
14712
+
14713
+ if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.addEventListener("message", doOnMessage);
14714
+ else clientSocket.on(channelName, doOnMessage);
14715
+
14716
+
14717
+
14718
+
14719
+
14720
+
14721
+
14722
+
14723
+
14724
+
14717
14725
 
14718
14726
 
14719
14727
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.294",
3
+ "version": "0.0.296",
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)",