Skip to content

C#

A KCD:MP game mode can be a C# class library instead of a Lua script: a .dll compiled against the server folder’s sdk/KcdMp.Api.dll, placed in a folder of its own under gamemodes/ and named in server.toml (script = "gamemodes/arena/Arena.dll"). It is the native tier - the Lua API is built on exactly these interfaces, so anything Lua can do a plugin can do with the same semantics, typed, and with the whole of .NET behind it: a database, a web service, a package from NuGet. The built-in freeroam the server falls back to is one.

Server API building a plugin, loading it, a database or web service behind it, IGameMode (the callbacks), IServerApi (the functions), IPlayer, IWorldEntity, IZone, IHudText, IParty, the records and enums

There is no client tier in C#: a mode’s client half is a Lua client script whatever the server side is written in. The behaviour of every call is documented once, on the Lua pages; the C# page maps the names and types. Setting up has the server folder, the first run and the editor; the reference has the keys the functions take.