TG: Ban moved into IsBanned so that people whom are banned can actually see -why-

they are banned. Another perk of using IsBanned and not client/New() is that we
now disconnect potential clients before they are given a client object and start
downloading any resources...which is like a 30Mb saving per failed login (after
each server update).

Tidied up the Login and Logout procs for mobs. Moved the sandbox buildmode stuff
to mob/living/login.dm so you shouldn't have to log-out and back in to enable
build mode.

Removed the logged_in variable for mobs as it was the most pointless thing ever.

Made the multikeying checks a separate proc. People are checked the second they
get a new_player mob. Its notices are also less spammy.

Changed AllowUpload from the default. It now restricts uploads of over 1Mb to
prevent admins uploading massive .Oggs and lagging the server to hell whilst it
sends the ogg to 40+ players. Feel free to change the limit.

Moved some of the core client procs into one folder; they should really be
together and not in /modules/mob/mob.dm and various other places. I will be
giving the client stuff a belated spring-clean over the next few commits, just
got to iron out some of the kinks.
Revision: r3694
Author: 	 elly1...@rocketmail.com
This commit is contained in:
Erthilo
2012-06-03 01:09:26 +01:00
parent 813d43e1d5
commit 86feaac9c2
19 changed files with 761 additions and 717 deletions

View File

@@ -14,6 +14,7 @@
var/log_adminchat = 0 // log admin chat messages
var/log_adminwarn = 0 // log warnings admins get about bomb construction and such
var/log_pda = 0 // log pda messages
var/log_hrefs = 0 // logs all links clicked in-game. Could be used for debugging and tracking down exploits
var/sql_enabled = 1 // for sql switching
var/allow_vote_restart = 0 // allow votes to restart
var/allow_vote_mode = 0 // allow votes to change mode
@@ -171,6 +172,9 @@
if ("log_pda")
config.log_pda = 1
if ("log_hrefs")
config.log_hrefs = 1
if ("allow_vote_restart")
config.allow_vote_restart = 1

View File

@@ -248,7 +248,6 @@ client
if(ishuman(D))
body += "<option value>---</option>"
body += "<option value='byond://?src=\ref[src];makeai=\ref[D]'>Make AI</option>"
body += "<option value='byond://?src=\ref[src];makeaisilent=\ref[D]'>Make AI (Silently)</option>"
body += "<option value='byond://?src=\ref[src];makerobot=\ref[D]'>Make cyborg</option>"
body += "<option value='byond://?src=\ref[src];makemonkey=\ref[D]'>Make monkey</option>"
body += "<option value='byond://?src=\ref[src];makealien=\ref[D]'>Make alien</option>"
@@ -390,419 +389,382 @@ client
return html
//All BYOND links pass through client/Topic() FIRST and are then directed to [hsrc]/Topic() by the ..() call at the end.
client/Topic(href, href_list, hsrc)
file("topic_log") << "[time2text(world.realtime, "DDD MMM DD YYYY")] at [time2text(world.timeofday, "hh:mm:ss")], [ckey], \"[url_encode(href)]\""
// build some more useful info
var/references = ""
for(var/href_key in href_list)
var/href_val = locate(href_list[href_key])
references += "[href_key] = [href_val]("
if(istype(href_val,/datum))
references += "[href_val:type]"
if(istype(href_val,/atom))
references += " at [href_val:x],[href_val:y],[href_val:z]"
/client/proc/view_var_Topic(href,href_list,hsrc)
//This will all be moved over to datum/admins/Topic() ~Carn
if( (usr.client == src) && src.holder )
. = 1 //default return
if (href_list["Vars"])
debug_variables(locate(href_list["Vars"]))
references += "); "
file("topic_log") << references
//~CARN: for renaming mobs (updates their real_name and their ID/PDA if applicable).
else if (href_list["rename"])
var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name") as text|null),1,MAX_NAME_LEN)
if(!new_name) return
var/mob/M = locate(href_list["rename"])
if(!istype(M)) return
sleep(3)
message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].", 1)
if(istype(M, /mob/living/carbon/human))
for(var/obj/item/weapon/card/id/ID in M.contents)
if(ID.registered_name == M.real_name)
ID.name = "[new_name]'s ID Card ([ID.assignment])"
ID.registered_name = new_name
break
for(var/obj/item/device/pda/PDA in M.contents)
if(PDA.owner == M.real_name)
PDA.name = "PDA-[new_name] ([PDA.ownjob])"
PDA.owner = new_name
break
M.real_name = new_name
M.name = new_name
M.original_name = new_name
href_list["datumrefresh"] = href_list["rename"]
//search the href for script injection //This is a temporary measure
if( findtext(href,"<script",1,0) )
world.log << "Attempted use of scripts within a topic call, by [src]"
message_admins("Attempted use of scripts within a topic call, by [src]")
del(usr)
return
else if (href_list["varnameedit"])
if(!href_list["datumedit"] || !href_list["varnameedit"])
usr << "Varedit error: Not all information has been sent Contact a coder."
return
var/DAT = locate(href_list["datumedit"])
if(!DAT)
usr << "Item not found"
return
if(!istype(DAT,/datum) && !istype(DAT,/client))
usr << "Can't edit an item of this type. Type must be /datum or /client, so anything except simple variables."
return
modify_variables(DAT, href_list["varnameedit"], 1)
else if (href_list["varnamechange"])
if(!href_list["datumchange"] || !href_list["varnamechange"])
usr << "Varedit error: Not all information has been sent. Contact a coder."
return
var/DAT = locate(href_list["datumchange"])
if(!DAT)
usr << "Item not found"
return
if(!istype(DAT,/datum) && !istype(DAT,/client))
usr << "Can't edit an item of this type. Type must be /datum or /client, so anything except simple variables."
return
modify_variables(DAT, href_list["varnamechange"], 0)
else if (href_list["varnamemass"])
if(!href_list["datummass"] || !href_list["varnamemass"])
usr << "Varedit error: Not all information has been sent. Contact a coder."
return
var/atom/A = locate(href_list["datummass"])
if(!A)
usr << "Item not found"
return
if(!istype(A,/atom))
usr << "Can't mass edit an item of this type. Type must be /atom, so an object, turf, mob or area. You cannot mass edit clients!"
return
cmd_mass_modify_object_variables(A, href_list["varnamemass"])
else if (href_list["mob_player_panel"])
if(!href_list["mob_player_panel"])
return
var/mob/MOB = locate(href_list["mob_player_panel"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.holder.show_player_panel(MOB)
href_list["datumrefresh"] = href_list["mob_player_panel"]
else if (href_list["give_spell"])
if(!href_list["give_spell"])
return
var/mob/MOB = locate(href_list["give_spell"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.give_spell(MOB)
href_list["datumrefresh"] = href_list["give_spell"]
else if (href_list["ninja"])
if(!href_list["ninja"])
return
var/mob/MOB = locate(href_list["ninja"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.cmd_admin_ninjafy(MOB)
href_list["datumrefresh"] = href_list["ninja"]
else if (href_list["godmode"])
if(!href_list["godmode"])
return
var/mob/MOB = locate(href_list["godmode"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.cmd_admin_godmode(MOB)
href_list["datumrefresh"] = href_list["godmode"]
else if (href_list["gib"])
if(!href_list["gib"])
return
var/mob/MOB = locate(href_list["gib"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.cmd_admin_gib(MOB)
if(href_list["priv_msg"])
var/client/C = locate(href_list["priv_msg"])
if(ismob(C)) //Old stuff can pass in mobs instead of clients
var/mob/M = C
C = M.client
cmd_admin_pm(C,null)
return
else if (href_list["build_mode"])
if(!href_list["build_mode"])
return
var/mob/MOB = locate(href_list["build_mode"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
togglebuildmode(MOB)
href_list["datumrefresh"] = href_list["build_mode"]
else
//THIS **REALLY** NEEDS TO BE REWRITTEN AS obj/admin/Topic or something. As a matter of urgency.
if( (usr.client == src) && src.holder )
if (href_list["Vars"])
debug_variables(locate(href_list["Vars"]))
else if (href_list["drop_everything"])
if(!href_list["drop_everything"])
return
var/mob/MOB = locate(href_list["drop_everything"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
//~CARN: for renaming mobs (updates their real_name and their ID/PDA if applicable).
else if (href_list["rename"])
var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name") as text|null),1,MAX_NAME_LEN)
if(!new_name) return
var/mob/M = locate(href_list["rename"])
if(!istype(M)) return
if(usr.client)
usr.client.cmd_admin_drop_everything(MOB)
message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].", 1)
if(istype(M, /mob/living/carbon/human))
for(var/obj/item/weapon/card/id/ID in M.contents)
if(ID.registered_name == M.real_name)
ID.name = "[new_name]'s ID Card ([ID.assignment])"
ID.registered_name = new_name
break
for(var/obj/item/device/pda/PDA in M.contents)
if(PDA.owner == M.real_name)
PDA.name = "PDA-[new_name] ([PDA.ownjob])"
PDA.owner = new_name
break
M.real_name = new_name
M.name = new_name
M.original_name = new_name
href_list["datumrefresh"] = href_list["rename"]
else if (href_list["direct_control"])
if(!href_list["direct_control"])
return
var/mob/MOB = locate(href_list["direct_control"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
else if (href_list["varnameedit"])
if(!href_list["datumedit"] || !href_list["varnameedit"])
usr << "Varedit error: Not all information has been sent Contact a coder."
return
var/DAT = locate(href_list["datumedit"])
if(!DAT)
usr << "Item not found"
return
if(!istype(DAT,/datum) && !istype(DAT,/client))
usr << "Can't edit an item of this type. Type must be /datum or /client, so anything except simple variables."
return
modify_variables(DAT, href_list["varnameedit"], 1)
else if (href_list["varnamechange"])
if(!href_list["datumchange"] || !href_list["varnamechange"])
usr << "Varedit error: Not all information has been sent. Contact a coder."
return
var/DAT = locate(href_list["datumchange"])
if(!DAT)
usr << "Item not found"
return
if(!istype(DAT,/datum) && !istype(DAT,/client))
usr << "Can't edit an item of this type. Type must be /datum or /client, so anything except simple variables."
return
modify_variables(DAT, href_list["varnamechange"], 0)
else if (href_list["varnamemass"])
if(!href_list["datummass"] || !href_list["varnamemass"])
usr << "Varedit error: Not all information has been sent. Contact a coder."
return
var/atom/A = locate(href_list["datummass"])
if(!A)
usr << "Item not found"
return
if(!istype(A,/atom))
usr << "Can't mass edit an item of this type. Type must be /atom, so an object, turf, mob or area. You cannot mass edit clients!"
return
cmd_mass_modify_object_variables(A, href_list["varnamemass"])
else if (href_list["mob_player_panel"])
if(!href_list["mob_player_panel"])
return
var/mob/MOB = locate(href_list["mob_player_panel"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.holder.show_player_panel(MOB)
href_list["datumrefresh"] = href_list["mob_player_panel"]
else if (href_list["give_spell"])
if(!href_list["give_spell"])
return
var/mob/MOB = locate(href_list["give_spell"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.give_spell(MOB)
href_list["datumrefresh"] = href_list["give_spell"]
else if (href_list["ninja"])
if(!href_list["ninja"])
return
var/mob/MOB = locate(href_list["ninja"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.cmd_admin_ninjafy(MOB)
href_list["datumrefresh"] = href_list["ninja"]
else if (href_list["godmode"])
if(!href_list["godmode"])
return
var/mob/MOB = locate(href_list["godmode"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.cmd_admin_godmode(MOB)
href_list["datumrefresh"] = href_list["godmode"]
else if (href_list["gib"])
if(!href_list["gib"])
return
var/mob/MOB = locate(href_list["gib"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.cmd_admin_gib(MOB)
if(usr.client)
usr.client.cmd_assume_direct_control(MOB)
else if (href_list["build_mode"])
if(!href_list["build_mode"])
else if (href_list["delall"])
if(!href_list["delall"])
return
var/atom/A = locate(href_list["delall"])
if(!A)
return
if(!isobj(A))
usr << "This can only be used on objects (of type /obj)"
return
if(!A.type)
return
var/action_type = alert("Strict type ([A.type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel")
if(!action_type || action_type == "Cancel")
return
if(alert("Are you really sure you want to delete all objects of type [A.type]?",,"Yes","No") != "Yes")
return
if(alert("Second confirmation required. Delete?",,"Yes","No") != "Yes")
return
var/a_type = A.type
if(action_type == "Strict type")
var/i = 0
for(var/obj/O in world)
if(O.type == a_type)
i++
del(O)
if(!i)
usr << "No objects of this type exist"
return
var/mob/MOB = locate(href_list["build_mode"])
if(!MOB)
log_admin("[key_name(usr)] deleted all objects of scrict type [a_type] ([i] objects deleted) ")
message_admins("\blue [key_name(usr)] deleted all objects of scrict type [a_type] ([i] objects deleted) ", 1)
else if(action_type == "Type and subtypes")
var/i = 0
for(var/obj/O in world)
if(istype(O,a_type))
i++
del(O)
if(!i)
usr << "No objects of this type exist"
return
if(!ismob(MOB))
return
if(!src.holder)
return
togglebuildmode(MOB)
href_list["datumrefresh"] = href_list["build_mode"]
log_admin("[key_name(usr)] deleted all objects of scrict type with subtypes [a_type] ([i] objects deleted) ")
message_admins("\blue [key_name(usr)] deleted all objects of type with subtypes [a_type] ([i] objects deleted) ", 1)
else if (href_list["drop_everything"])
if(!href_list["drop_everything"])
return
var/mob/MOB = locate(href_list["drop_everything"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
else if (href_list["explode"])
if(!href_list["explode"])
return
var/atom/A = locate(href_list["explode"])
if(!A)
return
if(!isobj(A) && !ismob(A) && !isturf(A))
return
src.cmd_admin_explosion(A)
href_list["datumrefresh"] = href_list["explode"]
else if (href_list["emp"])
if(!href_list["emp"])
return
var/atom/A = locate(href_list["emp"])
if(!A)
return
if(!isobj(A) && !ismob(A) && !isturf(A))
return
src.cmd_admin_emp(A)
href_list["datumrefresh"] = href_list["emp"]
else if (href_list["mark_object"])
if(!href_list["mark_object"])
return
var/datum/D = locate(href_list["mark_object"])
if(!D)
return
if(!src.holder)
return
src.holder.marked_datum = D
href_list["datumrefresh"] = href_list["mark_object"]
else if (href_list["rotatedatum"])
if(!href_list["rotatedir"])
return
var/atom/A = locate(href_list["rotatedatum"])
if(!A)
return
if(!istype(A,/atom))
usr << "This can only be done to objects of type /atom"
return
if(!src.holder)
return
switch(href_list["rotatedir"])
if("right")
A.dir = turn(A.dir, -45)
if("left")
A.dir = turn(A.dir, 45)
href_list["datumrefresh"] = href_list["rotatedatum"]
else if (href_list["makemonkey"])
var/mob/M = locate(href_list["makemonkey"])
if(!M)
return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("monkeyone"=href_list["makemonkey"]))
else if (href_list["makerobot"])
var/mob/M = locate(href_list["makerobot"])
if(!M)
return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makerobot"=href_list["makerobot"]))
else if (href_list["makealien"])
var/mob/M = locate(href_list["makealien"])
if(!M)
return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makealien"=href_list["makealien"]))
else if (href_list["makemetroid"])
var/mob/M = locate(href_list["makemetroid"])
if(!M)
return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makemetroid"=href_list["makemetroid"]))
else if (href_list["makeai"])
var/mob/M = locate(href_list["makeai"])
if(!M)
return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makeai"=href_list["makeai"]))
else if (href_list["adjustDamage"] && href_list["mobToDamage"])
var/mob/M = locate(href_list["mobToDamage"])
var/Text = locate(href_list["adjustDamage"])
if(usr.client)
usr.client.cmd_admin_drop_everything(MOB)
else if (href_list["direct_control"])
if(!href_list["direct_control"])
return
var/mob/MOB = locate(href_list["direct_control"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
if(usr.client)
usr.client.cmd_assume_direct_control(MOB)
else if (href_list["delall"])
if(!href_list["delall"])
return
var/atom/A = locate(href_list["delall"])
if(!A)
return
if(!isobj(A))
usr << "This can only be used on objects (of type /obj)"
return
if(!A.type)
return
var/action_type = alert("Strict type ([A.type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel")
if(!action_type || action_type == "Cancel")
return
if(alert("Are you really sure you want to delete all objects of type [A.type]?",,"Yes","No") != "Yes")
return
if(alert("Second confirmation required. Delete?",,"Yes","No") != "Yes")
return
var/a_type = A.type
if(action_type == "Strict type")
var/i = 0
for(var/obj/O in world)
if(O.type == a_type)
i++
del(O)
if(!i)
usr << "No objects of this type exist"
return
log_admin("[key_name(usr)] deleted all objects of scrict type [a_type] ([i] objects deleted) ")
message_admins("\blue [key_name(usr)] deleted all objects of scrict type [a_type] ([i] objects deleted) ", 1)
else if(action_type == "Type and subtypes")
var/i = 0
for(var/obj/O in world)
if(istype(O,a_type))
i++
del(O)
if(!i)
usr << "No objects of this type exist"
return
log_admin("[key_name(usr)] deleted all objects of scrict type with subtypes [a_type] ([i] objects deleted) ")
message_admins("\blue [key_name(usr)] deleted all objects of type with subtypes [a_type] ([i] objects deleted) ", 1)
else if (href_list["explode"])
if(!href_list["explode"])
return
var/atom/A = locate(href_list["explode"])
if(!A)
return
if(!isobj(A) && !ismob(A) && !isturf(A))
return
src.cmd_admin_explosion(A)
href_list["datumrefresh"] = href_list["explode"]
else if (href_list["emp"])
if(!href_list["emp"])
return
var/atom/A = locate(href_list["emp"])
if(!A)
return
if(!isobj(A) && !ismob(A) && !isturf(A))
return
src.cmd_admin_emp(A)
href_list["datumrefresh"] = href_list["emp"]
else if (href_list["mark_object"])
if(!href_list["mark_object"])
return
var/datum/D = locate(href_list["mark_object"])
if(!D)
return
if(!src.holder)
return
src.holder.marked_datum = D
href_list["datumrefresh"] = href_list["mark_object"]
else if (href_list["rotatedatum"])
if(!href_list["rotatedir"])
return
var/atom/A = locate(href_list["rotatedatum"])
if(!A)
return
if(!istype(A,/atom))
usr << "This can only be done to objects of type /atom"
return
if(!src.holder)
return
switch(href_list["rotatedir"])
if("right")
A.dir = turn(A.dir, -45)
if("left")
A.dir = turn(A.dir, 45)
href_list["datumrefresh"] = href_list["rotatedatum"]
else if (href_list["makemonkey"])
var/mob/M = locate(href_list["makemonkey"])
if(!M)
return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("monkeyone"=href_list["makemonkey"]))
else if (href_list["makerobot"])
var/mob/M = locate(href_list["makerobot"])
if(!M)
return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makerobot"=href_list["makerobot"]))
else if (href_list["makealien"])
var/mob/M = locate(href_list["makealien"])
if(!M)
return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makealien"=href_list["makealien"]))
else if (href_list["makemetroid"])
var/mob/M = locate(href_list["makemetroid"])
if(!M)
return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makemetroid"=href_list["makemetroid"]))
else if (href_list["makeai"])
var/mob/M = locate(href_list["makeai"])
if(!M)
return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makeai"=href_list["makeai"]))
else if (href_list["adjustDamage"] && href_list["mobToDamage"])
var/mob/M = locate(href_list["mobToDamage"])
var/Text = locate(href_list["adjustDamage"])
var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num
if(Text == "brute")
M.adjustBruteLoss(amount)
else if(Text == "fire")
M.adjustFireLoss(amount)
else if(Text == "toxin")
M.adjustToxLoss(amount)
else if(Text == "oxygen")
M.adjustOxyLoss(amount)
else if(Text == "brain")
M.adjustBrainLoss(amount)
else if(Text == "clone")
M.adjustCloneLoss(amount)
else
usr << "You caused an error. DEBUG: Text:[Text] Mob:[M]"
return
if(amount != 0)
log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [M] ")
message_admins("\blue [key_name(usr)] dealt [amount] amount of [Text] damage to [M] ", 1)
href_list["datumrefresh"] = href_list["mobToDamage"]
var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num
if(Text == "brute")
M.adjustBruteLoss(amount)
else if(Text == "fire")
M.adjustFireLoss(amount)
else if(Text == "toxin")
M.adjustToxLoss(amount)
else if(Text == "oxygen")
M.adjustOxyLoss(amount)
else if(Text == "brain")
M.adjustBrainLoss(amount)
else if(Text == "clone")
M.adjustCloneLoss(amount)
else
..()
usr << "You caused an error. DEBUG: Text:[Text] Mob:[M]"
return
if (href_list["datumrefresh"])
if(!href_list["datumrefresh"])
return
var/datum/DAT = locate(href_list["datumrefresh"])
if(!DAT)
return
if(!istype(DAT,/datum))
return
src.debug_variables(DAT)
return
if(amount != 0)
log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [M] ")
message_admins("\blue [key_name(usr)] dealt [amount] amount of [Text] damage to [M] ", 1)
href_list["datumrefresh"] = href_list["mobToDamage"]
else
. = 0
if (href_list["datumrefresh"])
var/datum/DAT = locate(href_list["datumrefresh"])
if(!DAT)
return
if(!istype(DAT,/datum))
return
src.debug_variables(DAT)
. = 1
return
//Ok, all done with that admin crap. redirect it to the Topic for hsrc
..()

View File

@@ -1,53 +0,0 @@
/client
//START Admin Things
//This should be changed to a datum
var/obj/admins/holder = null // Stays null if client isn't an admin. Stores properties about the admin, if not null.
var/buildmode = 0
var/stealth = 0
var/fakekey = null
var/seeprayers = 0
//Hosts can change their color
var/ooccolor = "#b82e00"
var/muted = null //Can't talk in OOC, say, whisper, emote... anything except for adminhelp and admin-pm. An admin punishment
var/muted_complete = null //Can't talk in any way shape or form (muted + can't adminhelp or respond to admin pm-s). An admin punishment
var/admin_invis = 0
//END Admin Things
//Key auth things
// authenticate = 0
// var/authenticated = 0
// var/authenticating = 0
var/listen_ooc = 1
var/move_delay = 1
var/moving = null
var/adminobs = null
var/deadchat = 0.0
var/changes = 0
var/canplaysound = 1
var/ambience_playing = null
var/no_ambi = 0
var/area = null
var/played = 0
var/team = null
var/warned = 0
var/be_syndicate = 0 //Moving this into client vars, since I was silly when I made it.
var/STFU_ghosts //80+ people rounds are fun to admin when text flies faster than airport security
var/STFU_radio //80+ people rounds are fun to admin when text flies faster than airport security
var/sound_adminhelp = 0 //If set to 1 this will play a sound when adminhelps are received.
var/midis = 1 //Check if midis should be played for someone
var/bubbles = 1 //Check if bubbles should be displayed for someone
var/be_alien = 0 //Check if that guy wants to be an alien
var/be_pai = 1 //Consider client when searching for players to recruit as a pAI
var/vote = null
var/showvote = null
// comment out the line below when debugging locally to enable the options & messages menu
//control_freak = 1

View File

@@ -65,6 +65,7 @@ var/blobevent = 0
var/diary = null
var/diaryofmeanpeople = null
var/href_logfile = null
var/station_name = null
var/game_version = "Baystation 12"
@@ -83,7 +84,7 @@ var/goonsay_allowed = 0
var/dna_ident = 1
var/abandon_allowed = 1
var/enter_allowed = 1
// guests_allowed = 1
var/guests_allowed = 0
var/shuttle_frozen = 0
var/shuttle_left = 0
var/tinted_weldhelh = 1

View File

@@ -1,4 +1,4 @@
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/world/New()
..()
@@ -11,7 +11,6 @@ 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")]
@@ -28,15 +27,14 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")]
spawn(30)
KickInactiveClients()
#define INACTIVITY_KICK 6000 //10 minutes in ticks (approx.)
/world/proc/KickInactiveClients()
for(var/client/C)
if(!C.holder && ((C.inactivity/10)/60) >= 10)
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."
C.mob.logged_in = 0
del(C)
spawn(3000) KickInactiveClients()//more or less five minutes

View File

@@ -0,0 +1,19 @@
//Blocks an attempt to connect before even creating our client datum thing.
world/IsBanned(key,address,computer_id)
if(ckey(key) in admins)
return ..()
//Guest Checking
if( !guests_allowed && IsGuestKey(key) )
log_access("Failed Login: [key] - Guests not allowed")
message_admins("\blue Failed Login: [key] - Guests not allowed")
return list("reason"="guest", "desc"="\nReason: Guests not allowed.brb")
//Ban Checking
. = CheckBan( ckey(key), computer_id, address )
if(.)
log_access("Failed Login: [key] [computer_id] [address] - Banned [.["reason"]]")
message_admins("\blue Failed Login: [key] id:[computer_id] ip:[address] - Banned [.["reason"]]")
return .
return ..() //default pager ban stuff

View File

@@ -1,86 +1,82 @@
var/CMinutes = null
var/savefile/Banlist
/proc/LoadBans()
Banlist = new("data/banlist.bdb")
log_admin("Loading banlist.")
if (!length(Banlist.dir)) log_admin("Banlist is empty.")
if (!Banlist.dir.Find("base"))
log_admin("Banlist missing base dir.")
Banlist.dir.Add("base")
Banlist.cd = "/base"
ClearTempbans()
return 1
/proc/CheckBan(var/client/clientvar)
var/id = clientvar.computer_id
var/key = clientvar.ckey
/proc/CheckBan(var/ckey, var/id, var/address)
if(!Banlist) // if Banlist cannot be located for some reason
LoadBans() // try to load the bans
if(!Banlist) // uh oh, can't find bans!
return 0 // ABORT ABORT ABORT
. = list()
var/appeal
if(config && config.banappeals)
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[config.banappeals]'>[config.banappeals]</a>"
Banlist.cd = "/base"
if (Banlist.dir.Find("[key][id]"))
Banlist.cd = "[key][id]"
if( "[ckey][id]" in Banlist.dir )
Banlist.cd = "[ckey][id]"
if (Banlist["temp"])
if (!GetBanExp(Banlist["minutes"]))
ClearTempbans()
return 0
else
log_access("Failed Login: [clientvar] - Banned")
message_admins("\blue Failed Login: [clientvar] - Banned")
alert(clientvar,"You have been banned.\nReason : [Banlist["reason"]]\n(This ban will be automatically removed in [GetBanExp(Banlist["minutes"])].)[config.appeal_address ? "\nYou may try to appeal this at [config.appeal_address]" : ""]","Ban","Ok")
return 1
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetBanExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
else
Banlist.cd = "/base/[key][id]"
log_access("Failed Login: [clientvar] - Banned")
message_admins("\blue Failed Login: [clientvar] - Banned")
alert(clientvar,"You have been banned.\nReason : [Banlist["reason"]]\n(This is a permanent ban.)[config.appeal_address ? "\nYou may try to appeal this at [config.appeal_address]" : ""]","Ban","Ok")
return 1
Banlist.cd = "/base/[ckey][id]"
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [Banlist["bannedby"]][appeal]"
.["reason"] = "ckey/id"
return .
else
for (var/A in Banlist.dir)
Banlist.cd = "/base/[A]"
var/matches
if( ckey == Banlist["key"] )
matches += "ckey"
if( id == Banlist["id"] && Banlist["skipIdCheck"] == 0)
if(matches)
matches += "/"
matches += "id"
// if( address == Banlist["ip"] )
// if(matches)
// matches += "/"
// matches += "ip"
Banlist.cd = "/base"
for (var/A in Banlist.dir)
Banlist.cd = "/base/[A]"
if ( key == Banlist["key"] || (id == Banlist["id"] && Banlist["skipIdCheck"] == 0) )
if(Banlist["temp"])
if (!GetBanExp(Banlist["minutes"]))
ClearTempbans()
return 0
else
if(key != Banlist["key"])
log_access("Failed Login: [clientvar] - Banned as [Banlist["key"]]")
message_admins("\blue Failed Login: [clientvar] - Banned as [Banlist["key"]]")
if(matches)
if(Banlist["temp"])
if (!GetBanExp(Banlist["minutes"]))
ClearTempbans()
return 0
else
log_access("Failed Login: [clientvar] - Banned")
message_admins("\blue Failed Login: [clientvar] - Banned")
alert(clientvar,"You have been banned.\nReason : [Banlist["reason"]]\n(This ban will be automatically removed in [GetBanExp(Banlist["minutes"])].)[config.appeal_address ? "\nYou may try to appeal this at [config.appeal_address]" : ""]","Ban","Ok")
return 1
else
if(key != Banlist["key"])
log_access("Failed Login: [clientvar] - Banned as [Banlist["key"]]")
message_admins("\blue Failed Login: [clientvar] - Banned as [Banlist["key"]]")
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetBanExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
else
log_access("Failed Login: [clientvar] - Banned")
message_admins("\blue Failed Login: [clientvar] - Banned")
alert(clientvar,"You have been banned.\nReason : [Banlist["reason"]]\n(This is a permanent ban.)[config.appeal_address ? "\nYou may try to appeal this at [config.appeal_address]" : ""]","Ban","Ok")
return 1
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [Banlist["bannedby"]][appeal]"
.["reason"] = matches
return .
return 0
/proc/UpdateTime()
/proc/UpdateTime() //No idea why i made this a proc.
CMinutes = (world.realtime / 10) / 60
return 1
/proc/LoadBans()
Banlist = new("data/banlist.bdb")
log_admin("Loading Banlist")
if (!length(Banlist.dir)) log_admin("Banlist is empty.")
if (!Banlist.dir.Find("base"))
log_admin("Banlist missing base dir.")
Banlist.dir.Add("base")
Banlist.cd = "/base"
else if (Banlist.dir.Find("base"))
Banlist.cd = "/base"
ClearTempbans()
return 1
/proc/ClearTempbans()
UpdateTime()
@@ -171,6 +167,7 @@ var/savefile/Banlist
/obj/admins/proc/unbanpanel()
var/count = 0
var/dat
//var/dat = "<HR><B>Unban Player:</B> \blue(U) = Unban , (E) = Edit Ban\green (Total<HR><table border=1 rules=all frame=void cellspacing=0 cellpadding=3 >"
Banlist.cd = "/base"
for (var/A in Banlist.dir)
count++

View File

@@ -0,0 +1,54 @@
//Some of this is being changed to a datum to cut down on uneccessary variables at the client level. ~Carn
/client
////////////////
//ADMIN THINGS//
////////////////
var/obj/admins/holder = null
var/buildmode = 0
var/stealth = 0
var/fakekey = null
var/seeprayers = 0
var/ooccolor = "#b82e00"
var/muted = null //Can't talk in OOC, say, whisper, emote... anything except for adminhelp and admin-pm. An admin punishment
var/muted_complete = null //Can't talk in any way shape or form (muted + can't adminhelp or respond to admin pm-s). An admin punishment
var/warned = 0
var/sound_adminhelp = 0 //If set to 1 this will play a sound when adminhelps are received.
var/admin_invis = 0
/////////
//OTHER//
/////////
var/listen_ooc = 1
var/move_delay = 1
var/moving = null
var/adminobs = null
var/deadchat = 0
var/changes = 0
var/area = null
var/played = 0
var/team = null
var/be_alien = 0 //Check if that guy wants to be an alien
var/be_pai = 1 //Consider client when searching for players to recruit as a pAI
var/vote = null
var/showvote = null
var/STFU_ghosts //80+ people rounds are fun to admin when text flies faster than airport security
var/STFU_radio //80+ people rounds are fun to admin when text flies faster than airport security
var/be_syndicate = 0 //Moving this into client vars, since I was silly when I made it.
///////////////
//SOUND STUFF//
///////////////
var/canplaysound = 1
var/ambience_playing= null
var/no_ambi = 0 //Toggle Ambience
var/midis = 1 //Toggle Midis
////////////
//SECURITY//
////////////
var/next_allowed_topic_time = 10
// comment out the line below when debugging locally to enable the options & messages menu
control_freak = 1

View File

@@ -0,0 +1,112 @@
////////////
//SECURITY//
////////////
#define TOPIC_SPAM_DELAY 7 //7 tick delay is about half a second
#define UPLOAD_LIMIT 1048576 //Restricts client uploads to the server to 1MB //Could probably do with being lower.
/*
When somebody clicks a link in game, this Topic is called first.
It does the stuff in this proc and then is redirected to the Topic() proc for the src=[0xWhatever]
(if specified in the link). ie locate(hsrc).Topic()
Such links can be spoofed.
Because of this certain things MUST be considered whenever adding a Topic() for something:
- Can it be fed harmful values which could cause runtimes?
- Is the Topic call an admin-only thing?
- If so, does it have checks to see if the person who called it (usr.client) is an admin?
- Are the processes being called by Topic() particularly laggy?
- If so, is there any protection against somebody spam-clicking a link?
If you have any questions about this stuff feel free to ask. ~Carn
*/
/client/Topic(href, href_list, hsrc)
//Reduces spamming of links by dropping calls that happen during the delay period
if(next_allowed_topic_time > world.time)
// src << "\red DEBUG: Error: SPAM"
return
next_allowed_topic_time = world.time + TOPIC_SPAM_DELAY
//search the href for script injection
if( findtext(href,"<script",1,0) )
world.log << "Attempted use of scripts within a topic call, by [src]"
message_admins("Attempted use of scripts within a topic call, by [src]")
del(usr)
return
//Admin PM
if(href_list["priv_msg"])
var/client/C = locate(href_list["priv_msg"])
if(ismob(C)) //Old stuff can feed-in mobs instead of clients
var/mob/M = C
C = M.client
cmd_admin_pm(C,null)
return
//Logs all hrefs
if(config && config.log_hrefs && href_logfile)
href_logfile << "<small>[time2text(world.timeofday,"hh:mm")] [src] (usr:[usr])</small> || [href]<br>"
if(view_var_Topic(href,href_list,hsrc)) //Until viewvars can be rewritten as datum/admins/Topic()
return
..() //redirect to [locate(hsrc)]/Topic()
//This stops files larger than UPLOAD_LIMIT being sent from client to server via input(), client.Import() etc.
/client/AllowUpload(filename, filelength)
if(filelength > UPLOAD_LIMIT)
src << "<font color='red'>Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT/1024]KiB.</font>"
return 0
/* //Don't need this at the moment. But it's here if it's needed later.
//Helps prevent multiple files being uploaded at once. Or right after eachother.
var/time_to_wait = fileaccess_timer - world.time
if(time_to_wait > 0)
src << "<font color='red'>Error: AllowUpload(): Spam prevention. Please wait [round(time_to_wait/10)] seconds.</font>"
return 0
fileaccess_timer = world.time + FTPDELAY */
return 1
///////////
//CONNECT//
///////////
/client/New()
//Connection-Type Checking
if( connection != "seeker" )
del(src)
return
if(IsGuestKey(key))
alert(src,"Baystation12 doesn't allow guest accounts to play. Please go to http://www.byond.com/ and register for a key.","Guest","OK")
del(src)
return
if (((world.address == address || !(address)) && !(host)))
host = key
world.update_status()
..() //calls mob.Login()
makejson()
if(custom_event_msg && custom_event_msg != "")
src << "<h1 class='alert'>Custom Event</h1>"
src << "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>"
src << "<span class='alert'>[html_encode(custom_event_msg)]</span>"
src << "<br>"
//Admin Authorisation
if( ckey in admins )
holder = new /obj/admins(src)
holder.rank = admins[ckey]
update_admins(admins[ckey])
admin_memo_show()
//////////////
//DISCONNECT//
//////////////
/client/Del()
spawn(0)
if(holder)
del(holder)
makejson()
return ..()

View File

@@ -0,0 +1,12 @@
/mob/living/Login()
..()
if(ticker && ticker.mode)
switch(ticker.mode.name)
if("sandbox")
CanBuild()
if("revolution")
if ((src.mind in ticker.mode:revolutionaries) || (src.mind in ticker.mode:head_revolutionaries))
ticker.mode:update_rev_icons_added(src.mind)
if("cult")
if (src.mind in ticker.mode:cult)
ticker.mode:update_cult_icons_added(src.mind)

View File

@@ -1,4 +1,8 @@
/mob/living/silicon/ai/Login()
for(var/obj/effect/rune/rune in world)
var/image/blood = image('blood.dmi', loc = rune, icon_state = "floor[rand(1,7)]")
blood.override = 1
client.images += blood
..()
rebuild_appearance()
for(var/S in src.client.screen)

View File

@@ -1,32 +1,32 @@
/mob/Login()
log_access("Login: [key_name(src)] from [src.client.address ? src.client.address : "localhost"]")
src.lastKnownIP = src.client.address
src.computer_id = src.client.computer_id
if (config.log_access)
for (var/mob/M in world)
if(M == src)
continue
if(M.client && M.client.address == src.client.address)
log_access("Notice: [key_name(src)] has same IP address as [key_name(M)]")
message_admins("<font color='red'><B>Notice: </B><font color='blue'><A href='?src=\ref[usr];priv_msg=\ref[src]'>[key_name_admin(src)]</A> has the same IP address as <A href='?src=\ref[usr];priv_msg=\ref[M]'>[key_name_admin(M)]</A></font>", 1)
else if (M.lastKnownIP && M.lastKnownIP == src.client.address && M.ckey != src.ckey && M.key)
log_access("Notice: [key_name(src)] has same IP address as [key_name(M)] did ([key_name(M)] is no longer logged in).")
message_admins("<font color='red'><B>Notice: </B><font color='blue'><A href='?src=\ref[usr];priv_msg=\ref[src]'>[key_name_admin(src)]</A> has the same IP address as [key_name_admin(M)] did ([key_name_admin(M)] is no longer logged in).</font>", 1)
if(M.client && M.client.computer_id == src.client.computer_id)
log_access("Notice: [key_name(src)] has same computer ID as [key_name(M)]")
message_admins("<font color='red'><B>Notice: </B><font color='blue'><A href='?src=\ref[usr];priv_msg=\ref[src]'>[key_name_admin(src)]</A> has the same <font color='red'><B>computer ID</B><font color='blue'> as <A href='?src=\ref[usr];priv_msg=\ref[M]'>[key_name_admin(M)]</A></font>", 1)
spawn() alert("You have logged in already with another key this round, please log out of this one NOW or risk being banned!")
else if (M.computer_id && M.computer_id == src.client.computer_id && M.ckey != src.ckey && M.key)
log_access("Notice: [key_name(src)] has same computer ID as [key_name(M)] did ([key_name(M)] is no longer logged in).")
message_admins("<font color='red'><B>Notice: </B><font color='blue'><A href='?src=\ref[usr];priv_msg=\ref[src]'>[key_name_admin(src)]</A> has the same <font color='red'><B>computer ID</B><font color='blue'> as [key_name_admin(M)] did ([key_name_admin(M)] is no longer logged in).</font>", 1)
spawn() alert("You have logged in already with another key this round, please log out of this one NOW or risk being banned!")
if(!src.dna) src.dna = new /datum/dna(null)
//src.client.screen -= main_hud1.contents
world.update_status()
//if (!src.hud_used)
// src.hud_used = main_hud1
//handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying
/mob/proc/update_Login_details()
lastKnownIP = client.address
computer_id = client.computer_id
log_access("Login: [key_name(src)] from [lastKnownIP ? lastKnownIP : "localhost"]-[computer_id] || BYOND v[client.byond_version]")
if(config.log_access)
for(var/mob/M in world)
if(M == src) continue
if( M.key && (M.key != key) )
var/matches
if( (M.lastKnownIP == client.address) )
matches += "IP ([client.address])"
if( (M.computer_id == client.computer_id) )
if(matches) matches += " and "
matches += "ID ([client.computer_id])"
spawn() alert("You have logged in already with another key this round, please log out of this one NOW or risk being banned!")
if(matches)
if(M.client)
message_admins("<font color='red'><B>Notice: </B><font color='blue'><A href='?src=\ref[usr];priv_msg=\ref[src]'>[key_name_admin(src)]</A> has the same [matches] as <A href='?src=\ref[usr];priv_msg=\ref[M]'>[key_name_admin(M)]</A>.</font>", 1)
log_access("Notice: [key_name(src)] has the same [matches] as [key_name(M)].")
else
message_admins("<font color='red'><B>Notice: </B><font color='blue'><A href='?src=\ref[usr];priv_msg=\ref[src]'>[key_name_admin(src)]</A> has the same [matches] as [key_name_admin(M)] (no longer logged in). </font>", 1)
log_access("Notice: [key_name(src)] has the same [matches] as [key_name(M)] (no longer logged in).")
if (!src.hud_used)
/mob/Login()
update_Login_details()
if(!src.dna) src.dna = new /datum/dna(null)
world.update_status()
if(!src.hud_used)
src.hud_used = new/obj/hud( src )
else
del(src.hud_used)
@@ -34,20 +34,4 @@
src.next_move = 1
src.sight |= SEE_SELF
src.logged_in = 1
if(istype (src, /mob/living))
if(ticker)
if(ticker.mode)
if(ticker.mode.name == "revolution")
if ((src.mind in ticker.mode:revolutionaries) || (src.mind in ticker.mode:head_revolutionaries))
ticker.mode:update_rev_icons_added(src.mind)
if(ticker.mode.name == "cult")
if (src.mind in ticker.mode:cult)
ticker.mode:update_cult_icons_added(src.mind)
if(isAI(src))
for(var/obj/effect/rune/rune in world)
var/image/blood = image('blood.dmi', loc = rune, icon_state = "floor[rand(1,7)]")
blood.override = 1
client.images += blood
..()
..()

View File

@@ -2,7 +2,6 @@
log_access("Logout: [key_name(src)]")
if (admins[src.ckey])
message_admins("Admin logout: [key_name(src)]")
src.logged_in = 0
..()

View File

@@ -730,54 +730,6 @@
//usr << "[name]: Dn:[density] dir:[dir] cont:[contents] icon:[icon] is:[icon_state] loc:[loc]"
return
/client/New()
if( connection != "seeker" )
src << "Sorry, this game does not support [connection] connections." //doesn't work
del(src)
if (CheckBan(src))
del(src)
/*
if (!guests_allowed && IsGuestKey(key))
log_access("Failed Login: [src] - Guests not allowed")
message_admins("\blue Failed Login: [src] - Guests not allowed")
alert(src,"You cannot play here.\nReason : Guests not allowed","Guests not allowed","Ok")
del(src)
*/
if(IsGuestKey(key))
alert(src,"Baystation12 doesn't allow guest accounts to play. Please go to http://www.byond.com/ and register for a key.","Guest","OK")
del(src)
if (((world.address == address || !(address)) && !(host)))
host = key
world.update_status()
..()
makejson()
if(custom_event_msg && custom_event_msg != "")
src << "<h1 class='alert'>Custom Event</h1>"
src << "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>"
src << "<span class='alert'>[html_encode(custom_event_msg)]</span>"
src << "<br>"
if( ckey in admins )
holder = new /obj/admins(src)
holder.rank = admins[ckey]
update_admins(admins[ckey])
admin_memo_show()
if(ticker && ticker.mode && ticker.mode.name =="sandbox")
mob.CanBuild()
/client/Del()
spawn(0)
if(holder)
del(holder)
makejson()
return ..()
/mob/proc/can_use_hands()
if(handcuffed)
return 0

View File

@@ -182,7 +182,6 @@
var/job = null//Living
var/nodamage = 0
var/logged_in = 0
var/underwear = 1//Human
var/backbag = 2//Human

View File

@@ -0,0 +1,91 @@
/mob/new_player/Login()
update_Login_details() //handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying
if (join_motd)
src << "<div class=\"motd\">[join_motd]</div>"
if(!preferences)
preferences = new
if(!mind)
mind = new
mind.key = key
mind.current = src
spawn() Playmusic() // git some tunes up in heeyaa~
var/starting_loc = pick(newplayer_start)
if(!starting_loc) starting_loc = locate(1,1,1)
loc = starting_loc
lastarea = starting_loc
sight |= SEE_TURFS
var/list/watch_locations = list()
for(var/obj/effect/landmark/landmark in world)
if(landmark.tag == "landmark*new_player")
watch_locations += landmark.loc
if(watch_locations.len>0)
loc = pick(watch_locations)
if(!preferences.savefile_load(src, 0))
preferences.ShowChoices(src)
if(!client.changes)
changes()
else
var/lastchangelog = length('changelog.html')
if(!client.changes && preferences.lastchangelog!=lastchangelog)
changes()
preferences.lastchangelog = lastchangelog
preferences.savefile_save(src)
spawn(10)
if(client)
new_player_panel()
//PDA Resource Initialisation =======================================================>
/*
Quick note: local dream daemon instances don't seem to cache images right. Might be
a local problem with my machine but it's annoying nontheless.
*/
if(client)
//load the PDA iconset into the client
src << browse_rsc('pda_atmos.png')
src << browse_rsc('pda_back.png')
src << browse_rsc('pda_bell.png')
src << browse_rsc('pda_blank.png')
src << browse_rsc('pda_boom.png')
src << browse_rsc('pda_bucket.png')
src << browse_rsc('pda_crate.png')
src << browse_rsc('pda_cuffs.png')
src << browse_rsc('pda_eject.png')
src << browse_rsc('pda_exit.png')
src << browse_rsc('pda_flashlight.png')
src << browse_rsc('pda_honk.png')
src << browse_rsc('pda_mail.png')
src << browse_rsc('pda_medical.png')
src << browse_rsc('pda_menu.png')
src << browse_rsc('pda_mule.png')
src << browse_rsc('pda_notes.png')
src << browse_rsc('pda_power.png')
src << browse_rsc('pda_rdoor.png')
src << browse_rsc('pda_reagent.png')
src << browse_rsc('pda_refresh.png')
src << browse_rsc('pda_scanner.png')
src << browse_rsc('pda_signaler.png')
src << browse_rsc('pda_status.png')
//Loads icons for SpiderOS into client
src << browse_rsc('sos_1.png')
src << browse_rsc('sos_2.png')
src << browse_rsc('sos_3.png')
src << browse_rsc('sos_4.png')
src << browse_rsc('sos_5.png')
src << browse_rsc('sos_6.png')
src << browse_rsc('sos_7.png')
src << browse_rsc('sos_8.png')
src << browse_rsc('sos_9.png')
src << browse_rsc('sos_10.png')
src << browse_rsc('sos_11.png')
src << browse_rsc('sos_12.png')
src << browse_rsc('sos_13.png')
src << browse_rsc('sos_14.png')
//End PDA Resource Initialisation =====================================================>

View File

@@ -15,100 +15,6 @@
anchored = 1 // don't get pushed around
Login()
if (join_motd)
src << "<div class=\"motd\">[join_motd]</div>"
if(!preferences)
preferences = new
if(!mind)
mind = new
mind.key = key
mind.current = src
var/starting_loc = pick(newplayer_start)
if(!starting_loc) starting_loc = locate(1,1,1)
loc = starting_loc
lastarea = starting_loc
sight |= SEE_TURFS
var/list/watch_locations = list()
for(var/obj/effect/landmark/landmark in world)
if(landmark.tag == "landmark*new_player")
watch_locations += landmark.loc
if(watch_locations.len>0)
loc = pick(watch_locations)
if(!preferences.savefile_load(src, 1))
preferences.ShowChoices(src)
if(!client.changes)
changes()
else
var/lastchangelog = length('changelog.html')
if(!client.changes && preferences.lastchangelog!=lastchangelog)
changes()
preferences.lastchangelog = lastchangelog
preferences.savefile_save(src, 1)
if(preferences.pregame_music)
spawn() Playmusic() // git some tunes up in heeyaa~
if(client.has_news())
src << "<b><font color=blue>There are some unread <a href='?src=\ref[news_topic_handler];client=\ref[client];action=show_news'>news</a> for you! Please make sure to read all news, as they may contain important updates about roleplay rules or canon.</font></b>"
new_player_panel()
//PDA Resource Initialisation =======================================================>
/*
Quick note: local dream daemon instances don't seem to cache images right. Might be
a local problem with my machine but it's annoying nontheless.
*/
if(client)
//load the PDA iconset into the client
src << browse_rsc('pda_atmos.png')
src << browse_rsc('pda_back.png')
src << browse_rsc('pda_bell.png')
src << browse_rsc('pda_blank.png')
src << browse_rsc('pda_boom.png')
src << browse_rsc('pda_bucket.png')
src << browse_rsc('pda_crate.png')
src << browse_rsc('pda_cuffs.png')
src << browse_rsc('pda_eject.png')
src << browse_rsc('pda_exit.png')
src << browse_rsc('pda_flashlight.png')
src << browse_rsc('pda_honk.png')
src << browse_rsc('pda_mail.png')
src << browse_rsc('pda_medical.png')
src << browse_rsc('pda_menu.png')
src << browse_rsc('pda_mule.png')
src << browse_rsc('pda_notes.png')
src << browse_rsc('pda_power.png')
src << browse_rsc('pda_rdoor.png')
src << browse_rsc('pda_reagent.png')
src << browse_rsc('pda_refresh.png')
src << browse_rsc('pda_scanner.png')
src << browse_rsc('pda_signaler.png')
src << browse_rsc('pda_status.png')
//Loads icons for SpiderOS into client
src << browse_rsc('sos_1.png')
src << browse_rsc('sos_2.png')
src << browse_rsc('sos_3.png')
src << browse_rsc('sos_4.png')
src << browse_rsc('sos_5.png')
src << browse_rsc('sos_6.png')
src << browse_rsc('sos_7.png')
src << browse_rsc('sos_8.png')
src << browse_rsc('sos_9.png')
src << browse_rsc('sos_10.png')
src << browse_rsc('sos_11.png')
src << browse_rsc('sos_12.png')
src << browse_rsc('sos_13.png')
src << browse_rsc('sos_14.png')
//End PDA Resource Initialisation =====================================================>
Logout()
ready = 0
..()