mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-11 16:14:08 +01:00
aa4dc56835
## About The Pull Request Removes Station-Time entirely Server Time is now NST (Nanotrasen Standard Time). SS13 takes place exactly 540 years in the future of the current day, so every second is 1 second in-game. Round Time is now PT (Pay-Time), how Nanotrasen keeps track of how long the current rotation of Employees has been working for. Telecomms uses NST due to its importance of being the communication to the blackbox. Autopsy report, clocks, scientific reports and requisitions use both timestamps due to them being more official documents that NT may need to know beyond just the current round (just for flavortext). Pretty much everything else (Det scanner, PDA, IC logs, Time-of-Death, AI law changes, Cyborg file downloading) uses PT PT <img width="305" height="217" alt="image" src="https://github.com/user-attachments/assets/cef73025-6292-4f9c-8565-197397bda2ca" /> <img width="168" height="59" alt="image" src="https://github.com/user-attachments/assets/a99db568-045d-45fc-8206-0d9a7b13c7d2" /> <img width="308" height="122" alt="image" src="https://github.com/user-attachments/assets/37ca6f17-8916-4af2-9c91-0f0707038ca5" /> https://github.com/user-attachments/assets/29445051-c98b-4af3-a657-812083aab91a Clock (Literate) <img width="748" height="292" alt="image" src="https://github.com/user-attachments/assets/c824e812-91b5-4737-858d-768336e9a7c4" /> Clock (Illiterate) <img width="446" height="94" alt="image" src="https://github.com/user-attachments/assets/90d5ea0d-eaff-4ced-aa31-ffdf0b4832a5" /> New paperwork time working properly <img width="311" height="190" alt="image" src="https://github.com/user-attachments/assets/6d048926-db61-4c91-893b-ce93e1ea7775" /> NST <img width="800" height="115" alt="image" src="https://github.com/user-attachments/assets/35ffde49-13c1-4ce7-ab24-858e48b608bd" /> <img width="1288" height="142" alt="image" src="https://github.com/user-attachments/assets/40c30d16-e0de-4efc-b460-9486eeb901d6" /> # Other changes 1. Circuit time checker will now get the value of the given input (Hour, Minute, Second) rather than the full dedisecond time converted into hour/minutes/seconds <img width="270" height="67" alt="image" src="https://github.com/user-attachments/assets/097440cc-1c45-447f-9976-18de7f9c722c" /> 2. Turns nightshift into a round event that'll last approximately 22 minutes 3. 12-hour pref (doesn't apply to the stat panel because it's global info) & removal of "TCT" time <img width="569" height="440" alt="image" src="https://github.com/user-attachments/assets/d39083b1-d248-41c0-9a1c-b2398ca203a7" /> 4. The chocolate pudding negative moodlet is now based on the server's IRL time. 5. Admins can now use ``class``, ``style`` and ``background`` (they were already given perms to use ``img`` so hiding background, which was removed to prevent image embedding, is pointless) 6. Also fixes ``year`` being off on localhost. ## Why It's Good For The Game Server Time is approximately 1s = 12s converted, not including it desyncing from lag (I believe?). This makes it pretty much impossible for people to actually use this as a unit of measurement for in-game actions. Different things also uses different timestamps which is a bit more confusing. The main change here is for accessibility and, hopefully, using time as a source of immersion. "20 minutes ago" is no longer OOC, they're just speaking in PT. There's no timezones in space, Nanotrasen Standard Time is the closest there is, but Pay Time is how NT considers when you get your paychecks, so it's what is more commonly used. It also fixes major inconsistencies between "IC time" and "Station time", things like breakfast moodlet was the first 15mins of the round despite the round starting like 7 hours in? Nukies with an L6 SAW firing down the halls was shooting like 1 bullet every 3 seconds (assuming 4 bullets per second), overall there was just a disconnect between how long time actually is in the universe. The secondary reason for this change (though it is what pushed me to actually get around to making this change) is the greater stat-panel removal. This hopes to lessen the dependence on the stat panel for station-time by making it easier to understand, and the end-goal I have is for this information to be limited to Admins & the AI (AI will get the IC version with the accurate year), so until that happens I would like to improve the use of station-time by making it consistent (for example, you should only care for PT for IC, which is also what your PDA displays), so that when it gets removed it won't leave players timeless. If you haven't already, and is interested in helping remove the stat panel, every entry that needs to be removed can be found here - https://hackmd.io/443_dE5lRWeEAp9bjGcKYw?view Closes https://github.com/tgstation/tgstation/issues/94988 ## Changelog 🆑 del: Removed Station Time, now we use NST (Nanotrasen Standard Time), which is IRL server time +540 years, and PT (Pay Time), the amount of time since the round has started. del: Station nightshift is now a Station event rather than being based on Server time. balance: Time circuit's Unit of Measure now tells the amount of time in hour/minute/seconds rather than giving the whole time translated to hours/minutes/seconds. qol: Added a 12-hour clock pref for people who prefer it. qol: Hovering over NST timestamps on official documents will now translate how much it is in PT/Shift Time. admin: Admins can now use style/class/background in their papercode. /🆑 --------- Co-authored-by: Isratosh <Isratosh@hotmail.com>
133 lines
5.1 KiB
Plaintext
133 lines
5.1 KiB
Plaintext
#define MAX_CHANNELS 1000
|
|
|
|
/datum/ntnet_conversation
|
|
///The title of the conversation, seen in the UI.
|
|
var/title = "Untitled Conversation"
|
|
//If a channel is strong, it cannot be renamed or deleted.
|
|
var/strong = FALSE
|
|
///The password to join a channel, set by an Administrator.
|
|
var/password
|
|
|
|
///A static UID to ensure no conversations are the same.
|
|
var/static/ntnrc_uid = 0
|
|
///ID using the UID.
|
|
var/id
|
|
|
|
///Associative list of all messages sent in the conversation. id > message
|
|
var/list/messages = list()
|
|
///ID used for next message, increments each use. Convert to string before use.
|
|
var/next_message_id = 0
|
|
|
|
///The "Administrator" of the channel, the creator starts as channel's operator by default.
|
|
var/datum/computer_file/program/chatclient/channel_operator
|
|
///Chat clients who are active or minimized.
|
|
var/list/datum/computer_file/program/chatclient/active_clients = list()
|
|
///Chat clients who have exited out of the program.
|
|
var/list/datum/computer_file/program/chatclient/offline_clients = list()
|
|
///Chat clients currently muted by the operator, rendering them unable to ping other people.
|
|
var/list/datum/computer_file/program/chatclient/muted_clients = list()
|
|
|
|
/datum/ntnet_conversation/New(title, strong = FALSE)
|
|
src.title = title
|
|
src.strong = strong
|
|
|
|
id = ntnrc_uid
|
|
ntnrc_uid++
|
|
if(id > MAX_CHANNELS)
|
|
qdel(src)
|
|
return
|
|
SSmodular_computers.chat_channels.Add(src)
|
|
return ..()
|
|
|
|
/datum/ntnet_conversation/Destroy()
|
|
SSmodular_computers.chat_channels.Remove(src)
|
|
for(var/datum/computer_file/program/chatclient/chatterbox as anything in (active_clients | offline_clients))
|
|
purge_client(chatterbox)
|
|
return ..()
|
|
|
|
/datum/ntnet_conversation/proc/add_message(message, username)
|
|
message = "[round_timestamp(format = "hh:mm")] [username]: [message]"
|
|
messages["[next_message_id]"] = message
|
|
next_message_id++
|
|
trim_message_list()
|
|
|
|
/datum/ntnet_conversation/proc/add_status_message(message)
|
|
message = "[round_timestamp(format = "hh:mm")] -!- [message]"
|
|
messages["[next_message_id]"] = message
|
|
next_message_id++
|
|
trim_message_list()
|
|
|
|
/datum/ntnet_conversation/proc/trim_message_list()
|
|
if(messages.len <= 50)
|
|
return
|
|
messages = messages.Copy(messages.len-50 ,0)
|
|
|
|
/datum/ntnet_conversation/proc/add_client(datum/computer_file/program/chatclient/new_user, silent = FALSE)
|
|
if(!istype(new_user))
|
|
return
|
|
new_user.conversations |= src
|
|
active_clients.Add(new_user)
|
|
if(!silent)
|
|
add_status_message("[new_user.username] has joined the channel.")
|
|
// No operator, so we assume the channel was empty. Assign this user as operator, without the message, since you're the creator.
|
|
if(!channel_operator)
|
|
changeop(new_user, silent = TRUE)
|
|
|
|
//Clear all of our references to a client, used for client deletion
|
|
/datum/ntnet_conversation/proc/purge_client(datum/computer_file/program/chatclient/forget)
|
|
remove_client(forget)
|
|
forget.conversations -= src
|
|
|
|
/datum/ntnet_conversation/proc/remove_client(datum/computer_file/program/chatclient/leaving)
|
|
if(!istype(leaving))
|
|
return
|
|
if(leaving in active_clients)
|
|
active_clients.Remove(leaving)
|
|
add_status_message("[leaving.username] has left the channel.")
|
|
muted_clients -= leaving
|
|
offline_clients -= leaving
|
|
|
|
// Channel operator left, pick new operator
|
|
if(leaving == channel_operator)
|
|
channel_operator = null
|
|
if(active_clients.len)
|
|
var/datum/computer_file/program/chatclient/newop = pick(active_clients)
|
|
changeop(newop)
|
|
|
|
/datum/ntnet_conversation/proc/go_offline(datum/computer_file/program/chatclient/offline)
|
|
if(!istype(offline) || !(offline in active_clients))
|
|
return
|
|
active_clients.Remove(offline)
|
|
offline_clients.Add(offline)
|
|
|
|
/datum/ntnet_conversation/proc/mute_user(datum/computer_file/program/chatclient/op, datum/computer_file/program/chatclient/muted)
|
|
if(!op.netadmin_mode && (channel_operator != op)) //sanity even if the person shouldn't be able to see the mute button
|
|
return
|
|
if(muted in muted_clients)
|
|
muted_clients.Remove(muted)
|
|
muted.computer.alert_call(muted, "You have been unmuted from [title]!", 'sound/machines/ping.ogg')
|
|
else
|
|
muted_clients.Add(muted)
|
|
muted.computer.alert_call(muted, "You have been muted from [title]!")
|
|
|
|
/datum/ntnet_conversation/proc/ping_user(datum/computer_file/program/chatclient/pinger, datum/computer_file/program/chatclient/pinged)
|
|
if(pinger in muted_clients) //oh my god fuck off
|
|
return
|
|
add_status_message("[pinger.username] pinged [pinged.username].")
|
|
pinged.computer.alert_call(pinged, "You have been pinged in [title] by [pinger.username]!", 'sound/machines/ping.ogg')
|
|
|
|
/datum/ntnet_conversation/proc/changeop(datum/computer_file/program/chatclient/newop, silent = FALSE)
|
|
if(!istype(newop))
|
|
CRASH("[src] is attempting to add [newop] as the operator, but it isn't a chat client.")
|
|
channel_operator = newop
|
|
if(!silent)
|
|
add_status_message("Channel operator status transferred to [newop.username].")
|
|
|
|
/datum/ntnet_conversation/proc/change_title(newtitle, datum/computer_file/program/chatclient/renamer)
|
|
if((channel_operator != renamer) || strong) // Not Authorised or channel cannot be editted
|
|
return FALSE
|
|
add_status_message("[renamer.username] has changed channel title from [title] to [newtitle]")
|
|
title = newtitle
|
|
|
|
#undef MAX_CHANNELS
|