diff --git a/citadel.dme b/citadel.dme
index c1999fd4477a..0a960e32cf00 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -541,7 +541,6 @@
#include "code\controllers\configuration\entries\skills.dm"
#include "code\controllers\configuration\entries\urls.dm"
#include "code\controllers\configuration_old\configuration.dm"
-#include "code\controllers\configuration_old\configuration_vr.dm"
#include "code\controllers\observer_listener\atom\observer.dm"
#include "code\controllers\repository\designs.dm"
#include "code\controllers\repository\flooring.dm"
@@ -688,8 +687,10 @@
#include "code\controllers\subsystem\sound\soundbyte_manager.dm"
#include "code\controllers\toml_config\toml_config_entry.dm"
#include "code\controllers\toml_config\toml_configuration.dm"
+#include "code\controllers\toml_config\entries\backend-logging-toggles.dm"
+#include "code\controllers\toml_config\entries\backend-logging.dm"
+#include "code\controllers\toml_config\entries\backend-repository.dm"
#include "code\controllers\toml_config\entries\backend.dm"
-#include "code\controllers\toml_config\entries\backend.repository.dm"
#include "code\datums\ability.dm"
#include "code\datums\ability_handler.dm"
#include "code\datums\access.dm"
diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm
index 02374d8d8083..7b605c7b742c 100644
--- a/code/__HELPERS/_logging.dm
+++ b/code/__HELPERS/_logging.dm
@@ -80,39 +80,39 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
*/
/proc/log_admin(text)
admin_log.Add(text)
- if (config_legacy.log_admin)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/admin))
WRITE_LOG(GLOB.world_game_log, "ADMIN: [text]")
/proc/log_admin_private(text)
admin_log.Add(text)
- if (config_legacy.log_admin)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/admin))
WRITE_LOG(GLOB.world_game_log, "ADMINPRIVATE: [text]")
/proc/log_adminsay(text, mob/speaker)
- if (config_legacy.log_adminchat)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/adminchat))
if(speaker)
WRITE_LOG(GLOB.world_game_log, "ADMINPRIVATE: ASAY: [speaker.simple_info_line()]: [text]")
else
WRITE_LOG(GLOB.world_game_log, "ADMINPRIVATE: ASAY: [text]")
/proc/log_modsay(text, mob/speaker)
- if (config_legacy.log_adminchat)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/adminchat))
WRITE_LOG(GLOB.world_game_log, "MODSAY: [speaker.simple_info_line()]: [html_decode(text)]")
/proc/log_eventsay(text, mob/speaker)
- if (config_legacy.log_adminchat)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/adminchat))
WRITE_LOG(GLOB.world_game_log, "EVENTSAY: [speaker.simple_info_line()]: [html_decode(text)]")
/proc/log_adminpm(text, client/source, client/dest)
admin_log.Add(text)
- if (config_legacy.log_admin)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/admin))
WRITE_LOG(GLOB.world_game_log, "ADMINPM: [key_name(source)]->[key_name(dest)]: [html_decode(text)]")
/**
* All other items are public.
*/
/proc/log_game(text)
- if (config_legacy.log_game)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/game))
WRITE_LOG(GLOB.world_game_log, "GAME: [text]")
/proc/log_asset(text)
@@ -123,22 +123,22 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
///
/proc/log_access_in(client/new_client)
- if (config_legacy.log_access)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/access))
var/message = "[key_name(new_client)] - IP:[new_client.address] - CID:[new_client.computer_id] - BYOND v[new_client.byond_version]"
WRITE_LOG(GLOB.world_game_log, "ACCESS IN: [message]")
/proc/log_access_out(mob/last_mob)
- if (config_legacy.log_access)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/access))
var/message = "[key_name(last_mob)] - IP:[last_mob.lastKnownIP] - CID:Logged Out - BYOND Logged Out"
WRITE_LOG(GLOB.world_game_log, "ACCESS OUT: [message]")
///
/proc/log_attack(attacker, defender, message)
- if (config_legacy.log_attack)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/attack))
WRITE_LOG(GLOB.world_attack_log, "ATTACK: [attacker] against [defender]: [message]")
/proc/log_say(text, mob/speaker)
- if (config_legacy.log_say)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/say))
WRITE_LOG(GLOB.world_game_log, "SAY: [speaker.simple_info_line()]: [html_decode(text)]")
//Log the message to in-game dialogue logs, as well.
@@ -147,13 +147,13 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) SAY: - [text]"
/proc/log_ooc(text, client/user)
- if (config_legacy.log_ooc)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/ooc))
WRITE_LOG(GLOB.world_game_log, "OOC: [user.simple_info_line()]: [html_decode(text)]")
GLOB.round_text_log += "([time_stamp()]) ([user]) OOC: - [text]"
/proc/log_whisper(text, mob/speaker)
- if (config_legacy.log_whisper)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/whisper))
WRITE_LOG(GLOB.world_game_log, "WHISPER: [speaker.simple_info_line()]: [html_decode(text)]")
if(speaker.client)
@@ -161,7 +161,7 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) SAY: - [text]"
/proc/log_emote(text, mob/speaker)
- if (config_legacy.log_emote)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/emote))
WRITE_LOG(GLOB.world_game_log, "EMOTE: [speaker.simple_info_line()]: [html_decode(text)]")
if(speaker.client)
@@ -169,25 +169,25 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) EMOTE: - [text]"
/proc/log_subtle(text, mob/speaker)
- if (config_legacy.log_emote)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/emote))
WRITE_LOG(GLOB.world_game_log, "SUBTLE: [speaker.simple_info_line()]: [html_decode(text)]")
/proc/log_subtle_anti_ghost(text, mob/speaker)
- if (config_legacy.log_emote)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/emote))
WRITE_LOG(GLOB.world_game_log, "SUBTLER: [speaker.simple_info_line()]: [html_decode(text)]")
/proc/log_subtle_vore(text, mob/speaker)
- if (config_legacy.log_emote)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/emote))
WRITE_LOG(GLOB.world_game_log, "SUBTLE_VORE: [speaker.simple_info_line()]: [html_decode(text)]")
/proc/log_aooc(text, client/user)
- if (config_legacy.log_ooc)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/ooc))
WRITE_LOG(GLOB.world_game_log, "AOOC: [user.simple_info_line()]: [html_decode(text)]")
GLOB.round_text_log += "([time_stamp()]) ([user]) AOOC: - [text]"
/proc/log_looc(text, client/user)
- if (config_legacy.log_ooc)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/ooc))
WRITE_LOG(GLOB.world_game_log, "LOOC: [user.simple_info_line()]: [html_decode(text)]")
GLOB.round_text_log += "([time_stamp()]) ([user]) LOOC: - [text]"
@@ -196,7 +196,7 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
WRITE_LOG(GLOB.world_runtime_log, "IPINTEL: [text]")
/proc/log_vote(text)
- if (config_legacy.log_vote)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/vote))
WRITE_LOG(GLOB.world_game_log, "VOTE: [text]")
/proc/log_topic(text)
@@ -418,7 +418,7 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
/// VSTATION SPECIFIC LOGGING. ///
/proc/log_debug(text)
- if (config_legacy.log_debug)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/debug))
WRITE_LOG(GLOB.world_runtime_log, "DEBUG: [text]")
// for(var/client/C in GLOB.admins)
@@ -430,22 +430,22 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
// )
/proc/log_ghostsay(text, mob/speaker)
- if (config_legacy.log_say)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/say))
WRITE_LOG(GLOB.world_game_log, "DEADCHAT: [speaker.simple_info_line()]: [html_decode(text)]")
speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) DEADSAY: - [text]"
GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) DEADSAY: - [text]"
/proc/log_ghostemote(text, mob/speaker)
- if (config_legacy.log_emote)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/emote))
WRITE_LOG(GLOB.world_game_log, "DEADEMOTE: [speaker.simple_info_line()]: [html_decode(text)]")
/proc/log_adminwarn(text)
- if (config_legacy.log_adminwarn)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/adminwarn))
WRITE_LOG(GLOB.world_game_log, "ADMINWARN: [html_decode(text)]")
/proc/log_pda(text, mob/speaker)
- if (config_legacy.log_pda)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/pda))
WRITE_LOG(GLOB.world_game_log, "PDA: [speaker.simple_info_line()]: [html_decode(text)]")
speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) MSG: - [text]"
@@ -470,11 +470,11 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
log_world(progress_message)
/proc/log_nsay(text, inside, mob/speaker)
- if (config_legacy.log_say)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/say))
WRITE_LOG(GLOB.world_game_log, "NSAY (NIF:[inside]): [speaker.simple_info_line()]: [html_decode(text)]")
/proc/log_nme(text, inside, mob/speaker)
- if (config_legacy.log_emote)
+ if (Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/emote))
WRITE_LOG(GLOB.world_game_log, "NME (NIF:[inside]): [speaker.simple_info_line()]: [html_decode(text)]")
diff --git a/code/controllers/configuration_old/configuration.dm b/code/controllers/configuration_old/configuration.dm
index c67bb947d520..ea626cb6d33e 100644
--- a/code/controllers/configuration_old/configuration.dm
+++ b/code/controllers/configuration_old/configuration.dm
@@ -7,25 +7,6 @@
var/server_name = null // server name (for world name / status)
var/server_suffix = 0 // generate numeric suffix based on server port
- var/nudge_script_path = "nudge.py" // where the nudge.py script is located
-
- var/log_ooc = 0 // log OOC channel
- var/log_access = 0 // log login/logout
- var/log_say = 0 // log client say
- var/log_admin = 0 // log admin actions
- var/log_debug = 1 // log debug output
- var/log_game = 0 // log game events
- var/log_vote = 0 // log voting
- var/log_whisper = 0 // log client whisper
- var/log_emote = 0 // log emotes
- var/log_attack = 0 // log attack messages
- var/log_adminchat = 0 // log admin chat messages
- var/log_adminwarn = 0 // log warnings admins get about bomb construction and such
- var/log_pda = 0 // log pda messages
- var/log_hrefs = 0 // logs all links clicked in-game. Could be used for debugging and tracking down exploits
- var/log_runtime = 0 // logs world.log to a file
- var/log_world_output = 0 // log world.log << messages
- var/log_topic = TRUE
var/allow_vote_restart = 0 // allow votes to restart
var/ert_admin_call_only = 0
var/allow_vote_mode = 0 // allow votes to change mode
@@ -38,19 +19,12 @@
var/vote_autogamemode_timeleft = 100 //Length of time before round start when autogamemode vote is called (in seconds, default 100).
var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi)
var/vote_no_dead = 0 // dead people can't vote (tbi)
-// var/enable_authentication = 0 // goon authentication
- var/del_new_on_log = 1 // del's new players if they log before they spawn in
var/feature_object_spell_system = 0 //spawns a spellbook which gives object-type spells instead of verb-type spells for the wizard
var/traitor_scaling = 0 //if amount of traitors scales based on amount of players
var/objectives_disabled = 0 //if objectives are disabled or not
var/protect_roles_from_antagonist = 0// If security and such can be traitor/cult/other
var/continous_rounds = 0 // Gamemodes which end instantly will instead keep on going until the round ends by escape shuttle or nuke.
- var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1.
var/fps = 20
- var/tick_limit_mc_init = TICK_LIMIT_MC_INIT_DEFAULT //SSinitialization throttling
- var/Tickcomp = 0
- var/socket_talk = 0 // use socket_talk to communicate with other processes
- var/list/resource_urls = null
var/antag_hud_allowed = 0 // Ghosts can turn on Antagovision to see a HUD of who is the bad guys this round.
var/antag_hud_restricted = 0 // Ghosts that turn on Antagovision cannot rejoin the round.
var/list/mode_names = list()
@@ -74,13 +48,6 @@
var/guest_jobban = 1
var/usewhitelist = 0
var/kick_inactive = 0 //force disconnect for inactive players after this many minutes, if non-0
- var/show_mods = 0
- var/show_devs = 0
- var/show_event_managers = 0
- var/mods_can_tempban = 0
- var/mods_can_job_tempban = 0
- var/mod_tempban_max = 1440
- var/mod_job_tempban_max = 1440
var/load_jobs_from_txt = 0
var/ToRban = 0
var/automute_on = 0 //enables automuting/spam prevention
@@ -99,8 +66,6 @@
var/uneducated_mice = 0 //Set to 1 to prevent newly-spawned mice from understanding human speech
var/usealienwhitelist = 0
- var/limitalienplayers = 0
- var/alien_to_human_ratio = 0.5
var/allow_extra_antags = 0
var/guests_allowed = 1
var/debugparanoid = 0
@@ -115,25 +80,19 @@
var/rulesurl
var/mapurl
- var/forbid_singulo_possession = 0
-
//game_options.txt configs
var/health_threshold_softcrit = 0
var/health_threshold_crit = 0
var/health_threshold_dead = -100
- var/default_brain_health = 400
var/allow_headgibs = FALSE
var/revival_pod_plants = 1
var/revival_cloning = 1
var/revival_brain_life = -1
- var/use_loyalty_implants = 0
-
var/welder_vision = 1
- var/generate_map = 1
var/no_click_cooldown = 0
//Used for modifying movement speed for mobs.
@@ -165,17 +124,6 @@
var/enter_allowed = 1
- var/use_irc_bot = 0
- var/use_node_bot = 0
- var/irc_bot_port = 0
- var/irc_bot_host = ""
- var/irc_bot_export = 0 // whether the IRC bot in use is a Bot32 (or similar) instance; Bot32 uses world.Export() instead of nudge.py/libnudge
- var/main_irc = ""
- var/admin_irc = ""
- var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix
- var/use_lib_nudge = 0 //Use the C library nudge instead of the python nudge.
- var/use_overmap = 0
-
// Event settings
var/expected_round_length = 3 * 60 * 60 * 10 // 3 hours
// If the first delay has a custom start time
@@ -196,22 +144,10 @@
var/dooc_allowed = 1
var/dsay_allowed = 1
- var/static/starlight = 0 // Whether space turfs have ambient light or not
-
- var/list/ert_species = list(SPECIES_HUMAN)
-
var/law_zero = "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'ALL LAWS OVERRIDDEN#*?&110010"
- var/aggressive_changelog = 0
-
var/list/language_prefixes = list(",","#")//Default language prefixes
- var/show_human_death_message = 1
-
- var/radiation_decay_rate = 1 //How much radiation is reduced by each tick
- var/radiation_resistance_multiplier = 8.5
- var/radiation_lower_limit = 0.35 //If the radiation level for a turf would be below this, ignore it.
-
var/comms_key = "default_password"
var/minute_click_limit = 500 //default: 7+ clicks per second
@@ -269,9 +205,6 @@
if(type == "config")
switch (name)
- if ("resource_urls")
- config_legacy.resource_urls = splittext(value, " ")
-
if ("admin_legacy_system")
config_legacy.admin_legacy_system = 1
@@ -287,63 +220,9 @@
if ("multi_z_explosion_scalar")
multi_z_explosion_scalar = text2num(value)
- if ("log_ooc")
- config_legacy.log_ooc = 1
-
- if ("log_access")
- config_legacy.log_access = 1
-
- if ("log_say")
- config_legacy.log_say = 1
-
if ("debug_paranoid")
config_legacy.debugparanoid = 1
- if ("log_admin")
- config_legacy.log_admin = 1
-
- if ("log_debug")
- config_legacy.log_debug = text2num(value)
-
- if ("log_game")
- config_legacy.log_game = 1
-
- if ("log_vote")
- config_legacy.log_vote = 1
-
- if ("log_whisper")
- config_legacy.log_whisper = 1
-
- if ("log_attack")
- config_legacy.log_attack = 1
-
- if ("log_emote")
- config_legacy.log_emote = 1
-
- if ("log_adminchat")
- config_legacy.log_adminchat = 1
-
- if ("log_adminwarn")
- config_legacy.log_adminwarn = 1
-
- if ("log_pda")
- config_legacy.log_pda = 1
-
- if ("log_world_output")
- config_legacy.log_world_output = 1
-
- if ("log_hrefs")
- config_legacy.log_hrefs = 1
-
- if ("log_runtime")
- config_legacy.log_runtime = 1
-
- if ("log_topic")
- config_legacy.log_topic = text2num(value)
-
- if ("generate_map")
- config_legacy.generate_map = 1
-
if ("no_click_cooldown")
config_legacy.no_click_cooldown = 1
@@ -414,9 +293,6 @@
if ("serversuffix")
config_legacy.server_suffix = 1
- if ("nudge_script_path")
- config_legacy.nudge_script_path = value
-
if ("hostedby")
config_legacy.hostedby = value
@@ -530,67 +406,22 @@
if("kick_inactive")
config_legacy.kick_inactive = text2num(value)
- if("show_mods")
- config_legacy.show_mods = 1
-
- if("show_devs")
- config_legacy.show_devs = 1
-
- if("show_event_managers")
- config_legacy.show_event_managers = 1
-
- if("mods_can_tempban")
- config_legacy.mods_can_tempban = 1
-
- if("mods_can_job_tempban")
- config_legacy.mods_can_job_tempban = 1
-
- if("mod_tempban_max")
- config_legacy.mod_tempban_max = text2num(value)
-
- if("mod_job_tempban_max")
- config_legacy.mod_job_tempban_max = text2num(value)
-
if("load_jobs_from_txt")
load_jobs_from_txt = 1
- if("forbid_singulo_possession")
- forbid_singulo_possession = 1
-
- if("popup_admin_pm")
- config_legacy.popup_admin_pm = 1
-
if("allow_holidays")
Holiday = 1
- if("use_irc_bot")
- use_irc_bot = 1
-
- if("use_node_bot")
- use_node_bot = 1
-
- if("irc_bot_port")
- config_legacy.irc_bot_port = value
-
- if("irc_bot_export")
- irc_bot_export = 1
-
if("ticklag")
var/ticklag = text2num(value)
if(ticklag > 0)
fps = 10 / ticklag
- if("tick_limit_mc_init")
- tick_limit_mc_init = text2num(value)
-
if("allow_antag_hud")
config_legacy.antag_hud_allowed = 1
if("antag_hud_restricted")
config_legacy.antag_hud_restricted = 1
- if("socket_talk")
- socket_talk = text2num(value)
-
if("humans_need_surnames")
humans_need_surnames = 1
@@ -603,10 +434,6 @@
if("usealienwhitelist")
usealienwhitelist = 1
- if("alien_player_ratio")
- limitalienplayers = 1
- alien_to_human_ratio = text2num(value)
-
if("assistant_maint")
config_legacy.assistant_maint = 1
@@ -625,22 +452,6 @@
if("uneducated_mice")
config_legacy.uneducated_mice = 1
- if("irc_bot_host")
- config_legacy.irc_bot_host = value
-
- if("main_irc")
- config_legacy.main_irc = value
-
- if("admin_irc")
- config_legacy.admin_irc = value
-
- if("python_path")
- if(value)
- config_legacy.python_path = value
-
- if("use_lib_nudge")
- config_legacy.use_lib_nudge = 1
-
if("allow_cult_ghostwriter")
config_legacy.cult_ghostwriter = 1
@@ -659,21 +470,6 @@
if("max_maint_drones")
config_legacy.max_maint_drones = text2num(value)
- if("use_overmap")
- config_legacy.use_overmap = 1
-/*
- if("station_levels")
- (LEGACY_MAP_DATUM).station_levels = text2numlist(value, ";")
-
- if("admin_levels")
- (LEGACY_MAP_DATUM).admin_levels = text2numlist(value, ";")
-
- if("contact_levels")
- (LEGACY_MAP_DATUM).contact_levels = text2numlist(value, ";")
-
- if("player_levels")
- (LEGACY_MAP_DATUM).player_levels = text2numlist(value, ";")
-*/
if("expected_round_length")
config_legacy.expected_round_length = MinutesToTicks(text2num(value))
@@ -707,26 +503,15 @@
config_legacy.event_delay_upper[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
config_legacy.event_delay_upper[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3])
- if("ert_species")
- config_legacy.ert_species = splittext(value, ";")
- if(!config_legacy.ert_species.len)
- config_legacy.ert_species += SPECIES_HUMAN
-
if("law_zero")
law_zero = value
- if("aggressive_changelog")
- config_legacy.aggressive_changelog = 1
-
if("default_language_prefixes")
var/list/values = splittext(value, " ")
if(values.len > 0)
language_prefixes = values
- if("radiation_lower_limit")
- radiation_lower_limit = text2num(value)
-
- if ("paranoia_logging")
+ if("paranoia_logging")
config_legacy.paranoia_logging = 1
if("minute_click_limit")
@@ -763,18 +548,12 @@
config_legacy.health_threshold_softcrit = value
if("health_threshold_dead")
config_legacy.health_threshold_dead = value
- if("show_human_death_message")
- config_legacy.show_human_death_message = 1
if("revival_pod_plants")
config_legacy.revival_pod_plants = value
if("revival_cloning")
config_legacy.revival_cloning = value
if("revival_brain_life")
config_legacy.revival_brain_life = value
- if("default_brain_health")
- config_legacy.default_brain_health = text2num(value)
- if(!config_legacy.default_brain_health || config_legacy.default_brain_health < 1)
- config_legacy.default_brain_health = initial(config_legacy.default_brain_health)
if("allow_headgibs")
config_legacy.allow_headgibs = TRUE
@@ -799,9 +578,6 @@
if("footstep_volume")
config_legacy.footstep_volume = text2num(value)
- if("use_loyalty_implants")
- config_legacy.use_loyalty_implants = 1
-
else
log_misc("Unknown setting in configuration: '[name]'")
@@ -821,11 +597,3 @@
if(M && M.can_start() && !isnull(config_legacy.probabilities[M.config_tag]) && config_legacy.probabilities[M.config_tag] > 0)
runnable_modes |= M
return runnable_modes
-
-/datum/configuration_legacy/proc/post_load()
- //apply a default value to config_legacy.python_path, if needed
- if (!config_legacy.python_path)
- if(world.system_type == UNIX)
- config_legacy.python_path = "/usr/bin/env python2"
- else //probably windows, if not this should work anyway
- config_legacy.python_path = "python"
diff --git a/code/controllers/configuration_old/configuration_vr.dm b/code/controllers/configuration_old/configuration_vr.dm
deleted file mode 100644
index 3b61d5dd19dd..000000000000
--- a/code/controllers/configuration_old/configuration_vr.dm
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Lets read our settings from the configuration file on startup too!
-//
-
-/datum/configuration_legacy
- var/time_off = FALSE
-
-/hook/startup/proc/read_vs_config()
- var/list/Lines = world.file2list("config/legacy/config.txt")
- for(var/t in Lines)
- if(!t) continue
-
- t = trim(t)
- if (length(t) == 0)
- continue
- else if (copytext(t, 1, 2) == "#")
- continue
-
- var/pos = findtext(t, " ")
- var/name = null
- var/value = null
-
- if (pos)
- name = lowertext(copytext(t, 1, pos))
- value = copytext(t, pos + 1)
- else
- name = lowertext(t)
-
- if (!name)
- continue
-
- switch (name)
- if ("chat_webhook_url")
- config_legacy.chat_webhook_url = value
- if ("chat_webhook_key")
- config_legacy.chat_webhook_key = value
- if ("items_survive_digestion")
- config_legacy.items_survive_digestion = 1
- if ("time_off")
- config_legacy.time_off = TRUE
- return 1
diff --git a/code/controllers/toml_config/entries/backend-logging-toggles.dm b/code/controllers/toml_config/entries/backend-logging-toggles.dm
new file mode 100644
index 000000000000..45e18848b2b2
--- /dev/null
+++ b/code/controllers/toml_config/entries/backend-logging-toggles.dm
@@ -0,0 +1,67 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/datum/toml_config_entry/backend/logging/toggles
+ abstract_type = /datum/toml_config_entry/backend/logging/toggles
+ category = "backend.logging.toggles"
+ vv_locked = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/access
+ key = "access"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/admin
+ key = "admin"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/adminchat
+ key = "adminchat"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/adminwarn
+ key = "adminwarn"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/attack
+ key = "attack"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/debug
+ key = "debug"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/emote
+ key = "emote"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/game
+ key = "game"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/ooc
+ key = "ooc"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/pda
+ key = "pda"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/runtime
+ key = "runtime"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/say
+ key = "say"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/topic
+ key = "topic"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/vote
+ key = "vote"
+ default = TRUE
+
+/datum/toml_config_entry/backend/logging/toggles/whisper
+ key = "whisper"
+ default = TRUE
diff --git a/code/controllers/toml_config/entries/backend-logging.dm b/code/controllers/toml_config/entries/backend-logging.dm
new file mode 100644
index 000000000000..18dc551ba6fd
--- /dev/null
+++ b/code/controllers/toml_config/entries/backend-logging.dm
@@ -0,0 +1,6 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/datum/toml_config_entry/backend/logging
+ abstract_type = /datum/toml_config_entry/backend/logging
+ category = "backend.logging"
diff --git a/code/controllers/toml_config/entries/backend.repository.dm b/code/controllers/toml_config/entries/backend-repository.dm
similarity index 100%
rename from code/controllers/toml_config/entries/backend.repository.dm
rename to code/controllers/toml_config/entries/backend-repository.dm
diff --git a/code/controllers/toml_config/toml_configuration.dm b/code/controllers/toml_config/toml_configuration.dm
index ec2984bcdde6..9efe9d0830ee 100644
--- a/code/controllers/toml_config/toml_configuration.dm
+++ b/code/controllers/toml_config/toml_configuration.dm
@@ -27,6 +27,8 @@ GLOBAL_REAL(Configuration, /datum/controller/toml_configuration)
switch(var_name)
if(NAMEOF(src, keyed_entries))
return FALSE
+ if(NAMEOF(src, typed_entries))
+ return FALSE
return ..()
/datum/controller/toml_configuration/New()
@@ -64,7 +66,7 @@ GLOBAL_REAL(Configuration, /datum/controller/toml_configuration)
* * The value you get will be immediately consumed in a non-VV-able manner.
*/
/datum/controller/toml_configuration/proc/get_sensitive_entry(datum/toml_config_entry/entry_type)
- // todo: cache / optimize
+ // todo: cache / optimize maybe? would help to store everything in a vv-hidden list.
var/datum/toml_config_entry/entry = typed_entries[entry_type]
if(!entry)
return
@@ -79,7 +81,7 @@ GLOBAL_REAL(Configuration, /datum/controller/toml_configuration)
* * The value you are passing in is trusted and validated and not a variable that can be tampered with.
*/
/datum/controller/toml_configuration/proc/set_sensitive_entry(datum/toml_config_entry/entry_type, value)
- // todo: cache / optimize
+ // todo: cache / optimize maybe? would help to store everything in a vv-hidden list.
var/datum/toml_config_entry/entry = typed_entries[entry_type]
if(!entry)
return
@@ -88,7 +90,7 @@ GLOBAL_REAL(Configuration, /datum/controller/toml_configuration)
entry.value = value
/datum/controller/toml_configuration/proc/get_entry(datum/toml_config_entry/entry_type)
- // todo: cache / optimize
+ // todo: cache / optimize maybe? would help to store everything in a vv-hidden list.
var/datum/toml_config_entry/entry = typed_entries[entry_type]
if(!entry)
return
@@ -97,7 +99,7 @@ GLOBAL_REAL(Configuration, /datum/controller/toml_configuration)
return entry.value
/datum/controller/toml_configuration/proc/set_entry(datum/toml_config_entry/entry_type, value)
- // todo: cache / optimize
+ // todo: cache / optimize maybe? would help to store everything in a vv-hidden list.
var/datum/toml_config_entry/entry = typed_entries[entry_type]
if(!entry)
return
diff --git a/code/game/machinery/computer/timeclock_vr.dm b/code/game/machinery/computer/timeclock_vr.dm
index 55f5bf30f726..5c6a922150ec 100644
--- a/code/game/machinery/computer/timeclock_vr.dm
+++ b/code/game/machinery/computer/timeclock_vr.dm
@@ -102,10 +102,11 @@
"pto_department" = job.pto_type,
"is_off_duty" = job.is_off_duty,
)
- if(config_legacy.time_off)
- data["allow_change_job"] = TRUE
- if(job?.is_off_duty) // Currently are Off Duty, so gotta lookup what on-duty jobs are open
- data["job_choices"] = getOpenOnDutyJobs(user, job.pto_type)
+ // nah i don't care for configs worker's rights are human rights too bad
+ // if(config_legacy.time_off)
+ data["allow_change_job"] = TRUE
+ if(job?.is_off_duty) // Currently are Off Duty, so gotta lookup what on-duty jobs are open
+ data["job_choices"] = getOpenOnDutyJobs(user, job.pto_type)
return data
diff --git a/code/game/verbs/who.dm b/code/game/verbs/who.dm
index 2d578a59ddfb..a4b5b53ee4c3 100644
--- a/code/game/verbs/who.dm
+++ b/code/game/verbs/who.dm
@@ -116,9 +116,6 @@
msg += " (Inactive \[10m+\])"
msg += "\n"
-
- if(config_legacy.admin_irc)
- to_chat(src, "Adminhelps are also sent to IRC. If no admins are available in game try anyway and an admin on IRC may see it and respond.")
msg = "Current Admins ([num_admins_online]):\n" + msg
to_chat(src, msg)
diff --git a/code/game/world.dm b/code/game/world.dm
index 7c58816a39c1..4a2834e4322b 100644
--- a/code/game/world.dm
+++ b/code/game/world.dm
@@ -84,14 +84,12 @@ GLOBAL_LIST(topic_status_cache)
// shunt redirected world log from Master's init back into world log proper, now that logging has been set up.
shunt_redirected_log()
- config_legacy.post_load()
-
if(config && config_legacy.server_name != null && config_legacy.server_suffix && world.port > 0)
// dumb and hardcoded but I don't care~
config_legacy.server_name += " #[(world.port % 1000) / 100]"
// TODO - Figure out what this is. Can you assign to world.log?
- // if(config && config_legacy.log_runtime)
+ // if(config && Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/runtime))
// log = file("data/logs/runtime/[time2text(world.realtime,"YYYY-MM-DD-(hh-mm-ss)")]-runtime.log")
GLOB.timezoneOffset = get_timezone_offset()
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index cb32491e575c..a7821e30d8f5 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -629,10 +629,6 @@
to_chat(usr, "You do not have the appropriate permissions to add job bans!")
return
- if(check_rights(R_MOD,0) && !check_rights(R_ADMIN,0) && !config_legacy.mods_can_job_tempban) // If mod and tempban disabled
- to_chat(usr, "Mod jobbanning is disabled!")
- return
-
var/mob/M = locate(href_list["jobban4"])
if(!ismob(M))
to_chat(usr, "This can only be used on instances of type /mob")
@@ -727,9 +723,6 @@
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
if(!mins)
return
- if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > config_legacy.mod_job_tempban_max)
- to_chat(usr, " Moderators can only job tempban up to [config_legacy.mod_job_tempban_max] minutes!")
- return
var/reason = sanitize(input(usr,"Reason?","Please State Reason","") as text|null)
if(!reason)
return
@@ -843,10 +836,6 @@
to_chat(usr, "You do not have the appropriate permissions to add bans!")
return
- if(check_rights(R_MOD,0) && !check_rights(R_ADMIN, 0) && !config_legacy.mods_can_job_tempban) // If mod and tempban disabled
- to_chat(usr, "Mod jobbanning is disabled!")
- return
-
var/target_ckey = href_list["oocban"]
// clients can gc at any time, do not use this outside of getting existing mob
var/client/_existing_client = GLOB.directory[target_ckey]
@@ -900,10 +889,6 @@
to_chat(usr, "You do not have the appropriate permissions to add bans!")
return
- if(check_rights(R_MOD,0) && !check_rights(R_ADMIN, 0) && !config_legacy.mods_can_job_tempban) // If mod and tempban disabled
- to_chat(usr, "Mod jobbanning is disabled!")
- return
-
var/mob/M = locate(href_list["newban"])
if(!ismob(M)) return
@@ -914,9 +899,6 @@
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
if(!mins)
return
- if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > config_legacy.mod_tempban_max)
- to_chat(usr, "Moderators can only job tempban up to [config_legacy.mod_tempban_max] minutes!")
- return
if(mins >= 525600) mins = 525599
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
if(!reason)
diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm
index 7f0f2d1d55ef..e6f754f3357f 100644
--- a/code/modules/admin/verbs/adminpm.dm
+++ b/code/modules/admin/verbs/adminpm.dm
@@ -184,20 +184,6 @@
//always play non-admin recipients the adminhelp sound
SEND_SOUND(recipient, sound('sound/effects/adminhelp.ogg'))
-
- //AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config_legacy.txt ~Carn
- if(config_legacy.popup_admin_pm)
- spawn() //so we don't hold the caller proc up
- var/sender = src
- var/sendername = key
- var/reply = input(recipient, msg,"Admin PM from-[sendername]", "") as message|null //show message and await a reply
- if(recipient && reply)
- if(sender)
- recipient.cmd_admin_pm(sender,reply) //sender is still about, let's reply to them
- else
- adminhelp(reply) //sender has left, adminhelp instead
- return
-
else //neither are admins
to_chat(src, "Error: Admin-PM: Non-admin to non-admin PM communication is forbidden.")
return
diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm
index 4fda1c1a7638..02210dca182f 100644
--- a/code/modules/admin/verbs/possess.dm
+++ b/code/modules/admin/verbs/possess.dm
@@ -5,11 +5,6 @@
if(!O.loc)
return // erm erm erm maybe not?
- if(istype(O,/obj/singularity))
- if(config_legacy.forbid_singulo_possession)
- to_chat(usr, "It is forbidden to possess singularities.")
- return
-
var/turf/T = get_turf(O)
if(T)
diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm
index ccd41948568c..342fe4a2e95f 100644
--- a/code/modules/mob/living/carbon/brain/MMI.dm
+++ b/code/modules/mob/living/carbon/brain/MMI.dm
@@ -60,10 +60,7 @@
if(istype(O,/obj/item/organ/internal/brain) && !brainmob) //Time to stick a brain in it --NEO
var/obj/item/organ/internal/brain/B = O
- if(B.health <= 0)
- to_chat(user, SPAN_WARNING("That brain is well and truly dead."))
- return
- else if(!B.brainmob)
+ if(!B.brainmob)
to_chat(user, SPAN_WARNING("You aren't sure where this brain came from, but you're pretty sure it's useless."))
return
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index d471f5eaf9a2..76a3acafd968 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -187,8 +187,6 @@
)
/mob/living/carbon/human/proc/implant_loyalty(override = FALSE) // Won't override by default.
- if(!config_legacy.use_loyalty_implants && !override) return // Nuh-uh.
-
var/obj/item/implant/loyalty/L = new/obj/item/implant/loyalty(src)
if(L.handle_implant(src, BP_HEAD))
L.post_implant(src)
diff --git a/code/modules/mob/mob-login.dm b/code/modules/mob/mob-login.dm
index 2b8d8a1ea632..b0d204974dc0 100644
--- a/code/modules/mob/mob-login.dm
+++ b/code/modules/mob/mob-login.dm
@@ -109,7 +109,7 @@
lastKnownIP = client.address
computer_id = client.computer_id
log_access_in(client)
- if(config_legacy.log_access)
+ if(Configuration.get_entry(/datum/toml_config_entry/backend/logging/toggles/access))
for(var/mob/M in GLOB.player_list)
if(M == src) continue
if( M.key && (M.key != key) )
diff --git a/code/modules/organs/internal/subtypes/brain.dm b/code/modules/organs/internal/subtypes/brain.dm
index a5bccaad54c0..7e8f46088cbc 100644
--- a/code/modules/organs/internal/subtypes/brain.dm
+++ b/code/modules/organs/internal/subtypes/brain.dm
@@ -13,14 +13,12 @@
throw_range = 5
origin_tech = list(TECH_BIO = 3)
attack_verb = list("attacked", "slapped", "whacked")
- var/health = 400 //They need to live awhile longer than other organs. Is this even used by organ code anymore?
var/clone_source = FALSE
var/mob/living/carbon/brain/brainmob = null
var/can_assist = TRUE
/obj/item/organ/internal/brain/Initialize(mapload, ...)
. = ..()
- health = config_legacy.default_brain_health
addtimer(CALLBACK(src, PROC_REF(clear_brainmob_hud)), 15)
/obj/item/organ/internal/brain/Destroy()
diff --git a/code/modules/species/species_getters.dm b/code/modules/species/species_getters.dm
index 0b7de37c4fcb..48ab79afbb93 100644
--- a/code/modules/species/species_getters.dm
+++ b/code/modules/species/species_getters.dm
@@ -98,10 +98,7 @@
return ((H && H.isSynthetic()) ? "encounters a hardware fault and suddenly reboots!" : knockout_message)
/datum/species/proc/get_death_message(mob/living/carbon/human/H)
- if(config_legacy.show_human_death_message)
- return ((H && H.isSynthetic()) ? "gives one shrill beep before falling lifeless." : death_message)
- else
- return "no message"
+ return ((H && H.isSynthetic()) ? "gives one shrill beep before falling lifeless." : death_message)
/datum/species/proc/get_ssd(mob/living/carbon/human/H)
if(H)
diff --git a/config.default/config.toml b/config.default/config.toml
index d95a377f9c1e..6d5305501ef8 100644
--- a/config.default/config.toml
+++ b/config.default/config.toml
@@ -1,2 +1,19 @@
+[[backend.logging.toggles]]
+ access = true
+ admin = true
+ adminchat = true
+ adminwarn = true
+ attack = true
+ debug = true
+ emote = true
+ game = true
+ ooc = true
+ pda = true
+ runtime = true
+ say = true
+ topic = true
+ vote = true
+ whisper = true
+
[[backend.repository]]
persistence = true
diff --git a/tools/minibot/LICENCE-bot_folder.txt b/tools/minibot/LICENCE-bot_folder.txt
deleted file mode 100644
index 22dfb2546003..000000000000
--- a/tools/minibot/LICENCE-bot_folder.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-The author or authors of this code dedicate any and all copyright interest in
-this code to the public domain. We make this dedication for the benefit of the
-public at large and to the detriment of our heirs and successors. We intend
-this dedication to be an overt act of relinquishment in perpetuity of all
-present and future rights to this code under copyright law.
diff --git a/tools/minibot/config.py b/tools/minibot/config.py
deleted file mode 100644
index 8888753ab715..000000000000
--- a/tools/minibot/config.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Configuration for the minibot.py bot starts here
-server = "irc.rizon.net"
-port = 6667
-
-channels = ["#asdfgbus", "#botbus"]
-defaultchannel = "#asdfgbus"
-
-nick = "minibot-testing-ss13"
-altnick = "minibot-testing-ss13_"
-name = "minibot"
-ident = "minibot"
-realname = "minibot"
-password = "CHANGETHIS"
-# Configuration ends here
diff --git a/tools/minibot/minibot.py b/tools/minibot/minibot.py
deleted file mode 100644
index 92192c0264c3..000000000000
--- a/tools/minibot/minibot.py
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/usr/bin/env python3
-# This bot was made by tkdrg.
-# Ask #coderbus@irc.rizon.net if this breaks.
-# See LICENSE-bot_folder.txt for the license of the files in this folder.
-from config import *
-import collections
-import time
-import pickle
-import socket
-import sys
-import threading
-import logging
-import logging.handlers as handlers
-import signal
-
-global irc
-
-# Set to false when we've been killed
-running = True
-# times we've attempted to connect to server
-con_attempts = 0
-
-## Set up a logger object
-logger = logging.getLogger('minibot')
-logger.setLevel(logging.DEBUG)
-
-# create a file handler (rolls over midnight, keeps 7 days of log
-handler = handlers.TimedRotatingFileHandler('minibot.log', when='midnight', backupCount=7)
-# most verbose
-handler.setLevel(logging.DEBUG)
-
-#only send errors/notifications to the terminal
-iohandler = logging.StreamHandler()
-iohandler.setLevel(logging.INFO)
-
-# create a logging format
-#time - name - level - message (string)
-formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s', datefmt='%Y-%m-%d %H:%M')
-handler.setFormatter(formatter)
-iohandler.setFormatter(formatter)
-
-#finally attach them to the logger object
-logger.addHandler(handler)
-logger.addHandler(iohandler)
-
-
-def setup_irc_socket():
- global irc, running, con_attempts, logger
- s = socket.socket()
- s.settimeout(240)
- #why not reuse running here? because we want to break this loop if someone sigkills us
- connected = False
- while running and con_attempts < 3 and not connected:
- try:
- s.connect((server, port))
- except socket.error:
- logger.exception("Unable to connect to server {0}:{1}, attempting to reconnect in 20 seconds, Attempt number:{2}".format(server, port, con_attempts))
- con_attempts += 1
- time.sleep(20)
- continue
-
- logger.info("Connection established to server {0}:{1}.".format(server, port))
- connected = True
-
- if connected:
- s.send(bytes("NICK {0}\r\n".format(nick), "UTF-8"))
- s.send(bytes("USER {0} {1} {2} :{3}\r\n".format(ident, server, name, realname), "UTF-8"))
- else:
- logger.error("Unable to connect, shutting down")
- running = False
- return s
-
-
-def setup_nudge_socket():
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.bind(("", 45678)) # localhost:nudge_port
- s.listen(5)
- logger.info("Nudge socket up and listening")
- return s
-
-
-def nudge_handler():
- global irc, running, con_attempts, logger
- nudge = setup_nudge_socket()
- message_queue = collections.deque()
- while running:
- if len(message_queue):
- message = message_queue.popleft()
- else:
- try:
- s, ip = nudge.accept()
- except:
- logger.exception("Nudge socket lost, attempting to reopen.")
- nudge = setup_nudge_socket()
- continue
- rawdata = s.recv(1024)
- s.close()
- data = pickle.loads(rawdata)
- logger.debug(data)
- if data["ip"][0] == "#":
- message = "{0} :AUTOMATIC ANNOUNCEMENT : {1}\r\n".format(data["ip"], str(" ".join(data["data"])))
- else:
- message = "{0} :AUTOMATIC ANNOUNCEMENT : {1} | {2}\r\n".format(defaultchannel, data["ip"], str(" ".join(data["data"])))
- try:
- irc.send(bytes("PRIVMSG {0}".format(message), "UTF-8"))
- except:
- logger.exception("Nudge received without IRC socket, appending to queue.")
- logger.debug("Message: {0}".format(message))
- message_queue.append(message)
-
-
-def irc_handler():
- global irc, running, con_attempts, logger
- while running:
- try:
- buf = irc.recv(1024).decode("UTF-8").split("\n")
- for i in buf:
- logger.debug(i)
- if i[0:4] == "PING":
- irc.send(bytes("PONG {0}\r\n".format(i[5:]), "UTF-8"))
- else:
- l = i.split(" ")
- if len(l) < 2:
- continue
- elif l[1] == "001":
- logger.info("connected and registered, identifing and joining channels")
- irc.send(bytes("PRIVMSG NickServ :IDENTIFY {0}\r\n".format(password), "UTF-8"))
- time.sleep(1)
- for channel in channels:
- irc.send(bytes("JOIN {0}\r\n".format(channel), "UTF-8"))
- elif l[1] == "477":
- logger.error("Error: Nickname was not registered when joining {0}. Reauthing and retrying...".format(l[3]))
- irc.send(bytes("PRIVMSG NickServ :IDENTIFY {0}\r\n".format(password), "UTF-8"))
- time.sleep(5)
- irc.send(bytes("JOIN {0}\r\n".format(l[3]), "UTF-8"))
- elif l[1] == "433":
- logger.error("Error: Nickname already in use. Attempting to use alt nickname if available, sleeping 60s otherwise...")
- if(altnick):
- irc.send(bytes("NICK {0}\r\n".format(altnick), "UTF-8"))
- else:
- time.sleep(60)
- irc = setup_irc_socket()
- except InterruptedError as e:
- logger.exception("Interrupted, probably killed.")
- continue
- except:
- logger.exception("Lost connection to IRC server.")
- irc = setup_irc_socket()
-
-def signal_handler(signum, frame):
- global irc, running, con_attempts, logger
- logger.info("Recieved term kill, closing")
- running = False
-
-if __name__ == "__main__":
- #listen to signals (quit on ctrl c or kill from OS)
- signal.signal(signal.SIGINT, signal_handler)
- irc = setup_irc_socket()
- t = threading.Thread(target=nudge_handler)
- t.daemon = True
- t.start()
- irc_handler()
diff --git a/tools/minibot/nudge.py b/tools/minibot/nudge.py
deleted file mode 100644
index 7f195adae167..000000000000
--- a/tools/minibot/nudge.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python3
-import sys
-import pickle
-import socket
-
-
-def pack():
- ip = sys.argv[1]
- try:
- data = sys.argv[2:]
- except:
- data = "NO DATA SPECIFIED"
-
- nudge(pickle.dumps({"ip": ip, "data": data}))
-
-
-def nudge(data):
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.connect(("localhost", 45678))
- s.send(data)
- s.close()
-
-if __name__ == "__main__" and len(sys.argv) > 1:
- pack()