• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Ip issue.

Ufonica

New Member
Joined
Aug 3, 2018
Messages
55
Reaction score
0
Hello guys,

I was just wondering on my 8.6 server how do i restrict certain ips from login into the admin accounts and is there any way for me to check what ips have logged into certain chars?

Thanks in advance.
 
Just keep safe passwords and you'll be fine.
If you restrict some IPs, you can still use VPN to connect, but how do they even get access to the admin account in the first place?
 
I just want to be extra safe that's all but, i just want them to be able to only log into the account if they have x ip. So no one can hack the account unless they are the real owner of the account.
 
inside of login.lua (creaturescripts)
Lua:
if getPlayerIp(cid) ~= "127.0.0.1" then
    return false
end
 
Not 100% sure where to add that and how do i make that script only restrict just admin accounts?
you add it below function onLogin(cid)
Lua:
local accounts = {
    {"admin_account_name_1", "admin_ip_1"},
    {"admin_account_name_2", "admin_ip_2"}
}

local function getIpByAccount(account)
    for i = 1, #accounts do
        if accounts[i][1] == account then
            return accounts[i][2]
        end
    end
end

function onLogin(cid)
    local ip = getIpByAccount(getPlayerAccount(cid))
    if ip and getPlayerIp(cid) ~= ip then
        doPlayerPopupFYI(cid, "You are not allowed to access this account")
        return false
    end
    -- rest of the code here
    return true
end
 
Back
Top