Dedicated Server API

stickmenzstickmenz REGISTERED Posts: 12 Seed
Hello everyone,

We have a dedicated server live ( and are currently working through testing server loads and reporting back to the dev team. We would like to create some simple mods and push the limits, even though the API is in its early stages, it's great practice.

My mod team (from Minecraft) had some general questions, mostly: What event system can we hook into as we don't see any event listeners in the api? API version alpha 0.8.5.



  • stickmenzstickmenz REGISTERED Posts: 12 Seed
    Linking @Ghost
  • johnycilohoklajohnycilohokla REGISTERED Posts: 283 Seed
    Hello Stickmenz,

    We have a CallbackManager that allows callbacks/hooks to be exposed for modders to hook into, currently it only exposes few callbacks related to placement, but we are adding new hooks to it when needed.
    A lot of stuff can be achieved already by using the ModScriptClass.
    For example we are exposing LocalPlayerReady(player) on ModScriptClass, this will allow you to interact with players from mod files.
    You can also override files and functions for specific classes.

    We have used lua to create all of the game content, which means you can change almost anything.

    It really depends on what you want to achieve, will the modification be server side only or are you planning to have a client side mod for the server? Do you want to add new things to the game or modify what's currently there?

    Server side only mods are doable, but it will require tinkering with the systems.
    Server&Client mods will give you access to everything we have access to.

    My Blog
      yt.png  t.png  
  • sergeantmajormesergeantmajorme REGISTERED Posts: 1 Podling
    What we're trying to make is some server side plugins, mainly permissions/block protection. I have an entire password and permissions system built up, but need to be able to have a command run. I've tried following the testmodscript, but due to many issues it doesn't seem to be working. Even when I set it up properly I can't get it to send text to players for updates.

    The above command ends up printing no information. It seems like there is no way for me to add a server-side command via the modding API.

    Relevant code sections:

    Shows that rjcmd does in fact load as a valid permission
    [01:04:51] Precaching objects...
    [01:05:03] Initializing World
    [01:05:03] debugger.lua loaded for Lua 5.1
    [01:05:03] Command rjcmd registered to RJPermissions
    [01:05:03] Command login registered to RJPermissions
    [01:05:03] Command logout registered to RJPermissions

    Where the registration happens
    function RJPermissions:Initialize()
    failed = 0
    commands = {'rjcmd','login','logout','chgpwd','chgpwdadm','addperm','clearperm'}
    for count=1,#commands do
    if Eternus.CommandService:NKRegisterChatCommand(commands[count],commands[count]) then
    NKPrint("Command "..commands[count].." registered to RJPermissions")
    NKError("FAILED - Command "..commands[count].." NOT registered to RJPermissions")
    --INitialize the default playe
    rjpermtable["default"]["active"] = 1

    rjcmd function itself
    function RJPermissions:rjcmd(userCmd, args)
    rjdebug("RJPermissions has loaded properly")
    if table.getn(args) < 1 then return end
    if args[1] == "d" then displayTable() end
    rjdebug(tostring(args[1]).." "..tostring(args[2]).." "..tostring(args[3]))
    if args[1] == "h" then rjdebug(tostring(RJPermissions:HasPermssion(args[2],args[3]))) end

    rjdebug function
    function rjdebug(args)
    Eternus.CommandService:NKSendNetworkText(args) --This seems to NEVER send text to players...
  • johnycilohoklajohnycilohokla REGISTERED Posts: 283 Seed
    OK, now I see what you need.
    Currently the commands are executed on the client side, which means unfortunately it would have to be a client side mod.
    I will definitely add server side commands to the modding improvements list, I can see a lot of servers wanting those.
    My Blog
      yt.png  t.png  
  • StilleVandeStilleVande REGISTERED Posts: 81 Seed
    This is great work guys. Hats off to your team. :)

    Please keep it up! :)
    Seriously, it's Faroese for Calm Water. - StilleVande
  • PH4N20MPH4N20M REGISTERED Posts: 1 Podling
    Sorry to necro but this is very relevant to this post

    Has this server side issue been solved with the new 0.8.6 update?

    PH4N20M port: 6600
  • johnycilohoklajohnycilohokla REGISTERED Posts: 283 Seed
    Yes, this issue has been resolved.
    All unhandled commands are passed to TUGGameMode:ExecuteSlashCommand.
    If the command doesn't exist on the client it is sent to the server.

    TestModScript contains an example of server side command.
    function TestModScript:Initialize()
    -- ...
    if Eternus.IsServer then
    -- Register server side command
    Eternus.GameState:RegisterSlashCommand("TestServerCommand", self, "TestServerCommandFunction")
    -- ...

    function TestModScript:TestServerCommandFunction(userInput, args, commandName, player)
    player:SendChatMessage("Executed Command: " .. commandName)
    player:SendChatMessage("Now printing args:")
    for key,value in pairs(args) do
    player:SendChatMessage("Finished printing.")
    return true
    My Blog
      yt.png  t.png  
Sign In or Register to comment.