Files
Yogstation/code/modules/modular_computers/NTNet/NTNRC/conversation.dm
TheGamerdk 5e514f81e7 Ports tgui-next 3.0, removes tgui 1.0 + Smart Asset Cache (#8291)
* Update Smes.js

* teleporter

* timer

* mining

* infra + prox

* uplink

* apc

* laser

* compile

* ui_x and ui_y and custom_materials

* 512

* smart asset cache

* vending machines

* Fixes missing icons. Removes rasta beanie

* cargo

* MULE + Intelli + Shuttle + Preferences

* AI fixer

* robot

* thing

* thing x2

* mecha

* compile

* oops

* Mining Vendor Fix

* Update traitordevices.dm

* Update proximity.dm

* Update EmergencyShuttleConsole.js

* rebuild

* uwu

* Revert "uwu"

This reverts commit de3ab5ff76.

* Update autodrobe.dm

* Update Vending.js

* Update _vending.dm

* Update Vending.js

* Update _vending.dm

* Build

* Update _vending.dm

* rebuild

* Update _vending.dm

* laser

* shuttle

* gigas

* signaller

* launchpad

* Update Vending.js

* eigthball

* pad

* ntnet relay

* labor stuff

* solar

* contrcators

* sprite fix

* Fixes contractor runtime (#45932)

* fix

* word change

* fixes contractor tablet (#47559)

* contractor

* ntos card console thing

* fixes

* dna console

* tweaks

* byondUI

* cargo hold

* fixes

* robit

* malf picker

* compile

* dependencies

* electropack

* transfer valve

* canvas

* fixes

* uplni stuff

* dna

* e

* tgui

* Octet separators in DNA Console genome sequencer. (#50516)

* Octet separators for the octet separator god.

* Code review changes

* REMOVES TGUI

* KNOB

* r

* tgui 3.0

* compile

* fixes

* fixes

* crafting fixes

* canister

* refactors

* bio gen

* MIT license

* seed

* Update NaniteCloudControl.js

* Update Uplink.js

* uwu

* oops

* fixes

* nanites

* Fixes nanite deactivation timer

* Revert "Fixes nanite deactivation timer"

This reverts commit c5fcfd34de.

* Revert "nanites"

This reverts commit eade3a61f4.

* various fixes

* compile

* turdis

* Update build_tgui.sh

* akwrard

* ha

* haha, HAHAHA!!

* compile

* fixes

* quick fix

* gps + dna fixes

* Compile

* DNA

* fixes

* sleeper + optable

* fixes

* mulebot

* Update cloning.dm

* Update cloning.dm

* Update ClockworkSlab.js

* Update Operating.dm

* Update nanite_chamber.dm

* Update nanites.dm

* Update nanites.dm

* Update stasis.dm

* Update asset_list_items.dm

* Update ClockworkSlab.js

* uwu

* oof

* Various FIxes + clockwork UI

* compile

* Sleeper fix

* Crew console

* AWKWARD

* PsiWeb

* uwu

* uwu

* psi web

* TGUI GONE

* compile

* autolethe

* Gulag + Solar

* Canister

* build

* private sale

* compile

* Update ntnrc_client.dm

* uwu

* canvas

* uwu

* uwu

* uwu

* uwu

* uwu

* uwu

* uwu

* uwu

* compile

* rust_g 0.4.3

* rust_g 0.4.4

* paint

* fixed

* icons

* Update easter.dm

* Update yogstation.dme

* asset cache

* Update asset_cache.dm

* opops

* hmm

* hm

* oh no

* awkward

* Update asset_list_items.dm

* hey

* Update asset_list_items.dm

* Update asset_cache_item.dm

* last try

* Update asset_list_items.dm

* fuck it

* hmm

* Update asset_list_items.dm

* uwu

* Update client_procs.dm

* Update PDA.dm

* no i didn't

* Update guardianbuilder.dm

* Update solar.dm

* Update minimap.dm

* Update _vending.dm

* tgui

* Update skin.dmf

* Update tgui.bundle.js

* Fixes

* Update borg_monitor.dm

* nanite fix

* Update rust_g.dll

Co-authored-by: Neo <26365368+Neo-0@users.noreply.github.com>
Co-authored-by: Arkatos1 <43862960+Arkatos1@users.noreply.github.com>
Co-authored-by: Rob Bailey <actioninja@gmail.com>
Co-authored-by: nightred <nightred@gmail.com>
Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: zxaber <37497534+zxaber@users.noreply.github.com>
Co-authored-by: skoglol <33292112+kriskog@users.noreply.github.com>
Co-authored-by: TheChosenEvilOne <34602646+TheChosenEvilOne@users.noreply.github.com>
Co-authored-by: Jordie <4343468+Jordie0608@users.noreply.github.com>
Co-authored-by: 81Denton <32391752+81Denton@users.noreply.github.com>
Co-authored-by: MrPerson <spamtaffic@gmail.com>
Co-authored-by: Akrilla <mrtactical@hotmail.co.uk>
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: spookydonut <github@spooksoftware.com>
Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: oranges <email@oranges.net.nz>
Co-authored-by: WarlockD <warlockd@gmail.com>
Co-authored-by: XDTM <heliumt@yahoo.it>
Co-authored-by: Sanator <39862806+Sanator@users.noreply.github.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: Kelenius <kelenius@ya.ru>
2020-06-14 17:52:52 -04:00

77 lines
2.2 KiB
Plaintext

#define MAX_CHANNELS 1000
/datum/ntnet_conversation
var/id = null
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()
var/password
var/static/ntnrc_uid = 0
/datum/ntnet_conversation/New()
id = ntnrc_uid + 1
if(id > MAX_CHANNELS)
qdel(src)
return
ntnrc_uid = id
if(SSnetworks.station_network)
SSnetworks.station_network.chat_channels.Add(src)
..()
/datum/ntnet_conversation/Destroy()
if(SSnetworks.station_network)
SSnetworks.station_network.chat_channels.Remove(src)
return ..()
/datum/ntnet_conversation/proc/add_message(message, username)
message = "[station_time_timestamp()] [username]: [message]"
messages.Add(message)
trim_message_list()
/datum/ntnet_conversation/proc/add_status_message(message)
messages.Add("[station_time_timestamp()] -!- [message]")
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/C)
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)
/datum/ntnet_conversation/proc/remove_client(datum/computer_file/program/chatclient/C)
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)
operator = null
if(clients.len)
var/datum/computer_file/program/chatclient/newop = pick(clients)
changeop(newop)
/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
add_status_message("[client.username] has changed channel title from [title] to [newtitle]")
title = newtitle
#undef MAX_CHANNELS