mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Get the code running on 510
* Travis for 510 * Remove json, list2text, text2list, bygex * Change blind and click catcher to a low plane
This commit is contained in:
@@ -177,7 +177,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums
|
||||
continue
|
||||
|
||||
//Split the line at every "="
|
||||
var/list/List = text2list(line, "=")
|
||||
var/list/List = splittext(line, "=")
|
||||
if(!List.len)
|
||||
continue
|
||||
|
||||
|
||||
@@ -596,7 +596,7 @@ var/list/admin_verbs_hideable = list(
|
||||
//load text from file
|
||||
var/list/Lines = file2list("config/admins.txt")
|
||||
for(var/line in Lines)
|
||||
var/list/splitline = text2list(line, " = ")
|
||||
var/list/splitline = splittext(line, " = ")
|
||||
if(ckey(splitline[1]) == ckey)
|
||||
if(splitline.len >= 2)
|
||||
rank = ckeyEx(splitline[2])
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/datum/admins/proc/create_mob(mob/user)
|
||||
if (!create_mob_html)
|
||||
var/mobjs = null
|
||||
mobjs = list2text(typesof(/mob), ";")
|
||||
mobjs = jointext(typesof(/mob), ";")
|
||||
create_mob_html = file2text('html/create_object.html')
|
||||
create_mob_html = replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"")
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ var/list/create_object_forms = list(
|
||||
/datum/admins/proc/create_object(mob/user)
|
||||
if (!create_object_html)
|
||||
var/objectjs = null
|
||||
objectjs = list2text(typesof(/obj), ";")
|
||||
objectjs = jointext(typesof(/obj), ";")
|
||||
create_object_html = file2text('html/create_object.html')
|
||||
create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"")
|
||||
|
||||
@@ -19,7 +19,7 @@ var/list/create_object_forms = list(
|
||||
var/html_form = create_object_forms[path]
|
||||
|
||||
if (!html_form)
|
||||
var/objectjs = list2text(typesof(path), ";")
|
||||
var/objectjs = jointext(typesof(path), ";")
|
||||
html_form = file2text('html/create_object.html')
|
||||
html_form = replacetext(html_form, "null /* object types */", "\"[objectjs]\"")
|
||||
create_object_forms[path] = html_form
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/datum/admins/proc/create_turf(mob/user)
|
||||
if (!create_turf_html)
|
||||
var/turfjs = null
|
||||
turfjs = list2text(typesof(/turf), ";")
|
||||
turfjs = jointext(typesof(/turf), ";")
|
||||
create_turf_html = file2text('html/create_object.html')
|
||||
create_turf_html = replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"")
|
||||
|
||||
|
||||
@@ -168,53 +168,3 @@
|
||||
output += "<center><a href='?_src_=holder;addnoteempty=1'>\[Add Note\]</a></center>"
|
||||
output += ruler
|
||||
usr << browse(output, "window=show_notes;size=900x500")
|
||||
|
||||
/proc/regex_note_sql_extract(str, exp)
|
||||
return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_find")(str, exp))
|
||||
|
||||
#define NOTESFILE "data/player_notes.sav"
|
||||
//if the AUTOCONVERT_NOTES is turned on, anytime a player connects this will be run to try and add all their notes to the databas
|
||||
/proc/convert_notes_sql(ckey)
|
||||
var/savefile/notesfile = new(NOTESFILE)
|
||||
if(!notesfile)
|
||||
log_game("Error: Cannot access [NOTESFILE]")
|
||||
return
|
||||
notesfile.cd = "/[ckey]"
|
||||
while(!notesfile.eof)
|
||||
var/notetext
|
||||
notesfile >> notetext
|
||||
var/server
|
||||
if (config && config.server_name)
|
||||
server = config.server_name
|
||||
var/regex = "^(\\d{2}-\\w{3}-\\d{4}) \\| (.+) ~(\\w+)$"
|
||||
var/datum/regex/results = regex_note_sql_extract(notetext, regex)
|
||||
var/timestamp = results.str(2)
|
||||
notetext = results.str(3)
|
||||
var/adminckey = results.str(4)
|
||||
var/DBQuery/query_convert_time = dbcon.NewQuery("SELECT ADDTIME(STR_TO_DATE('[timestamp]','%d-%b-%Y'), '0')")
|
||||
if(!query_convert_time.Execute())
|
||||
var/err = query_convert_time.ErrorMsg()
|
||||
log_game("SQL ERROR converting timestamp. Error : \[[err]\]\n")
|
||||
return
|
||||
if(query_convert_time.NextRow())
|
||||
timestamp = query_convert_time.item[1]
|
||||
if(ckey && notetext && timestamp && adminckey && server)
|
||||
add_note(ckey, notetext, timestamp, adminckey, 0, server)
|
||||
notesfile.cd = "/"
|
||||
notesfile.dir.Remove(ckey)
|
||||
|
||||
/*alternatively this proc can be run once to pass through every note and attempt to convert it before deleting the file, if done then AUTOCONVERT_NOTES should be turned off
|
||||
this proc can take several minutes to execute fully if converting and cause DD to hang if converting a lot of notes; it's not advised to do so while a server is live
|
||||
/proc/mass_convert_notes()
|
||||
world << "Beginning mass note conversion"
|
||||
var/savefile/notesfile = new(NOTESFILE)
|
||||
if(!notesfile)
|
||||
log_game("Error: Cannot access [NOTESFILE]")
|
||||
return
|
||||
notesfile.cd = "/"
|
||||
for(var/ckey in notesfile.dir)
|
||||
convert_notes_sql(ckey)
|
||||
world << "Deleting NOTESFILE"
|
||||
fdel(NOTESFILE)
|
||||
world << "Finished mass note conversion, remember to turn off AUTOCONVERT_NOTES"*/
|
||||
#undef NOTESFILE
|
||||
|
||||
@@ -175,10 +175,10 @@
|
||||
if (!ban)
|
||||
return null
|
||||
. = params2list(ban)
|
||||
.["keys"] = text2list(.["keys"], ",")
|
||||
.["type"] = text2list(.["type"], ",")
|
||||
.["IP"] = text2list(.["IP"], ",")
|
||||
.["computer_id"] = text2list(.["computer_id"], ",")
|
||||
.["keys"] = splittext(.["keys"], ",")
|
||||
.["type"] = splittext(.["type"], ",")
|
||||
.["IP"] = splittext(.["IP"], ",")
|
||||
.["computer_id"] = splittext(.["computer_id"], ",")
|
||||
|
||||
|
||||
/proc/list2stickyban(var/list/ban)
|
||||
@@ -186,13 +186,13 @@
|
||||
return null
|
||||
. = ban.Copy()
|
||||
if (.["keys"])
|
||||
.["keys"] = list2text(.["keys"], ",")
|
||||
.["keys"] = jointext(.["keys"], ",")
|
||||
if (.["type"])
|
||||
.["type"] = list2text(.["type"], ",")
|
||||
.["type"] = jointext(.["type"], ",")
|
||||
if (.["IP"])
|
||||
.["IP"] = list2text(.["IP"], ",")
|
||||
.["IP"] = jointext(.["IP"], ",")
|
||||
if (.["computer_id"])
|
||||
.["computer_id"] = list2text(.["computer_id"], ",")
|
||||
.["computer_id"] = jointext(.["computer_id"], ",")
|
||||
. = list2params(.)
|
||||
|
||||
|
||||
|
||||
@@ -1882,7 +1882,7 @@
|
||||
alert("Select fewer object types, (max 5)")
|
||||
return
|
||||
|
||||
var/list/offset = text2list(href_list["offset"],",")
|
||||
var/list/offset = splittext(href_list["offset"],",")
|
||||
var/number = Clamp(text2num(href_list["object_count"]), 1, 100)
|
||||
var/X = offset.len > 0 ? text2num(offset[1]) : 0
|
||||
var/Y = offset.len > 1 ? text2num(offset[2]) : 0
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as", "i")
|
||||
|
||||
//explode the input msg into a list
|
||||
var/list/msglist = text2list(msg, " ")
|
||||
var/list/msglist = splittext(msg, " ")
|
||||
|
||||
//generate keywords lookup
|
||||
var/list/surnames = list()
|
||||
@@ -16,7 +16,7 @@
|
||||
indexing += M.mind.name
|
||||
|
||||
for(var/string in indexing)
|
||||
var/list/L = text2list(string, " ")
|
||||
var/list/L = splittext(string, " ")
|
||||
var/surname_found = 0
|
||||
//surnames
|
||||
for(var/i=L.len, i>=1, i--)
|
||||
|
||||
@@ -688,19 +688,19 @@ var/global/list/g_fancy_list_of_types = null
|
||||
|
||||
switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients"))
|
||||
if("Players")
|
||||
usr << list2text(player_list,",")
|
||||
usr << jointext(player_list,",")
|
||||
if("Admins")
|
||||
usr << list2text(admins,",")
|
||||
usr << jointext(admins,",")
|
||||
if("Mobs")
|
||||
usr << list2text(mob_list,",")
|
||||
usr << jointext(mob_list,",")
|
||||
if("Living Mobs")
|
||||
usr << list2text(living_mob_list,",")
|
||||
usr << jointext(living_mob_list,",")
|
||||
if("Dead Mobs")
|
||||
usr << list2text(dead_mob_list,",")
|
||||
usr << jointext(dead_mob_list,",")
|
||||
if("Clients")
|
||||
usr << list2text(clients,",")
|
||||
usr << jointext(clients,",")
|
||||
if("Joined Clients")
|
||||
usr << list2text(joined_player_list,",")
|
||||
usr << jointext(joined_player_list,",")
|
||||
|
||||
/client/proc/cmd_display_del_log()
|
||||
set category = "Debug"
|
||||
|
||||
@@ -151,7 +151,7 @@ var/global/dmm_suite/preloader/_preloader = null
|
||||
var/variables_start = findtext(full_def,"{")
|
||||
if(variables_start)//if there's any variable
|
||||
full_def = copytext(full_def,variables_start+1,length(full_def))//removing the last '}'
|
||||
fields = text2list(full_def,";")
|
||||
fields = readlist(full_def, ";")
|
||||
|
||||
//then fill the members_attributes list with the corresponding variables
|
||||
members_attributes.len++
|
||||
@@ -258,7 +258,7 @@ var/global/dmm_suite/preloader/_preloader = null
|
||||
|
||||
//build a list from variables in text form (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7))
|
||||
//return the filled list
|
||||
/dmm_suite/proc/text2list(text as text,delimiter=",")
|
||||
/dmm_suite/proc/readlist(text as text, delimiter=",")
|
||||
|
||||
var/list/to_return = list()
|
||||
|
||||
@@ -292,7 +292,7 @@ var/global/dmm_suite/preloader/_preloader = null
|
||||
|
||||
//Check for list
|
||||
else if(copytext(trim_right,1,5) == "list")
|
||||
trim_right = text2list(copytext(trim_right,6,length(trim_right)))
|
||||
trim_right = readlist(copytext(trim_right,6,length(trim_right)))
|
||||
|
||||
//Check for file
|
||||
else if(copytext(trim_right,1,2) == "'")
|
||||
|
||||
@@ -201,14 +201,11 @@ var/next_external_rsc = 0
|
||||
else
|
||||
winset(src, "infowindow.changelog", "font-style=bold")
|
||||
|
||||
if (ckey in clientmessages)
|
||||
for (var/message in clientmessages[ckey])
|
||||
if(ckey in clientmessages)
|
||||
for(var/message in clientmessages[ckey])
|
||||
src << message
|
||||
clientmessages.Remove(ckey)
|
||||
|
||||
if (config && config.autoconvert_notes)
|
||||
convert_notes_sql(ckey)
|
||||
|
||||
if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them.
|
||||
src << "<span class='warning'>Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.</span>"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/obj/item/weapon/paper/P = new(get_turf(src))
|
||||
P.name = "paper- 'Scanner Report'"
|
||||
P.info = "<center><font size='6'><B>Scanner Report</B></font></center><HR><BR>"
|
||||
P.info += list2text(log, "<BR>")
|
||||
P.info += jointext(log, "<BR>")
|
||||
P.info += "<HR><B>Notes:</B><BR>"
|
||||
P.info_links = P.info
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/proc/NewStutter(phrase,stunned)
|
||||
phrase = html_decode(phrase)
|
||||
|
||||
var/list/split_phrase = text2list(phrase," ") //Split it up into words.
|
||||
var/list/split_phrase = splittext(phrase," ") //Split it up into words.
|
||||
|
||||
var/list/unstuttered_words = split_phrase.Copy()
|
||||
var/i = rand(1,3)
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
split_phrase[index] = word
|
||||
|
||||
return sanitize(list2text(split_phrase," "))
|
||||
return sanitize(jointext(split_phrase," "))
|
||||
|
||||
/proc/Stagger(mob/M,d) //Technically not a filter, but it relates to drunkenness.
|
||||
step(M, pick(d,turn(d,90),turn(d,-90)))
|
||||
@@ -45,7 +45,7 @@
|
||||
if(chance >= 100) return original_msg
|
||||
|
||||
var/list
|
||||
words = text2list(original_msg," ")
|
||||
words = splittext(original_msg," ")
|
||||
new_words = list()
|
||||
|
||||
var/new_msg = ""
|
||||
@@ -57,6 +57,6 @@
|
||||
continue
|
||||
new_words += w
|
||||
|
||||
new_msg = list2text(new_words," ")
|
||||
new_msg = jointext(new_words," ")
|
||||
|
||||
return new_msg
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
if(!src.req_access)
|
||||
src.req_access = list()
|
||||
if(src.req_access_txt)
|
||||
var/list/req_access_str = text2list(req_access_txt,";")
|
||||
var/list/req_access_str = splittext(req_access_txt,";")
|
||||
for(var/x in req_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
@@ -133,7 +133,7 @@
|
||||
if(!src.req_one_access)
|
||||
src.req_one_access = list()
|
||||
if(src.req_one_access_txt)
|
||||
var/list/req_one_access_str = text2list(req_one_access_txt,";")
|
||||
var/list/req_one_access_str = splittext(req_one_access_txt,";")
|
||||
for(var/x in req_one_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
|
||||
@@ -1,284 +0,0 @@
|
||||
/* Usage:
|
||||
JSON.stringify(obj) - Converts lists and values into a JSON string.
|
||||
JSON.parse(json) - Converts a JSON string into lists and values.
|
||||
*/
|
||||
|
||||
/var/datum/jsonHelper/JSON = new // A namespace for procs.
|
||||
|
||||
// ************************************ WRITER ************************************
|
||||
/datum/jsonHelper/proc/stringify(value)
|
||||
return list2text(WriteValue(list(), value))
|
||||
|
||||
/datum/jsonHelper/proc/WriteValue(list/json, value)
|
||||
. = json
|
||||
if(isnum(value))
|
||||
json += value // Consider num2text(value, 20) for maximum accuracy.
|
||||
else if(isnull(value))
|
||||
json += "null"
|
||||
else if(istext(value))
|
||||
WriteString(json, value)
|
||||
else if(istype(value, /list))
|
||||
WriteList(json, value)
|
||||
else
|
||||
throw EXCEPTION("Datums cannot be converted to JSON.")
|
||||
|
||||
/datum/jsonHelper/proc/WriteString(list/json, str)
|
||||
. = json
|
||||
var/quotePos = findtextEx(str, "\"")
|
||||
var/bsPos = findtextEx(str, "\\")
|
||||
if (quotePos == 0 && bsPos == 0)
|
||||
json.Add("\"", str, "\"")
|
||||
else
|
||||
json += "\""
|
||||
var/lastStop = 1
|
||||
while(quotePos != 0 || bsPos != 0)
|
||||
var/escPos
|
||||
if(quotePos < bsPos && quotePos != 0 || bsPos == 0)
|
||||
escPos = quotePos
|
||||
else
|
||||
escPos = bsPos
|
||||
json.Add(copytext(str, lastStop, escPos), "\\")
|
||||
lastStop = escPos
|
||||
if(escPos == quotePos)
|
||||
quotePos = findtextEx(str, "\"", escPos + 1)
|
||||
else if(escPos == bsPos)
|
||||
bsPos = findtextEx(str, "\\", escPos + 1)
|
||||
json.Add(copytext(str, lastStop), "\"")
|
||||
|
||||
/datum/jsonHelper/proc/WriteList(list/json, list/listVal)
|
||||
. = json
|
||||
#define Either 0
|
||||
#define CannotBeArray 1
|
||||
#define CannotBeObject 2
|
||||
#define BadList (CannotBeArray | CannotBeObject)
|
||||
var/listType = Either
|
||||
for(var/key in listVal)
|
||||
if(istext(key))
|
||||
if(!isnull(listVal[key]))
|
||||
listType |= CannotBeArray
|
||||
else
|
||||
if(!isnum(key) && !isnull(listVal[key]))
|
||||
listType = BadList
|
||||
else
|
||||
listType |= CannotBeObject
|
||||
|
||||
if(listType == BadList)
|
||||
throw EXCEPTION("The given list cannot be converted to JSON.")
|
||||
|
||||
if(listType == CannotBeArray)
|
||||
json += "{"
|
||||
var/addComma
|
||||
for(var/key in listVal)
|
||||
if(addComma)
|
||||
json += ","
|
||||
else
|
||||
addComma = TRUE
|
||||
WriteString(json, key)
|
||||
json += ":"
|
||||
WriteValue(json, listVal[key])
|
||||
json += "}"
|
||||
else
|
||||
json += "\["
|
||||
var/addComma
|
||||
for(var/key in listVal)
|
||||
if(addComma)
|
||||
json += ","
|
||||
else
|
||||
addComma = TRUE
|
||||
WriteValue(json, key)
|
||||
json += "]"
|
||||
#undef Either
|
||||
#undef CannotBeFlat
|
||||
#undef CannotBeAssoc
|
||||
#undef BadList
|
||||
|
||||
// ************************************ READER ************************************
|
||||
#define aBackspace 0x08
|
||||
#define aTab 0x09
|
||||
#define aLineBreak 0x0A
|
||||
#define aVertTab 0x0B
|
||||
#define aFormFeed 0x0C
|
||||
#define aCarriageReturn 0x0D
|
||||
#define aSpace 0x20
|
||||
#define aZero 0x30
|
||||
#define aNonBreakSpace 0xA0
|
||||
|
||||
#define Advance if(++readPos > jsonLen) { curAscii = 0; curChar = "" } else { curAscii = text2ascii(json, readPos); curChar = ascii2text(curAscii) } // Deal with it.
|
||||
#define SkipWhitespace while(curAscii in whitespace) Advance
|
||||
#define AdvanceWS Advance; SkipWhitespace
|
||||
|
||||
/datum/jsonHelper/var
|
||||
readPos
|
||||
jsonLen
|
||||
json
|
||||
curAscii
|
||||
curChar
|
||||
static/list/whitespace = list(aTab, aLineBreak, aVertTab, aFormFeed, aCarriageReturn, aSpace, aNonBreakSpace)
|
||||
|
||||
/datum/jsonHelper/proc/parse(json)
|
||||
readPos = 0
|
||||
jsonLen = length(json)
|
||||
src.json = json
|
||||
curAscii = 0
|
||||
curChar = ""
|
||||
AdvanceWS
|
||||
var/value = ParseValue()
|
||||
if(readPos < jsonLen)
|
||||
throw EXCEPTION("Expected: End of JSON")
|
||||
return value
|
||||
|
||||
/datum/jsonHelper/proc/ParseValue()
|
||||
if(curChar == "\"")
|
||||
return ParseString()
|
||||
else if(curChar == "-" || (curAscii >= aZero && curAscii <= aZero + 9))
|
||||
return ParseNumber()
|
||||
else if(curChar == "{")
|
||||
return ParseObject()
|
||||
else if(curChar == "\[")
|
||||
return ParseArray()
|
||||
else if(curChar == "t")
|
||||
if(copytext(json, readPos, readPos+4) == "true")
|
||||
readPos += 3
|
||||
AdvanceWS
|
||||
return TRUE
|
||||
else
|
||||
throw EXCEPTION("Expected: 'true'")
|
||||
else if(curChar == "f")
|
||||
if(copytext(json, readPos, readPos+5) == "false")
|
||||
readPos += 4
|
||||
AdvanceWS
|
||||
return FALSE
|
||||
else
|
||||
throw EXCEPTION("Expected: 'false'")
|
||||
else if(curChar == "n")
|
||||
if(copytext(json, readPos, readPos+4) == "null")
|
||||
readPos += 3
|
||||
AdvanceWS
|
||||
return null
|
||||
else
|
||||
throw EXCEPTION("Expected: 'null'")
|
||||
else if(curChar == "")
|
||||
throw EXCEPTION("Unexpected: End of JSON")
|
||||
else
|
||||
throw EXCEPTION("Unexpected: '[curChar]'")
|
||||
|
||||
|
||||
|
||||
/datum/jsonHelper/proc/ParseString()
|
||||
ASSERT(curChar == "\"")
|
||||
Advance
|
||||
var/list/chars = list()
|
||||
while(readPos <= jsonLen)
|
||||
if(curChar == "\"")
|
||||
AdvanceWS
|
||||
return list2text(chars)
|
||||
else if(curChar == "\\")
|
||||
Advance
|
||||
switch(curChar)
|
||||
if("\"", "\\", "/")
|
||||
chars += ascii2text(curAscii)
|
||||
if("b")
|
||||
chars += ascii2text(aBackspace)
|
||||
if("f")
|
||||
chars += ascii2text(aFormFeed)
|
||||
if("n")
|
||||
chars += "\n"
|
||||
if("r")
|
||||
chars += ascii2text(aCarriageReturn) // Should we ignore these?
|
||||
if("t")
|
||||
chars += "\t"
|
||||
if("u")
|
||||
throw EXCEPTION("JSON \\uXXXX escape sequence not supported")
|
||||
else
|
||||
throw EXCEPTION("Invalid escape sequence")
|
||||
Advance
|
||||
else
|
||||
chars += ascii2text(curAscii)
|
||||
Advance
|
||||
throw EXCEPTION("Unterminated string")
|
||||
|
||||
/datum/jsonHelper/proc/ParseNumber()
|
||||
var/firstPos = readPos
|
||||
if(curChar == "-")
|
||||
Advance
|
||||
if(curAscii >= aZero + 1 && curAscii <= aZero + 9)
|
||||
do
|
||||
Advance
|
||||
while(curAscii >= aZero && curAscii <= aZero + 9)
|
||||
else if(curAscii == aZero)
|
||||
Advance
|
||||
else
|
||||
throw EXCEPTION("Expected: digit")
|
||||
|
||||
if(curChar == ".")
|
||||
Advance
|
||||
var/found = FALSE
|
||||
while(curAscii >= aZero && curAscii <= aZero + 9)
|
||||
found = TRUE
|
||||
Advance
|
||||
if(!found)
|
||||
throw EXCEPTION("Expected: digit")
|
||||
|
||||
if(curChar == "E" || curChar == "e")
|
||||
Advance
|
||||
var/found = FALSE
|
||||
if(curChar == "-")
|
||||
Advance
|
||||
else if(curChar == "+")
|
||||
Advance
|
||||
while(curAscii >= aZero && curAscii <= aZero + 9)
|
||||
found = TRUE
|
||||
Advance
|
||||
if(!found)
|
||||
throw EXCEPTION("Expected: digit")
|
||||
|
||||
SkipWhitespace
|
||||
return text2num(copytext(json, firstPos, readPos))
|
||||
|
||||
/datum/jsonHelper/proc/ParseObject()
|
||||
ASSERT(curChar == "{")
|
||||
var/list/object = list()
|
||||
AdvanceWS
|
||||
while(curChar == "\"")
|
||||
var/key = ParseString()
|
||||
if(curChar != ":")
|
||||
throw EXCEPTION("Expected: ':'")
|
||||
AdvanceWS
|
||||
object[key] = ParseValue()
|
||||
if(curChar == ",")
|
||||
AdvanceWS
|
||||
else
|
||||
break
|
||||
if(curChar != "}")
|
||||
throw EXCEPTION("Expected: string or '}'")
|
||||
AdvanceWS
|
||||
return object
|
||||
|
||||
/datum/jsonHelper/proc/ParseArray()
|
||||
ASSERT(curChar == "\[")
|
||||
var/list/array = list()
|
||||
AdvanceWS
|
||||
while(curChar != "]")
|
||||
array += list(ParseValue()) // Wrapped in a list in case ParseValue() returns a list.
|
||||
if(curChar == ",")
|
||||
AdvanceWS
|
||||
else
|
||||
break
|
||||
if(curChar != "]")
|
||||
throw EXCEPTION("Expected: ']'")
|
||||
AdvanceWS
|
||||
return array
|
||||
|
||||
#undef aBackspace
|
||||
#undef aTab
|
||||
#undef aLineBreak
|
||||
#undef aVertTab
|
||||
#undef aFormFeed
|
||||
#undef aCarriageReturn
|
||||
#undef aSpace
|
||||
#undef aZero
|
||||
#undef aNonBreakSpace
|
||||
|
||||
#undef Advance
|
||||
#undef SkipWhitespace
|
||||
#undef AdvanceWS
|
||||
@@ -10,7 +10,7 @@
|
||||
visible_message("<span class='name'>[src]</span> lets out a waning guttural screech, green blood bubbling from its maw...")
|
||||
update_canmove()
|
||||
if(client)
|
||||
blind.layer = 0
|
||||
blind.plane = -80
|
||||
update_icons()
|
||||
status_flags |=CANPUSH
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
if(!gibbed)
|
||||
visible_message("<span class='name'>[src]</span> lets out a waning high-pitched cry.")
|
||||
update_canmove()
|
||||
if(client) blind.layer = 0
|
||||
if(client)
|
||||
blind.plane = -80
|
||||
|
||||
tod = worldtime2text() //weasellos time of death patch
|
||||
if(mind)
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
container.icon_state = "mmi_dead"
|
||||
stat = DEAD
|
||||
|
||||
if(blind) blind.layer = 0
|
||||
if(blind)
|
||||
blind.plane = -80
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
emote("deathgasp") //let the world KNOW WE ARE DEAD
|
||||
|
||||
update_canmove()
|
||||
if(client) blind.layer = 0
|
||||
if(client)
|
||||
blind.plane = -80
|
||||
|
||||
dna.species.spec_death(gibbed,src)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
message = dna.species.handle_speech(message,src)
|
||||
if(viruses.len)
|
||||
for(var/datum/disease/pierrot_throat/D in viruses)
|
||||
var/list/temp_message = text2list(message, " ") //List each word in the message
|
||||
var/list/temp_message = splittext(message, " ") //List each word in the message
|
||||
var/list/pick_list = list()
|
||||
for(var/i = 1, i <= temp_message.len, i++) //Create a second list for excluding words down the line
|
||||
pick_list += i
|
||||
@@ -22,7 +22,7 @@
|
||||
if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":")) continue
|
||||
temp_message[H] = "HONK"
|
||||
pick_list -= H //Make sure that you dont HONK the same word twice
|
||||
message = list2text(temp_message, " ")
|
||||
message = jointext(temp_message, " ")
|
||||
message = ..(message)
|
||||
message = dna.mutations_say_mods(message)
|
||||
return message
|
||||
|
||||
@@ -716,10 +716,10 @@
|
||||
if(H.blind)
|
||||
if(H.eye_blind)
|
||||
H.throw_alert("blind", /obj/screen/alert/blind)
|
||||
H.blind.layer = 18
|
||||
H.blind.plane = 0
|
||||
else
|
||||
H.clear_alert("blind")
|
||||
H.blind.layer = 0
|
||||
H.blind.plane = -80
|
||||
|
||||
if(!H.client)//no client, no screen to update
|
||||
return 1
|
||||
|
||||
@@ -74,15 +74,10 @@ datum/species/human/spec_death(gibbed, mob/living/carbon/human/H)
|
||||
|
||||
return randname
|
||||
|
||||
/datum/species/lizard/handle_speech(message)
|
||||
|
||||
if(copytext(message, 1, 2) != "*")
|
||||
message = regEx_replaceall(message, "(?<!s)s(?!s)", "sss") //(?<!s) Not s before. (?!s) not s after. That way it only triples a single s instead of double ss.
|
||||
message = regEx_replaceall(message, "(?<!s)ss(?!s)", "ssss")
|
||||
message = regEx_replaceall(message, "(?<!S)S(?!S)", "SSS")
|
||||
message = regEx_replaceall(message, "(?<!S)SS(?!S)", "SSSS")
|
||||
|
||||
return message
|
||||
/datum/species/lizard/qualifies_for_rank(rank, list/features)
|
||||
if(rank in command_positions)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
//I wag in death
|
||||
/datum/species/lizard/spec_death(gibbed, mob/living/carbon/human/H)
|
||||
@@ -415,7 +410,7 @@ datum/species/human/spec_death(gibbed, mob/living/carbon/human/H)
|
||||
specflags = list(NOBREATH,HEATRES,COLDRES,NOBLOOD,RADIMMUNE)
|
||||
|
||||
/datum/species/zombie/handle_speech(message)
|
||||
var/list/message_list = text2list(message, " ")
|
||||
var/list/message_list = splittext(message, " ")
|
||||
var/maxchanges = max(round(message_list.len / 1.5), 2)
|
||||
|
||||
for(var/i = rand(maxchanges / 2, maxchanges), i > 0, i--)
|
||||
@@ -428,7 +423,7 @@ datum/species/human/spec_death(gibbed, mob/living/carbon/human/H)
|
||||
if(prob(20) && message_list.len > 3)
|
||||
message_list.Insert(insertpos, "[pick("BRAINS", "Brains", "Braaaiinnnsss", "BRAAAIIINNSSS")]...")
|
||||
|
||||
return list2text(message_list, " ")
|
||||
return jointext(message_list, " ")
|
||||
|
||||
/datum/species/cosmetic_zombie
|
||||
name = "Human"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
update_canmove()
|
||||
if(blind)
|
||||
blind.layer = 0
|
||||
blind.plane = -80
|
||||
|
||||
if(ticker && ticker.mode)
|
||||
ticker.mode.check_win()
|
||||
|
||||
@@ -190,10 +190,10 @@
|
||||
if(stat != DEAD)
|
||||
if(blind)
|
||||
if(eye_blind)
|
||||
blind.layer = 18
|
||||
blind.plane = 0
|
||||
throw_alert("blind", /obj/screen/alert/blind)
|
||||
else
|
||||
blind.layer = 0
|
||||
blind.plane = -80
|
||||
clear_alert("blind")
|
||||
|
||||
if (disabilities & NEARSIGHT)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
if(src.eyeobj)
|
||||
src.eyeobj.setLoc(get_turf(src))
|
||||
if(blind)
|
||||
blind.layer = 0
|
||||
blind.plane = -80
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
|
||||
@@ -55,8 +55,7 @@
|
||||
|
||||
if (!blindness)
|
||||
//stage = 4.5
|
||||
if (src.blind.layer != 0)
|
||||
src.blind.layer = 0
|
||||
src.blind.plane = -80
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
@@ -74,19 +73,16 @@
|
||||
if (aiRestorePowerRoutine==2)
|
||||
src << "Alert cancelled. Power has been restored without our assistance."
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0
|
||||
return
|
||||
else if (aiRestorePowerRoutine==3)
|
||||
src << "Alert cancelled. Power has been restored."
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0
|
||||
return
|
||||
else
|
||||
|
||||
//stage = 6
|
||||
src.blind.screen_loc = "1,1 to 15,15"
|
||||
if (src.blind.layer!=18)
|
||||
src.blind.layer = 18
|
||||
src.blind.plane = 0
|
||||
src.sight = src.sight&~SEE_TURFS
|
||||
src.sight = src.sight&~SEE_MOBS
|
||||
src.sight = src.sight&~SEE_OBJS
|
||||
@@ -111,7 +107,7 @@
|
||||
if (!istype(T, /turf/space))
|
||||
src << "Alert cancelled. Power has been restored without our assistance."
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0
|
||||
src.blind.plane = -80
|
||||
return
|
||||
src << "Fault confirmed: missing external power. Shutting down main control system to save power."
|
||||
sleep(20)
|
||||
@@ -149,7 +145,7 @@
|
||||
if (!istype(T, /turf/space))
|
||||
src << "Alert cancelled. Power has been restored without our assistance."
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0 //This, too, is a fix to issue 603
|
||||
src.blind.plane = -80
|
||||
return
|
||||
switch(PRP)
|
||||
if (1) src << "APC located. Optimizing route to APC to avoid needless power waste."
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
blind.icon_state = "black"
|
||||
blind.name = " "
|
||||
blind.screen_loc = "1,1 to 15,15"
|
||||
blind.layer = 0
|
||||
blind.plane = -80
|
||||
client.screen.Add( blind, flash )
|
||||
|
||||
if(stat != DEAD)
|
||||
|
||||
@@ -109,7 +109,7 @@ var/const/VOX_DELAY = 600
|
||||
src << "<span class='notice'>Wireless interface disabled, unable to interact with announcement PA.</span>"
|
||||
return
|
||||
|
||||
var/list/words = text2list(trim(message), " ")
|
||||
var/list/words = splittext(trim(message), " ")
|
||||
var/list/incorrect_words = list()
|
||||
|
||||
if(words.len > 30)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
stat = DEAD
|
||||
canmove = 0
|
||||
if(blind)
|
||||
blind.layer = 0
|
||||
blind.plane = -80
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
uneq_all() // particularly to ensure sight modes are cleared
|
||||
|
||||
if(blind)
|
||||
blind.layer = 0
|
||||
blind.plane = -80
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
update_canmove()
|
||||
if(blind)
|
||||
blind.layer = 0
|
||||
blind.plane = -80
|
||||
|
||||
if(ticker && ticker.mode)
|
||||
ticker.mode.check_win()
|
||||
|
||||
@@ -21,7 +21,7 @@ Contents:
|
||||
/obj/item/clothing/mask/gas/voice/space_ninja/speechModification(message)
|
||||
if(voice == "Unknown")
|
||||
if(copytext(message, 1, 2) != "*")
|
||||
var/list/temp_message = text2list(message, " ")
|
||||
var/list/temp_message = splittext(message, " ")
|
||||
var/list/pick_list = list()
|
||||
for(var/i = 1, i <= temp_message.len, i++)
|
||||
pick_list += i
|
||||
@@ -30,7 +30,7 @@ Contents:
|
||||
if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":")) continue
|
||||
temp_message[H] = ninjaspeak(temp_message[H])
|
||||
pick_list -= H
|
||||
message = list2text(temp_message, " ")
|
||||
message = jointext(temp_message, " ")
|
||||
|
||||
//The Alternate speech mod is now the main one.
|
||||
message = replacetext(message, "l", "r")
|
||||
|
||||
@@ -155,8 +155,8 @@
|
||||
src << "Missing Input"
|
||||
return
|
||||
|
||||
var/list/startCoords = text2list(startInput, ";")
|
||||
var/list/endCoords = text2list(endInput, ";")
|
||||
var/list/startCoords = splittext(startInput, ";")
|
||||
var/list/endCoords = splittext(endInput, ";")
|
||||
if(!startCoords || !endCoords)
|
||||
src << "Invalid Coords"
|
||||
src << "Start Input: [startInput]"
|
||||
|
||||
@@ -39,12 +39,12 @@
|
||||
var/list/temp_list
|
||||
if(!id_with_upload.len)
|
||||
temp_list = list()
|
||||
temp_list = text2list(id_with_upload_string, ";")
|
||||
temp_list = splittext(id_with_upload_string, ";")
|
||||
for(var/N in temp_list)
|
||||
id_with_upload += text2num(N)
|
||||
if(!id_with_download.len)
|
||||
temp_list = list()
|
||||
temp_list = text2list(id_with_download_string, ";")
|
||||
temp_list = splittext(id_with_download_string, ";")
|
||||
for(var/N in temp_list)
|
||||
id_with_download += text2num(N)
|
||||
|
||||
|
||||
@@ -245,10 +245,11 @@
|
||||
json_data["data"] = data
|
||||
|
||||
// Generate the JSON.
|
||||
var/json = JSON.stringify(json_data)
|
||||
var/json = json_encode(json_data)
|
||||
//var/json = JSON.stringify(json_data)
|
||||
// Strip #255/improper.
|
||||
json = regex_replaceall(json, "\improper", "")
|
||||
json = regex_replaceall(json, "\proper", "")
|
||||
json = replacetext(json, "\improper", "")
|
||||
json = replacetext(json, "\proper", "")
|
||||
return json
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user