Bleeding edgy refresh (#303)

* not code stuff

* other things

* global vars, defines, helpers

* onclick hud stuff, orphans, world.dm

* controllers and datums

* game folder

* everything not client/mobs in modules

* client folder

* stage 1 mob stuff

* simple animal things

* silicons

* carbon things

* ayylmaos and monkeys

* hyoomahn

* icons n shit

* sprite fixes

* compile fixes

* some fixes I cherrypicked.

* qdel fixes

* forgot brain refractors
This commit is contained in:
Poojawa
2017-03-21 11:44:10 -05:00
committed by GitHub
parent 099a6c8764
commit f67e9f6d87
1476 changed files with 344416 additions and 40694 deletions
+19 -129
View File
@@ -1,6 +1,6 @@
/world
mob = /mob/new_player
turf = /turf/open/space
mob = /mob/dead/new_player
turf = /turf/basic
area = /area/space
view = "15x15"
cache_lifespan = 7
@@ -13,11 +13,8 @@
loop_checks = FALSE
#endif
var/list/map_transition_config = MAP_TRANSITION_CONFIG
/world/New()
log_world("World loaded at [world.timeofday]")
map_ready = 1
log_world("World loaded at [time_stamp()]")
#if (PRELOAD_RSC == 0)
external_rsc_urls = file2list("config/external_rsc_urls.txt","\n")
@@ -33,8 +30,8 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
href_logfile = file("data/logs/[date_string] hrefs.htm")
diary = file("data/logs/[date_string].log")
diaryofmeanpeople = file("data/logs/[date_string] Attack.log")
diary << "\n\nStarting up. [time2text(world.timeofday, "hh:mm.ss")]\n---------------------"
diaryofmeanpeople << "\n\nStarting up. [time2text(world.timeofday, "hh:mm.ss")]\n---------------------"
diary << "\n\nStarting up. [time_stamp()]\n---------------------"
diaryofmeanpeople << "\n\nStarting up. [time_stamp()]\n---------------------"
changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently
make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
@@ -60,16 +57,7 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
data_core = new /datum/datacore()
SortAreas() //Build the list of all existing areas and sort it alphabetically
process_teleport_locs() //Sets up the wizard teleport locations
#ifdef MAP_NAME
map_name = "[MAP_NAME]"
#else
map_name = "Unknown"
#endif
Master.Setup(10, FALSE)
Master.Initialize(10, FALSE)
#define IRC_STATUS_THROTTLE 50
/world/Topic(T, addr, master, key)
@@ -132,7 +120,7 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
if(ticker)
s["gamestate"] = ticker.current_state
s["map_name"] = map_name ? map_name : "Unknown"
s["map_name"] = SSmapping.config.map_name
if(key_valid && ticker && ticker.mode)
s["real_mode"] = ticker.mode.name
@@ -157,7 +145,7 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
#define CHAT_PULLR 64 //defined in preferences.dm, but not available here at compilation time
for(var/client/C in clients)
if(C.prefs && (C.prefs.chat_toggles & CHAT_PULLR))
C << "<span class='announce'>PR: [input["announce"]]</span>"
to_chat(C, "<span class='announce'>PR: [input["announce"]]</span>")
#undef CHAT_PULLR
else if("crossmessage" in input)
@@ -191,14 +179,16 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
return "Bad Key"
else
return ircadminwho()
else if("server_hop" in input)
show_server_hop_transfer_screen(input["server_hop"])
#define WORLD_REBOOT(X) log_world("World rebooted at [world.timeofday]"); ..(X); return;
#define WORLD_REBOOT(X) log_world("World rebooted at [time_stamp()]"); ..(X); return;
/world/Reboot(var/reason, var/feedback_c, var/feedback_r, var/time)
if (reason == 1) //special reboot, do none of the normal stuff
if (usr)
log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools")
message_admins("[key_name_admin(usr)] Has requested an immediate world restart via client side debugging tools")
world << "<span class='boldannounce'>Rebooting World immediately due to host request</span>"
to_chat(world, "<span class='boldannounce'>Rebooting World immediately due to host request</span>")
WORLD_REBOOT(1)
var/delay
if(time)
@@ -206,9 +196,9 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
else
delay = config.round_end_countdown * 10
if(ticker.delay_end)
world << "<span class='boldannounce'>An admin has delayed the round end.</span>"
to_chat(world, "<span class='boldannounce'>An admin has delayed the round end.</span>")
return
world << "<span class='boldannounce'>Rebooting World in [delay/10] [(delay >= 10 && delay < 20) ? "second" : "seconds"]. [reason]</span>"
to_chat(world, "<span class='boldannounce'>Rebooting World in [delay/10] [(delay >= 10 && delay < 20) ? "second" : "seconds"]. [reason]</span>")
var/round_end_sound_sent = FALSE
if(ticker.round_end_sound)
round_end_sound_sent = TRUE
@@ -219,15 +209,7 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
C.Export("##action=load_rsc", ticker.round_end_sound)
sleep(delay)
if(ticker.delay_end)
world << "<span class='boldannounce'>Reboot was cancelled by an admin.</span>"
return
if(mapchanging)
world << "<span class='boldannounce'>Map change operation detected, delaying reboot.</span>"
rebootingpendingmapchange = 1
spawn(1200)
if(mapchanging)
mapchanging = 0 //map rotation can in some cases be finished but never exit, this is a failsafe
Reboot("Map change timed out", time = 10)
to_chat(world, "<span class='boldannounce'>Reboot was cancelled by an admin.</span>")
return
OnReboot(reason, feedback_c, feedback_r, round_end_sound_sent)
WORLD_REBOOT(0)
@@ -249,7 +231,7 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
Master.Shutdown() //run SS shutdowns
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>"
to_chat(world, "<span class='boldannounce'>Rebooting world...</span>")
for(var/thing in clients)
var/client/C = thing
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
@@ -278,7 +260,8 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
)
for(var/thing in clients)
new /obj/screen/splash(thing, FALSE, FALSE)
var/obj/screen/splash/S = new(thing, FALSE)
S.Fade(FALSE,FALSE)
world << sound(round_end_sound)
@@ -298,12 +281,11 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
join_motd = file2text("config/motd.txt") + "<br>" + revdata.GetTestMergeInfo()
/world/proc/load_configuration()
protected_config = new /datum/protected_configuration()
config = new /datum/configuration()
config.load("config/config.txt")
config.load("config/game_options.txt","game_options")
config.loadsql("config/dbconfig.txt")
if (config.maprotation && SERVERTOOLS)
if (config.maprotation)
config.loadmaplist("config/maps.txt")
// apply some settings from config..
@@ -360,95 +342,3 @@ var/list/map_transition_config = MAP_TRANSITION_CONFIG
s += ": [jointext(features, ", ")]"
status = s
/proc/maprotate()
if (!SERVERTOOLS)
return
var/players = clients.len
var/list/mapvotes = list()
//count votes
for (var/client/c in clients)
var/vote = c.prefs.preferred_map
if (!vote)
if (config.defaultmap)
mapvotes[config.defaultmap.name] += 1
continue
mapvotes[vote] += 1
//filter votes
for (var/map in mapvotes)
if (!map)
mapvotes.Remove(map)
if (!(map in config.maplist))
mapvotes.Remove(map)
continue
var/datum/votablemap/VM = config.maplist[map]
if (!VM)
mapvotes.Remove(map)
continue
if (VM.voteweight <= 0)
mapvotes.Remove(map)
continue
if (VM.minusers > 0 && players < VM.minusers)
mapvotes.Remove(map)
continue
if (VM.maxusers > 0 && players > VM.maxusers)
mapvotes.Remove(map)
continue
mapvotes[map] = mapvotes[map]*VM.voteweight
var/pickedmap = pickweight(mapvotes)
if (!pickedmap)
return
var/datum/votablemap/VM = config.maplist[pickedmap]
message_admins("Randomly rotating map to [VM.name]([VM.friendlyname])")
. = changemap(VM)
if (. == 0)
world << "<span class='boldannounce'>Map rotation has chosen [VM.friendlyname] for next round!</span>"
var/datum/votablemap/nextmap
var/mapchanging = 0
var/rebootingpendingmapchange = 0
/proc/changemap(var/datum/votablemap/VM)
if (!SERVERTOOLS)
return
if (!istype(VM))
return
mapchanging = 1
log_game("Changing map to [VM.name]([VM.friendlyname])")
var/file = file("setnewmap.bat")
file << "\nset MAPROTATE=[VM.name]\n"
. = shell("..\\bin\\maprotate.bat")
mapchanging = 0
switch (.)
if (null)
message_admins("Failed to change map: Could not run map rotator")
log_game("Failed to change map: Could not run map rotator")
if (0)
log_game("Changed to map [VM.friendlyname]")
nextmap = VM
//1x: file errors
if (11)
message_admins("Failed to change map: File error: Map rotator script couldn't find file listing new map")
log_game("Failed to change map: File error: Map rotator script couldn't find file listing new map")
if (12)
message_admins("Failed to change map: File error: Map rotator script couldn't find tgstation-server framework")
log_game("Failed to change map: File error: Map rotator script couldn't find tgstation-server framework")
//2x: conflicting operation errors
if (21)
message_admins("Failed to change map: Conflicting operation error: Current server update operation detected")
log_game("Failed to change map: Conflicting operation error: Current server update operation detected")
if (22)
message_admins("Failed to change map: Conflicting operation error: Current map rotation operation detected")
log_game("Failed to change map: Conflicting operation error: Current map rotation operation detected")
//3x: external errors
if (31)
message_admins("Failed to change map: External error: Could not compile new map:[VM.name]")
log_game("Failed to change map: External error: Could not compile new map:[VM.name]")
else
message_admins("Failed to change map: Unknown error: Error code #[.]")
log_game("Failed to change map: Unknown error: Error code #[.]")
if(rebootingpendingmapchange)
world.Reboot("Map change finished", time = 10)