fix pref_ip not working issue
This commit is contained in:
parent
57bc85c0dc
commit
524c3994de
@ -14,10 +14,10 @@ var occupancy = [0, 0, 0, 0];
|
|||||||
var suffixes = [11, 12, 13, 14];
|
var suffixes = [11, 12, 13, 14];
|
||||||
var clients = {};
|
var clients = {};
|
||||||
|
|
||||||
function allocateClient(req) {
|
function allocateClient(msg) {
|
||||||
var slot;
|
var slot;
|
||||||
if (req.pref_ip) {
|
if (msg.pref_ip) {
|
||||||
slot = suffixes.indexOf(req.pref_ip);
|
slot = suffixes.indexOf(msg.pref_ip);
|
||||||
if (slot >= 0 && !occupancy[slot]) {
|
if (slot >= 0 && !occupancy[slot]) {
|
||||||
occupancy[slot] = 1;
|
occupancy[slot] = 1;
|
||||||
return slot;
|
return slot;
|
||||||
@ -81,7 +81,7 @@ function registerUser(conn, req, msg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Allocate User
|
// Allocate User
|
||||||
var slot = allocateClient(req);
|
var slot = allocateClient(msg);
|
||||||
var realip = req.socket.remoteAddress;
|
var realip = req.socket.remoteAddress;
|
||||||
if (slot < 0) {
|
if (slot < 0) {
|
||||||
console.log('Dropping ' + realip + ' due to no party vacancy');
|
console.log('Dropping ' + realip + ' due to no party vacancy');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user