mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* Ports SSnetworks killings * Update names.dm * Removes my debug message and fixes instances it caught
102 lines
4.0 KiB
Plaintext
102 lines
4.0 KiB
Plaintext
/obj/item/computer_hardware/network_card
|
|
name = "network card"
|
|
desc = "A basic wireless network card for usage with standard NTNet frequencies."
|
|
power_usage = 50
|
|
icon_state = "radio_mini"
|
|
var/identification_id = null // Identification ID. Technically MAC address of this device. Can't be changed by user.
|
|
var/identification_string = "" // Identification string, technically nickname seen in the network. Can be set by user.
|
|
var/long_range = 0
|
|
var/ethernet = 0 // Hard-wired, therefore always on, ignores NTNet wireless checks.
|
|
malfunction_probability = 1
|
|
device_type = MC_NET
|
|
var/global/ntnet_card_uid = 1
|
|
|
|
/obj/item/computer_hardware/network_card/diagnostics(mob/user)
|
|
..()
|
|
to_chat(user, "NIX Unique ID: [identification_id]")
|
|
to_chat(user, "NIX User Tag: [identification_string]")
|
|
to_chat(user, "Supported protocols:")
|
|
to_chat(user, "511.m SFS (Subspace) - Standard Frequency Spread")
|
|
if(long_range)
|
|
to_chat(user, "511.n WFS/HB (Subspace) - Wide Frequency Spread/High Bandiwdth")
|
|
if(ethernet)
|
|
to_chat(user, "OpenEth (Physical Connection) - Physical network connection port")
|
|
|
|
/obj/item/computer_hardware/network_card/New(l)
|
|
..()
|
|
identification_id = ntnet_card_uid++
|
|
|
|
// Returns a string identifier of this network card
|
|
/obj/item/computer_hardware/network_card/proc/get_network_tag()
|
|
return "[identification_string] (NID [identification_id])"
|
|
|
|
// 0 - No signal, 1 - Low signal, 2 - High signal. 3 - Wired Connection
|
|
/obj/item/computer_hardware/network_card/proc/get_signal(specific_action = 0)
|
|
if(!holder) // Hardware is not installed in anything. No signal. How did this even get called?
|
|
return NTNET_NO_SIGNAL
|
|
|
|
if(!check_functionality())
|
|
return NTNET_NO_SIGNAL
|
|
|
|
if(ethernet) // Computer is connected via wired connection.
|
|
return NTNET_ETHERNET_SIGNAL
|
|
|
|
if(!SSmodular_computers || !SSmodular_computers.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal.
|
|
return NTNET_NO_SIGNAL
|
|
|
|
if(holder)
|
|
|
|
var/turf/T = get_turf(holder)
|
|
if((T && istype(T)) && (is_station_level(T.z) || is_mining_level(T.z)))
|
|
// Computer is on station. Low/High signal depending on what type of network card you have
|
|
if(long_range)
|
|
return NTNET_GOOD_SIGNAL
|
|
else
|
|
return NTNET_LOW_SIGNAL
|
|
|
|
if(long_range) // Computer is not on station, but it has upgraded network card. Low signal.
|
|
return NTNET_LOW_SIGNAL
|
|
|
|
return NTNET_NO_SIGNAL // Computer is not on station and does not have upgraded network card. No signal.
|
|
|
|
|
|
/obj/item/computer_hardware/network_card/advanced
|
|
name = "advanced network card"
|
|
desc = "An advanced network card for usage with standard NTNet frequencies. Its transmitter is strong enough to connect even off-station."
|
|
long_range = 1
|
|
power_usage = 100 // Better range but higher power usage.
|
|
icon_state = "radio"
|
|
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
|
|
/obj/item/computer_hardware/network_card/wired
|
|
name = "wired network card"
|
|
desc = "An advanced network card for usage with standard NTNet frequencies. This one also supports wired connection."
|
|
ethernet = 1
|
|
power_usage = 100 // Better range but higher power usage.
|
|
icon_state = "net_wired"
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
|
|
/obj/item/computer_hardware/network_card/integrated //Borg tablet version, only works while the borg has power and is not locked
|
|
name = "cyborg data link"
|
|
|
|
/obj/item/computer_hardware/network_card/integrated/get_signal(specific_action = 0)
|
|
var/obj/item/modular_computer/tablet/integrated/modularInterface = holder
|
|
|
|
if(!modularInterface || !istype(modularInterface))
|
|
return FALSE //wrong type of tablet
|
|
|
|
if(istype(modularInterface.borgo, /mob/living/silicon/robot))
|
|
var/mob/living/silicon/robot/R = modularInterface.borgo
|
|
if(!R)
|
|
return FALSE //No borg found
|
|
|
|
if(R.lockcharge)
|
|
return FALSE //lockdown restricts borg networking
|
|
|
|
if(!R.cell || R.cell.charge == 0)
|
|
return FALSE //borg cell dying restricts borg networking
|
|
|
|
return ..()
|