MAEngine

Server APIs

Server-side Lua APIs for MAEngine

Server APIs

These APIs are available in server-side scripts (Server/init.lua).

Core

Game Logic

Shared APIs

These are also available on server (identical to client):


Server Authority

The server is authoritative for all game state:

  • Entity spawning - Only the server can create entities
  • State modification - Server validates and applies all changes
  • Database access - Only server has DB access
  • Player management - Kick, ban, possess operations
-- Server/init.lua
Server.Subscribe("Start", function()
    Log("Server started!")
end)

Player.Subscribe("Spawn", function(player)
    local character = Character.Spawn(Vec3(0, 0, 100))
    player:Possess(character)
end)

On this page