Commit 23e2e089 authored by IamI's avatar IamI

check arena

parent f35f68c1
......@@ -421,10 +421,17 @@ let endUserResponse = function(req, res) {
let getUserPermit = function(query, req, res) {
let username = query.username;
let password = query.password;
let arena = query.arena || 'entertain';
if (playingPlayerPool.has(username)) {
let info = playingPlayerPool.get(username);
if (password == info.password)
res.end(JSON.stringify({ permit: true, reason: null }));
if (password == info.password) {
// There is a bug. Should check if server is an array.
// But since now we have only one server for each arena..
if (info.address == config.servers[arena])
res.end(JSON.stringify({ permit: true, reason: null }));
else
res.end(JSON/stringify({ permit: false, reason: 'Wrong arena.' }))
}
else
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