File tree 2 files changed +24
-0
lines changed
code/controllers/configuration/entries
monkestation/code/modules/mentor
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 35
35
/ datum / config_entry/ string/ issue_slug
36
36
protection = CONFIG_ENTRY_LOCKED
37
37
38
+ / datum / config_entry/ flag/ mentor_legacy_system
39
+
38
40
/ datum / config_entry/ flag/ looc_enabled
39
41
40
42
/ datum / config_entry/ flag/ log_storyteller
Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ GLOBAL_PROTECT(mentor_href_token)
62
62
return " mentor_token=[ RawMentorHrefToken(forceGlobal)] "
63
63
64
64
/ proc / load_mentors()
65
+ var /dbfail
66
+ if (! CONFIG_GET (flag/ admin_legacy_system) && ! SSdbcore. Connect())
67
+ message_admins (" Failed to connect to database while loading mentors. Loading from backup." )
68
+ log_sql (" Failed to connect to database while loading mentors. Loading from backup." )
69
+ dbfail = 1
65
70
GLOB . mentor_datums. Cut()
66
71
for (var /client /mentor_clients in GLOB . mentors)
67
72
mentor_clients. remove_mentor_verbs()
@@ -74,3 +79,20 @@ GLOBAL_PROTECT(mentor_href_token)
74
79
if (findtextEx(line, " #" , 1 , 2 ))
75
80
continue
76
81
new / datum / mentors(line)
82
+
83
+ if (! CONFIG_GET (flag/ mentor_legacy_system) || dbfail)
84
+ var /datum /db_query/query_load_mentors = SSdbcore. NewQuery(" SELECT ckey, rank FROM [ format_table_name(" mentor" )] " )
85
+ if (! query_load_mentors. Execute())
86
+ message_admins (" Error loading mentors from database. Loading from backup." )
87
+ log_sql (" Error loading mentors from database. Loading from backup." )
88
+ dbfail = 1
89
+ else
90
+ while (query_load_mentors. NextRow())
91
+ var /mentor_ckey = ckey(query_load_mentors. item[1 ])
92
+ var /skip
93
+
94
+ if (GLOB . mentor_datums[mentor_ckey])
95
+ skip = 1
96
+ if (! skip)
97
+ new / datum / mentors(mentor_ckey)
98
+ qdel (query_load_mentors)
You can’t perform that action at this time.
0 commit comments