Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev team chat #26669

Merged
merged 9 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions code/__DEFINES/admin_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define BANTYPE_ADMIN_PERMA 7
#define BANTYPE_ADMIN_TEMP 8

//Please don't edit these values without speaking to Errorage first ~Carn
//Admin Permissions
#define R_BUILDMODE (1<<0)
#define R_ADMIN (1<<1)
Expand All @@ -40,11 +39,12 @@
#define R_PROCCALL (1<<15)
#define R_VIEWRUNTIMES (1<<16)
#define R_MAINTAINER (1<<17)
#define R_DEV_TEAM (1<<18)
// Update the following two defines if you add more

#define R_MAXPERMISSION (1<<17) //This holds the maximum value for a permission. It is used in iteration, so keep it updated.
#define R_MAXPERMISSION (1<<18) // This holds the maximum value for a permission. It is used in iteration, so keep it updated.

#define R_HOST ((1<<18)-1) //17 bit bitmask, update me if we ever add more admin permissions. Sum of all permissions to allow easy setting.
#define R_HOST ((1<<19)-1) // 18 bit bitmask, update me if we ever add more admin permissions. Sum of all permissions to allow easy setting.
S34NW marked this conversation as resolved.
Show resolved Hide resolved


#define ADMIN_QUE(user,display) "<a href='byond://?_src_=holder;adminmoreinfo=[user.UID()]'>[display]</a>"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define MESSAGE_TYPE_COMBAT "combat"
#define MESSAGE_TYPE_ADMINCHAT "adminchat"
#define MESSAGE_TYPE_MENTORCHAT "mentorchat"
#define MESSAGE_TYPE_DEVCHAT "devchat"
#define MESSAGE_TYPE_EVENTCHAT "eventchat"
#define MESSAGE_TYPE_ADMINLOG "adminlog"
#define MESSAGE_TYPE_ATTACKLOG "attacklog"
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@

#define is_admin(user) (check_rights(R_ADMIN, 0, (user)) != 0)

#define is_developer(user) (check_rights(R_DEV_TEAM, 0, (user)) != 0)

#define SLEEP_CHECK_DEATH(X) sleep(X); if(QDELETED(src) || stat == DEAD) return;

// Locations
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/speech_channels.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
#define MENTOR_CHANNEL "Mentor"
#define ADMIN_CHANNEL "Admin"
#define DSAY_CHANNEL "Dsay"
#define DEV_CHANNEL "Dev"

4 changes: 4 additions & 0 deletions code/__HELPERS/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ GLOBAL_PROTECT(log_end)
if(GLOB.configuration.logging.adminchat_logging)
rustg_log_write(GLOB.world_game_log, "MENTORSAY: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]")

/proc/log_devsay(text, mob/speaker)
if(GLOB.configuration.logging.adminchat_logging)
rustg_log_write(GLOB.world_game_log, "DEVSAY: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]")

/proc/log_ghostsay(text, mob/speaker)
if(GLOB.configuration.logging.say_logging)
rustg_log_write(GLOB.world_game_log, "DEADCHAT: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]")
Expand Down
1 change: 1 addition & 0 deletions code/__HELPERS/type2type.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
if(rights & R_MENTOR) . += "[seperator]+MENTOR"
if(rights & R_VIEWRUNTIMES) . += "[seperator]+VIEWRUNTIMES"
if(rights & R_MAINTAINER) . += "[seperator]+MAINTAINER"
if(rights & R_DEV_TEAM) . += "[seperator]+DEV_TEAM"

/proc/ui_style2icon(ui_style)
switch(ui_style)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
var/mentor_role_id = ""
/// List of all URLs for the main webhooks
var/list/main_webhook_urls = list()
/// List of all URLs for the admin webhooks
var/list/mentor_webhook_urls = list()
/// List of all URLs for the mentor webhooks
var/list/mentor_webhook_urls = list()
/// List of all URLs for the admin webhooks
var/list/admin_webhook_urls = list()



/datum/configuration_section/discord_configuration/load_data(list/data)
// Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line
CONFIG_LOAD_BOOL(webhooks_enabled, data["enable_discord_webhooks"])
Expand Down
5 changes: 5 additions & 0 deletions code/datums/keybindings/communication_keybinds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,8 @@
name = DSAY_CHANNEL
keys = list("F10")
required_rights = R_ADMIN

/datum/keybinding/client/communication/devsay
name = DEV_CHANNEL
keys = list("F2")
required_rights = R_DEV_TEAM | R_ADMIN
221 changes: 102 additions & 119 deletions code/game/verbs/who.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,44 @@
set category = "OOC"

var/list/lines = list()
var/list/temp = list()
var/list/ckeys = list()

for(var/client/C in GLOB.clients)
if(C.holder && C.holder.big_brother) // BB doesn't show up at all
continue

if(C.holder && C.holder.fakekey)
temp += C.holder.fakekey
ckeys.Add(C.holder.fakekey)
else
temp += C.key
ckeys.Add(C.key)
S34NW marked this conversation as resolved.
Show resolved Hide resolved

temp = sortList(temp) // Sort it. We dont do this above because fake keys would be out of order, which would be a giveaway
ckeys = sortList(ckeys) // Sort it. We dont do this above because fake keys would be out of order, which would be a giveaway

var/list/output_players = list()

// Now go over it again to apply colours.
for(var/p in temp)
var/client/C = GLOB.directory[ckey(p)]
for(var/player in ckeys)
var/client/C = GLOB.directory[ckey(player)]
if(!C)
// This should NEVER happen, but better to be safe
continue
// Get the colour
var/colour = client2rankcolour(C)
var/out = "[p]"
var/output = "[player]"
if(C.holder)
out = "<b>[out]</b>"
output = "<b>[output]</b>"
if(colour)
out = "<font color='[colour]'>[out]</font>"
output = "<font color='[colour]'>[output]</font>"

output_players += out
output_players.Add(output)

lines += "<b>Current Players ([length(output_players)]): </b>"
lines += output_players.Join(", ") // Turn players into a comma separated list
lines.Add("<b>Current Players ([length(output_players)]): </b>")
lines.Add(output_players.Join(", ")) // Turn players into a comma separated list

if(check_rights(R_ADMIN, FALSE))
lines += "Click <a href='byond://?_src_=holder;who_advanced=1'>here</a> for detailed (old) who."
lines.Add("Click <a href='byond://?_src_=holder;who_advanced=1'>here</a> for detailed (old) who.")

var/msg = lines.Join("\n")

to_chat(src, msg)
to_chat(src, lines.Join("<br>"))

// Advanced version of `who` to show player age, antag status and more. Lags the chat when loading, so its in its own proc
/client/proc/who_advanced()
Expand All @@ -55,132 +53,117 @@
if(C.holder && C.holder.big_brother && !check_rights(R_PERMISSIONS, FALSE)) // need PERMISSIONS to see BB
continue

var/entry = "\t[C.key]"
var/list/entry = list()
entry.Add("\t[C.key]")
if(C.holder && C.holder.fakekey)
entry += " <i>(as [C.holder.fakekey])</i>"
entry += " - Playing as [C.mob.real_name]"
entry.Add(" <i>(as [C.holder.fakekey])</i>")
entry.Add(" - Playing as [C.mob.real_name]")
switch(C.mob.stat)
if(UNCONSCIOUS)
entry += " - <font color='darkgray'><b>Unconscious</b></font>"
entry.Add(" - <font color='darkgray'><b>Unconscious</b></font>")
if(DEAD)
if(isobserver(C.mob))
var/mob/dead/observer/O = C.mob
if(O.started_as_observer)
entry += " - <font color='gray'>Observing</font>"
var/mob/dead/observer/observer = C.mob
if(observer.started_as_observer)
entry.Add(" - <font color='gray'>Observing</font>")
else
entry += " - <font color='black'><b>DEAD</b></font>"
entry.Add(" - <font color='black'><b>DEAD</b></font>")
else if(isnewplayer(C.mob))
entry += " - <font color='green'>New Player</font>"
entry.Add(" - <font color='green'>New Player</font>")
else
entry += " - <font color='black'><b>DEAD</b></font>"
entry.Add(" - <font color='black'><b>DEAD</b></font>")

var/age
var/account_age
if(isnum(C.player_age))
age = C.player_age
account_age = C.player_age
else
age = 0
account_age = 0

if(age <= 1)
age = "<font color='#ff0000'><b>[age]</b></font>"
else if(age < 10)
age = "<font color='#ff8c00'><b>[age]</b></font>"
if(account_age <= 1)
account_age = "<font color='#ff0000'><b>[account_age]</b></font>"
else if(account_age < 10)
account_age = "<font color='#ff8c00'><b>[account_age]</b></font>"

entry += " - [age]"
entry.Add(" - [account_age]")

if(is_special_character(C.mob))
entry += " - <b><font color='red'>Antagonist</font></b>"
entry += " ([ADMIN_QUE(C.mob, "?")])"
Lines += entry
entry.Add(" - <b><font color='red'>Antagonist</font></b>")
entry.Add(" ([ADMIN_QUE(C.mob, "?")])")

Lines.Add(entry.Join(""))

var/msg = ""
var/list/msg = list()

for(var/line in sortList(Lines))
msg += "[line]\n"
msg.Add("[line]")

msg += "<b>Total Players: [length(Lines)]</b>"
to_chat(src, msg)
msg.Add("<b>Total Players: [length(Lines)]</b>")
to_chat(src, msg.Join("<br>"))

/client/verb/adminwho()
set category = "Admin"
set name = "Adminwho"

var/msg = ""
var/modmsg = ""
var/num_mods_online = 0
var/list/adminmsg = list()
var/list/mentormsg = list()
var/list/devmsg = list()
var/num_mentors_online = 0
var/num_admins_online = 0
if(holder)
for(var/client/C in GLOB.admins)
if(check_rights(R_ADMIN, 0, C.mob))

if(C?.holder?.fakekey && !check_rights(R_ADMIN, 0)) //Mentors can't see stealthmins
continue

if(C?.holder?.big_brother && !check_rights(R_PERMISSIONS, FALSE)) // normal admins can't see BB
continue

// Their rank may not have a defined colour, only set colour if so
var/rank_colour = client2rankcolour(C)
if(rank_colour)
msg += "<font color='[rank_colour]'><b>[C]</b></font> is a [C.holder.rank]"
else
msg += "<b>[C]</b> is a [C.holder.rank]"

if(C.holder.fakekey)
msg += " <i>(as [C.holder.fakekey])</i>"

if(isobserver(C.mob))
msg += " - Observing"
else if(isnewplayer(C.mob))
msg += " - Lobby"
else
msg += " - Playing"
var/num_devs_online = 0

if(C.is_afk())
msg += " (AFK)"
msg += "\n"

num_admins_online++

else if(check_rights(R_MENTOR|R_MOD, 0, C.mob))
// Their rank may not have a defined colour, only set colour if so
var/rank_colour = client2rankcolour(C)
if(rank_colour)
modmsg += "<font color='[rank_colour]'><b>[C]</b></font> is a [C.holder.rank]"
else
modmsg += "<b>[C]</b> is a [C.holder.rank]"

if(isobserver(C.mob))
modmsg += " - Observing"
else if(isnewplayer(C.mob))
modmsg += " - Lobby"
else
modmsg += " - Playing"

if(C.is_afk())
modmsg += " (AFK)"
modmsg += "\n"
num_mods_online++
else
for(var/client/C in GLOB.admins)

if(check_rights(R_ADMIN, 0, C.mob))
if(!C.holder.fakekey)
var/rank_colour = client2rankcolour(C)
if(rank_colour)
msg += "<font color='[rank_colour]'><b>[C]</b></font> is a [C.holder.rank]"
else
msg += "<b>[C]</b> is a [C.holder.rank]"
msg += "\n"
num_admins_online++
else if(check_rights(R_MOD|R_MENTOR, 0, C.mob) && !check_rights(R_ADMIN, 0, C.mob))
var/rank_colour = client2rankcolour(C)
if(rank_colour)
modmsg += "<font color='[rank_colour]'><b>[C]</b></font> is a [C.holder.rank]"
else
modmsg += "<b>[C]</b> is a [C.holder.rank]"
modmsg += "\n"
num_mods_online++

var/noadmins_info = "\n<span class='notice'><small>If no admins or mentors are online, make a ticket anyways. Adminhelps and mentorhelps will be relayed to discord, and staff will still be informed.<small></span>"
msg = "<b>Current Admins ([num_admins_online]):</b>\n" + msg + "\n<b>Current Mentors ([num_mods_online]):</b>\n" + modmsg + noadmins_info
to_chat(src, msg)
for(var/client/C in GLOB.admins)
var/list/line = list()
var/rank_colour = client2rankcolour(C)
if(rank_colour)
line.Add("<font color='[rank_colour]'><b>[C]</b></font> is a [C.holder.rank]")
else
line.Add("<b>[C]</b> is a [C.holder.rank]")

if(holder) // Only for those with perms see the extra bit
if(C.holder.fakekey || check_rights(R_ADMIN, FALSE))
line.Add(" <i>(as [C.holder.fakekey])</i>")

if(isobserver(C.mob))
line.Add(" - Observing")
else if(isnewplayer(C.mob))
line.Add(" - Lobby")
else
line.Add(" - Playing")

if(C.is_afk())
line.Add(" (AFK)")

line.Add("<br>")
if(check_rights(R_ADMIN, FALSE, C.mob)) // Is this client an admin?
if(C?.holder?.fakekey && !check_rights(R_ADMIN, FALSE)) // Only admins can see stealthmins
continue

if(C?.holder?.big_brother && !check_rights(R_PERMISSIONS, FALSE)) // Normal admins can't see Big Brother
continue
num_admins_online++
adminmsg.Add(line.Join(""))

else if(check_rights(R_DEV_TEAM, FALSE, C.mob)) // Is this client a developer?
num_devs_online++
devmsg.Add(line.Join(""))

else if(check_rights(R_MENTOR, FALSE, C.mob)) // Is this client a mentor?
num_mentors_online++
mentormsg.Add(line.Join(""))

var/list/final_message = list()
if(num_admins_online)
final_message.Add("<b>Current Admins ([num_admins_online]):</b><br>")
final_message.Add(adminmsg)
final_message.Add("<br>")
if(num_devs_online)
final_message.Add("<b>Current Developers ([num_devs_online]):</b><br>")
final_message.Add(devmsg)
final_message.Add("<br>")
if(num_mentors_online)
final_message.Add("<b>Current Mentors ([num_mentors_online]):</b><br>")
final_message.Add(mentormsg)
final_message.Add("<br>")
if(!num_admins_online || !num_mentors_online)
final_message.Add("<span class='notice'>Even with no [!num_admins_online ? "admins" : ""][!num_admins_online && !num_mentors_online ? " or " : ""][!num_mentors_online ? "mentors" : ""] are online, make a ticket anyways. [!num_admins_online ? "Adminhelps" : ""][!num_admins_online && !num_mentors_online ? " and " : ""][!num_mentors_online ? "Mentorhelps" : ""] will be relayed to discord, and staff will still be informed.</span>")
to_chat(src, final_message.Join(""))
1 change: 1 addition & 0 deletions code/modules/admin/admin_ranks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
if("spawn","create") rights |= R_SPAWN
if("mod") rights |= R_MOD
if("mentor") rights |= R_MENTOR
if("developer") rights |= R_DEV_TEAM
if("proccall") rights |= R_PROCCALL
if("viewruntimes") rights |= R_VIEWRUNTIMES
if("maintainer") rights |= R_MAINTAINER
Expand Down
3 changes: 2 additions & 1 deletion code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ GLOBAL_LIST_INIT(admin_verbs_admin, list(
/client/proc/library_manager,
/client/proc/view_asays,
/client/proc/view_msays,
/client/proc/view_devsays,
/client/proc/empty_ai_core_toggle_latejoin,
/client/proc/aooc,
/client/proc/freeze,
Expand Down Expand Up @@ -1179,7 +1180,7 @@ GLOBAL_LIST_INIT(view_runtimes_verbs, list(
message_admins("[key_name_admin(usr)] is visualising interesting atmos turfs. Server may lag.")

var/list/zlevel_turf_indexes = list()

var/list/coords = get_interesting_atmos_tiles()
if(!length(coords))
to_chat(mob, "<span class='notice'>There are no interesting turfs. How interesting!</span>")
Expand Down
Loading