Network Card
Building Type |
Build Gun | In Game |
---|---|
This computer module ia a network card that allows for intercomputer communication in form of pakets you can send over the network.
The communication happens in channels from 0 to 10000. If you want to recieve network messages you will need to open the channel and then you can use the signal system to get the signals from the network card. Network messages are limited to 7 custom parameters and additionally the channel number and the sender address. The sender address has to be the other network card’s ID, not the ID of the computer.
You can only create a instance of a network card when you try to instantiate it from the computer it is placed on.
Interface
Parent |
Functions
Send Message send
(String Receiver receiver
, Int Port port
)
Sends a network message to the receiver with the given address on the given port. The data you want to add can be passed as additional parameters. Max amount of such parameters is 7 and they can only be nil, booleans, numbers and strings.
Flags |
RuntimeSync RuntimeParallel VarArgs |
- Parameters
-
Name Type Description Receiver
receiver
String
The component ID as string of the component you want to send the network message to.
Port
port
Int
The port on which the network message should get sent. For outgoing network messages a port does not need to be opened.
Open Port open
(Int Port port
)
Opens the given port so the network card is able to receive network messages on the given port.
Flags |
RuntimeSync RuntimeParallel |
- Parameters
-
Name Type Description Port
port
Int
The port you want to open.
Close All Ports closeAll
()
Closes all ports of the network card so no further messages are able to get received
Flags |
RuntimeSync RuntimeParallel |
Close Port close
(Int Port port
)
Closes the given port so the network card wont receive network messages on the given port.
Flags |
RuntimeSync RuntimeParallel |
- Parameters
-
Name Type Description Port
port
Int
The port you want to close.
Broadcast Message broadcast
(Int Port port
)
Sends a network message to all components in the network message network (including networks sepperated by network routers) on the given port. The data you want to add can be passed as additional parameters. Max amount of such parameters is 7 and they can only be nil, booleans, numbers and strings.
Flags |
RuntimeSync RuntimeParallel VarArgs |
- Parameters
-
Name Type Description Port
port
Int
The port on which the network message should get sent. For outgoing network messages a port does not need to be opened.
Signals
Network Message NetworkMessage
(String Sender sender
, Int Port port
)
Triggers when the network card receives a network message on one of its opened ports. The additional arguments are the data that is contained within the network message.
Flags |
VarArgs |
- Parameters
-
Name Type Description Sender
sender
String
The component id of the sender of the network message.
Port
port
Int
The port on which the network message got sent.
- Computer Modules
-
Drive Holder - GPU Base - GPU T1 - Internet Card - Network Card - Processor Lua - RAM - Screen Driver
- Buildings