Differences

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

Link to this comparison view

Next revision
Previous revision
component:tunnel:zh [2023/10/25 09:41]
hfsr created
component:tunnel:zh [2023/12/27 03:40] (current)
hfsr [组件:隧道]
Line 1: Line 1:
-Component: Tunnel+组件:隧道
 ================ ================
-This component is provided by the [[item:​linked_card|linked card]].+此组件由[[item:​linked_card|连接卡]]提供。
  
-This card is similar to the [[component:​modem|network card's component]], but as it is only point-to-point,​ no ports can be configured, and the connection is always open.+这种扩展卡与[[component:​modem:zh|网卡组件]]类似,但是由于这种卡仅限点对点通信,所以它不能配置端口,而且连接是常开的。
  
-Component name: `tunnel`.  ​ +组件名:`tunnel` 
-Callbacks:+ 
 +回调函数:
  
 - `send(data...)`  ​ - `send(data...)`  ​
-  ​Sends the specified data to the card this one is linked to.+  ​将给定数据发送到另一张连接卡。 ​  
 +\\
 - `maxPacketSize():​number`  ​ - `maxPacketSize():​number`  ​
-  ​Gets the maximum packet size (config setting).+  ​获取最大数据包大小(可在配置文件修改)。 ​  
 +\\
 - `getChannel():​string`  ​ - `getChannel():​string`  ​
-  ​Gets the tunnel address of the link card. This is also available in `linkChannel` ​using an inventory controller and getting the stack from an inventory slot.+  ​获取连接卡的隧道地址。此属性的另一种获取方式为通过物品栏控制器读取含有此物品的物品栏槽位数据,其中的`linkChannel`即为此数据。 ​  
 +\\
 - `getWakeMessage():​string`  ​ - `getWakeMessage():​string`  ​
-  ​Gets the current wake-up message. When the network card detects the wake message (a string in the first argument of a network packet), on any port and the machine is off, the machine is started. This is the same functionality also provided by robots, cases, servers, drones, and tablets.+  ​获取当前设置的唤醒信息。当网卡的任意端口检测到了唤醒信息(某网络数据包第一个参数中的字符串),而电脑处于关闭状态,则电脑会启动。可用于机器人、普通电脑、服务器、无人机以及平板电脑。 ​  
 +\\
 - `setWakeMessage(message:​ string, [fuzzy: boolean]):​string`  ​ - `setWakeMessage(message:​ string, [fuzzy: boolean]):​string`  ​
-  ​Sets the wake-up message to the specified ​**string**. The message matching can be fuzzy (default is false). A fuzzy match ignores additional trailing arguments in the network packet.+  ​将唤醒信息设定为给定的**字符串**。信息可以模糊匹配(由`fuzzy`参数决定,默认为`false`)。模糊匹配时会忽略网络数据包中的其他参数。
  
-This card generates ​`modem_message` ​signals of the same format network cards do.+此扩展卡也会产生`modem_message`信号,格式与网卡相同。
  
 目录 目录