April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
@@ -78,8 +78,8 @@
|
||||
return
|
||||
|
||||
//Logs all hrefs
|
||||
if(config && config.log_hrefs && href_logfile)
|
||||
href_logfile << "<small>[time_stamp(show_ds = TRUE)] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][href]<br>"
|
||||
if(config && config.log_hrefs && GLOB.href_logfile)
|
||||
GLOB.href_logfile << "<small>[time_stamp(show_ds = TRUE)] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][href]<br>"
|
||||
|
||||
// Admin PM
|
||||
if(href_list["priv_msg"])
|
||||
@@ -146,8 +146,7 @@
|
||||
//CONNECT//
|
||||
///////////
|
||||
#if (PRELOAD_RSC == 0)
|
||||
var/list/external_rsc_urls
|
||||
var/next_external_rsc = 0
|
||||
GLOBAL_LIST(external_rsc_urls)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -159,13 +158,14 @@ var/next_external_rsc = 0
|
||||
return null
|
||||
|
||||
#if (PRELOAD_RSC == 0)
|
||||
var/static/next_external_rsc = 0
|
||||
if(external_rsc_urls && external_rsc_urls.len)
|
||||
next_external_rsc = Wrap(next_external_rsc+1, 1, external_rsc_urls.len+1)
|
||||
preload_rsc = external_rsc_urls[next_external_rsc]
|
||||
#endif
|
||||
|
||||
clients += src
|
||||
directory[ckey] = src
|
||||
GLOB.clients += src
|
||||
GLOB.directory[ckey] = src
|
||||
|
||||
//Admin Authorisation
|
||||
var/localhost_addresses = list("127.0.0.1", "::1")
|
||||
@@ -175,9 +175,9 @@ var/next_external_rsc = 0
|
||||
var/datum/admins/localhost_holder = new(localhost_rank, ckey)
|
||||
localhost_holder.associate(src)
|
||||
if(config.autoadmin)
|
||||
if(!admin_datums[ckey])
|
||||
if(!GLOB.admin_datums[ckey])
|
||||
var/datum/admin_rank/autorank
|
||||
for(var/datum/admin_rank/R in admin_ranks)
|
||||
for(var/datum/admin_rank/R in GLOB.admin_ranks)
|
||||
if(R.name == config.autoadmin_rank)
|
||||
autorank = R
|
||||
break
|
||||
@@ -185,34 +185,60 @@ var/next_external_rsc = 0
|
||||
to_chat(world, "Autoadmin rank not found")
|
||||
else
|
||||
var/datum/admins/D = new(autorank, ckey)
|
||||
admin_datums[ckey] = D
|
||||
holder = admin_datums[ckey]
|
||||
GLOB.admin_datums[ckey] = D
|
||||
holder = GLOB.admin_datums[ckey]
|
||||
if(holder)
|
||||
admins |= src
|
||||
GLOB.admins |= src
|
||||
holder.owner = src
|
||||
|
||||
//Mentor Authorisation
|
||||
var/mentor = mentor_datums[ckey]
|
||||
/* var/mentor = GLOB.mentor_datums[ckey]
|
||||
if(mentor)
|
||||
verbs += /client/proc/cmd_mentor_say
|
||||
verbs += /client/proc/show_mentor_memo
|
||||
mentors += src
|
||||
GLOB.mentors |= src */
|
||||
|
||||
//preferences datum - also holds some persistent data for the client (because we may as well keep these datums to a minimum)
|
||||
prefs = preferences_datums[ckey]
|
||||
prefs = GLOB.preferences_datums[ckey]
|
||||
if(!prefs)
|
||||
prefs = new /datum/preferences(src)
|
||||
preferences_datums[ckey] = prefs
|
||||
else
|
||||
prefs.parent = src
|
||||
GLOB.preferences_datums[ckey] = prefs
|
||||
prefs.last_ip = address //these are gonna be used for banning
|
||||
prefs.last_id = computer_id //these are gonna be used for banning
|
||||
if(world.byond_version >= 511 && byond_version >= 511 && prefs.clientfps)
|
||||
vars["fps"] = prefs.clientfps
|
||||
sethotkeys(1) //set hoykeys from preferences (from_pref = 1)
|
||||
|
||||
log_access("Login: [key_name(src)] from [address ? address : "localhost"]-[computer_id] || BYOND v[byond_version]")
|
||||
var/alert_mob_dupe_login = FALSE
|
||||
if(config.log_access)
|
||||
for(var/I in GLOB.clients)
|
||||
if(I == src)
|
||||
continue
|
||||
var/client/C = I
|
||||
if(C.key && (C.key != key) )
|
||||
var/matches
|
||||
if( (C.address == address) )
|
||||
matches += "IP ([address])"
|
||||
if( (C.computer_id == computer_id) )
|
||||
if(matches)
|
||||
matches += " and "
|
||||
matches += "ID ([computer_id])"
|
||||
alert_mob_dupe_login = TRUE
|
||||
if(matches)
|
||||
if(C)
|
||||
message_admins("<font color='red'><B>Notice: </B><font color='blue'>[key_name_admin(src)] has the same [matches] as [key_name_admin(C)].</font>")
|
||||
log_access("Notice: [key_name(src)] has the same [matches] as [key_name(C)].")
|
||||
else
|
||||
message_admins("<font color='red'><B>Notice: </B><font color='blue'>[key_name_admin(src)] has the same [matches] as [key_name_admin(C)] (no longer logged in). </font>")
|
||||
log_access("Notice: [key_name(src)] has the same [matches] as [key_name(C)] (no longer logged in).")
|
||||
|
||||
. = ..() //calls mob.Login()
|
||||
|
||||
if(alert_mob_dupe_login)
|
||||
set waitfor = FALSE
|
||||
alert(mob, "You have logged in already with another key this round, please log out of this one NOW or risk being banned!")
|
||||
|
||||
connection_time = world.time
|
||||
connection_realtime = world.realtime
|
||||
connection_timeofday = world.timeofday
|
||||
@@ -245,25 +271,25 @@ var/next_external_rsc = 0
|
||||
qdel(src)
|
||||
return 0
|
||||
|
||||
if( (world.address == address || !address) && !host )
|
||||
host = key
|
||||
if( (world.address == address || !address) && !GLOB.host )
|
||||
GLOB.host = key
|
||||
world.update_status()
|
||||
|
||||
if(holder)
|
||||
add_admin_verbs()
|
||||
to_chat(src, get_message_output("memo"))
|
||||
adminGreet()
|
||||
if((global.comms_key == "default_pwd" || length(global.comms_key) <= 6) && global.comms_allowed) //It's the default value or less than 6 characters long, but it somehow didn't disable comms.
|
||||
if((GLOB.comms_key == "default_pwd" || length(GLOB.comms_key) <= 6) && GLOB.comms_allowed) //It's the default value or less than 6 characters long, but it somehow didn't disable comms.
|
||||
to_chat(src, "<span class='danger'>The server's API key is either too short or is the default value! Consider changing it immediately!</span>")
|
||||
|
||||
if(mentor && !holder)
|
||||
mentor_memo_output("Show")
|
||||
/* if(mentor && !holder)
|
||||
mentor_memo_output("Show") */
|
||||
|
||||
add_verbs_from_config()
|
||||
set_client_age_from_db()
|
||||
|
||||
if (isnum(player_age) && player_age == -1) //first connection
|
||||
if (config.panic_bunker && !holder && !(ckey in deadmins))
|
||||
if (config.panic_bunker && !holder && !(ckey in GLOB.deadmins))
|
||||
log_access("Failed Login: [key] - New account attempting to connect during panic bunker")
|
||||
message_admins("<span class='adminnotice'>Failed Login: [key] - New account attempting to connect during panic bunker</span>")
|
||||
to_chat(src, "Sorry but the server is currently not accepting connections from never before seen players.")
|
||||
@@ -284,7 +310,7 @@ var/next_external_rsc = 0
|
||||
else if (isnum(player_age) && player_age < config.notify_new_player_age)
|
||||
message_admins("New user: [key_name_admin(src)] just connected with an age of [player_age] day[(player_age==1?"":"s")]")
|
||||
|
||||
if(!IsGuestKey(key) && dbcon.IsConnected())
|
||||
if(!IsGuestKey(key) && GLOB.dbcon.IsConnected())
|
||||
findJoinDate()
|
||||
|
||||
sync_client_with_db(tdata)
|
||||
@@ -298,17 +324,17 @@ var/next_external_rsc = 0
|
||||
|
||||
screen += void
|
||||
|
||||
if(prefs.lastchangelog != changelog_hash) //bolds the changelog button on the interface so we know there are updates.
|
||||
if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates.
|
||||
to_chat(src, "<span class='info'>You have unread updates in the changelog.</span>")
|
||||
if(config.aggressive_changelog)
|
||||
changelog()
|
||||
else
|
||||
winset(src, "infowindow.changelog", "font-style=bold")
|
||||
|
||||
if(ckey in clientmessages)
|
||||
for(var/message in clientmessages[ckey])
|
||||
if(ckey in GLOB.clientmessages)
|
||||
for(var/message in GLOB.clientmessages[ckey])
|
||||
to_chat(src, message)
|
||||
clientmessages.Remove(ckey)
|
||||
GLOB.clientmessages.Remove(ckey)
|
||||
|
||||
if(config && config.autoconvert_notes)
|
||||
convert_notes_sql(ckey)
|
||||
@@ -321,19 +347,18 @@ var/next_external_rsc = 0
|
||||
if(!tooltips)
|
||||
tooltips = new /datum/tooltip(src)
|
||||
|
||||
hook_vr("client_new",list(src))
|
||||
|
||||
//////////////
|
||||
//DISCONNECT//
|
||||
//////////////
|
||||
|
||||
/client/Del()
|
||||
log_access("Logout: [key_name(src)]")
|
||||
if(holder)
|
||||
adminGreet(1)
|
||||
holder.owner = null
|
||||
admins -= src
|
||||
directory -= ckey
|
||||
clients -= src
|
||||
GLOB.admins -= src
|
||||
GLOB.directory -= ckey
|
||||
GLOB.clients -= src
|
||||
if(movingmob != null)
|
||||
movingmob.client_mobs_in_contents -= mob
|
||||
UNSETEMPTY(movingmob.client_mobs_in_contents)
|
||||
@@ -346,12 +371,12 @@ var/next_external_rsc = 0
|
||||
if (IsGuestKey(src.key))
|
||||
return
|
||||
|
||||
if(!dbcon.Connect())
|
||||
if(!GLOB.dbcon.Connect())
|
||||
return
|
||||
|
||||
var/sql_ckey = sanitizeSQL(src.ckey)
|
||||
|
||||
var/DBQuery/query_get_client_age = dbcon.NewQuery("SELECT id, datediff(Now(),firstseen) as age FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'")
|
||||
var/DBQuery/query_get_client_age = GLOB.dbcon.NewQuery("SELECT id, datediff(Now(),firstseen) as age FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'")
|
||||
if(!query_get_client_age.Execute())
|
||||
return
|
||||
|
||||
@@ -367,18 +392,18 @@ var/next_external_rsc = 0
|
||||
if (IsGuestKey(src.key))
|
||||
return
|
||||
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
return
|
||||
|
||||
var/sql_ckey = sanitizeSQL(ckey)
|
||||
|
||||
var/DBQuery/query_get_ip = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ip = INET_ATON('[address]') AND ckey != '[sql_ckey]'")
|
||||
var/DBQuery/query_get_ip = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ip = INET_ATON('[address]') AND ckey != '[sql_ckey]'")
|
||||
query_get_ip.Execute()
|
||||
related_accounts_ip = ""
|
||||
while(query_get_ip.NextRow())
|
||||
related_accounts_ip += "[query_get_ip.item[1]], "
|
||||
|
||||
var/DBQuery/query_get_cid = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE computerid = '[computer_id]' AND ckey != '[sql_ckey]'")
|
||||
var/DBQuery/query_get_cid = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE computerid = '[computer_id]' AND ckey != '[sql_ckey]'")
|
||||
if(!query_get_cid.Execute())
|
||||
return
|
||||
related_accounts_cid = ""
|
||||
@@ -397,13 +422,13 @@ var/next_external_rsc = 0
|
||||
var/sql_admin_rank = sanitizeSQL(admin_rank)
|
||||
|
||||
|
||||
var/DBQuery/query_log_player = dbcon.NewQuery("INSERT INTO [format_table_name("player")] (id, ckey, firstseen, lastseen, ip, computerid, lastadminrank) VALUES (null, '[sql_ckey]', Now(), Now(), INET_ATON('[sql_ip]'), '[sql_computerid]', '[sql_admin_rank]') ON DUPLICATE KEY UPDATE lastseen = VALUES(lastseen), ip = VALUES(ip), computerid = VALUES(computerid), lastadminrank = VALUES(lastadminrank)")
|
||||
var/DBQuery/query_log_player = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("player")] (id, ckey, firstseen, lastseen, ip, computerid, lastadminrank) VALUES (null, '[sql_ckey]', Now(), Now(), INET_ATON('[sql_ip]'), '[sql_computerid]', '[sql_admin_rank]') ON DUPLICATE KEY UPDATE lastseen = VALUES(lastseen), ip = VALUES(ip), computerid = VALUES(computerid), lastadminrank = VALUES(lastadminrank)")
|
||||
if(!query_log_player.Execute())
|
||||
return
|
||||
|
||||
//Logging player access
|
||||
|
||||
var/DBQuery/query_log_connection = dbcon.NewQuery("INSERT INTO `[format_table_name("connection_log")]` (`id`,`datetime`,`server_ip`,`server_port`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),INET_ATON('[world.internet_address]'),'[world.port]','[sql_ckey]',INET_ATON('[sql_ip]'),'[sql_computerid]')")
|
||||
var/DBQuery/query_log_connection = GLOB.dbcon.NewQuery("INSERT INTO `[format_table_name("connection_log")]` (`id`,`datetime`,`server_ip`,`server_port`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),INET_ATON('[world.internet_address]'),'[world.port]','[sql_ckey]',INET_ATON('[sql_ip]'),'[sql_computerid]')")
|
||||
query_log_connection.Execute()
|
||||
|
||||
/client/proc/check_randomizer(topic)
|
||||
@@ -459,7 +484,7 @@ var/next_external_rsc = 0
|
||||
cidcheck -= ckey
|
||||
else
|
||||
var/sql_ckey = sanitizeSQL(ckey)
|
||||
var/DBQuery/query_cidcheck = dbcon.NewQuery("SELECT computerid FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'")
|
||||
var/DBQuery/query_cidcheck = GLOB.dbcon.NewQuery("SELECT computerid FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'")
|
||||
query_cidcheck.Execute()
|
||||
|
||||
var/lastcid
|
||||
@@ -487,13 +512,13 @@ var/next_external_rsc = 0
|
||||
var/const/adminckey = "CID-Error"
|
||||
var/sql_ckey = sanitizeSQL(ckey)
|
||||
//check to see if we noted them in the last day.
|
||||
var/DBQuery/query_get_notes = dbcon.NewQuery("SELECT id FROM [format_table_name("messages")] WHERE type = 'note' AND targetckey = '[sql_ckey]' AND adminckey = '[adminckey]' AND timestamp + INTERVAL 1 DAY < NOW()")
|
||||
var/DBQuery/query_get_notes = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("messages")] WHERE type = 'note' AND targetckey = '[sql_ckey]' AND adminckey = '[adminckey]' AND timestamp + INTERVAL 1 DAY < NOW()")
|
||||
if(!query_get_notes.Execute())
|
||||
return
|
||||
if(query_get_notes.NextRow())
|
||||
return
|
||||
//regardless of above, make sure their last note is not from us, as no point in repeating the same note over and over.
|
||||
query_get_notes = dbcon.NewQuery("SELECT adminckey FROM [format_table_name("messages")] WHERE targetckey = '[sql_ckey]' ORDER BY timestamp DESC LIMIT 1")
|
||||
query_get_notes = GLOB.dbcon.NewQuery("SELECT adminckey FROM [format_table_name("messages")] WHERE targetckey = '[sql_ckey]' ORDER BY timestamp DESC LIMIT 1")
|
||||
if(!query_get_notes.Execute())
|
||||
return
|
||||
if(query_get_notes.NextRow())
|
||||
@@ -551,7 +576,7 @@ var/next_external_rsc = 0
|
||||
)
|
||||
spawn (10) //removing this spawn causes all clients to not get verbs.
|
||||
//Precache the client with all other assets slowly, so as to not block other browse() calls
|
||||
getFilesSlow(src, SSasset.cache, register_asset = FALSE)
|
||||
getFilesSlow(src, SSassets.cache, register_asset = FALSE)
|
||||
|
||||
|
||||
//Hook, override it to run code when dir changes
|
||||
|
||||
Reference in New Issue
Block a user