aaand fixed the return route, too... (cc -> oc networking)

This commit is contained in:
Florian Nücke 2014-03-08 21:34:14 +01:00
parent 261aecd6e8
commit ed7f2f0a21
2 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,6 @@ class Proxy {
def call = FileSystem.fromClass(OpenComputers.getClass, Settings.resourceDomain, "lua/rom")
},
Settings.resourceDomain + "/lua/rom")
}
def init(e: FMLInitializationEvent): Unit = {

View File

@ -52,7 +52,10 @@ class Router extends Hub with IPeripheral {
case "transmit" =>
val sendPort = checkPort(arguments, 0)
val answerPort = checkPort(arguments, 1)
plugs.foreach(_.node.sendToReachable("network.message", Seq(Int.box(sendPort), Int.box(answerPort)) ++ arguments.drop(2): _*))
val data = Seq(Int.box(answerPort)) ++ arguments.drop(2)
plugs.foreach(plug => {
plug.node.sendToReachable("network.message", new Packet(plug.node.address, None, sendPort, data))
})
null
case "isWireless" => Array(java.lang.Boolean.FALSE)
case _ => null