mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-18 11:30:35 +01:00
modular computer stuff
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
var/global/ntnrc_uid = 0
|
||||
|
||||
/datum/ntnet_conversation/
|
||||
var/id = null
|
||||
var/title = "Untitled Conversation"
|
||||
@@ -8,11 +7,15 @@ var/global/ntnrc_uid = 0
|
||||
var/list/clients = list()
|
||||
var/password
|
||||
|
||||
/datum/ntnet_conversation/New()
|
||||
/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/add_message(var/message, var/username, var/mob/user)
|
||||
@@ -38,7 +41,6 @@ var/global/ntnrc_uid = 0
|
||||
if(!istype(C))
|
||||
return
|
||||
clients.Add(C)
|
||||
add_status_message("[C.username] has joined the channel.")
|
||||
// No operator, so we assume the channel was empty. Assign this user as operator.
|
||||
if(!operator)
|
||||
changeop(C)
|
||||
@@ -47,7 +49,6 @@ var/global/ntnrc_uid = 0
|
||||
if(!istype(C) || !(C in clients))
|
||||
return
|
||||
clients.Remove(C)
|
||||
add_status_message("[C.username] has left the channel.")
|
||||
|
||||
// Channel operator left, pick new operator
|
||||
if(C == operator)
|
||||
@@ -67,4 +68,4 @@ var/global/ntnrc_uid = 0
|
||||
return 0 // Not Authorised
|
||||
|
||||
add_status_message("[client.username] has changed channel title from [title] to [newtitle]")
|
||||
title = newtitle
|
||||
title = newtitle
|
||||
@@ -38,6 +38,9 @@ var/global/datum/ntnet/ntnet_global = new()
|
||||
build_news_list()
|
||||
add_log("NTNet logging system activated.")
|
||||
|
||||
//add some default channels
|
||||
new /datum/ntnet_conversation("NTNet Relay", TRUE)
|
||||
|
||||
// Simplified logging: Adds a log. log_string is mandatory parameter, source is optional.
|
||||
/datum/ntnet/proc/add_log(var/log_string, var/obj/item/computer_hardware/network_card/source = null)
|
||||
var/log_text = "[worldtime2text()] - "
|
||||
|
||||
Reference in New Issue
Block a user