aotrautils 0.0.341 → 0.0.342

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 (04/12/2022-18:41:27)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (04/12/2022-18:51:53)»*/
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 (04/12/2022-18:41:27)»*/
4830
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (04/12/2022-18:51:53)»*/
4831
4831
  /*-----------------------------------------------------------------------------*/
4832
4832
  /* ## Utility global methods in a browser (htmljs) client environment.
4833
4833
  *
@@ -11418,7 +11418,6 @@ initClient=function(isNodeContext=true, useSocketIOImplementation=/*DEBUG*/false
11418
11418
  // if(doOnError && useSocketIOImplementation /*TODO : FIXME: FOR NOW, ONLY WORKS FOR SOCKET.IO IMPLEMENTATION !'*/){
11419
11419
  //
11420
11420
  //// // DBG
11421
- //// lognow(">>> serverSocket.connected:"+serverSocket.isConnected);
11422
11421
  //// lognow(">>> serverSocket:",serverSocket);
11423
11422
  //
11424
11423
  //
@@ -12949,7 +12948,7 @@ createOritaMicroClient=function(url, port, isNode=false){
12949
12948
  };
12950
12949
 
12951
12950
 
12952
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (04/12/2022-18:41:27)»*/
12951
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (04/12/2022-18:51:53)»*/
12953
12952
  /*-----------------------------------------------------------------------------*/
12954
12953
 
12955
12954
 
@@ -14177,7 +14176,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14177
14176
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14178
14177
 
14179
14178
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14180
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/12/2022-18:41:27)»*/
14179
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/12/2022-18:51:53)»*/
14181
14180
  /*-----------------------------------------------------------------------------*/
14182
14181
 
14183
14182
 
@@ -14334,6 +14333,14 @@ if(typeof(fs)==="undefined"){
14334
14333
  //Networking management :
14335
14334
  //- WEBSOCKETS AND NODEJS :
14336
14335
 
14336
+ function isConnected(clientSocket){
14337
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState===WebSocket.OPEN) return true;
14338
+ else if(clientSocket.connected) return true;
14339
+ return false;
14340
+ }
14341
+
14342
+
14343
+
14337
14344
  // -Server :
14338
14345
 
14339
14346
  getServerParams=function(portParam=null,certPathParam=null,keyPathParam=null){
@@ -14624,9 +14631,8 @@ WebsocketImplementation={
14624
14631
 
14625
14632
  serverClients.forEach((clientSocket)=>{
14626
14633
 
14627
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState===WebSocket.OPEN) clientSocket.isConnected=true;
14628
- else if(clientSocket.connected) clientSocket.isConnected=true;
14629
- if(!clientSocket.isConnected) return;
14634
+
14635
+ if(!isConnected(clientSocket)) return;
14630
14636
 
14631
14637
 
14632
14638
  // Room information is stored in client socket object :
@@ -14877,7 +14883,7 @@ WebsocketImplementation={
14877
14883
  }
14878
14884
 
14879
14885
  // DBG
14880
- lognow("DEBUG : CLIENT : clientSocket created:"+clientSocket.isConnected);
14886
+ lognow("DEBUG : CLIENT : clientSocket created:");
14881
14887
 
14882
14888
 
14883
14889
  // NODE CLIENT INSTANCE :
@@ -14928,9 +14934,7 @@ WebsocketImplementation={
14928
14934
  // // DBG
14929
14935
  // console.log("(NODE CLIENT) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
14930
14936
 
14931
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState===WebSocket.OPEN) clientSocket.isConnected=true;
14932
- else if(clientSocket.connected) clientSocket.isConnected=true;
14933
- if(!clientSocket.isConnected) return;
14937
+ if(!isConnected(clientSocket)) return;
14934
14938
 
14935
14939
 
14936
14940
  // Room information is stored in client socket object :
@@ -15100,9 +15104,7 @@ WebsocketImplementation={
15100
15104
  // // DBG
15101
15105
  // console.log("(BROWSER) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
15102
15106
 
15103
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState===WebSocket.OPEN) clientSocket.isConnected=true;
15104
- else if(clientSocket.connected) clientSocket.isConnected=true;
15105
- if(!clientSocket.isConnected) return;
15107
+ if(!isConnected(clientSocket)) return;
15106
15108
 
15107
15109
 
15108
15110
  // Room information is stored in client socket object :
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.341",
3
+ "version": "0.0.342",
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)",