Overhauls and 2/28 sync (#244)
* map tweaks/shuttle engines * helpers and defines * global/onclick * controllers and datums * mapping * game folder * some other stuff * some modules * modules that aren't mobs * some mob stuff * new player stuff * mob living * silicon stuff * simple animal things * carbon/ayylmao * update_icons * carbon/human * sounds and tools * icons and stuff * hippie grinder changes + tgui * kitchen.dmi * compile issues fixed * mapfix * Mapfixes 2.0 * mapedit2.0 * mapmerger pls * Revert "mapedit2.0" This reverts commit 74139a3cacea10df7aafca06c0a10bd3daf3a481. * clean up vore folder + 2 hotfixes * admin ticket refinement * Blob tweaks and LAZYADD * LAZYADD IS LAZY * Magic strings purged * DEFINES NEED HIGHER PRIORITIES * Only a sleepless idiot deals in absolute TRUE|FALSE * u h g * progress bar fix * reverts ticket logs * there's always that one guy * fixes and stuff * 2/27 fixes * game folder stuff * stats * some modules again * clothing stuff gets vg clothing out of the main files * everything not mobs again * mob stuff * maps, tgui, sql stuff * icons * additional fixes and compile errors * don't need this anymore * Oh right this isn't needed anymore * maint bar re-added * that doesn't need to be here * stupid events * wtfeven * probably makes Travis happy * don't care to fix the grinder atm * fixes vending sprites, changes turret * lethal, not lethals * overylays are finicky creatures * lazy fix for bleeding edgy (#252) * map tweaks/shuttle engines * helpers and defines * global/onclick * controllers and datums * mapping * game folder * some other stuff * some modules * modules that aren't mobs * some mob stuff * new player stuff * mob living * silicon stuff * simple animal things * carbon/ayylmao * update_icons * carbon/human * sounds and tools * icons and stuff * hippie grinder changes + tgui * kitchen.dmi * compile issues fixed * mapfix * Mapfixes 2.0 * mapedit2.0 * mapmerger pls * Revert "mapedit2.0" This reverts commit 74139a3cacea10df7aafca06c0a10bd3daf3a481. * clean up vore folder + 2 hotfixes * admin ticket refinement * Blob tweaks and LAZYADD * LAZYADD IS LAZY * Magic strings purged * DEFINES NEED HIGHER PRIORITIES * Only a sleepless idiot deals in absolute TRUE|FALSE * u h g * progress bar fix * reverts ticket logs * there's always that one guy * fixes and stuff * 2/27 fixes * game folder stuff * stats * some modules again * clothing stuff gets vg clothing out of the main files * everything not mobs again * mob stuff * maps, tgui, sql stuff * icons * additional fixes and compile errors * don't need this anymore * Oh right this isn't needed anymore * maint bar re-added * that doesn't need to be here * stupid events * wtfeven * probably makes Travis happy * don't care to fix the grinder atm * fixes vending sprites, changes turret * lethal, not lethals * overylays are finicky creatures
This commit is contained in:
+10
-52
@@ -39,6 +39,7 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
|
||||
|
||||
make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
|
||||
load_configuration()
|
||||
revdata.DownloadPRDetails()
|
||||
load_mode()
|
||||
load_motd()
|
||||
load_admins()
|
||||
@@ -51,7 +52,7 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
|
||||
timezoneOffset = text2num(time2text(0,"hh")) * 36000
|
||||
|
||||
if(config.sql_enabled)
|
||||
if(!setup_database_connection())
|
||||
if(!dbcon.Connect())
|
||||
log_world("Your server failed to establish a connection with the database.")
|
||||
else
|
||||
log_world("Database connection established.")
|
||||
@@ -71,14 +72,13 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
|
||||
Master.Setup(10, FALSE)
|
||||
|
||||
#define IRC_STATUS_THROTTLE 50
|
||||
var/last_irc_status = 0
|
||||
|
||||
/world/Topic(T, addr, master, key)
|
||||
if(config && config.log_world_topic)
|
||||
diary << "TOPIC: \"[T]\", from:[addr], master:[master], key:[key]"
|
||||
|
||||
var/list/input = params2list(T)
|
||||
var/key_valid = (global.comms_allowed && input["key"] == global.comms_key)
|
||||
var/static/last_irc_status = 0
|
||||
|
||||
if("ping" in input)
|
||||
var/x = 1
|
||||
@@ -102,7 +102,6 @@ var/last_irc_status = 0
|
||||
status += "Players: [clients.len] (Active: [get_active_player_count(0,1,0)]). Mode: [ticker.mode.name]."
|
||||
send2irc("Status", status)
|
||||
last_irc_status = world.time
|
||||
// send2maindiscord("**Server starting up**. [clients.len] (Active: [get_active_player_count(0,1,0)]). Mode: [ticker.mode.name].`. Map is **Probably Box Station**")
|
||||
|
||||
else if("status" in input)
|
||||
var/list/s = list()
|
||||
@@ -248,7 +247,7 @@ var/last_irc_status = 0
|
||||
if(blackbox)
|
||||
blackbox.save_all_data_to_sql()
|
||||
Master.Shutdown() //run SS shutdowns
|
||||
RoundEndSound(round_end_sound_sent)
|
||||
RoundEndAnimation(round_end_sound_sent)
|
||||
kick_clients_in_lobby("<span class='boldannounce'>The round came to an end with you in the lobby.</span>", 1) //second parameter ensures only afk clients are kicked
|
||||
world << "<span class='boldannounce'>Rebooting world. Loading next map...</span>"
|
||||
for(var/thing in clients)
|
||||
@@ -256,7 +255,7 @@ var/last_irc_status = 0
|
||||
if(C && config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
|
||||
C << link("byond://[config.server]")
|
||||
|
||||
/world/proc/RoundEndSound(round_end_sound_sent)
|
||||
/world/proc/RoundEndAnimation(round_end_sound_sent)
|
||||
set waitfor = FALSE
|
||||
var/round_end_sound
|
||||
if(!ticker && ticker.round_end_sound)
|
||||
@@ -277,6 +276,10 @@ var/last_irc_status = 0
|
||||
'sound/roundend/yeehaw.ogg',
|
||||
'sound/roundend/disappointed.ogg'\
|
||||
)
|
||||
|
||||
for(var/thing in clients)
|
||||
new /obj/screen/splash(thing, FALSE, FALSE)
|
||||
|
||||
world << sound(round_end_sound)
|
||||
|
||||
/world/proc/load_mode()
|
||||
@@ -292,11 +295,7 @@ var/last_irc_status = 0
|
||||
F << the_mode
|
||||
|
||||
/world/proc/load_motd()
|
||||
join_motd = file2text("config/motd.txt")
|
||||
join_motd += "<br>"
|
||||
for(var/line in revdata.testmerge)
|
||||
if(line)
|
||||
join_motd += "Test merge active of PR <a href='[config.githuburl]/pull/[line]'>#[line]</a><br>"
|
||||
join_motd = file2text("config/motd.txt") + "<br>" + revdata.GetTestMergeInfo()
|
||||
|
||||
/world/proc/load_configuration()
|
||||
protected_config = new /datum/protected_configuration()
|
||||
@@ -362,47 +361,6 @@ var/last_irc_status = 0
|
||||
|
||||
status = s
|
||||
|
||||
#define FAILED_DB_CONNECTION_CUTOFF 5
|
||||
var/failed_db_connections = 0
|
||||
|
||||
/proc/setup_database_connection()
|
||||
|
||||
if(failed_db_connections >= FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to connect anymore.
|
||||
return 0
|
||||
|
||||
if(!dbcon)
|
||||
dbcon = new()
|
||||
|
||||
var/user = sqlfdbklogin
|
||||
var/pass = sqlfdbkpass
|
||||
var/db = sqlfdbkdb
|
||||
var/address = sqladdress
|
||||
var/port = sqlport
|
||||
|
||||
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
|
||||
. = dbcon.IsConnected()
|
||||
if ( . )
|
||||
failed_db_connections = 0 //If this connection succeeded, reset the failed connections counter.
|
||||
else
|
||||
failed_db_connections++ //If it failed, increase the failed connections counter.
|
||||
if(config.sql_enabled)
|
||||
log_world("SQL error: " + dbcon.ErrorMsg())
|
||||
|
||||
return .
|
||||
|
||||
//This proc ensures that the connection to the feedback database (global variable dbcon) is established
|
||||
/proc/establish_db_connection()
|
||||
if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF)
|
||||
return 0
|
||||
|
||||
if(!dbcon || !dbcon.IsConnected())
|
||||
return setup_database_connection()
|
||||
else
|
||||
return 1
|
||||
|
||||
#undef FAILED_DB_CONNECTION_CUTOFF
|
||||
|
||||
|
||||
/proc/maprotate()
|
||||
if (!SERVERTOOLS)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user