Commit b36d9bc5 authored by IamI's avatar IamI

check arena fix

parent b49095ea
...@@ -427,10 +427,11 @@ let getUserPermit = function(query, req, res) { ...@@ -427,10 +427,11 @@ let getUserPermit = function(query, req, res) {
if (password == info.password) { if (password == info.password) {
// There is a bug. Should check if server is an array. // There is a bug. Should check if server is an array.
// But since now we have only one server for each arena.. // But since now we have only one server for each arena..
if (arena == null || arena == undefined || info.address == config.servers[arena]) let isCorrectArena = (!arena || (info.address === config.servers[arena].address && info.port === config.servers[arena].port));
if (isCorrectArena)
res.end(JSON.stringify({ permit: true, reason: null })); res.end(JSON.stringify({ permit: true, reason: null }));
else else
res.end(JSON/stringify({ permit: false, reason: 'Wrong arena.' })) res.end(JSON.stringify({ permit: false, reason: 'Wrong arena.' }))
} }
else else
res.end(JSON.stringify({ permit: false, reason: 'Wrong roomname.' })); res.end(JSON.stringify({ permit: false, reason: 'Wrong roomname.' }));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment