mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 23:17:02 +01:00
is_connecting_from_localhost()
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
//Admin PM
|
||||
if(href_list["priv_msg"])
|
||||
var/client/C = locate(href_list["priv_msg"])
|
||||
|
||||
|
||||
if(!C) // Might be a stealthmin ID, so pass it in straight
|
||||
C = href_list["priv_msg"]
|
||||
else if(C.UID() != href_list["priv_msg"])
|
||||
@@ -320,8 +320,7 @@
|
||||
//Admin Authorisation
|
||||
// Automatically makes localhost connection an admin
|
||||
if(!config.disable_localhost_admin)
|
||||
var/localhost_addresses = list("127.0.0.1", "::1") // Adresses
|
||||
if(!isnull(address) && address in localhost_addresses)
|
||||
if(is_connecting_from_localhost())
|
||||
new /datum/admins("!LOCALHOST!", R_HOST, ckey) // Makes localhost rank
|
||||
holder = admin_datums[ckey]
|
||||
if(holder)
|
||||
@@ -411,6 +410,12 @@
|
||||
|
||||
Master.UpdateTickRate()
|
||||
|
||||
/client/proc/is_connecting_from_localhost()
|
||||
var/localhost_addresses = list("127.0.0.1", "::1") // Adresses
|
||||
if(!isnull(address) && address in localhost_addresses)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
//////////////
|
||||
//DISCONNECT//
|
||||
//////////////
|
||||
@@ -539,6 +544,10 @@
|
||||
if(living_hours >= config.ipintel_maxplaytime)
|
||||
return
|
||||
|
||||
if(is_connecting_from_localhost())
|
||||
log_debug("IPIntel: skip check for player [key_name_admin(src)] connecting from localhost.")
|
||||
return
|
||||
|
||||
var/datum/ipintel/res = get_ip_intel(address)
|
||||
if(res.intel >= config.ipintel_rating_bad)
|
||||
message_admins("<span class='adminnotice'>Proxy Detection: [key_name_admin(src)] IP intel rated [res.intel*100]% likely to be a Proxy/VPN.</span>")
|
||||
|
||||
Reference in New Issue
Block a user