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

[WIP] NTSL and Signal Technician #1945

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions code/__DEFINES/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@
ACCESS_MINISAT, \
ACCESS_RC_ANNOUNCE, \
ACCESS_TCOMMS, \
ACCESS_TCOM_ADMIN, \
ACCESS_TECH_STORAGE, \
ACCESS_TELEPORTER, \
ACCESS_VAULT, \
Expand Down Expand Up @@ -486,6 +487,7 @@
ACCESS_MINISAT, \
ACCESS_TCOMMS, \
ACCESS_TECH_STORAGE, \
ACCESS_TCOM_ADMIN, \
)
/// Name for the Supply region.
#define REGION_SUPPLY "Supply"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
#define JOB_DISPLAY_ORDER_CHIEF_ENGINEER 16
#define JOB_DISPLAY_ORDER_STATION_ENGINEER 17
#define JOB_DISPLAY_ORDER_ATMOSPHERIC_TECHNICIAN 18
#define JOB_DISPLAY_ORDER_SIGNAL_TECHNICIAN 18.5 // NTSL. Scream at me if you hate this, but I'm keeping it as modular as I can - Kitsunemitsu
#define JOB_DISPLAY_ORDER_QUARTERMASTER 19
#define JOB_DISPLAY_ORDER_CARGO_TECHNICIAN 20
#define JOB_DISPLAY_ORDER_SHAFT_MINER 21
Expand Down
3 changes: 2 additions & 1 deletion code/__DEFINES/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#define LOG_CLONING (1 << 22)
#define LOG_MECHCOMP (1 << 23)
#define LOG_BLACKMARKET (1 << 24)
#define LOG_NTSL (1 << 20)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have a 1<<20 needs to be 1<<25

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure I changed this; will fix.


//Individual logging panel pages
#define INDIVIDUAL_GAME_LOG (LOG_GAME)
Expand All @@ -60,7 +61,7 @@
#define INDIVIDUAL_COMMS_LOG (LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS)
#define INDIVIDUAL_OOC_LOG (LOG_OOC | LOG_ADMIN)
#define INDIVIDUAL_OWNERSHIP_LOG (LOG_OWNERSHIP)
#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_RADIO_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME | LOG_ADMIN_PRIVATE | LOG_ASAY | LOG_MECHA | LOG_VIRUS | LOG_SHUTTLE | LOG_ECON | LOG_VICTIM | LOG_SPEECH_INDICATORS | LOG_CLONING)
#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_RADIO_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME | LOG_ADMIN_PRIVATE | LOG_ASAY | LOG_MECHA | LOG_VIRUS | LOG_SHUTTLE | LOG_ECON | LOG_VICTIM | LOG_SPEECH_INDICATORS | LOG_CLONING | LOG_NTSL)

#define LOGSRC_CKEY "Ckey"
#define LOGSRC_MOB "Mob"
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/~monkestation/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

/// Access to permabrig. [ACCESS_BRIG] also grants permabrig access, this is just for ONLY permabrig accesss, for security assistants.
#define ACCESS_PERMABRIG "permabrig"

/// Access to the NTSL console. It's important because only like 3 people should have access to this
#define ACCESS_TCOM_ADMIN "tcomms_admin"
2 changes: 2 additions & 0 deletions code/__DEFINES/~monkestation/jobs.dm
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#define JOB_SECURITY_ASSISTANT "Security Assistant"

#define JOB_SIGNAL_TECH "Signal Technician"
4 changes: 4 additions & 0 deletions code/datums/chatmessage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@
speaker = v.source
spans |= "virtual-speaker"

// NTSL doesn't pass a speaker when you do broadcast() since technically nothing is actually speaking.
if (!speaker)
return

// Ignore virtual speaker (most often radio messages) from ourself
if (originalSpeaker != src && speaker == src)
return
Expand Down
1 change: 1 addition & 0 deletions code/datums/id_trim/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
ACCESS_RC_ANNOUNCE,
ACCESS_TCOMMS,
ACCESS_TECH_STORAGE,
ACCESS_TCOM_ADMIN,
)
minimal_wildcard_access = list(
ACCESS_CE,
Expand Down
11 changes: 8 additions & 3 deletions code/game/machinery/telecomms/broadcasting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
datum/language/language, // the language of the message
message, // the text content of the message
spans, // the list of spans applied to the message
list/message_mods // the list of modification applied to the message. Whispering, singing, ect
list/message_mods, // the list of modification applied to the message. Whispering, singing, ect
lvls // NTSL. It's the list of Z-levels that should hear this message
)
src.source = source
src.frequency = frequency
Expand All @@ -118,8 +119,12 @@
"spans" = spans,
"mods" = message_mods
)
var/turf/T = get_turf(source)
levels = list(T.z)
//NTSL
if(lvls)
levels = lvls
else
var/turf/T = get_turf(source)
levels = list(T.z)

/datum/signal/subspace/vocal/copy()
var/datum/signal/subspace/vocal/copy = new(source, frequency, virt, language)
Expand Down
6 changes: 6 additions & 0 deletions code/game/machinery/telecomms/machines/server.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
if (log_entries.len >= 400)
log_entries.Cut(1, 2)

signal.data["server"] = src;

// Don't create a log if the frequency is banned from being logged
if(!(signal.frequency in banned_frequencies))
var/datum/comm_log_entry/log = new
Expand All @@ -51,6 +53,10 @@
log.name = "data packet ([md5(identifier)])"
log_entries.Add(log)

//Run the damn NTSL code
if(Compiler && autoruncode)
Compiler.Run(signal)

var/can_send = relay_information(signal, /obj/machinery/telecomms/hub)
if(!can_send)
relay_information(signal, /obj/machinery/telecomms/broadcaster)
Expand Down
8 changes: 7 additions & 1 deletion code/game/machinery/telecomms/telecomunications.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ GLOBAL_LIST_EMPTY(telecomms_list)
if(!on)
return

//Make sure the NTSL shit actually has a path
if(filter && !ispath(filter))
CRASH("relay_information() was given a path filter that wasn't actually a path!")


if(!filter || !ispath(filter, /obj/machinery/telecomms))
CRASH("null or non /obj/machinery/telecomms typepath given as the filter argument! given typepath: [filter]")

Expand All @@ -67,8 +72,9 @@ GLOBAL_LIST_EMPTY(telecomms_list)
signal.data["slow"] = netlag

// Loop through all linked machines and send the signal or copy.
for(var/m_typeless in links_by_telecomms_type?[filter]) //Not sure what this does, and I don't really want to read it, I just ported this. Related to NTSL - Kitsunemitsu
var/obj/machinery/telecomms/filtered_machine = m_typeless

for(var/obj/machinery/telecomms/filtered_machine in links_by_telecomms_type?[filter])
if(!filtered_machine.on)
continue
if(amount && send_count >= amount)
Expand Down
31 changes: 28 additions & 3 deletions code/game/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ GLOBAL_LIST_INIT(freqtospan, list(
var/spanpart2 = "<span class='name'>"
//Radio freq/name display
var/freqpart = radio_freq ? "\[[get_radio_name(radio_freq)]\] " : ""
//For NTSL and AI tracking
var/realnamepart = "[speaker.GetVoice(TRUE)][speaker.get_alt_name()]"
//Speaker name
var/namepart = "[speaker.GetVoice()][speaker.get_alt_name()]"
if(face_name && ishuman(speaker))
Expand All @@ -105,8 +107,8 @@ GLOBAL_LIST_INIT(freqtospan, list(
else if(visible_name && ishuman(speaker))
var/mob/living/carbon/human/human_speaker = speaker
namepart = "[human_speaker.get_visible_name()]"
//End name span.
var/endspanpart = "</span>"
//End name span. Small NTSL change
var/endspanpart = "</span></a>"

//Message
var/messagepart
Expand All @@ -122,7 +124,8 @@ GLOBAL_LIST_INIT(freqtospan, list(

messagepart = " <span class='message'>[say_emphasis(messagepart)]</span></span>"

return "[spanpart1][spanpart2][freqpart][languageicon][compose_track_href(speaker, namepart)][namepart][compose_job(speaker, message_language, raw_message, radio_freq)][endspanpart][messagepart]"
//Make sure that you're sending all the parts of the message, including the NTSL parts
return "[spanpart1][spanpart2][freqpart][languageicon][compose_track_href(speaker, realnamepart)][namepart][compose_job(speaker, message_language, raw_message, radio_freq)][endspanpart][messagepart]"

/atom/movable/proc/compose_track_href(atom/movable/speaker, message_langs, raw_message, radio_freq)
return ""
Expand Down Expand Up @@ -182,6 +185,10 @@ GLOBAL_LIST_INIT(freqtospan, list(
if(!language)
return "makes a strange sound."

//Make sure that you are properly sending language across too
if(isnum(language))
language = NTSL_LANG_TODATUM(language)

if(!has_language(language))
var/datum/language/dialect = GLOB.language_datum_instances[language]
raw_message = dialect.scramble(raw_message)
Expand Down Expand Up @@ -235,6 +242,7 @@ GLOBAL_LIST_INIT(freqtospan, list(
//VIRTUALSPEAKERS
/atom/movable/virtualspeaker
var/job
var/realvoice //NTSL, Gives an extra UUID
var/atom/movable/source
var/obj/item/radio/radio

Expand All @@ -245,6 +253,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/virtualspeaker)
source = M
if(istype(M))
name = radio.anonymize ? "Unknown" : M.GetVoice()
realvoice = M.GetVoice() //NTSL. Taking use of the new UUID
verb_say = M.verb_say
verb_ask = M.verb_ask
verb_exclaim = M.verb_exclaim
Expand Down Expand Up @@ -276,8 +285,24 @@ INITIALIZE_IMMEDIATE(/atom/movable/virtualspeaker)
/atom/movable/virtualspeaker/GetJob()
return job

/atom/movable/virtualspeaker/GetVoice(bool)
if(bool && realvoice)
return realvoice
else
return "[src]"

// Commented out because this was causing NTSL to not properly be capable of editing verb_say & al.
// However, I don't exactly know why it was even in here in the first place, so,
// if there's some weird bugs involving virtualspeaker, check here first.
/*
/atom/movable/virtualspeaker/GetSource()
return source
*/

//Comment from 3 years after this was first ported:
//I have no fuckign clue what this does still, nor am I really going to learn.
//If this seriously breaks anything, and I doubt it will because no one ever touches T-Comms code (and with good reason)
//notify Kitsunemitsu.

/atom/movable/virtualspeaker/GetRadio()
return radio
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/ai/ai_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
return ..()

/mob/living/silicon/ai/compose_track_href(atom/movable/speaker, namepart)
var/mob/M = speaker.GetSource()
var/mob/M = speaker.GetJob() //Dont' get source. Get Job - NTSL
if(M)
return "<a href='?src=[REF(src)];track=[html_encode(namepart)]'>"
return ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@
/datum/computer_file/program/supermatter_monitor,
)

/obj/item/modular_computer/pda/signal
name = "signal PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick
greyscale_colors = "#D99A2E#0EC220#727272"
starting_programs = list(
)

/obj/item/modular_computer/pda/atmos
name = "atmospherics PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick
Expand Down
Binary file modified icons/obj/card.dmi
Binary file not shown.
95 changes: 95 additions & 0 deletions interface/skin.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,98 @@ window "tgui_say"
anchor2 = 0,0
saved-params = ""


window "Telecomms IDE"
elem "Telecomms IDE"
type = MAIN
pos = 281,0
size = 569x582
anchor1 = none
anchor2 = none
text-color = #eeeeee
background-color = #222222
is-visible = false
saved-params = "pos;size;is-minimized;is-maximized"
title = "TCS IDE"
statusbar = false
on-close = "exittcs"
elem "button5"
type = BUTTON
pos = 209,464
size = 70x20
anchor1 = 37,80
anchor2 = 49,83
text-color = #eeeeee
background-color = #555555
saved-params = "is-checked"
text = "Clear Memory"
command = "tcsclearmem"
elem "button4"
type = BUTTON
pos = 157,464
size = 52x20
anchor1 = 28,80
anchor2 = 37,83
text-color = #eeeeee
background-color = #555555
saved-params = "is-checked"
text = "Revert"
command = "tcsrevert"
elem "button3"
type = BUTTON
pos = 105,464
size = 52x20
anchor1 = 18,80
anchor2 = 28,83
text-color = #eeeeee
background-color = #555555
saved-params = "is-checked"
text = "Execute"
command = "tcsrun"
elem "tcserror"
type = OUTPUT
pos = 0,488
size = 566x94
anchor1 = 0,84
anchor2 = 99,100
font-family = "sans-serif"
font-size = 9
text-color = #eeeeee
background-color = #333334
saved-params = "max-lines"
elem "button2"
type = BUTTON
pos = 53,464
size = 52x20
anchor1 = 9,80
anchor2 = 18,83
text-color = #eeeeee
background-color = #555555
saved-params = "is-checked"
text = "Compile"
command = "tcscompile"
elem "button1"
type = BUTTON
pos = 0,464
size = 53x20
anchor1 = 0,80
anchor2 = 9,83
text-color = #eeeeee
background-color = #555555
saved-params = "is-checked"
text = "Save"
command = "tcssave"
elem "tcscode"
type = INPUT
pos = 0,0
size = 569x464
anchor1 = 0,0
anchor2 = 100,80
font-family = "Courier"
font-size = 10
text-color = #eeeeee
background-color = #333334
saved-params = ""
command = "cancel"
multi-line = true
no-command = true
3 changes: 3 additions & 0 deletions monkestation/code/modules/NTSL/code/_HELPERS/_logging.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/proc/log_ntsl(text)
if (CONFIG_GET(flag/log_ntsl))
WRITE_LOG(GLOB.world_ntsl_log, "NTSL: [text]")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should use the new logging system with Logger.Log

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GLOBAL_LIST_EMPTY(traffic_comps)
2 changes: 2 additions & 0 deletions monkestation/code/modules/NTSL/code/_globalvars/logging.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GLOBAL_VAR(world_ntsl_log)
GLOBAL_PROTECT(world_ntsl_log)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/datum/config_entry/flag/log_ntsl // log NTSL compilation
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/obj/machinery/computer/telecomms/server/Initialize()
.=..()
light_color = LIGHT_COLOR_GREEN
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/obj/machinery/computer/telecomms/monitor/Initialize()
.=..()
light_color = LIGHT_COLOR_GREEN
Loading
Loading