mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
@@ -70,4 +70,8 @@
|
||||
|
||||
/proc/log_pda(text)
|
||||
if (config.log_pda)
|
||||
diary << "\[[time_stamp()]]PDA: [text]"
|
||||
diary << "\[[time_stamp()]]PDA: [text]"
|
||||
|
||||
/proc/log_chat(text)
|
||||
if (config.log_pda) //reusing this for now, can change if needed
|
||||
diary << "\[[time_stamp()]]CHAT: [text]"
|
||||
@@ -114,8 +114,10 @@
|
||||
else
|
||||
dat += "<dd><A href='?src=\ref[src];view=1'>	[++i]. View Message Logs </a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];viewr=1'>	[++i]. View Request Console Logs </a></br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];viewc=1'>	[++i]. View Chatroom Logs </a></br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];clear=1'>	[++i]. Clear Message Logs</a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];clearr=1'>	[++i]. Clear Request Console Logs</a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];clearc=1'>	[++i]. Clear Chatroom Logs</a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];pass=1'>	[++i]. Set Custom Key</a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];msg=1'>	[++i]. Send Admin Message</a><br></dd>"
|
||||
else
|
||||
@@ -236,6 +238,24 @@
|
||||
<td width='15%'>[rc.rec_dpt]</td><td width='300px'>[rc.message]</td><td width='15%'>[rc.stamp]</td><td width='15%'>[rc.id_auth]</td><td width='15%'>[rc.priority]</td></tr>"}
|
||||
dat += "</table>"
|
||||
|
||||
//Chatroom Logs
|
||||
if(5)
|
||||
|
||||
var/index = 0
|
||||
//var/sender = "Anon"
|
||||
//var/channel = "ss13"
|
||||
//var/message = "Blank"
|
||||
dat += "<center><A href='?src=\ref[src];back=1'>Back</a> - <A href='?src=\ref[src];refresh=1'>Refresh</center><hr>"
|
||||
dat += "<table border='1' width='100%'><tr><th width = '5%'>X</th><th width='15%'>Channel</th><th width='15%'>Nick</th><th width='300px' word-wrap: break-word>Message</th></tr>"
|
||||
for(var/datum/data_chat_msg/msg in src.linkedServer.chat_msgs)
|
||||
index++
|
||||
if(index > 3000)
|
||||
break
|
||||
// Del - Channel - Sender - Message
|
||||
// X - #ss13 - bigdik - hi asl
|
||||
dat += "<tr><td width = '5%'><center><A href='?src=\ref[src];delete=\ref[msg]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[msg.channel]</td><td width='15%'>[msg.sender]</td><td width='300px'>[msg.message]</td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
message = defaultmsg
|
||||
//user << browse(dat, "window=message;size=700x700")
|
||||
//onclose(user, "message")
|
||||
@@ -321,6 +341,14 @@
|
||||
if(auth)
|
||||
src.linkedServer.rc_msgs = list()
|
||||
message = "<span class='notice'>NOTICE: Logs cleared.</span>"
|
||||
//Clears the chatroom logs - KEY REQUIRED
|
||||
if (href_list["clearc"])
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.linkedServer.chat_msgs = list()
|
||||
message = "<span class='notice'>NOTICE: Logs cleared.</span>"
|
||||
//Change the password - KEY REQUIRED
|
||||
if (href_list["pass"])
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
@@ -464,6 +492,13 @@
|
||||
else
|
||||
if(auth)
|
||||
src.screen = 4
|
||||
//Chatroom Logs - KEY REQUIRED
|
||||
if(href_list["viewc"])
|
||||
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.screen = 5
|
||||
|
||||
//usr << href_list["select"]
|
||||
|
||||
|
||||
@@ -44,6 +44,12 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
|
||||
var/obj/item/device/paicard/pai = null // A slot for a personal AI device
|
||||
|
||||
var/chat_channel = "#ss13" //name of our current NTRC channel
|
||||
var/nick = "" //our NTRC nick
|
||||
var/list/ntrclog = list() //NTRC message log
|
||||
|
||||
var/noreturn = 0 //whether the PDA can use the Return button, used for the aiPDA chatroom
|
||||
|
||||
/obj/item/device/pda/medical
|
||||
default_cartridge = /obj/item/weapon/cartridge/medical
|
||||
icon_state = "pda-medical"
|
||||
@@ -186,13 +192,15 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
/obj/item/device/pda/ai
|
||||
icon_state = "NONE"
|
||||
ttone = "data"
|
||||
mode = 5
|
||||
noreturn = 1
|
||||
detonate = 0
|
||||
|
||||
/obj/item/device/pda/ai/attack_self(mob/user as mob)
|
||||
if ((honkamt > 0) && (prob(60)))//For clown virus.
|
||||
honkamt--
|
||||
playsound(loc, 'sound/items/bikehorn.ogg', 30, 1)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/device/pda/ai/pai
|
||||
ttone = "assist"
|
||||
@@ -257,7 +265,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
|
||||
if ((!isnull(cartridge)) && (mode == 0))
|
||||
dat += " | <a href='byond://?src=\ref[src];choice=Eject'><img src=pda_eject.png> Eject [cartridge]</a>"
|
||||
if (mode)
|
||||
if (mode && !noreturn)
|
||||
dat += " | <a href='byond://?src=\ref[src];choice=Return'><img src=pda_menu.png> Return</a>"
|
||||
dat += " | <a href='byond://?src=\ref[src];choice=Refresh'><img src=pda_refresh.png> Refresh</a>"
|
||||
|
||||
@@ -283,7 +291,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
dat += "<ul>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=1'><img src=pda_notes.png> Notekeeper</a></li>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=2'><img src=pda_mail.png> Messenger</a></li>"
|
||||
//dat += "<li><a href='byond://?src=\red[src];choice=chatroom'><img src=pda_chatroom.png> Nanotrasen Relay Chat</a></li>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=5'><img src=pda_chatroom.png> Nanotrasen Relay Chat</a></li>"
|
||||
|
||||
if (cartridge)
|
||||
if (cartridge.access_clown)
|
||||
@@ -433,16 +441,18 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
dat += "<br>"
|
||||
|
||||
if (5)
|
||||
dat += "<h4><img src=pda_chatroom.png> Nanotrasen Relay Chat</h4>"
|
||||
|
||||
dat += "<h4><img src=pda_menu.png> Detected Channels</h4>: <li>"
|
||||
for(var/datum/chatroom/C in chatrooms)
|
||||
dat += "<a href='byond://?src=\ref[src];pdachannel=[C.name]'>#[html_encode(lowertext(C.name))]"
|
||||
if(C.password != "")
|
||||
dat += " <img src=pda_locked.png>"
|
||||
dat += "</li>"
|
||||
|
||||
if(!nick) //first time join
|
||||
nick = copytext(sanitize(owner), 1, 9)
|
||||
var/datum/chatroom/C = chatchannels[chat_channel]
|
||||
C.parse_msg(src, nick, "/join [chat_channel]")
|
||||
dat += "<h4><img src=pda_chatroom.png> SS13 Nanotrasen Relay Chat Network</h4>"
|
||||
|
||||
dat += "<a href='byond://?src=\ref[src];choice=Set Nick'>[nick]</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];choice=Set Channel'>[chat_channel]</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];choice=NTRC Message'>Write message</a> | "
|
||||
dat += "<a href='byond://?src=\ref[src];choice=NTRC Help'>Help</a><br>"
|
||||
if(chat_channel)
|
||||
dat += ntrclog[chat_channel]
|
||||
|
||||
else//Else it links to the cart menu proc. Although, it really uses menu hub 4--menu 4 doesn't really exist as it simply redirects to hub.
|
||||
dat += cart
|
||||
@@ -510,7 +520,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
mode = 3
|
||||
if("4")//Redirects to hub
|
||||
mode = 0
|
||||
if("chatroom") // chatroom hub
|
||||
if("5")//Chatroom
|
||||
mode = 5
|
||||
|
||||
|
||||
@@ -615,6 +625,53 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
return
|
||||
|
||||
|
||||
//CHATROOM FUNCTIONS====================================
|
||||
|
||||
if("Set Nick")
|
||||
var/t = stripped_input(U, "Please enter nickname", name, null) as text
|
||||
nick = copytext(sanitize(t), 1, 9)
|
||||
|
||||
if("Set Channel")
|
||||
var/t = stripped_input(U, "Please enter channel", name, (chat_channel)) as text
|
||||
|
||||
if(t)
|
||||
ntrclog[chat_channel] = "<hr>" + ntrclog[chat_channel]
|
||||
var/datum/chatroom/C = chatchannels[chat_channel]
|
||||
if(!findtext(t,"#",1,2))
|
||||
t = "#" + t
|
||||
chat_channel = t
|
||||
C.parse_msg(src, nick, "/join [chat_channel]")
|
||||
|
||||
if("NTRC Message")
|
||||
var/t = msg_input(U) as text
|
||||
var/datum/chatroom/C = chatchannels[chat_channel]
|
||||
if(C)
|
||||
var/lt = text2list(t, " ")
|
||||
if(lt[1] == "/join")
|
||||
if(!findtext(lt[2],"#",1,2))
|
||||
lt[2] = "#" + lt[2]
|
||||
var/ret = C.parse_msg(src,nick,t)
|
||||
if(findtextEx(ret,"ERR_",1,5))
|
||||
ntrclog[chat_channel] = "[ret]<br>" + ntrclog[chat_channel]
|
||||
else
|
||||
if(ret == 0)
|
||||
ntrclog[chat_channel] = "Failure<br>" + ntrclog[chat_channel]
|
||||
else
|
||||
if(lt[1] == "/join")
|
||||
chat_channel = lt[2]
|
||||
|
||||
if("NTRC Help")
|
||||
var/helptext = "<b>NTRC reference:</b><br><br>"
|
||||
helptext += "<i>General commands</i><br>"
|
||||
helptext += "/join #channel<br>/part<br>/log amountoflines<br>/who<br>/topic<br>/register<br><br>"
|
||||
helptext += "<i>Moderation commands</i><br>"
|
||||
helptext += "/ban targetnick<br>/unban targetnick<br>/kick targetnick<br>/mute targetnick<br><br>"
|
||||
helptext += "<i>Management commands</i><br>"
|
||||
helptext += "/topic topictext<br>/op targetnick<br>/deop targetnick<br>/delchannel"
|
||||
usr << browse(helptext, "window=ntrchelp;size=400x444;border=1;can_resize=1;can_close=1;can_minimize=0")
|
||||
|
||||
|
||||
|
||||
//SYNDICATE FUNCTIONS===================================
|
||||
|
||||
if("Toggle Door")
|
||||
@@ -675,8 +732,9 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
|
||||
else//Cartridge menu linking
|
||||
mode = text2num(href_list["choice"])
|
||||
cartridge.mode = mode
|
||||
cartridge.unlock()
|
||||
if(cartridge)
|
||||
cartridge.mode = mode
|
||||
cartridge.unlock()
|
||||
else//If not in range, can't interact or not using the pda.
|
||||
U.unset_machine()
|
||||
U << browse(null, "window=pda")
|
||||
@@ -708,40 +766,39 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
id.loc = get_turf(src)
|
||||
id = null
|
||||
|
||||
/obj/item/device/pda/proc/create_message(var/mob/living/U = usr, var/obj/item/device/pda/P)
|
||||
|
||||
/obj/item/device/pda/proc/msg_input(var/mob/living/U = usr)
|
||||
var/t = input(U, "Please enter message", name, null) as text
|
||||
t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
|
||||
if (!t || !istype(P))
|
||||
if (!t || toff)
|
||||
return
|
||||
if (!in_range(src, U) && loc != U)
|
||||
return
|
||||
|
||||
if (isnull(P)||P.toff || toff)
|
||||
if(!can_use(U))
|
||||
return
|
||||
if(emped)
|
||||
t = Gibberish(t, 100)
|
||||
return t
|
||||
|
||||
/obj/item/device/pda/proc/create_message(var/mob/living/U = usr, var/obj/item/device/pda/P)
|
||||
|
||||
var/t = msg_input(U)
|
||||
|
||||
if (last_text && world.time < last_text + 5)
|
||||
return
|
||||
|
||||
if(!can_use(U))
|
||||
if (isnull(P) || P.toff || !istype(P))
|
||||
return
|
||||
|
||||
last_text = world.time
|
||||
// check if telecomms I/O route 1459 is stable
|
||||
//var/telecomms_intact = telecomms_process(P.owner, owner, t)
|
||||
var/obj/machinery/message_server/useMS = null
|
||||
if(message_servers)
|
||||
for (var/obj/machinery/message_server/MS in message_servers)
|
||||
//PDAs are now dependant on the Message Server.
|
||||
if(MS.active)
|
||||
useMS = MS
|
||||
break
|
||||
|
||||
var/datum/signal/signal = src.telecomms_process()
|
||||
|
||||
if(emped)
|
||||
t = Gibberish(t, 100)
|
||||
|
||||
var/useTC = 0
|
||||
if(signal)
|
||||
if(signal.data["done"])
|
||||
@@ -782,7 +839,6 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
else
|
||||
U << "<span class='notice'>ERROR: Server isn't responding.</span>"
|
||||
|
||||
|
||||
/obj/item/device/pda/verb/verb_remove_id()
|
||||
set category = "Object"
|
||||
set name = "Remove id"
|
||||
@@ -1045,6 +1101,18 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
else
|
||||
usr << "You do not have a PDA. You should make an issue report about this."
|
||||
|
||||
/mob/living/silicon/ai/verb/cmd_use_chatroom()
|
||||
set category = "AI Commands"
|
||||
set name = "PDA - Chatrooms"
|
||||
if(usr.stat == 2)
|
||||
usr << "You can't do that because you are dead!"
|
||||
return
|
||||
if(!isnull(aiPDA))
|
||||
aiPDA.mode = 5
|
||||
aiPDA.attack_self(src)
|
||||
else
|
||||
usr << "You do not have a PDA. You should make an issue report about this."
|
||||
|
||||
/mob/living/silicon/ai/proc/cmd_show_message_log(mob/user as mob)
|
||||
if(user.stat == 2)
|
||||
user << "You can't do that because you are dead!"
|
||||
@@ -1085,6 +1153,17 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
spawn(200 * severity)
|
||||
emped -= 1
|
||||
|
||||
//ntrc handler proc
|
||||
/obj/item/device/pda/proc/msg_chat(channel as text, sender as text, message as text)
|
||||
var/msg = "<b>[strip_html_properly(sender)]</b>| [strip_html_properly(message)]<br>"
|
||||
if(!channel)
|
||||
for(var/C in ntrclog)
|
||||
ntrclog[C] = msg + ntrclog[C]
|
||||
else
|
||||
ntrclog[channel] = msg + ntrclog[channel]
|
||||
if (!silent)
|
||||
loc.audible_message("\icon[src] *[ttone]*", null, 3)
|
||||
|
||||
/proc/get_viewable_pdas()
|
||||
. = list()
|
||||
// Returns a list of PDAs which can be viewed from another PDA/message monitor.
|
||||
|
||||
@@ -1,16 +1,212 @@
|
||||
var/list/chatrooms = list()
|
||||
var/datum/chatroom/default_ntrc_chatroom = new("")
|
||||
var/list/chatchannels = list(default_ntrc_chatroom.name = default_ntrc_chatroom)
|
||||
|
||||
//procs that can be used directly:
|
||||
//channel.parse_msg
|
||||
|
||||
/datum/chatroom
|
||||
var/name = "Generic Chatroom"
|
||||
var/list/logged_in = list()
|
||||
var/name = "#ss13"
|
||||
var/topic = "Welcome to the best NTRC channel in this sector of the galaxy!" // topic message for the chatroom
|
||||
var/list/operators = list() // chat operators
|
||||
var/list/logs = list() // chat logs
|
||||
var/list/muted = list() // muted users
|
||||
var/list/banned = list() // banned users
|
||||
var/list/whitelist = list() // whitelisted users
|
||||
var/list/muted = list()
|
||||
var/topic = "" // topic message for the chatroom
|
||||
var/password = "" // blank for no password.
|
||||
var/operator = "" // name of the operator
|
||||
var/list/auth = list() // authenticated clients
|
||||
var/list/users = list() // current users
|
||||
var/datum/events/events = new ()
|
||||
var/list/datum/event/evlist = list()
|
||||
|
||||
/datum/chatroom/proc/attempt_connect(var/obj/item/device/pda/device, var/obj/password)
|
||||
if(!device)
|
||||
return
|
||||
//parse_msg() is the exposed interface chat
|
||||
//clients should interact with parse_msg() and parse_msg() only
|
||||
|
||||
/datum/chatroom/proc/parse_msg(client,nick,message)
|
||||
var/obj/machinery/message_server/MS = check_server(client)
|
||||
if(!MS)
|
||||
return "ERR_TCOM"
|
||||
|
||||
if(!nick || length(nick) > 8)
|
||||
return "ERR_NICK"
|
||||
|
||||
MS.send_chat_message(nick,name,message)
|
||||
|
||||
if(findtext(message,"/",1,2))
|
||||
return handle_command(client,nick,copytext(message,2))
|
||||
|
||||
else
|
||||
return send_message(client,nick,message)
|
||||
|
||||
//the following are for internal use only
|
||||
|
||||
/datum/chatroom/proc/check_server(client)
|
||||
var/atom/C = client
|
||||
var/turf/CT = get_turf(C)
|
||||
if(message_servers)
|
||||
for (var/obj/machinery/message_server/MS in message_servers)
|
||||
var/turf/T = get_turf(MS)
|
||||
if(MS.active && (T.z == CT.z))
|
||||
return MS
|
||||
return 0
|
||||
|
||||
/datum/chatroom/proc/handle_command(client,nick,command) //command parser
|
||||
var/list/cmd=text2list(command, " ")
|
||||
|
||||
if(!get_auth(client,nick))
|
||||
return "ERR_AUTH"
|
||||
|
||||
switch(cmd[1]) //argument-less commmands
|
||||
if("topic")
|
||||
if(cmd.len == 1)
|
||||
return get_topic(client)
|
||||
else
|
||||
return set_topic(client,nick,cmd[2])
|
||||
if("part")
|
||||
return channel_part(client,nick)
|
||||
if("delchannel")
|
||||
return delete_channel(client,nick)
|
||||
if("who")
|
||||
return get_who(client, nick)
|
||||
if("register")
|
||||
return register_auth(client,nick)
|
||||
|
||||
if(cmd.len == 1)
|
||||
return "ERR_ARGS"
|
||||
|
||||
switch(cmd[1]) //commands with 1 arg
|
||||
if("join")
|
||||
return channel_join(client,nick,cmd[2])
|
||||
if("log")
|
||||
return get_log(client,nick,cmd[2])
|
||||
if("op")
|
||||
return make_op(client,nick,cmd[2])
|
||||
if("deop")
|
||||
return deop(client,nick,cmd[2])
|
||||
if("ban")
|
||||
return ban(client,nick,cmd[2])
|
||||
if("unban")
|
||||
return unban(client,nick,cmd[2])
|
||||
if("kick")
|
||||
return kick(client,nick,cmd[2])
|
||||
if("mute")
|
||||
return mute_nick(client,nick,cmd[2])
|
||||
|
||||
return "ERR_WCMD"
|
||||
|
||||
/datum/chatroom/proc/send_message(client,nick,message) //standard message
|
||||
if(nick in muted)
|
||||
return "ERR_MUTE"
|
||||
if(!message)
|
||||
return "ERR_BLNK"
|
||||
logs += "[strip_html_properly(nick)]> [strip_html_properly(message)]"
|
||||
log_chat("[usr]/([usr.ckey]) as [nick] sent to [name]: [message]")
|
||||
events.fireEvent("msg_chat",name,nick,message)
|
||||
return 1
|
||||
|
||||
/datum/chatroom/proc/get_auth(client,nick) //check auth
|
||||
if((!(nick in auth)) || (auth[nick] == client))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//chat commands go here
|
||||
/datum/chatroom/proc/register_auth(client,nick) //register
|
||||
if(!get_auth(client,nick))
|
||||
return 0
|
||||
auth[nick] = client
|
||||
return 1
|
||||
|
||||
/datum/chatroom/proc/delete_channel(client,nick) //delchannel
|
||||
if(nick in operators)
|
||||
for(var/event in events.events)
|
||||
events.clearEvent("msg_chat",event)
|
||||
qdel(src)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/chatroom/proc/channel_join(client,nick,channel) //join
|
||||
if(!findtext(channel,"#",1,2))
|
||||
channel = "#" + channel
|
||||
if(channel == name)
|
||||
if((nick in banned) || (nick in users))
|
||||
return 0
|
||||
users += nick
|
||||
get_topic(client,nick)
|
||||
evlist[nick] = events.addEvent("msg_chat",client,"msg_chat")
|
||||
return 1
|
||||
else
|
||||
if(!(channel in chatchannels))
|
||||
var/ret = new_channel(client,nick,channel)
|
||||
if(!ret)
|
||||
return 0
|
||||
channel_part(client,nick)
|
||||
var/datum/chatroom/C = chatchannels[channel]
|
||||
return C.parse_msg(client,nick,"/join [channel]")
|
||||
|
||||
/datum/chatroom/proc/channel_part(client,nick) //part
|
||||
users -= nick
|
||||
events.clearEvent("msg_chat",evlist[nick])
|
||||
return 1
|
||||
|
||||
/datum/chatroom/proc/make_op(client,nick,target) //op
|
||||
if(nick in operators)
|
||||
operators += target
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/chatroom/proc/deop(client,nick,target) //deop
|
||||
if(nick in operators)
|
||||
operators -= target
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/chatroom/proc/ban(client,nick,target) //ban
|
||||
if(nick in operators)
|
||||
banned += target
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/chatroom/proc/unban(client,nick,target) //unban
|
||||
if(nick in operators)
|
||||
banned -= target
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/chatroom/proc/kick(client,nick,target) //kick
|
||||
if(nick in operators)
|
||||
channel_part(null,nick)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/chatroom/proc/set_topic(client,nick,newtopic) //topic
|
||||
if(nick in operators)
|
||||
topic = strip_html_properly(newtopic)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/chatroom/proc/get_topic(client,nick) //topic
|
||||
call(client,"msg_chat")(name,"NTbot","TOPIC: [topic]")
|
||||
return 1
|
||||
|
||||
/datum/chatroom/proc/get_who(client,nick) //who
|
||||
for(var/user in users)
|
||||
call(client,"msg_chat")(name,"NTbot","WHO: [user]")
|
||||
return 1
|
||||
|
||||
/datum/chatroom/proc/get_log(client,nick,lines) //log
|
||||
for(var/i=0;i<lines;i++)
|
||||
var/mylog = logs[logs.len-i]
|
||||
call(client,"msg_chat")(name,"NTbot","LOG[i]: [mylog]")
|
||||
return 1
|
||||
|
||||
/datum/chatroom/proc/mute_nick(client,nick,target) //mute
|
||||
if(nick in operators)
|
||||
muted += target
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/chatroom/proc/new_channel(client,nick,target) //called by join
|
||||
if(target in chatchannels)
|
||||
return 0
|
||||
chatchannels[target] = new /datum/chatroom()
|
||||
var/datum/chatroom/C = chatchannels[target]
|
||||
C.name = target
|
||||
C.operators += nick
|
||||
return 1
|
||||
|
||||
@@ -259,6 +259,7 @@ var/next_external_rsc = 0
|
||||
'icons/pda_icons/pda_blank.png',
|
||||
'icons/pda_icons/pda_boom.png',
|
||||
'icons/pda_icons/pda_bucket.png',
|
||||
'icons/pda_icons/pda_chatroom.png',
|
||||
'icons/pda_icons/pda_medbot.png',
|
||||
'icons/pda_icons/pda_floorbot.png',
|
||||
'icons/pda_icons/pda_cleanbot.png',
|
||||
@@ -305,4 +306,4 @@ var/next_external_rsc = 0
|
||||
'icons/stamp_icons/large_stamp-cap.png',
|
||||
'icons/stamp_icons/large_stamp-qm.png',
|
||||
'icons/stamp_icons/large_stamp-law.png'
|
||||
)
|
||||
)
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
/mob/living/silicon/pai/var/list/available_software = list(
|
||||
"crew manifest" = 5,
|
||||
"digital messenger" = 5,
|
||||
"chatroom client" = 5,
|
||||
"medical records" = 15,
|
||||
"security records" = 15,
|
||||
//"camera jack" = 10,
|
||||
@@ -66,6 +67,8 @@
|
||||
left_part = src.softwareCamera()
|
||||
if("signaller")
|
||||
left_part = src.softwareSignal()
|
||||
if("chatroom")
|
||||
src.chatroom() //snowflake? maybe, but it's less effort this way
|
||||
|
||||
//usr << browse_rsc('windowbak.png') // This has been moved to the mob's Login() proc
|
||||
|
||||
@@ -276,6 +279,8 @@
|
||||
for(var/s in src.software)
|
||||
if(s == "digital messenger")
|
||||
dat += "<a href='byond://?src=\ref[src];software=pdamessage;sub=0'>Digital Messenger</a> <br>"
|
||||
if(s == "chatroom client")
|
||||
dat += "<a href='byond://?src=\ref[src];software=chatroom;sub=0'>Chatroom Client</a> <br>"
|
||||
if(s == "crew manifest")
|
||||
dat += "<a href='byond://?src=\ref[src];software=manifest;sub=0'>Crew Manifest</a> <br>"
|
||||
if(s == "medical records")
|
||||
@@ -631,4 +636,9 @@
|
||||
dat += "</ul>"
|
||||
dat += "<br><br>"
|
||||
dat += "Messages: <hr> [pda.tnote]"
|
||||
return dat
|
||||
return dat
|
||||
|
||||
/mob/living/silicon/pai/proc/chatroom()
|
||||
|
||||
pda.mode = 5
|
||||
pda.attack_self()
|
||||
@@ -1,5 +1,18 @@
|
||||
var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
|
||||
/datum/data_chat_msg
|
||||
var/sender = "Anon"
|
||||
var/channel = "ss13"
|
||||
var/message = "Blank"
|
||||
|
||||
/datum/data_chat_msg/New(var/param_sen = "", var/param_chan = "", var/param_msg = "")
|
||||
if(param_sen)
|
||||
sender = param_sen
|
||||
if(param_chan)
|
||||
channel = param_chan
|
||||
if(param_msg)
|
||||
message = param_msg
|
||||
|
||||
/datum/data_pda_msg
|
||||
var/recipient = "Unspecified" //name of the person
|
||||
var/sender = "Unspecified" //name of the sender
|
||||
@@ -54,6 +67,7 @@ var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
|
||||
var/list/datum/data_chat_msg/chat_msgs = list()
|
||||
var/list/datum/data_pda_msg/pda_msgs = list()
|
||||
var/list/datum/data_rc_msg/rc_msgs = list()
|
||||
var/active = 1
|
||||
@@ -88,6 +102,9 @@ var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/message_server/proc/send_chat_message(var/sender = "", var/channel = "", var/message = "")
|
||||
chat_msgs += new/datum/data_chat_msg(sender,channel,message)
|
||||
|
||||
/obj/machinery/message_server/proc/send_pda_message(var/recipient = "",var/sender = "",var/message = "")
|
||||
pda_msgs += new/datum/data_pda_msg(recipient,sender,message)
|
||||
|
||||
@@ -240,10 +257,13 @@ var/obj/machinery/blackbox_recorder/blackbox
|
||||
|
||||
/obj/machinery/blackbox_recorder/proc/round_end_data_gathering()
|
||||
|
||||
var/chat_msg_amt = 0
|
||||
var/pda_msg_amt = 0
|
||||
var/rc_msg_amt = 0
|
||||
|
||||
for (var/obj/machinery/message_server/MS in world)
|
||||
if (MS.chat_msgs.len > chat_msg_amt)
|
||||
chat_msg_amt = MS.chat_msgs.len
|
||||
if (MS.pda_msgs.len > pda_msg_amt)
|
||||
pda_msg_amt = MS.pda_msgs.len
|
||||
if (MS.rc_msgs.len > rc_msg_amt)
|
||||
@@ -262,6 +282,7 @@ var/obj/machinery/blackbox_recorder/blackbox
|
||||
feedback_add_details("radio_usage","SRV-[msg_service.len]")
|
||||
feedback_add_details("radio_usage","CAR-[msg_cargo.len]")
|
||||
feedback_add_details("radio_usage","OTH-[messages.len]")
|
||||
feedback_add_details("radio_usage","CHA-[chat_msg_amt]")
|
||||
feedback_add_details("radio_usage","PDA-[pda_msg_amt]")
|
||||
feedback_add_details("radio_usage","RC-[rc_msg_amt]")
|
||||
|
||||
@@ -346,4 +367,4 @@ proc/feedback_add_details(var/variable,var/details)
|
||||
|
||||
if (!FV) return
|
||||
|
||||
FV.add_details(details)
|
||||
FV.add_details(details)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
author: Tkdrg
|
||||
delete-after: true
|
||||
changes:
|
||||
- rscadd: "Cutting-edge research in a secret Nanotransen lab has shed light into a revolutionary form of communication technology known as 'chat'. The Personal Data Assistants of Space Station 13 have been deployed with an experimental module implementing this system, dubbed 'Nanotransen Relay Chat'."
|
||||
Reference in New Issue
Block a user