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 4 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
3 changes: 3 additions & 0 deletions code/__DEFINES/misc_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,9 @@
/// Send to the mentor Discord webhook
#define DISCORD_WEBHOOK_MENTOR "MENTOR"

/// Send to the developer Discord webhook
#define DISCORD_WEBHOOK_DEVELOPER "DEVELOPER"

// Hallucination severities
#define HALLUCINATE_MINOR 1
#define HALLUCINATE_MODERATE 2
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
10 changes: 8 additions & 2 deletions code/controllers/configuration/sections/discord_configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
var/admin_role_id = ""
/// Mentor role to ping if no mentors are online. Disables if empty string
var/mentor_role_id = ""
/// Developer role in case ping functionality is added. Disables if empty string
var/developer_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()
/// List of all URLs for the developer webhooks
var/list/developer_webhook_urls = list()



Expand All @@ -24,6 +28,8 @@
CONFIG_LOAD_BOOL(forward_all_ahelps, data["forward_all_ahelps"])
CONFIG_LOAD_STR(admin_role_id, data["admin_role_id"])
CONFIG_LOAD_STR(mentor_role_id, data["mentor_role_id"])
CONFIG_LOAD_STR(developer_role_id, data["developer_role_id"])
CONFIG_LOAD_LIST(main_webhook_urls, data["main_webhook_urls"])
CONFIG_LOAD_LIST(mentor_webhook_urls, data["mentor_webhook_urls"])
CONFIG_LOAD_LIST(admin_webhook_urls, data["admin_webhook_urls"])
CONFIG_LOAD_LIST(developer_webhook_urls, data["developer_webhook_urls"])
4 changes: 4 additions & 0 deletions code/datums/discord/discord_manager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ GLOBAL_DATUM_INIT(discord_manager, /datum/discord_manager, new())
webhook_urls = GLOB.configuration.discord.main_webhook_urls
if(DISCORD_WEBHOOK_MENTOR)
webhook_urls = GLOB.configuration.discord.mentor_webhook_urls
if(DISCORD_WEBHOOK_DEVELOPER)
webhook_urls = GLOB.configuration.discord.developer_webhook_urls

var/datum/discord_webhook_payload/dwp = new()
dwp.webhook_content = "**\[[GLOB.configuration.system.instance_id]]** [content]"
Expand All @@ -36,6 +38,8 @@ GLOBAL_DATUM_INIT(discord_manager, /datum/discord_manager, new())
webhook_urls = GLOB.configuration.discord.main_webhook_urls
if(DISCORD_WEBHOOK_MENTOR)
webhook_urls = GLOB.configuration.discord.mentor_webhook_urls
if(DISCORD_WEBHOOK_DEVELOPER)
webhook_urls = GLOB.configuration.discord.developer_webhook_urls
for(var/url in webhook_urls)
SShttp.create_async_request(RUSTG_HTTP_METHOD_POST, url, dwp.serialize2json(), list("content-type" = "application/json"))

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
Loading