Old School Ops

# RF 4.55: feature request: load server modules from Lua scripts (`scripts\modules\*.lua`)

Open RF Online: Dragonborn IDEA-1 proposed by cybercyber ·

Game: RF 4.55 (Dragonborn), server v0.2.0, Windows build (stock gameserver.exe, SHA-256 96452fbd…).

Summary

The gameserver already has a module system, but every module has to be written in Go and compiled into gameserver.exe. The server's Lua runtime can only declare dungeons. A server owner who wants a small server-side feature (an autoloot, a boss alert, a system notice) has no way to add one without a new build.

I'd like gamemodule to also load modules written in Lua, through the gopher-lua runtime the server already ships for dungeons.

What's there today (read from the v0.2.0 binary's Go symbols)

  • gommo/pkg/gamemodule.(*Set): Register, Settings, Commands, EnsureTables, Start, Stop, Run, with CommandSpec for % commands. A module implements Key, Settings, Requirements, Commands, EnsureTables, Start and Stop.
  • The only module is rfmodule/season. Nothing loads a module from disk.
  • gommo/games/rfscript (gopher-lua) has one verb, the dungeon (declareDungeon, parseMission, parseSpawnList). Inside a run a script can spawn, morph, count kills and grant rewards, but it has no hooks outside a dungeon run.

Request

Let gamemodule load Lua modules from scripts\modules\*.lua:

  • Lifecycle: the same as a Go module: a key, settings in server_config, % commands with GM levels (gm.command_levels), tables, start and stop.
  • Events (a script registers handlers for these):
    • player login and logout;
    • monster spawned and killed (the killer, the monster, the map);
    • player killed by a player (PvP);
    • Chip War start, end and result;
    • item dropped and looted;
    • chat (each channel);
    • auction listing;
    • level up;
    • enhance/upgrade result;
    • a timer.
  • Actions (what a handler can call):
    • announce and system notice;
    • mail;
    • give an item or currency;
    • apply a buff;
    • warp.
  • Safety: a module that fails validation is refused at load time, with the same checks and did-you-mean hints the dungeon scripts get, so a broken script can't take the server down.

What it would allow

Each of these is a small server-side feature that today needs a GoMMO build:

FeatureNeeds
Autolootmonster killed, item dropped, give item
Global message, system noticechat, timer, announce
Pit boss alertmonster killed / spawned, announce
New-player informer, staff presencelogin, announce
Auction max price, cross-race auctionauction listing
PvP penaltyplayer killed
Cash regen, level bonustimer, level up, give currency/item
Enhance notifyenhance result, announce
Chip War random/cash reward, bonus buffChip War events, give item/currency, buff

Comments

Nothing yet.

Sign in to comment.

Top xp sources

How xp works
Loading…

Open the full search page