mirror of
https://github.com/Sandstorm-Station/Sandstorm-Station-13.git
synced 2026-08-22 12:47:43 +01:00
Ports tgstation/53371 (#60)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
////////////
|
||||
//SECURITY//
|
||||
////////////
|
||||
#define UPLOAD_LIMIT 1048576 //Restricts client uploads to the server to 1MB //Could probably do with being lower.
|
||||
#define UPLOAD_LIMIT 524288 //Restricts client uploads to the server to 0.5MB
|
||||
#define UPLOAD_LIMIT_ADMIN 5242880 //Restricts admin client uploads to the server to 5MB
|
||||
//(bumps admin's up to 5, admins should be trustworthy enough to not do shit)
|
||||
|
||||
GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
"1407" = "bug preventing client display overrides from working leads to clients being able to see things/mobs they shouldn't be able to see",
|
||||
@@ -199,11 +201,14 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
|
||||
//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)
|
||||
if(holder)
|
||||
if(filelength > UPLOAD_LIMIT_ADMIN)
|
||||
to_chat(src, "<font color='red'>Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT_ADMIN/1024]KiB.</font>")
|
||||
return FALSE
|
||||
else if(filelength > UPLOAD_LIMIT)
|
||||
to_chat(src, "<font color='red'>Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT/1024]KiB.</font>")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
///////////
|
||||
//CONNECT//
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
var/datum/preferences/P = new
|
||||
P.load_path("test")
|
||||
P.features["flavor_text"] = "Foo"
|
||||
P.features["ooc_notes"] = "Bar"
|
||||
P.features["skyrat_ooc_notes"] = "Bar"
|
||||
P.save_character()
|
||||
P.load_character()
|
||||
if(P.features["flavor_text"] != "Foo")
|
||||
Fail("Flavor text is failing to save.")
|
||||
if(P.features["ooc_notes"] != "Bar")
|
||||
if(P.features["skyrat_ooc_notes"] != "Bar")
|
||||
Fail("OOC text is failing to save.")
|
||||
catch(var/exception/e)
|
||||
Fail("Failed to save and load character due to exception [e.name]")
|
||||
|
||||
Reference in New Issue
Block a user