From 4bdec9aa7cddfeb005be682014ef4dabd04cc504 Mon Sep 17 00:00:00 2001
From: Oblisk234 <61151679+Oblisk234@users.noreply.github.com>
Date: Sat, 30 Nov 2024 21:04:26 +0000
Subject: [PATCH 1/7] Mentor fixes
---
yogstation/code/modules/mentor/mentor_verbs.dm | 3 +--
yogstation/code/modules/mentor/mentorpm.dm | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/yogstation/code/modules/mentor/mentor_verbs.dm b/yogstation/code/modules/mentor/mentor_verbs.dm
index 91aff1e4d67de..5f98858219642 100644
--- a/yogstation/code/modules/mentor/mentor_verbs.dm
+++ b/yogstation/code/modules/mentor/mentor_verbs.dm
@@ -64,9 +64,8 @@ GLOBAL_PROTECT(mentor_verbs)
if(C.is_afk())
msg += " (AFK)"
- else
- msg += span_info("Mentorhelps are also sent to Discord. If no mentors are available in game mentorhelp anyways and a mentor on Discord may see it and respond.")
msg += "\n"
+ msg += span_info("Mentorhelps are also sent to Discord. If no mentors are available in game mentorhelp anyways and a mentor on Discord may see it and respond.")
to_chat(src, msg, confidential=TRUE)
diff --git a/yogstation/code/modules/mentor/mentorpm.dm b/yogstation/code/modules/mentor/mentorpm.dm
index 826c6bb5f82c4..629bf07eaaf14 100644
--- a/yogstation/code/modules/mentor/mentorpm.dm
+++ b/yogstation/code/modules/mentor/mentorpm.dm
@@ -90,7 +90,7 @@
var/datum/DBQuery/add_mhelp_query = SSdbcore.NewQuery(
"INSERT INTO `[format_table_name("mentor_interactions")]` (round_id, ckey, ckey_mentor, target_ckey, target_mentor, message) VALUES (:round, :send, :smentor, :receive, :rmentor, :msg);",
- list("round" = GLOB.round_id, "send" = ckey, "smentor" = is_mentor(), "receive" = C.ckey, "rmentor" = C.is_mentor(), "msg" = msg)
+ list("round" = GLOB.round_id, "send" = ckey, "smentor" = is_mentor(), "receive" = discord_id ? discord_id : C.ckey, "rmentor" = C.is_mentor(), "msg" = msg)
)
if(!add_mhelp_query.Execute())
message_admins("Failed insert mhelp into mhelp DB. Check the SQL error logs for more details.")
From b6d196c18eca8fcb277529ae999d47db51258e72 Mon Sep 17 00:00:00 2001
From: Oblisk234 <61151679+Oblisk234@users.noreply.github.com>
Date: Sat, 30 Nov 2024 21:22:29 +0000
Subject: [PATCH 2/7] That may have been the actual ID and not their alias
---
yogstation/code/modules/mentor/mentorpm.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/yogstation/code/modules/mentor/mentorpm.dm b/yogstation/code/modules/mentor/mentorpm.dm
index 629bf07eaaf14..56a69ccd38943 100644
--- a/yogstation/code/modules/mentor/mentorpm.dm
+++ b/yogstation/code/modules/mentor/mentorpm.dm
@@ -90,7 +90,7 @@
var/datum/DBQuery/add_mhelp_query = SSdbcore.NewQuery(
"INSERT INTO `[format_table_name("mentor_interactions")]` (round_id, ckey, ckey_mentor, target_ckey, target_mentor, message) VALUES (:round, :send, :smentor, :receive, :rmentor, :msg);",
- list("round" = GLOB.round_id, "send" = ckey, "smentor" = is_mentor(), "receive" = discord_id ? discord_id : C.ckey, "rmentor" = C.is_mentor(), "msg" = msg)
+ list("round" = GLOB.round_id, "send" = ckey, "smentor" = is_mentor(), "receive" = discord_id ? whom : C.ckey, "rmentor" = C.is_mentor(), "msg" = msg)
)
if(!add_mhelp_query.Execute())
message_admins("Failed insert mhelp into mhelp DB. Check the SQL error logs for more details.")
From ada49958038f215344059cce9d6729b775b60679 Mon Sep 17 00:00:00 2001
From: Oblisk234 <61151679+Oblisk234@users.noreply.github.com>
Date: Sun, 1 Dec 2024 10:56:58 +0000
Subject: [PATCH 3/7] OOC tag fix
---
code/modules/admin/holder2.dm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm
index b7acb10ee9456..b5efb03c25bff 100644
--- a/code/modules/admin/holder2.dm
+++ b/code/modules/admin/holder2.dm
@@ -122,6 +122,8 @@ GLOBAL_PROTECT(href_token)
if (deadmined)
activate()
+ if(C.mentor_datum)
+ C.mentor_position = C.mentor_datum.position
owner = C
ip_cache = C.address
cid_cache = C.computer_id
From ef0102ed0000851cfac26000b39996cbaba684d4 Mon Sep 17 00:00:00 2001
From: Oblisk234 <61151679+Oblisk234@users.noreply.github.com>
Date: Fri, 6 Dec 2024 13:34:15 +0000
Subject: [PATCH 4/7] Not another runtime
---
yogstation/code/modules/mentor/mentorpm.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/yogstation/code/modules/mentor/mentorpm.dm b/yogstation/code/modules/mentor/mentorpm.dm
index 56a69ccd38943..9b5dc41f93490 100644
--- a/yogstation/code/modules/mentor/mentorpm.dm
+++ b/yogstation/code/modules/mentor/mentorpm.dm
@@ -90,7 +90,7 @@
var/datum/DBQuery/add_mhelp_query = SSdbcore.NewQuery(
"INSERT INTO `[format_table_name("mentor_interactions")]` (round_id, ckey, ckey_mentor, target_ckey, target_mentor, message) VALUES (:round, :send, :smentor, :receive, :rmentor, :msg);",
- list("round" = GLOB.round_id, "send" = ckey, "smentor" = is_mentor(), "receive" = discord_id ? whom : C.ckey, "rmentor" = C.is_mentor(), "msg" = msg)
+ list("round" = GLOB.round_id, "send" = ckey, "smentor" = is_mentor(), "receive" = discord_id ? whom : C.ckey, "rmentor" = discord_id ? TRUE : C.is_mentor(), "msg" = msg)
)
if(!add_mhelp_query.Execute())
message_admins("Failed insert mhelp into mhelp DB. Check the SQL error logs for more details.")
From 452bb807bb3527016e42d5def5c74e009364343f Mon Sep 17 00:00:00 2001
From: Oblisk234 <61151679+Oblisk234@users.noreply.github.com>
Date: Sat, 7 Dec 2024 00:22:23 +0000
Subject: [PATCH 5/7] Fixes discord mentor messages not being logged in
database or mentor tickets
---
yogstation/code/datums/world_topic.dm | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/yogstation/code/datums/world_topic.dm b/yogstation/code/datums/world_topic.dm
index 97e34eb09d5e5..f142afab6cd0e 100644
--- a/yogstation/code/datums/world_topic.dm
+++ b/yogstation/code/datums/world_topic.dm
@@ -86,6 +86,16 @@ GLOBAL_VAR_INIT(mentornoot, FALSE)
SEND_SOUND(C, sound('sound/misc/nootnoot.ogg'))
else
SEND_SOUND(C, sound('sound/items/bikehorn.ogg'))
+ var/datum/DBQuery/add_mhelp_query = SSdbcore.NewQuery(
+ "INSERT INTO `[format_table_name("mentor_interactions")]` (round_id, ckey, ckey_mentor, target_ckey, target_mentor, message) VALUES (:round, :send, :smentor, :receive, :rmentor, :msg);",
+ list("round" = GLOB.round_id, "send" = from, "smentor" = TRUE, "receive" = C.ckey, "rmentor" = C.is_mentor(), "msg" = msg)
+ )
+ if(!add_mhelp_query.Execute())
+ message_admins("Failed insert mhelp into mhelp DB. Check the SQL error logs for more details.")
+ qdel(add_mhelp_query)
+ if(ckey in SSYogs.mentortickets)
+ var/datum/mentorticket/T = SSYogs.mentortickets[ckey]
+ T.log += "[from]: [msg]"
to_chat(C, "Mentor PM from-[discord_mentor_link(from, from_id)]: [msg]", confidential = TRUE)
var/show_char_recip = !C.is_mentor() && CONFIG_GET(flag/mentors_mobname_only)
for(var/client/X in GLOB.mentors | GLOB.permissions.admins)
From c40909bc94ef47fe4c0a0ec57d1756ecf237131d Mon Sep 17 00:00:00 2001
From: Oblisk234 <61151679+Oblisk234@users.noreply.github.com>
Date: Sat, 7 Dec 2024 00:26:26 +0000
Subject: [PATCH 6/7] Fixes bad indents
---
yogstation/code/datums/world_topic.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/yogstation/code/datums/world_topic.dm b/yogstation/code/datums/world_topic.dm
index f142afab6cd0e..2f43af3f8684c 100644
--- a/yogstation/code/datums/world_topic.dm
+++ b/yogstation/code/datums/world_topic.dm
@@ -94,8 +94,8 @@ GLOBAL_VAR_INIT(mentornoot, FALSE)
message_admins("Failed insert mhelp into mhelp DB. Check the SQL error logs for more details.")
qdel(add_mhelp_query)
if(ckey in SSYogs.mentortickets)
- var/datum/mentorticket/T = SSYogs.mentortickets[ckey]
- T.log += "[from]: [msg]"
+ var/datum/mentorticket/T = SSYogs.mentortickets[ckey]
+ T.log += "[from]: [msg]"
to_chat(C, "Mentor PM from-[discord_mentor_link(from, from_id)]: [msg]", confidential = TRUE)
var/show_char_recip = !C.is_mentor() && CONFIG_GET(flag/mentors_mobname_only)
for(var/client/X in GLOB.mentors | GLOB.permissions.admins)
From 67c900918521e4847ffd3062170bad399f436c70 Mon Sep 17 00:00:00 2001
From: Oblisk234 <61151679+Oblisk234@users.noreply.github.com>
Date: Sat, 7 Dec 2024 00:29:42 +0000
Subject: [PATCH 7/7] This is why you need to be careful when copypasting
---
yogstation/code/datums/world_topic.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/yogstation/code/datums/world_topic.dm b/yogstation/code/datums/world_topic.dm
index 2f43af3f8684c..bae1a25fa85b6 100644
--- a/yogstation/code/datums/world_topic.dm
+++ b/yogstation/code/datums/world_topic.dm
@@ -93,8 +93,8 @@ GLOBAL_VAR_INIT(mentornoot, FALSE)
if(!add_mhelp_query.Execute())
message_admins("Failed insert mhelp into mhelp DB. Check the SQL error logs for more details.")
qdel(add_mhelp_query)
- if(ckey in SSYogs.mentortickets)
- var/datum/mentorticket/T = SSYogs.mentortickets[ckey]
+ if(C.ckey in SSYogs.mentortickets)
+ var/datum/mentorticket/T = SSYogs.mentortickets[C.ckey]
T.log += "[from]: [msg]"
to_chat(C, "Mentor PM from-[discord_mentor_link(from, from_id)]: [msg]", confidential = TRUE)
var/show_char_recip = !C.is_mentor() && CONFIG_GET(flag/mentors_mobname_only)