Files
vgstation13/code/game/algorithm.dm
elly1989@rocketmail.com a9eabb0561 Created global lists for hair and facial_hair datums since they are referenced frequently. This means those datums are only ever created once. Also, the list is indexed by hairstyle name. This means means we only need to store one variable to find the hair datum. It also means admins can change h_style and f_style to the name of the hair and use the Regenerate Icons function in viewvars to update a human's hair icon. If an incorrect f_style or h_style is input it won't affect anything adversely (besides hair not showing for that mob).
The hub will no longer report admins who are stealthminning.

Added a server byond_version check. All it does is tell you if your byond_version is below RECOMMENDED_VERSION and encourages you to update BYOND.

Underwear and bag lists are now a single global list rather than creating the same list for every new player.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4268 316c924e-a436-60f5-8080-3fe189b3f50e
2012-08-01 13:40:43 +00:00

75 lines
2.3 KiB
Plaintext

//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
#define RECOMMENDED_VERSION 494
/world/New()
..()
if(byond_version < RECOMMENDED_VERSION)
world.log << "Your server's byond version does not meet the recommended requirements for TGstation code. Please update BYOND"
diary = file("data/logs/[time2text(world.realtime, "YYYY/MM-Month/DD-Day")].log")
diary << {"
Starting up. [time2text(world.timeofday, "hh:mm.ss")]
---------------------
"}
diaryofmeanpeople = file("data/logs/[time2text(world.realtime, "YYYY/MM-Month/DD-Day")] Attack.log")
diaryofmeanpeople << {"
Starting up. [time2text(world.timeofday, "hh:mm.ss")]
---------------------
"}
href_logfile = file("data/logs/[time2text(world.realtime, "YYYY/MM-Month/DD-Day")] hrefs.html")
jobban_loadbanfile()
jobban_updatelegacybans()
LoadBans()
make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
process_teleport_locs() //Sets up the wizard teleport locations
process_ghost_teleport_locs() //Sets up ghost teleport locations.
sleep_offline = 1
spawn(3000) //so we aren't adding to the round-start lag
if(config.ToRban)
ToRban_autoupdate()
if(config.kick_inactive)
KickInactiveClients()
#undef RECOMMENDED_VERSION
#define INACTIVITY_KICK 6000 //10 minutes in ticks (approx.)
/world/proc/KickInactiveClients()
for(var/client/C)
if( !C.holder && (C.inactivity >= INACTIVITY_KICK) )
if(C.mob)
if(!istype(C.mob, /mob/dead/))
log_access("AFK: [key_name(C)]")
C << "\red You have been inactive for more than 10 minutes and have been disconnected."
del(C)
spawn(3000) KickInactiveClients()//more or less five minutes
#undef INACTIVITY_KICK
/// EXPERIMENTAL STUFF
// This function counts a passed job.
proc/countJob(rank)
var/jobCount = 0
for(var/mob/H in player_list)
if(H.mind && H.mind.assigned_role == rank)
jobCount++
return jobCount
/proc/AutoUpdateAI(obj/subject)
if (subject!=null)
for(var/mob/living/silicon/ai/M in player_list)
if ((M.client && M.machine == subject))
subject.attack_ai(M)
/proc/AutoUpdateTK(obj/subject)
if (subject!=null)
for(var/obj/item/tk_grab/T in world)
if (T.host)
var/mob/M = T.host
if(M.client && M.machine == subject)
subject.attack_hand(M)