VE Lua Documentation

Press F to search!

sendStreams

Definition


-- @/lua/common/guihooks.lua:88

-- WARNING: this can only be called from vehicle onGraphicsStep
local function sendStreams()
  vehicleLuaSpecific()
  for streamName, data in pairs(cache) do
    queueStreamDataJS(streamName, jsonEncodeWorkBuffer(data))
  end
  sendStreamsToGELua(cache)
  table.clear(cache)
end

Callers

@/lua/ge/main.lua
    if guihooks.updateStreams then
      guihooks.sendStreams(dtReal)
      guihooks.updateStreams = false
@/lua/common/guihooks.lua
  queueStream = function(key, value)
    -- set a flag that we will send streams later (see main.lua guihooks.sendStreams(dtReal))
    M.updateStreams = true
@/lua/vehicle/main.lua
    guihooks.updateStreams = true
    guihooks.sendStreams()
  else