sharedstate: Add alternative ping using key names
This commit is contained in:
parent
34cd1f5956
commit
60b57fd097
@ -146,6 +146,16 @@ function pings.sharedstate_transfer(index, value)
|
||||
set_value(resolve_key(index), value)
|
||||
end
|
||||
|
||||
--- Internal; transfer value over network using key names
|
||||
---Ping used to transfer a value over the network, should not be called
|
||||
---directly
|
||||
---@param key string Key
|
||||
---@param value any New value
|
||||
function pings.sharedstate_ktransfer(key, value)
|
||||
logging.trace("pings.sharedstate_ktransfer", key, value)
|
||||
set_value(key, value)
|
||||
end
|
||||
|
||||
--- Set shared value
|
||||
---Sets a shared value. This sends a ping to transfer it over the network.
|
||||
---@param key string key name
|
||||
@ -158,6 +168,7 @@ function sharedstate.set(key, value)
|
||||
error(errormsg)
|
||||
end
|
||||
pings.sharedstate_transfer(resolve_index(key), value)
|
||||
-- pings.sharedstate_ktransfer(key, value)
|
||||
end
|
||||
|
||||
-- this can be copied directly from the internal functions as it is read only
|
||||
|
Loading…
x
Reference in New Issue
Block a user