mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
@@ -370,6 +370,8 @@
|
|||||||
/proc/sortNames(list/L, order=1)
|
/proc/sortNames(list/L, order=1)
|
||||||
return sortTim(L, order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc)
|
return sortTim(L, order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc)
|
||||||
|
|
||||||
|
/proc/sortUsernames(list/L, order=1)
|
||||||
|
return sortTim(L, order >= 0 ? /proc/cmp_username_asc : /proc/cmp_username_dsc)
|
||||||
|
|
||||||
/// Converts a bitfield to a list of numbers (or words if a wordlist is provided)
|
/// Converts a bitfield to a list of numbers (or words if a wordlist is provided)
|
||||||
/proc/bitfield2list(bitfield = 0, list/wordlist)
|
/proc/bitfield2list(bitfield = 0, list/wordlist)
|
||||||
|
|||||||
@@ -16,6 +16,12 @@
|
|||||||
/proc/cmp_name_dsc(atom/a, atom/b)
|
/proc/cmp_name_dsc(atom/a, atom/b)
|
||||||
return sorttext(a.name, b.name)
|
return sorttext(a.name, b.name)
|
||||||
|
|
||||||
|
/proc/cmp_username_asc(datum/computer_file/program/pdamessager/a, datum/computer_file/program/pdamessager/b)
|
||||||
|
return sorttext(b.username, a.username)
|
||||||
|
|
||||||
|
/proc/cmp_username_dsc(datum/computer_file/program/pdamessager/a, datum/computer_file/program/pdamessager/b)
|
||||||
|
return sorttext(a.username, b.username)
|
||||||
|
|
||||||
GLOBAL_VAR_INIT(cmp_field, "name")
|
GLOBAL_VAR_INIT(cmp_field, "name")
|
||||||
/proc/cmp_records_asc(datum/data/record/a, datum/data/record/b)
|
/proc/cmp_records_asc(datum/data/record/a, datum/data/record/b)
|
||||||
return sorttext(b.fields[GLOB.cmp_field], a.fields[GLOB.cmp_field])
|
return sorttext(b.fields[GLOB.cmp_field], a.fields[GLOB.cmp_field])
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ GLOBAL_LIST_EMPTY(NTPDAMessages)
|
|||||||
. = ..()
|
. = ..()
|
||||||
username = "NewUser[rand(100, 999)]"
|
username = "NewUser[rand(100, 999)]"
|
||||||
GLOB.NTPDAs += src
|
GLOB.NTPDAs += src
|
||||||
|
GLOB.NTPDAs = sortUsernames(GLOB.NTPDAs)
|
||||||
for (var/obj/machinery/telecomms/message_server/preset/server in GLOB.telecomms_list)
|
for (var/obj/machinery/telecomms/message_server/preset/server in GLOB.telecomms_list)
|
||||||
if (server.decryptkey)
|
if (server.decryptkey)
|
||||||
authkey = server.decryptkey
|
authkey = server.decryptkey
|
||||||
@@ -315,6 +316,7 @@ GLOBAL_LIST_EMPTY(NTPDAMessages)
|
|||||||
return
|
return
|
||||||
|
|
||||||
username = newname
|
username = newname
|
||||||
|
GLOB.NTPDAs = sortUsernames(GLOB.NTPDAs)
|
||||||
computer.visible_message(span_notice("Username set to [newname]."), null, null, 1)
|
computer.visible_message(span_notice("Username set to [newname]."), null, null, 1)
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user