sharedstate: don't send unchanged values

This commit is contained in:
NullBite 2023-06-25 00:46:22 -04:00
parent 3c13cacfc9
commit ad783d8a7e
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -183,8 +183,11 @@ function sharedstate.set(key, value)
local errormsg="sharedstate: Key " .. key .. " has not been initialized."
error(errormsg)
end
pings.sharedstate_recv(resolve_index(key), value)
-- pings.sharedstate_recv_named(key, value)
-- don't bother sending unchanged values
if value ~= get_value(key) then
-- pings.sharedstate_recv(resolve_index(key), value)
pings.sharedstate_recv_named(key, value)
end
end
---Queue entries for sending