closing commit before branching out Multiplex
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"channel":"agents:42",
|
||||
"packet":{
|
||||
"eventType": "age",
|
||||
"payload": {
|
||||
"aid": "agent42",
|
||||
"color": "#0F0"
|
||||
},
|
||||
"sender": "steinic"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"channel":"requests:gps","packet":{"action":"TIME","sender":"steinic","reqid":"9d3bcb2e-ef1d-4620-86ff-5c0b0f4063f7"}}
|
||||
@@ -1,62 +1,14 @@
|
||||
{
|
||||
"sequenceDelay": 500,
|
||||
"sequenceLoop":10,
|
||||
"sequence":[
|
||||
{
|
||||
"channel":"gps:agents",
|
||||
"packet":{
|
||||
"eventType": "moving",
|
||||
"eventType": "move",
|
||||
"payload": {
|
||||
"aid": "agent42",
|
||||
"attrs": {
|
||||
"x": "10",
|
||||
"y": "10"
|
||||
}
|
||||
},
|
||||
"sender": "steinic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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"
|
||||
"coords": {
|
||||
"x": "0",
|
||||
"y": "0"
|
||||
}
|
||||
},
|
||||
"sender": "steinic"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"channel":"agents:42",
|
||||
"packet":{
|
||||
"eventType": "polarize",
|
||||
"payload": {
|
||||
"aid": "agent42",
|
||||
"color": "#F00"
|
||||
},
|
||||
"sender": "steinic"
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
"Xpass": "yj465sqfCTA0bKDw3zEYg8OqYl9Tv",
|
||||
"user": "",
|
||||
"pass": "",
|
||||
"basePrefix": "messageBus:",
|
||||
"authTokenPrefix": "authorizer:message_bus_user_"
|
||||
"basePrefix": "messageBus:"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"channel":"agents:42",
|
||||
"packet":{
|
||||
"eventType": "rotate",
|
||||
"payload": {
|
||||
"aid": "agent42",
|
||||
"facing": {
|
||||
"y": "45"
|
||||
}
|
||||
},
|
||||
"sender": "steinic"
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -19,7 +19,10 @@ export const methods = {
|
||||
|
||||
for(var chan of payload){
|
||||
if((!chan) || (typeof(chan)!='string')) continue
|
||||
if(!this.accessRights.canSubscribe(this.userId, this.roles, chan)) continue
|
||||
if(!this.accessRights.canSubscribe(this.userId, this.roles, chan)) {
|
||||
if(this.debug) console.log('SUB: No rights to this chan!', this.userId, this.roles, chan)
|
||||
continue
|
||||
}
|
||||
// Chat chans are forbidden here
|
||||
if((chan.substr(0,8) == 'userchans') || (chan.substr(0,9) == 'lobbychans')) continue;
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
"port": { "type": "integer" },
|
||||
"user": { "type": "string" },
|
||||
"pass": { "type": "string" },
|
||||
"authTokenPrefix": { "type": "string" },
|
||||
"basePrefix": { "type": "string" },
|
||||
"challengePrefix": { "type": "string" },
|
||||
"historizeMax": { "type": "integer" },
|
||||
@@ -90,7 +89,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"authTokenPrefix",
|
||||
"basePrefix",
|
||||
"challengePrefix",
|
||||
"historizeChannels",
|
||||
|
||||
@@ -238,6 +238,7 @@ export class RedisConnexion {
|
||||
|
||||
}
|
||||
}
|
||||
console.log('=====>',uuids)
|
||||
for(var uuid of uuids) {
|
||||
if(uuid in this.wssConnections) {
|
||||
if(this.debug) console.log('Sending to ', uuid, payload);
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /opt/WssGateway/
|
||||
cd /opt/p42wssGateway/
|
||||
|
||||
pid=`ps -ef | grep wssGateway |grep -v grep | awk '{print $2}'`
|
||||
pid=`ps -ef | grep p42wssGateway |grep -v grep | awk '{print $2}'`
|
||||
if [ -z "$pid" ]
|
||||
then
|
||||
node wssGateway.js > wssGateway.log 2>&1 &
|
||||
node p42wssGateway.js > wssGateway.log 2>&1 &
|
||||
else
|
||||
echo ''
|
||||
echo 'Already running PID='"$pid"' (use stopWssGw.sh to stop it)'
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
pid=`ps -ef | grep wssGateway.js |grep -v grep | awk '{print $2}'`
|
||||
pid=`ps -ef | grep p42wssGateway.js |grep -v grep | awk '{print $2}'`
|
||||
if [ -n "$pid" ]
|
||||
then
|
||||
echo "killing pid: $pid"
|
||||
|
||||
Reference in New Issue
Block a user