multi pc tests

This commit is contained in:
Ryan Ward 2018-07-02 20:40:24 -04:00
parent c88ad2e73b
commit 291c30a7ac
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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)