From 291c30a7ac7461325b55466373aa46a7d2fb1233 Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Mon, 2 Jul 2018 20:40:24 -0400 Subject: [PATCH] multi pc tests --- multi/integration/networkManager.lua | 2 ++ test.lua | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/multi/integration/networkManager.lua b/multi/integration/networkManager.lua index b0f2271..7559b5a 100644 --- a/multi/integration/networkManager.lua +++ b/multi/integration/networkManager.lua @@ -158,6 +158,7 @@ function multi:newNode(settings) node.name = name node.server = net:newUDPServer(0) -- hosts the node using the default port node.port = node.server.port + print(node.port,node.port.udp:getsockname()) node.connections = net.ClientCache node.queue = Queue:newQueue() node.functions = bin.stream("RegisteredFunctions.dat",false) @@ -330,6 +331,7 @@ function multi:newMaster(settings) -- You will be able to have more than one mas client.OnDataRecieved(function(client,data) local cmd = data:sub(1,1) if cmd == "N" then + print(data) local name,ip,port = data:match("(.-)|(.-)|(.+)") local c = net:newUDPClient(ip,port) net.OnCastedClientInfo:Fire(c,name,ip,port)master.connections[name]=c diff --git a/test.lua b/test.lua index ae75f1e..2e2cc36 100644 --- a/test.lua +++ b/test.lua @@ -7,8 +7,8 @@ nGLOBAL = require("multi.integration.networkManager").init() -- Act as a master node master = multi:newMaster{ name = "Main", -- the name of the master - --noBroadCast = true, -- if using the node manager, set this to true to avoid double connections - --managerDetails = {"localhost",12345}, -- the details to connect to the node manager (ip,port) + noBroadCast = true, -- if using the node manager, set this to true to avoid double connections + managerDetails = {"localhost",12345}, -- the details to connect to the node manager (ip,port) } -- Send to all the nodes that are connected to the master master.OnNodeConnected(function(node)