Files
CHOMPStation2/code/game/algorithm.dm
elly1989@rocketmail.com 99354f8c71 More gifts from FPstation. This fetches a list of known proxies and stops people from connecting whilst using them. Proxies are often used for nefarious reasons.
It needs to be kept as up-to-date as possible, so it autoupdates every 6+ hours or so to ensure the database is relatively up-to-date.

Like the previous commit, I'd only really recommend it if the other stuff isn't getting the job done.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4257 316c924e-a436-60f5-8080-3fe189b3f50e
2012-07-31 20:42:10 +00:00

69 lines
2.0 KiB
Plaintext

//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/world/New()
..()
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()
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()
#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
/// 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)