mirror of
https://github.com/karl0ss/orvibo-b25-server-kex.git
synced 2025-04-29 12:53:40 +01:00
fixes
This commit is contained in:
parent
7acde1750e
commit
9726512795
15
server.js
15
server.js
@ -1,27 +1,16 @@
|
|||||||
const Orvibo = require('./server/utils/Orvibo');
|
const Orvibo = require('./server/utils/Orvibo');
|
||||||
|
const utils = require('./server/utils/Utils')
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.set('view engine', 'pug');
|
app.set('view engine', 'pug');
|
||||||
app.use(express.static(__dirname + '/server'));
|
app.use(express.static(__dirname + '/server'));
|
||||||
|
|
||||||
const plugArray = str => {
|
|
||||||
const arr = str.split(',');
|
|
||||||
const pairs = [];
|
|
||||||
for (let i=0; i<arr.length; i+=2) {
|
|
||||||
let o = {};
|
|
||||||
o.uid = arr[i].split(':')[1];
|
|
||||||
o.name = arr[i+1].split(':')[1];
|
|
||||||
pairs.push(o);
|
|
||||||
}
|
|
||||||
return pairs;
|
|
||||||
}
|
|
||||||
|
|
||||||
const settings = {
|
const settings = {
|
||||||
LOG_PACKET: true, //Show incoming packet data from the socket
|
LOG_PACKET: true, //Show incoming packet data from the socket
|
||||||
ORVIBO_KEY: process.env.orviboPK,
|
ORVIBO_KEY: process.env.orviboPK,
|
||||||
plugInfo :
|
plugInfo :
|
||||||
plugArray(process.env.plugArray)
|
utils.generatePlugArray(process.env.plugArray)
|
||||||
,
|
,
|
||||||
};
|
};
|
||||||
let orvibo = new Orvibo(settings);
|
let orvibo = new Orvibo(settings);
|
||||||
|
@ -25,3 +25,14 @@ module.exports.generateRandomNumber = function(length) {
|
|||||||
return parseInt(result);
|
return parseInt(result);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.generatePlugArray = function(str) {
|
||||||
|
const arr = str.split(',');
|
||||||
|
const pairs = [];
|
||||||
|
for (let i=0; i<arr.length; i+=2) {
|
||||||
|
let o = {};
|
||||||
|
o.uid = arr[i].split(':')[1];
|
||||||
|
o.name = arr[i+1].split(':')[1];
|
||||||
|
pairs.push(o);
|
||||||
|
}
|
||||||
|
return pairs;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user