Actually use unique client id
This commit is contained in:
parent
b47d2dd2e1
commit
1dcc9ebf66
@ -137,7 +137,7 @@ function love.load()
|
||||
local requirePaths = love.filesystem.getRequirePath()
|
||||
love.filesystem.setRequirePath(requirePaths .. ";client/?.lua;client/?/init.lua")
|
||||
local mqttThread = love.thread.newThread("mqttthread.lua")
|
||||
mqttThread:start()
|
||||
mqttThread:start(love.math.random(0, 999999))
|
||||
mqttEventChannel = love.thread.getChannel("mqtt_event")
|
||||
mqttCommandChannel = love.thread.getChannel("mqtt_command")
|
||||
end
|
||||
|
@ -2,6 +2,8 @@
|
||||
local mqtt = require("mqtt")
|
||||
local client
|
||||
|
||||
local maxClientId = ...
|
||||
|
||||
local eventChannel = love.thread.getChannel("mqtt_event")
|
||||
local commandChannel = love.thread.getChannel("mqtt_command")
|
||||
|
||||
@ -46,7 +48,7 @@ end
|
||||
local function main()
|
||||
client = mqtt.client {
|
||||
uri = "mqtt.seeseepuff.be",
|
||||
username = "mqtt_controller-" .. math.random(0, 999999999),
|
||||
username = "mqtt_controller-" .. math.random(0, maxClientId),
|
||||
clean = true,
|
||||
reconnect = 5,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user