mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 03:26:31 +01:00
Add #cargobus and gauntlets (also modernizes ntchat) (#58609)
* cargobus, start of gloves * basics of the HAUL gauntlets * fully mapped in * almost forgot the gauntlets * ntnet improvements * cargo gaunts, tablet cargobus * excludes body bags * dmis and map back * readd icons
This commit is contained in:
@@ -5,7 +5,14 @@
|
||||
var/title = "Untitled Conversation"
|
||||
var/datum/computer_file/program/chatclient/operator // "Administrator" of this channel. Creator starts as channel's operator,
|
||||
var/list/messages = list()
|
||||
var/list/clients = list()
|
||||
///chat clients who are active or minimized
|
||||
var/list/active_clients = list()
|
||||
///chat clients who have exited out of the program.
|
||||
var/list/offline_clients = list()
|
||||
///clients muted by operator
|
||||
var/list/muted_clients = list()
|
||||
//if a channel is strong, it cannot be renamed or deleted.
|
||||
var/strong = FALSE
|
||||
var/password
|
||||
var/static/ntnrc_uid = 0
|
||||
|
||||
@@ -25,12 +32,12 @@
|
||||
return ..()
|
||||
|
||||
/datum/ntnet_conversation/proc/add_message(message, username)
|
||||
message = "[station_time_timestamp()] [username]: [message]"
|
||||
message = "[station_time_timestamp(format = "hh:mm")] [username]: [message]"
|
||||
messages.Add(message)
|
||||
trim_message_list()
|
||||
|
||||
/datum/ntnet_conversation/proc/add_status_message(message)
|
||||
messages.Add("[station_time_timestamp()] -!- [message]")
|
||||
messages.Add("[station_time_timestamp(format = "hh:mm")] -!- [message]")
|
||||
trim_message_list()
|
||||
|
||||
/datum/ntnet_conversation/proc/trim_message_list()
|
||||
@@ -38,39 +45,61 @@
|
||||
return
|
||||
messages = messages.Copy(messages.len-50 ,0)
|
||||
|
||||
/datum/ntnet_conversation/proc/add_client(datum/computer_file/program/chatclient/C)
|
||||
if(!istype(C))
|
||||
/datum/ntnet_conversation/proc/add_client(datum/computer_file/program/chatclient/new_user, silent = FALSE)
|
||||
if(!istype(new_user))
|
||||
return
|
||||
clients.Add(C)
|
||||
add_status_message("[C.username] has joined the channel.")
|
||||
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.
|
||||
if(!operator)
|
||||
changeop(C)
|
||||
changeop(new_user)
|
||||
|
||||
/datum/ntnet_conversation/proc/remove_client(datum/computer_file/program/chatclient/C)
|
||||
if(!istype(C) || !(C in clients))
|
||||
/datum/ntnet_conversation/proc/remove_client(datum/computer_file/program/chatclient/leaving)
|
||||
if(!istype(leaving) || !(leaving in active_clients))
|
||||
return
|
||||
clients.Remove(C)
|
||||
add_status_message("[C.username] has left the channel.")
|
||||
active_clients.Remove(leaving)
|
||||
add_status_message("[leaving.username] has left the channel.")
|
||||
|
||||
// Channel operator left, pick new operator
|
||||
if(C == operator)
|
||||
if(leaving == operator)
|
||||
operator = null
|
||||
if(clients.len)
|
||||
var/datum/computer_file/program/chatclient/newop = pick(clients)
|
||||
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(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)
|
||||
if(istype(newop))
|
||||
operator = newop
|
||||
add_status_message("Channel operator status transferred to [newop.username].")
|
||||
|
||||
/datum/ntnet_conversation/proc/change_title(newtitle, datum/computer_file/program/chatclient/client)
|
||||
if(operator != client)
|
||||
return FALSE // Not Authorised
|
||||
/datum/ntnet_conversation/proc/change_title(newtitle, datum/computer_file/program/chatclient/renamer)
|
||||
if(operator != renamer || strong)
|
||||
return FALSE // Not Authorised or channel cannot be editted
|
||||
|
||||
add_status_message("[client.username] has changed channel title from [title] to [newtitle]")
|
||||
add_status_message("[renamer.username] has changed channel title from [title] to [newtitle]")
|
||||
title = newtitle
|
||||
|
||||
#undef MAX_CHANNELS
|
||||
|
||||
Reference in New Issue
Block a user