mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 21:12:24 +01:00
Discord over IRC
Converts and replaces all IRC centric procs, vars, etcetera, into discord centric ones.
This commit is contained in:
+1
-1
@@ -1036,7 +1036,7 @@
|
||||
#include "code\modules\examine\descriptions\structures.dm"
|
||||
#include "code\modules\examine\descriptions\turfs.dm"
|
||||
#include "code\modules\examine\descriptions\weapons.dm"
|
||||
#include "code\modules\ext_scripts\irc.dm"
|
||||
#include "code\modules\ext_scripts\discord.dm"
|
||||
#include "code\modules\ext_scripts\python.dm"
|
||||
#include "code\modules\flufftext\Dreaming.dm"
|
||||
#include "code\modules\flufftext\Hallucination.dm"
|
||||
|
||||
@@ -168,12 +168,10 @@ var/list/gamemode_cache = list()
|
||||
|
||||
var/enter_allowed = 1
|
||||
|
||||
var/use_irc_bot = 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_discord_bot = 0
|
||||
var/discord_bot_host = "localhost"
|
||||
var/discord_bot_port = 0
|
||||
var/python_path = "python" //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
|
||||
|
||||
@@ -522,12 +520,6 @@ var/list/gamemode_cache = list()
|
||||
if("allow_holidays")
|
||||
Holiday = 1
|
||||
|
||||
if("use_irc_bot")
|
||||
use_irc_bot = 1
|
||||
|
||||
if("irc_bot_export")
|
||||
irc_bot_export = 1
|
||||
|
||||
if("ticklag")
|
||||
Ticklag = text2num(value)
|
||||
|
||||
@@ -579,14 +571,14 @@ var/list/gamemode_cache = list()
|
||||
if("comms_password")
|
||||
config.comms_password = value
|
||||
|
||||
if("irc_bot_host")
|
||||
config.irc_bot_host = value
|
||||
if("use_discord_bot")
|
||||
config.use_discord_bot = 1
|
||||
|
||||
if("main_irc")
|
||||
config.main_irc = value
|
||||
if("discord_bot_host")
|
||||
config.discord_bot_host = value
|
||||
|
||||
if("admin_irc")
|
||||
config.admin_irc = value
|
||||
if("discord_bot_port")
|
||||
config.discord_bot_port = value
|
||||
|
||||
if("python_path")
|
||||
if(value)
|
||||
|
||||
@@ -440,8 +440,6 @@ var/global/list/additional_antag_types = list()
|
||||
if(escaped_on_pod_5 > 0)
|
||||
feedback_set("escaped_on_pod_5",escaped_on_pod_5)
|
||||
|
||||
send2mainirc("A round of [src.name] has ended - [surviving_total] survivors, [ghosts] ghosts.")
|
||||
|
||||
return 0
|
||||
|
||||
/datum/game_mode/proc/check_win() //universal trigger to be called at mob death, nuke explosion, etc. To be called from everywhere.
|
||||
|
||||
@@ -144,10 +144,10 @@ var/global/datum/controller/gameticker/ticker
|
||||
|
||||
var/admins_number = 0
|
||||
for(var/client/C)
|
||||
if(C.holder)
|
||||
if(C.holder && (C.holder.rights & (R_MOD|R_ADMIN)))
|
||||
admins_number++
|
||||
if(admins_number == 0)
|
||||
send2adminirc("Round has started with no admins online.")
|
||||
send_to_admin_discord("@everyone Round has started with no admins online.")
|
||||
|
||||
/* supply_controller.process() //Start the supply shuttle regenerating points -- TLE // handled in scheduler
|
||||
master_controller.process() //Start master_controller.process()
|
||||
|
||||
@@ -151,8 +151,8 @@
|
||||
cciaamsg += "\t[C] is a [C.holder.rank]\n"
|
||||
num_cciaa_online++
|
||||
|
||||
if(config.admin_irc)
|
||||
src << "<span class='info'>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.</span>"
|
||||
if(config.use_discord_bot)
|
||||
src << "<span class='info'>Adminhelps are also sent to Discord. If no admins are available in game try anyway and an admin on Discord may see it and respond.</span>"
|
||||
msg = "<b>Current Admins ([num_admins_online]):</b>\n" + msg
|
||||
|
||||
if(config.show_mods)
|
||||
|
||||
@@ -116,8 +116,6 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
|
||||
var/admin_number_present = admins.len - admin_number_afk
|
||||
log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins.")
|
||||
if(admin_number_present <= 0)
|
||||
send2adminirc("Request for Help from [key_name(src)]: [html_decode(original_msg)] - !![admin_number_afk ? "All admins AFK ([admin_number_afk])" : "No admins online"]!!")
|
||||
else
|
||||
send2adminirc("Request for Help from [key_name(src)]: [html_decode(original_msg)]")
|
||||
send_to_admin_discord("@everyone Request for Help from [key_name(src)]: [html_decode(original_msg)] - !![admin_number_afk ? "All admins AFK ([admin_number_afk])" : "No admins online"]!!")
|
||||
feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
@@ -108,7 +108,6 @@
|
||||
C << 'sound/effects/adminhelp.ogg'
|
||||
|
||||
log_admin("PM: [key_name(src)]->[key_name(C)]: [msg]")
|
||||
send2adminirc("Reply: [key_name(src)]->[key_name(C)]: [html_decode(msg)]")
|
||||
|
||||
//we don't use message_admins here because the sender/receiver might get it too
|
||||
for(var/client/X in admins)
|
||||
@@ -118,31 +117,25 @@
|
||||
if(X.key != key && X.key != C.key && (X.holder.rights & (R_ADMIN|R_MOD)))
|
||||
X << "<span class='pm'><span class='other'>" + create_text_tag("pm_other", "PM:", X) + " <span class='name'>[key_name(src, X, 0)]</span> to <span class='name'>[key_name(C, X, 0)]</span>: <span class='message'>[msg]</span></span></span>"
|
||||
|
||||
/client/proc/cmd_admin_irc_pm(sender)
|
||||
/client/proc/cmd_admin_discord_pm(sender)
|
||||
if(prefs.muted & MUTE_ADMINHELP)
|
||||
src << "<font color='red'>Error: Private-Message: You are unable to use PM-s (muted).</font>"
|
||||
return
|
||||
|
||||
var/msg = input(src,"Message:", "Reply private message to [sender] on IRC / 400 character limit") as text|null
|
||||
var/msg = input(src,"Message:", "Reply private message to [sender] on Discord") as text|null
|
||||
|
||||
if(!msg)
|
||||
return
|
||||
|
||||
sanitize(msg)
|
||||
|
||||
// Handled on Bot32's end, unsure about other bots
|
||||
// if(length(msg) > 400) // TODO: if message length is over 400, divide it up into seperate messages, the message length restriction is based on IRC limitations. Probably easier to do this on the bots ends.
|
||||
// src << "<span class='warning'>Your message was not sent because it was more then 400 characters find your message below for ease of copy/pasting</span>"
|
||||
// src << "\blue [msg]</span>"
|
||||
// return
|
||||
send_to_admin_discord("PlayerPM to [sender] from [key_name(src)]: [html_decode(msg)]")
|
||||
|
||||
send2adminirc("PlayerPM to [sender] from [key_name(src)]: [html_decode(msg)]")
|
||||
src << "<span class='pm'><span class='out'>" + create_text_tag("pm_out_alt", "", src) + " to <span class='name'>Discord-[sender]</span>: <span class='message'>[msg]</span></span></span>"
|
||||
|
||||
src << "<span class='pm'><span class='out'>" + create_text_tag("pm_out_alt", "", src) + " to <span class='name'>IRC-[sender]</span>: <span class='message'>[msg]</span></span></span>"
|
||||
|
||||
log_admin("PM: [key_name(src)]->IRC-[sender]: [msg]")
|
||||
log_admin("PM: [key_name(src)]->Discord-[sender]: [msg]")
|
||||
for(var/client/X in admins)
|
||||
if(X == src)
|
||||
continue
|
||||
if(X.holder.rights & (R_ADMIN|R_MOD))
|
||||
X << "<span class='pm'><span class='other'>" + create_text_tag("pm_other", "PM:", X) + " <span class='name'>[key_name(src, X, 0)]</span> to <span class='name'>IRC-[sender]</span>: <span class='message'>[msg]</span></span></span>"
|
||||
X << "<span class='pm'><span class='other'>" + create_text_tag("pm_other", "PM:", X) + " <span class='name'>[key_name(src, X, 0)]</span> to <span class='name'>Discord-[sender]</span>: <span class='message'>[msg]</span></span></span>"
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
else if (R_CCIAA & C.holder.rights)
|
||||
C << msg_cciaa
|
||||
|
||||
send_to_cciaa_discord("!!! @everyone - Emergency message from the station: \"[msg]\", sent by [Sender] !!!")
|
||||
|
||||
/proc/Syndicate_announce(var/msg, var/mob/Sender)
|
||||
msg = "\blue <b><font color=crimson>ILLEGAL:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;SyndicateReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
|
||||
for(var/client/C in admins)
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
// comment out the line below when debugging locally to enable the options & messages menu
|
||||
//control_freak = 1
|
||||
|
||||
var/received_irc_pm = -99999
|
||||
var/irc_admin //IRC admin that spoke with them last.
|
||||
var/mute_irc = 0
|
||||
var/received_discord_pm = -99999
|
||||
var/discord_admin //IRC- no more IRC, K? Discord admin that spoke with them last.
|
||||
var/mute_discord = 0
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
|
||||
@@ -45,14 +45,14 @@
|
||||
cmd_admin_pm(C,null)
|
||||
return
|
||||
|
||||
if(href_list["irc_msg"])
|
||||
if(!holder && received_irc_pm < world.time - 6000) //Worse they can do is spam IRC for 10 minutes
|
||||
usr << "<span class='warning'>You are no longer able to use this, it's been more then 10 minutes since an admin on IRC has responded to you</span>"
|
||||
if(href_list["discord_msg"])
|
||||
if(!holder && received_discord_pm < world.time - 6000) //Worse they can do is spam IRC for 10 minutes
|
||||
usr << "<span class='warning'>You are no longer able to use this, it's been more then 10 minutes since an admin on Discord has responded to you</span>"
|
||||
return
|
||||
if(mute_irc)
|
||||
usr << "<span class='warning'You cannot use this as your client has been muted from sending messages to the admins on IRC</span>"
|
||||
if(mute_discord)
|
||||
usr << "<span class='warning'You cannot use this as your client has been muted from sending messages to the admins on Discord</span>"
|
||||
return
|
||||
cmd_admin_irc_pm(href_list["irc_msg"])
|
||||
cmd_admin_discord_pm(href_list["discord_msg"])
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
message_admins("Admin logout: [key_name(src)]")
|
||||
if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell.
|
||||
send2adminirc("[key_name(src)] logged out - no more admins online.")
|
||||
send_to_admin_discord("@everyone [key_name(src)] logged out - no more admins online.")
|
||||
..()
|
||||
|
||||
return 1
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user