GE Lua Documentation

Press F to search!

onInstructions

Definition


-- @/lua/ge/extensions/core/online.lua:297

-- called from C++ do not remove
local function onInstructions(data)
  --log('D', 'online.onInstructions', 'got instructions: ' .. dumps(data))

  if not data.origin or data.origin ~= 'gameauth' or type(data.cmds) ~= 'table' then
    log('E', 'online.onInstructions', 'unknown instructions. Discarded: ' .. dumps(data))
    return
  end

  for _, cmd in pairs(data.cmds) do
    if cmd.type == 'message' then
      table.insert(storedMessages, cmd)
      -- if ready, directly show them
      if messageUIReady then
        showStoredMessages()
      end
    elseif cmd.type == 'modUpdateAvailable' then
      log('D',"online.onInstructions","modUpdateAvailable")
      extensions.core_modmanager.check4Update()
    elseif cmd.type == 'repomsg' then
      extensions.core_repository.setRepoMsg(cmd)
    elseif cmd.type == "repocmd" then
      extensions.core_repository.setRepoCmd(cmd)
    elseif cmd.type == 'automationmsg' then
      extensions.core_repository.setrepoAutomationMsg(cmd)
    else
      log('E', 'online.onInstructions', 'unknown instruction: ' .. dumps(cmd))
    end
  end
end

Callers