closing commit before branching out Multiplex

This commit is contained in:
STEINNI
2025-10-05 10:11:03 +00:00
parent 6381bfe44a
commit 03af111d7f
16 changed files with 167 additions and 87 deletions
+11
View File
@@ -0,0 +1,11 @@
{
"channel":"agents:42",
"packet":{
"eventType": "age",
"payload": {
"aid": "agent42",
"color": "#0F0"
},
"sender": "steinic"
}
}
+1
View File
@@ -0,0 +1 @@
{"channel":"requests:gps","packet":{"action":"TIME","sender":"steinic","reqid":"9d3bcb2e-ef1d-4620-86ff-5c0b0f4063f7"}}
+10 -58
View File
@@ -1,62 +1,14 @@
{
"sequenceDelay": 500,
"sequenceLoop":10,
"sequence":[
{
"channel":"gps:agents",
"packet":{
"eventType": "moving",
"payload": {
"aid": "agent42",
"attrs": {
"x": "10",
"y": "10"
}
},
"sender": "steinic"
"channel":"gps:agents",
"packet":{
"eventType": "move",
"payload": {
"aid": "agent42",
"coords": {
"x": "0",
"y": "0"
}
},
{
"channel":"gps:agents",
"packet":{
"eventType": "moving",
"payload": {
"aid": "agent42",
"attrs": {
"x": "800",
"y": "30"
}
},
"sender": "steinic"
}
},
{
"channel":"gps:agents",
"packet":{
"eventType": "moving",
"payload": {
"aid": "agent42",
"attrs": {
"x": "800",
"y": "500"
}
},
"sender": "steinic"
}
},
{
"channel":"gps:agents",
"packet":{
"eventType": "moving",
"payload": {
"aid": "agent42",
"attrs": {
"x": "10",
"y": "500"
}
},
"sender": "steinic"
}
}
]
"sender": "steinic"
}
}
+106
View File
@@ -0,0 +1,106 @@
{
"sequenceDelay": 500,
"sequenceLoop":10,
"sequence":[
{
"channel":"gps:agents",
"packet":{
"eventType": "move",
"payload": {
"aid": "agent42",
"coords": {
"x": "5",
"y": "5"
}
},
"sender": "steinic"
}
},
{
"channel":"gps:agents",
"packet":{
"eventType": "move",
"payload": {
"aid": "agent42",
"coords": {
"x": "-5",
"y": "5"
}
},
"sender": "steinic"
}
},
{
"channel":"gps:agents",
"packet":{
"eventType": "move",
"payload": {
"aid": "agent42",
"coords": {
"x": "-5",
"y": "-5"
}
},
"sender": "steinic"
}
},
{
"channel":"gps:agents",
"packet":{
"eventType": "move",
"payload": {
"aid": "agent42",
"coords": {
"x": "5",
"y": "-5"
}
},
"sender": "steinic"
}
},
{
"channel":"gps:agents",
"packet":{
"eventType": "move",
"payload": {
"aid": "agent42",
"coords": {
"x": "5",
"y": "5"
}
},
"sender": "steinic"
}
},
{
"channel":"gps:agents",
"packet":{
"eventType": "move",
"payload": {
"aid": "agent42",
"coords": {
"x": "5",
"y": "5",
"z": "2"
}
},
"sender": "steinic"
}
},
{
"channel":"gps:agents",
"packet":{
"eventType": "move",
"payload": {
"aid": "agent42",
"coords": {
"x": "5",
"y": "5",
"z": "0"
}
},
"sender": "steinic"
}
}
]
}
+4 -4
View File
@@ -1,12 +1,12 @@
{
"channel":"gps:agents",
"packet":{
"eventType": "moving",
"eventType": "move",
"payload": {
"aid": "agent42",
"attrs": {
"x": "950",
"y": "650"
"coords": {
"x": "5",
"y": "5"
}
},
"sender": "steinic"
+11
View File
@@ -0,0 +1,11 @@
{
"channel":"agents:42",
"packet":{
"eventType": "polarize",
"payload": {
"aid": "agent42",
"color": "#F00"
},
"sender": "steinic"
}
}
-15
View File
@@ -199,21 +199,6 @@ module.exports = class RedisConnexion {
return(matches.length > 0);
}
async getUserRoles(uid){
let roles = []
//TODO : Maybe do better...? (check in DB ?)
if(uid.startsWith('backend-')){
roles = [uid.substr(8)]
} else {
let rawPayload = await this.redisGet(uid, this.config.redis.authTokenPrefix)
let payload = JSON.parse(rawPayload)
if(payload && payload.roles) roles = payload.roles
}
if(this.debug) console.log(`Got roles for ${uid} => ${roles}`)
return(roles)
}
}
+1 -1
View File
@@ -229,7 +229,7 @@ if(argv.file){
} else console.error('Bad file format !?', fileData)
}
await rediscnx.redisClient.disconnect()
}
} else { console.error('Cannot open file !')}
} else {
let dialog = new Dialog(dialogData, selectors)
dialog.start('step1').then(answers => {
+1 -2
View File
@@ -7,7 +7,6 @@
"Xpass": "yj465sqfCTA0bKDw3zEYg8OqYl9Tv",
"user": "",
"pass": "",
"basePrefix": "messageBus:",
"authTokenPrefix": "authorizer:message_bus_user_"
"basePrefix": "messageBus:"
}
}
+13
View File
@@ -0,0 +1,13 @@
{
"channel":"agents:42",
"packet":{
"eventType": "rotate",
"payload": {
"aid": "agent42",
"facing": {
"y": "45"
}
},
"sender": "steinic"
}
}