Commit 87f5e0d9 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent deebe538
......@@ -46,6 +46,17 @@ async function doAuth(packet, user, rinfo) {
return
}
let keys = await redis.getAllKeysByUUID(user.username)
for (let i=0;i<keys.length;i++)
{
if (user.username+'_'+user.ip ===keys)
{
console.log('uuid with ' + user.username + ' with ip:' + user.ip + ' granted')
sendResponsePacket(packet, rinfo, accept)
redis.addIp(user.username, user.ip)
return
}
}
if (keys.length >= 2) {
console.log('uuid with ' + user.username + ' with ip:' + user.ip + ' reach limits')
sendResponsePacket(packet, rinfo, reject)
......
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