aotrautils 0.0.325 → 0.0.327
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.
- aotrautils/aotrautils.build.js +29 -25
- aotrautils/package.json +1 -1
aotrautils/aotrautils.build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (04/12/2022-
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (04/12/2022-02:54:41)»*/
|
|
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-
|
|
4830
|
+
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (04/12/2022-02:54:41)»*/
|
|
4831
4831
|
/*-----------------------------------------------------------------------------*/
|
|
4832
4832
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
4833
4833
|
*
|
|
@@ -12949,7 +12949,7 @@ createOritaMicroClient=function(url, port, isNode=false){
|
|
|
12949
12949
|
};
|
|
12950
12950
|
|
|
12951
12951
|
|
|
12952
|
-
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (04/12/2022-
|
|
12952
|
+
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (04/12/2022-02:54:41)»*/
|
|
12953
12953
|
/*-----------------------------------------------------------------------------*/
|
|
12954
12954
|
|
|
12955
12955
|
|
|
@@ -14177,7 +14177,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
14177
14177
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
14178
14178
|
|
|
14179
14179
|
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
14180
|
-
/*utils SERVER library associated with aotra version : «1_29072022-2359 (04/12/2022-
|
|
14180
|
+
/*utils SERVER library associated with aotra version : «1_29072022-2359 (04/12/2022-02:54:41)»*/
|
|
14181
14181
|
/*-----------------------------------------------------------------------------*/
|
|
14182
14182
|
|
|
14183
14183
|
|
|
@@ -14536,14 +14536,14 @@ WebsocketImplementation={
|
|
|
14536
14536
|
serverSocket:serverSocket,
|
|
14537
14537
|
receptionEntryPoints:[],
|
|
14538
14538
|
|
|
14539
|
-
receive:(
|
|
14539
|
+
receive:(channelNameParam, doOnIncomingMessage, clientsRoomsTag=null)=>{
|
|
14540
14540
|
|
|
14541
14541
|
// DBG
|
|
14542
|
-
lognow("(SERVER) Registering receive for «"+
|
|
14542
|
+
lognow("(SERVER) Registering receive for «"+channelNameParam+"»...",doOnIncomingMessage);
|
|
14543
14543
|
|
|
14544
14544
|
|
|
14545
14545
|
const receptionEntryPoint={
|
|
14546
|
-
channelName:
|
|
14546
|
+
channelName:channelNameParam,
|
|
14547
14547
|
clientsRoomsTag:clientsRoomsTag,
|
|
14548
14548
|
execute:(eventOrMessage, clientSocketParam)=>{
|
|
14549
14549
|
|
|
@@ -14569,7 +14569,7 @@ WebsocketImplementation={
|
|
|
14569
14569
|
|
|
14570
14570
|
|
|
14571
14571
|
// DBG
|
|
14572
|
-
lognow("(SERVER) ENTRY POINT IS OF THE RIGHT CHANNEL:", channelName);
|
|
14572
|
+
lognow("(SERVER) ENTRY POINT IS OF THE RIGHT CHANNEL:", receptionEntryPoint.channelName);
|
|
14573
14573
|
|
|
14574
14574
|
|
|
14575
14575
|
|
|
@@ -14729,7 +14729,11 @@ WebsocketImplementation={
|
|
|
14729
14729
|
|
|
14730
14730
|
if (clientSocket.isConnectionAlive===false){
|
|
14731
14731
|
|
|
14732
|
-
|
|
14732
|
+
|
|
14733
|
+
// On today, this method is named as same for the two implementations :
|
|
14734
|
+
clientSocket.removeAllListeners();
|
|
14735
|
+
|
|
14736
|
+
|
|
14733
14737
|
// TODO : FIXME : Use one single interface !
|
|
14734
14738
|
if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.terminate();
|
|
14735
14739
|
else clientSocket.emit("endConnection");
|
|
@@ -14886,10 +14890,10 @@ WebsocketImplementation={
|
|
|
14886
14890
|
|
|
14887
14891
|
receptionEntryPoints:[],
|
|
14888
14892
|
|
|
14889
|
-
receive:(
|
|
14893
|
+
receive:(channelNameParam, doOnIncomingMessage, clientsRoomsTag=null)=>{
|
|
14890
14894
|
|
|
14891
14895
|
const receptionEntryPoint={
|
|
14892
|
-
channelName:
|
|
14896
|
+
channelName:channelNameParam,
|
|
14893
14897
|
clientsRoomsTag:clientsRoomsTag,
|
|
14894
14898
|
execute:(eventOrMessage)=>{
|
|
14895
14899
|
|
|
@@ -14900,7 +14904,7 @@ WebsocketImplementation={
|
|
|
14900
14904
|
const dataWrapped=WebsocketImplementation.getMessageDataBothImplementations(eventOrMessage);
|
|
14901
14905
|
|
|
14902
14906
|
// Channel information is stored in exchanged data :
|
|
14903
|
-
if(dataWrapped.channelName && dataWrapped.channelName!==
|
|
14907
|
+
if(dataWrapped.channelName && dataWrapped.channelName!==channelNameParam) return;
|
|
14904
14908
|
|
|
14905
14909
|
const clientSocket=nodeClientInstance.clientSocket;
|
|
14906
14910
|
|
|
@@ -14920,7 +14924,7 @@ WebsocketImplementation={
|
|
|
14920
14924
|
},
|
|
14921
14925
|
|
|
14922
14926
|
|
|
14923
|
-
send:(
|
|
14927
|
+
send:(channelNameParam, data, clientsRoomsTag=null)=>{
|
|
14924
14928
|
|
|
14925
14929
|
const clientSocket=nodeClientInstance.clientSocket;
|
|
14926
14930
|
|
|
@@ -14937,7 +14941,7 @@ WebsocketImplementation={
|
|
|
14937
14941
|
if(!WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
|
|
14938
14942
|
|
|
14939
14943
|
// Channel information is stored in exchanged data :
|
|
14940
|
-
let dataWrapped={channelName:
|
|
14944
|
+
let dataWrapped={channelName:channelNameParam, data:data};
|
|
14941
14945
|
|
|
14942
14946
|
|
|
14943
14947
|
// // DBG
|
|
@@ -14948,12 +14952,12 @@ WebsocketImplementation={
|
|
|
14948
14952
|
|
|
14949
14953
|
|
|
14950
14954
|
// // DBG
|
|
14951
|
-
// console.log("(NODE CLIENT) SENDING DATA !
|
|
14955
|
+
// console.log("(NODE CLIENT) SENDING DATA ! channelNameParam:«"+channelNameParam+"» ; clientsRoomsTag:«"+clientsRoomsTag+"»");
|
|
14952
14956
|
// console.log("(NODE CLIENT) SENDING DATA ! dataWrapped:",dataWrapped);
|
|
14953
14957
|
|
|
14954
14958
|
// TODO : FIXME : Use one single interface !
|
|
14955
14959
|
if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.send(dataWrapped);
|
|
14956
|
-
else clientSocket.emit(
|
|
14960
|
+
else clientSocket.emit(channelNameParam,dataWrapped);
|
|
14957
14961
|
|
|
14958
14962
|
return nodeClientInstance;
|
|
14959
14963
|
},
|
|
@@ -14991,7 +14995,7 @@ WebsocketImplementation={
|
|
|
14991
14995
|
|
|
14992
14996
|
const clientSocket=nodeClientInstance.clientSocket;
|
|
14993
14997
|
if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.addEventListener("message", doOnMessage);
|
|
14994
|
-
else clientSocket.on(
|
|
14998
|
+
else clientSocket.on(channelNameParam, doOnMessage);
|
|
14995
14999
|
|
|
14996
15000
|
doOnConnection(nodeClientInstance, clientSocket);
|
|
14997
15001
|
|
|
@@ -15057,10 +15061,10 @@ WebsocketImplementation={
|
|
|
15057
15061
|
const browserInstance={
|
|
15058
15062
|
clientSocket:clientSocket,
|
|
15059
15063
|
|
|
15060
|
-
receive:(
|
|
15064
|
+
receive:(channelNameParam, doOnIncomingMessage, clientsRoomsTag=null)=>{
|
|
15061
15065
|
|
|
15062
15066
|
// DBG
|
|
15063
|
-
lognow("INFO : (CLIENT-BROWSER) SETTING UP RECEIVE for :",
|
|
15067
|
+
lognow("INFO : (CLIENT-BROWSER) SETTING UP RECEIVE for :",channelNameParam);
|
|
15064
15068
|
|
|
15065
15069
|
|
|
15066
15070
|
const doOnMessage=(eventOrMessage)=>{
|
|
@@ -15072,7 +15076,7 @@ WebsocketImplementation={
|
|
|
15072
15076
|
|
|
15073
15077
|
|
|
15074
15078
|
// Channel information is stored in exchanged data :
|
|
15075
|
-
if(dataWrapped.channelName && dataWrapped.channelName!==
|
|
15079
|
+
if(dataWrapped.channelName && dataWrapped.channelName!==channelNameParam) return;
|
|
15076
15080
|
|
|
15077
15081
|
const clientSocket=browserInstance.clientSocket;
|
|
15078
15082
|
|
|
@@ -15085,14 +15089,14 @@ WebsocketImplementation={
|
|
|
15085
15089
|
|
|
15086
15090
|
|
|
15087
15091
|
if(!WebsocketImplementation.useSocketIOImplementation) browserInstance.clientSocket.addEventListener("message", doOnMessage);
|
|
15088
|
-
else browserInstance.clientSocket.on(
|
|
15092
|
+
else browserInstance.clientSocket.on(channelNameParam, doOnMessage);
|
|
15089
15093
|
|
|
15090
15094
|
|
|
15091
15095
|
return browserInstance;
|
|
15092
15096
|
},
|
|
15093
15097
|
|
|
15094
15098
|
|
|
15095
|
-
send:(
|
|
15099
|
+
send:(channelNameParam, data, clientsRoomsTag=null)=>{
|
|
15096
15100
|
|
|
15097
15101
|
const clientSocket=browserInstance.clientSocket;
|
|
15098
15102
|
|
|
@@ -15109,7 +15113,7 @@ WebsocketImplementation={
|
|
|
15109
15113
|
if(!WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
|
|
15110
15114
|
|
|
15111
15115
|
// Channel information is stored in exchanged data :
|
|
15112
|
-
let dataWrapped={channelName:
|
|
15116
|
+
let dataWrapped={channelName:channelNameParam, data:data};
|
|
15113
15117
|
|
|
15114
15118
|
|
|
15115
15119
|
// DBG
|
|
@@ -15122,7 +15126,7 @@ WebsocketImplementation={
|
|
|
15122
15126
|
|
|
15123
15127
|
// TODO : FIXME : Use one single interface !
|
|
15124
15128
|
if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.send(dataWrapped);
|
|
15125
|
-
else clientSocket.emit(
|
|
15129
|
+
else clientSocket.emit(channelNameParam,dataWrapped);
|
|
15126
15130
|
|
|
15127
15131
|
|
|
15128
15132
|
return browserInstance;
|
|
@@ -15502,7 +15506,7 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
|
|
|
15502
15506
|
//
|
|
15503
15507
|
//
|
|
15504
15508
|
// const server=initNodeServer(
|
|
15505
|
-
// // On client connection :
|
|
15509
|
+
// // On each client connection :
|
|
15506
15510
|
//// (serverParam, clientSocketParam)=>{},
|
|
15507
15511
|
// null,
|
|
15508
15512
|
// // On server finalization :
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.327",
|
|
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)",
|