mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-29 03:21:30 +00:00
* tgui the beginning * binaries and the like * Bring in the last of it * Example radio UI * delete example * NTOS Main Menu, start on manifest, tgui states * tasks.json * gunnery ui pt 1 * okay * fix everything * scss update * oops * manifest gigablast * downloader part 1 * download prt 2 * NTOSDownloader final * mfw committing to_worlds * gunnery console pt2 * i cooked * targeting (finished) * one vueui down * voting ui almost done * MY MIND FEELS LIKE AN ARCH ENEMYYYY * voting ui down * photocopier * ntos config + download fixes * photocopier 2 * refactor define * NTOS client manager + fixes * fax machine final (it also uses toner now) * marching forwards... left behind... * ntnrc part 1 * canister * add quotes * portable pumps pt1 + more backgrounds * oops * finish the portable pump * freezers so I'll keep on pushing forward... you haven't seen the last of me... oooooooh... * doors ui pt1 * finish doors UI (forgive me wildkins it's a bit of shitcode) * vitals monitor, make things use labeled lists, new backgrounds * mais j'envoyé aucun mayday... * maglock pt1 * pour ça je me suis perdu... * infrared * fix that * prox sensor pt1 * prox sensor * signaler (this was actually pretty hard) * atmos control pt1 * atmos control pt1.1 * atmos pt 2 * fuel injector * multitool UI * jammer * list viewer * APC * portgen * targeting console updates + SMES ui * new themes, shield generator * supermatter * Add ore detector and (shitty) NTNet Relay * orderterminal pt1 * orderterminal pt2 * smartfridge * Add (air-)tank GUI update ore detector size * Adds Transfer Valves * Add AtmoScrubber * analyzer pt1 * weapons analyzer pt2 * bodyscanner pt1 * bodyscanner pt2 * fix this shitcode * seed storage * appearance changer * appearance changer final * sleeper pt1 * sleeper * gps * vehicles * chem dispenser * lily request * holopad * tgui modules pt1 * ppanel * damage menu * fixes * im here too now * follow menu, search bars * quikpay * quikpay fixes * circuit printer * ppanel * ppanel updates * pai * turret controls (i want to kill myself) * tweak * remove the boardgame * guntracker * implant tracker * penal mechs come close to me, come close to me * chem codex * pai radio * doorjack * pai directives * signaler removal, sensors * ghost spawner * spawnpoint * fixes * teleporter * one more to the chopping block * account database * remove divider * scanner, atmos * latejoin ui pt1 * latejoin * records pt1 * RECORDS UI DONE * delete interpreter & records * CHAT FUCKING CLIENT * data updates * fix some things * final UI, log * basic nanoui fix * antag panel * remove vueui * atm update * vending update * warrants, cameras * ntmonitor * time comes for all * preserve this legacy * bring that back (oops) * rcon, ui auto update for computer UIs, remove rcon computers * alarm monitoring (a bit broke and also todo: add custom alarm monitoring programs to a few consoles) * A LIKE SUPREME * a * power monitor * lights on * fuck this code, fuck nanoui modules, and fuck nanoui * LEAVE IT OH SO FAR BEHIND * fix alarm monitoring for synths * I SAW IN YOU WHAT LIFE WAS MISSING * comms console * idcard and record updates * turn the light on * arcade * pt2 * news browser * static * crusher * f * COULD I JUST SLEIGH THE GOLD FROM THE BALLS? I'M SO FRUSTRATED OH COULD YOU TELL? IF I HEAR ONE MORE VUEUI OR ONE NANOUI I'M GONNA LOSE IT SO LET ME GOOOOOOOOOOOOOOOOO * codeowners & suit sensors * html ui style removal * make lint happy * resist and disorder * i slowly get up and turn off the noise, already fed up... * pleaseeeeeeeeeeeeeee * THE CREDIT LARP IS NECESSARY * i hold the keys * RISE UP * fix that? * harry's suggestions xoxo * runtime fix pt2 * You are the only thing that I still care about * adds build workflow * Update update_tgui.yml * adds some needed steps * ATM * misc fixes and tweaks * fixes 2 * make newscasters usable and fix use power on freezers * turret control is clearer --------- Co-authored-by: John Wildkins <john.wildkins@gmail.com> Co-authored-by: Matt Atlas <liermattia@gmail.com> Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> Co-authored-by: Werner <Arrow768@users.noreply.github.com> Co-authored-by: Geeves <ggrobler447@gmail.com> Co-authored-by: harryob <me@harryob.live>
176 lines
5.3 KiB
Plaintext
176 lines
5.3 KiB
Plaintext
var/global/ntnrc_uid = 0
|
|
/datum/ntnet_conversation
|
|
var/id
|
|
var/title = "Untitled Conversation"
|
|
var/datum/ntnet_user/operator // "Administrator" of this channel. Creator starts as channel's operator,
|
|
var/list/messages = list()
|
|
var/list/users = list()
|
|
var/direct = FALSE
|
|
var/password
|
|
|
|
/datum/ntnet_conversation/New(var/name, var/no_operator)
|
|
id = ntnrc_uid
|
|
ntnrc_uid++
|
|
if(name)
|
|
title = name
|
|
if(ntnet_global)
|
|
ntnet_global.chat_channels.Add(src)
|
|
if(no_operator)
|
|
operator = "NanoTrasen Information Technology Division" // assign a fake operator
|
|
..()
|
|
|
|
/datum/ntnet_conversation/proc/process_message(var/datum/ntnet_message/message, var/update_ui = TRUE)
|
|
var/admin_log = message.format_admin_log()
|
|
if (admin_log)
|
|
log_ntirc("[message.user.client.ckey] ([message.user.client.mob.real_name])|([message.nuser.username]) -> ([title]): [admin_log]", ckey=key_name(message.user), conversation=title)
|
|
|
|
for(var/datum/ntnet_user/U in users)
|
|
for(var/datum/computer_file/program/chat_client/Cl in U.clients)
|
|
var/notification_text = message.format_chat_notification(src, Cl)
|
|
if(notification_text && Cl.can_receive_notification(message.client))
|
|
if(!Cl.message_mute)
|
|
Cl.computer.output_message(notification_text, 0)
|
|
if(message.play_sound)
|
|
Cl.play_notification_sound(message.client)
|
|
|
|
var/ntnet_log = message.format_ntnet_log(src)
|
|
if(ntnet_log)
|
|
ntnet_global.add_log(ntnet_log, message.client.computer.network_card, TRUE)
|
|
|
|
var/chat_log = message.format_chat_log(src)
|
|
if(chat_log)
|
|
messages.Add(chat_log)
|
|
trim_message_list()
|
|
|
|
if(update_ui)
|
|
for(var/datum/ntnet_user/U in users)
|
|
for(var/datum/computer_file/program/chat_client/Cl in U.clients)
|
|
SStgui.update_uis(Cl)
|
|
|
|
/datum/ntnet_conversation/proc/trim_message_list()
|
|
if(messages.len <= 50)
|
|
return
|
|
for(var/message in messages)
|
|
messages -= message
|
|
if(messages.len <= 50)
|
|
return
|
|
|
|
/// EXTERNAL PROCs
|
|
|
|
/datum/ntnet_conversation/proc/get_title(var/datum/computer_file/program/chat_client/cl = null)
|
|
if(direct)
|
|
var/names = list()
|
|
for(var/datum/ntnet_user/U in users)
|
|
names += U.username
|
|
if(istype(cl) && istype(cl.my_user))
|
|
names -= cl.my_user.username
|
|
return "\[DM] [english_list(names)]"
|
|
else
|
|
return title
|
|
|
|
/datum/ntnet_conversation/proc/can_see(var/datum/computer_file/program/chat_client/cl)
|
|
if(cl.netadmin_mode)
|
|
return TRUE
|
|
if(istype(cl.my_user))
|
|
if(cl.my_user in users)
|
|
return TRUE
|
|
else
|
|
for(var/datum/ntnet_user/user in users)
|
|
if(cl in user.clients)
|
|
return TRUE
|
|
if(!direct)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/datum/ntnet_conversation/proc/can_interact(var/datum/computer_file/program/chat_client/cl)
|
|
if(cl.netadmin_mode)
|
|
return TRUE
|
|
if(istype(cl.my_user))
|
|
if(cl.my_user in users)
|
|
return TRUE
|
|
else
|
|
for(var/datum/ntnet_user/user in users)
|
|
if(cl in user.clients)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/datum/ntnet_conversation/proc/can_manage(var/datum/computer_file/program/chat_client/cl)
|
|
if(cl.netadmin_mode)
|
|
return TRUE
|
|
if(cl.my_user == operator)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/datum/ntnet_conversation/proc/cl_send(var/datum/computer_file/program/chat_client/Cl, var/message, var/mob/user)
|
|
if(!istype(Cl) || !can_interact(Cl))
|
|
return
|
|
var/datum/ntnet_message/message/msg = new(Cl)
|
|
msg.message = message
|
|
msg.user = user
|
|
process_message(msg)
|
|
|
|
/datum/ntnet_conversation/proc/cl_join(var/datum/computer_file/program/chat_client/Cl)
|
|
if(!istype(Cl) || !can_see(Cl) || direct)
|
|
return
|
|
var/datum/ntnet_message/join/msg = new(Cl)
|
|
Cl.my_user.channels.Add(src)
|
|
users.Add(Cl.my_user)
|
|
if(!operator)
|
|
operator = Cl.my_user
|
|
var/datum/ntnet_message/new_op/msg2 = new(Cl)
|
|
process_message(msg, FALSE)
|
|
process_message(msg2)
|
|
return
|
|
process_message(msg)
|
|
|
|
/datum/ntnet_conversation/proc/cl_leave(var/datum/computer_file/program/chat_client/Cl)
|
|
if(!istype(Cl) || !istype(Cl.my_user) || !(Cl.my_user in users) || !can_interact(Cl) || direct)
|
|
return
|
|
if(Cl.focused_conv == src)
|
|
Cl.focused_conv = null
|
|
var/datum/ntnet_message/leave/msg = new(Cl)
|
|
Cl.my_user.channels.Remove(src)
|
|
users.Remove(Cl.my_user)
|
|
if(operator == Cl.my_user)
|
|
if(users.len)
|
|
operator = pick(users)
|
|
var/datum/ntnet_message/new_op/msg2 = new()
|
|
msg2.nuser = operator
|
|
process_message(msg, FALSE)
|
|
process_message(msg2)
|
|
return
|
|
process_message(msg)
|
|
|
|
/datum/ntnet_conversation/proc/cl_change_title(var/datum/computer_file/program/chat_client/Cl, var/newTitle)
|
|
if(!istype(Cl) || !istype(Cl.my_user) || !can_manage(Cl) || direct)
|
|
return
|
|
var/datum/ntnet_message/new_title/msg = new(Cl)
|
|
msg.title = newTitle
|
|
process_message(msg)
|
|
title = newTitle
|
|
|
|
/datum/ntnet_conversation/proc/cl_set_password(var/datum/computer_file/program/chat_client/Cl, var/newPassword)
|
|
if(!istype(Cl) || !istype(Cl.my_user) || !can_manage(Cl) || direct)
|
|
return
|
|
if(newPassword)
|
|
password = newPassword
|
|
else
|
|
password = FALSE
|
|
|
|
/datum/ntnet_conversation/proc/cl_kick(var/datum/computer_file/program/chat_client/Cl, var/datum/ntnet_user/target)
|
|
if(!istype(Cl) || !istype(Cl.my_user) || !can_manage(Cl) || !(target in users) || direct)
|
|
return
|
|
var/datum/ntnet_message/kick/msg = new(Cl)
|
|
msg.target = target
|
|
target.channels.Remove(src)
|
|
users.Remove(target)
|
|
if(operator == target)
|
|
if(users.len)
|
|
operator = pick(users)
|
|
var/datum/ntnet_message/new_op/msg2 = new()
|
|
msg2.nuser = operator
|
|
process_message(msg, FALSE)
|
|
process_message(msg2)
|
|
return
|
|
process_message(msg)
|