Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
block:switch:zh [2022/08/14 13:00]
hxt521 created
block:switch:zh [2024/02/13 03:23] (current)
hfsr [中继器]
Line 1: Line 1:
-Relay+中继器
 ====== ======
 {{:​blocks:​switch.png?​nolink&​128|}} {{:​blocks:​switch.png?​nolink&​128|}}
  
-The Relay allows connecting different networks to each other. Only network messages will be passed along, components will not be visible through this. Use this to separate networks while still allowing communication using Network Cards. The reasoning is the same as for the [[block:​power_distributor|power distributor]] not connecting its adjacent networks: you may often wish to keep your sub-networks separate. This allows computers in different sub-networks to communicate without having to go all out and use wireless networks.+注:旧版本的交换机与无线接入点合并为了中继器。
  
-Note that relays have a limited bandwidth. They will only transfer one packet per 5 ticks (250ms) and their internal queue is limited to 20 packets. If you exceed this limit you will experience dropped packets. Also note that packets can be relayed no more than 5 times. After that the packet is dropped.+中继器可用于连接不同网络。只有网络报文可穿过中继器,而网络中的组件彼此不可见。使用它可以在保持网络独立的情况下允许使用网卡进行通信。不连接相邻网络的原因如[[block:​power_distributor:​zh|能量分配器]]页面所述:你可能需要保证子网络独立,避免组件混乱。中继器的存在使得不同子网中的电脑无需费力使用无线网络即可通信。
  
-Relays will not route packets back where they came from, but it is still possible to generate loops where packets will then arrive multiple times, so keep that in mind.+请注意中继器的带宽有限。它们只能每 5 tick(250ms)传输一个数据包,且其内部队列大小上限为 20 个数据包。如果超过这个限制就会出现丢包的情况。还需要注意的是,数据包的转发次数不能超过 5 次。超过之后数据包将被遗弃。
  
-A Wireless or Linked Relay may be created by first right-clicking on the Relay, and inserting a Wireless or Linked Card into the resultant GUI.+中继器不会将数据包传回它们传来的地方,但仍有可能产生回环,此时同一个数据包将会多次出现。所以一定要注意。
  
-The Relay block also serves as a ComputerCraft peripheral, providing an interface imitating that of ComputerCraft'​s (wired) modems. It will forward network messages sent from ComputerCraft to the OpenComputers side, which can be received if a [[item:​lan_card|network card]] is installed. It will also receive OpenComputers'​ network messages and push a corresponding signal in CC computers attached to the adapter. Note that network messages in OpenComputers do not require a "​response port" like ComputerCraft does. If the first argument for the network message is a number, it will be interpreted as the response port to tell ComputerCraft receivers, otherwise the response port will be set to `-1`.   +无线或连接中继器可以通过首先右键单击中继器,再将无线网卡或连接卡插入到GUI中来创建。
-*Note*: this functionality was available via the Adapter block before 1.1.0.+
  
-The Relay is crafted using the following recipe:  +中继器方块也可以充当CC模组的外设,提供了模仿CC(有线)调制解调器的接口。它将把CC模组发送的网络报文转发到OC模组一侧,如果这一侧的设备安装了[[item:network_card:​zh|网卡]]就可以接收到这些消息。它还会接收OC模组的网络报文,并向连接到适配器的CC电脑推送一个相应的信号。注意,OC模组中的网络报文不像CC模组那样需要“响应端口”。若网络报文的第一个参数为数字,则它将被理解为响应端口,并通知CC的接收方,否则响应端口将被设置为 `-1` 。 
-  * 3 x [[block:​cable|Cable]] + 
-  * 4 x Iron Ingot +注意:该功能在1.1.0之前也可以通过适配器方块使用。 
-  * 1 x [[item:​network_card|Network Card]] + 
-  * 1 x [[item:​materials|Printed Circuit Board]]+中继器由以下配方合成: 
 +  * 3 x [[block:​cable:zh|线缆]] 
 +  * 4 x 铁锭 
 +  * 1 x [[item:​network_card:zh|网卡]] 
 +  * 1 x [[item:​materials:​zh#​印刷电路板|印刷电路板]]
  
 {{:​recipes:​blocks:​switch.png?​nolink&​200|}} {{:​recipes:​blocks:​switch.png?​nolink&​200|}}