Skip to content

LiF-x/ServerAutoloader

Repository files navigation

Dynamic JSON Badge

ServerAutoloader

The LiFx ServerAutoloader is the server-side mod framework for Life is Feudal: Your Own. It turns an unmoddable dedicated server into one that discovers and loads mods automatically, exposes lifecycle and gameplay hooks, and registers custom items and crafting recipes into the game database — so multiple mods from different authors can run side by side without editing game files.

Features

  • Automatic mod loading — drop a folder with a mod.cs into mods/ and it loads on server start.
  • Hook system — 20+ callbacks covering server lifecycle, player connections, spawns, deaths/kills/suicides, Justice Hour, swimming, and a 5-second tick. Mods register callbacks instead of overwriting game functions.
  • Database registration — declare custom object types and recipes in script; the framework writes them into sql/dump.sql with duplicate protection and validation (including the 100% quality-influence rule).
  • Client data export — exports objects_types, recipe and recipe_requirement to XML for building client modpacks.
  • Mod transparency — players see the framework version and every loaded mod (with its version) when they spawn.
  • Bundled utilitiesJettison JSON library, SHA-256 hashing, and gameplay features from ServerUtility (offline raid protection, online alignment gain, loot drops) configured via AutoloadConfig.cs.

Documentation

📚 Full documentation

Page What it covers
Getting Started Mod requirements, folder layout, load sequence, full mod template
Hooks Reference Every callback hook, with parameters and timing
API Reference All LiFx:: functions and globals
Objects & Recipes Adding custom items and crafting recipes
Configuration AutoloadConfig.cs settings
Data Export DB → XML export for client modpacks
Jettison JSON The bundled JSON library

Quick example

// mods/ExampleMod/mod.cs
if (!isObject(ExampleMod))
{
    new ScriptObject(ExampleMod) {};
}

package ExampleMod
{
    function ExampleMod::version(%this) { return "1.0.0"; }

    function ExampleMod::setup(%this)
    {
        LiFx::registerCallback($LiFx::hooks::onSpawnCallbacks, "onSpawn", ExampleMod);
    }

    function ExampleMod::onSpawn(%this, %client)
    {
        %client.cmSendClientMessage(2475, "Welcome to the server!");
    }
};

activatePackage(ExampleMod);

See Getting Started for the full walkthrough.

Installation

Grab the latest release (art.zip) from Releases and place it in your dedicated server root. On first start the framework extracts its configuration to mods/AutoloadConfig.cs. Guides and troubleshooting live in the LiFx knowledge base.

Repository layout

Path Purpose
main.cs The framework: mod loader, hook system, DB registration, data export
AutoloadConfig.cs Default server configuration (extracted to mods/ at runtime)
jettison.cs JSON parser/serializer
sha256.cs SHA-256 implementation (framework build verification)
dump.sql Pristine game-data dump used to rebuild sql/dump.sql each start
ServerUtility/ Submodule: bundled gameplay features (utility.cs)
art.bat Packs the release art.zip

Related projects

License

GNU General Public License v3. Publicly distributed mods built on this framework must comply with the license's source-sharing requirements.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Contributors

Languages