Godfinger
Godfinger is a modular script extension system that allows rcon hookup and plugin interaction to simplify serverside external scripting for MBII OpenJK in python.
Install / Use
/learn @MBII-Galactic-Conquest/GodfingerREADME
ㅤㅤㅤMBII OpenJK "Godfinger" scripting platform
</br>ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ
ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ
</br>
ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤㅤㅤ
A modular script extension system that allows streamlined rcon & plugin interaction to simplify serverside processing for MBII in python. Aimed to better equip server owners to improve their own creative works, and have more expression over their game servers.
The possibilities of this system allow for myriad of custom logfile implements, such as:
- moderation,
- translations,
- blacklisting,
- kill tracking,
- points tracking,
- complex teamconfig management,
- making custom gamemodes,
- organizing round information,
- fun interactions with chat,
- remote cvar injection,
- smod smsay admin chat commands,
- incorporating shell scripts,
- account systems,
- sql databases,
- AI responses,
- automated asset building,
- integrating other languages,
- discord integration, & more.
</br>
</br>
</br> </br>[!IMPORTANT]
** REQUIRES PYTHON 3.12.7+ **Ensure godfinger folder is installed in
Jedi Academy/GameData/.Ensure your logfile is set to
server.login yourserver.cfg.Ensure the following cvars are set in your
server.cfg.
g_logExplicitis"3"g_logSyncis"1"com_logChatis"2"g_logClientInfois"1"g_statLogis"1"g_statLogFileisstatlog.logsv_maxOOBRateIPshould be at least3to prevent rcon rate limiting. If rate limiting persists, increase this value. </br>THEN,
</br>
- set
com_logfile"2"- set
com_logSync"1"- set
logfile"2"Execute
"prepare"script based on platform in./prepare/osto install dependancy modules, run the"start"or"startDebug"script based on platform in./start/os, then sufficiently fill out the generatedgodfingerCfg.jsonin root directory.You may now
startthe godfinger system normally.
</br> </br>[!NOTE] This system was created initially for the
MBII Supremacy Project, now available for public use.</br>Originally created byViceDice&ACHUTA, redistributed for a public MIT release.All bugfixes or optimizations may be reviewed and potentially accepted through method of
pull requests.</br>All pull requests are asked to be directed at themergebranch before tested approval into upstreamdevormainbranches.</br></br>We will not accept custom plugins upstream, outside of crucial widespread plugins likeRTV, designed for abstract server hosting.
</br> </br>[!CAUTION]
Known problems
</br>#1) Python has issues sometimes with dirpathing in json files, so double backslashes
</br>\\may be necessary.</br>e.g:C:\\Program Files (x86)\\SteamCMD\\JKA\\Gamedata\\MBII\\#2)
138is the maximum bytes for svsay,993for vstr, and2048for general rcon payload in MBII OpenJK.</br>Estimating roughly5 rcon messages per 0.02 seconds( 20 milliseconds, 50 fps )The rcon messaging if rate is limiting will block calling thread until next timeframe, because we have to send/recieve rcon messaging in sync mode.
</br>So i.e, if you send 6 rcons within 20 miliseconds frame time, it will send 5 and then wait for 20 milliseconds and send the 6th rcon afterwards.
#3) If you don't have GIT natively installed when running the update process as a windows user, and it errors on portable install,
7z_portable.zipis stored using Git LFS. You mustdownloadand place it in./lib/other/win, then run the update process again, or referencereleaseversions with 7Z portable file manager included natively.</br>Alternatively, and for
UNIXusers, ensureGIT is installedbefore using the godfinger platform as a necessary precaution.
</br> </br>[!NOTE]
Config file documentation
The JSON file format is used for all config files included in this release, and while its usage is convenient for the programmers, it does not allow for in-line commentary to describe the function and usage of various settings in the file. Thus, the following is a brief overview of the config files included in this release.
</br>godfingerCfg.json
- "Remote" - "address" - "ip" : The IP address of the server to connect to. In most cases this should be localhost as the script requires access to the log file to function. - "port" : The port to connect to. In most cases, should be 29070. - "bindAddress" : The address for the script to use as a bind address. In most cases should be the same as the IP. - "password" : The server's rcon password. Set in server.cfg. - "MBIIPath" : File path to the MBII installation to be used. - "logFilename" : Name of the server log file (defined in server.cfg, default is server.log) - "serverFileName" : Name of the server executable file to use. - "logicDelay" : Interval of time to pass between script heartbeat loops. - "logReadDelay" : Interval of time to pass between retrieval of new log lines to parse. - "paths" : A list of string paths to append to system path, used to pass import directories for dependancies of plugins and such. - "restartOnCrash" : If this is set to true, the server will attempt to restart itself if a fatal exception is detected. - "watchdog" : Process monitoring and auto-restart configuration for the MB2 dedicated server. The RconInterface already monitors the MB2 server process automatically - this setting enables automatic restart when the process dies. - "enabled" : If true, enables automatic restart when the MB2 server process dies. The process monitoring is always active in RconInterface. - "restartServer" : If true, attempts to restart the MB2 server when it crashes. - "serverStartCommand" : Path to the script/executable to start the MB2 server. If left empty (""), Godfinger will automatically set this to the platform-specific autostart scripts by OS. - "interfaces" - "pty" : Pseudo-terminal utilities (https://docs.python.org/3/library/pty.html), used to wrap the mbiided process. - "target" : File path to the MBII dedicated server executable. - "inputDelay" : Interval of time to pass between terminal heartbeat loops. - "rcon" : The typical use of the godfinger script extension system, generic logfile parsing. - "Remote" - "address" - "ip" : The IP address of the server to connect to. In most cases this should be localhost as the script requires access to the log file to function. - "port" : The port to connect to. In most cases, should be 29070. - "bindAddress" : The address for the script to use as a bind address. In most cases should be the same as the IP. - "password" : The server's rcon password. Set in server.cfg. - "logFilename" : Name of the server log file (defined in server.cfg, default is server.log) - "logReadDelay" : Interval of time to pass between retrieval of new log lines to parse. - "Debug" - "TestRetrospect" : true/false allows for simulating and recreating active game data for the purpose of test case bugfixing. False is generally considered default. - "interface" : Where you can specify which interface you wish to use, in this case, "rcon" or "pty", with "rcon" as default. - "paths" : Where you can specify foreign directories not native to the godfinger root working directory, in the event of private codebases, or other implements with the godfinger system. Default is ".\\" - "prologueMessage" : String to show when the godfinger system has acknowledged sufficiently starting up, and deployed natively without error. - "epilogueMessage" : String to show when the godfinger system concludes, and has exited cleanly, safely. - "Plugins" : A list of plugin names, defined as python package strings (https://docs.python.org/3/tutorial/modules.html#packages), to use with the engine.
</br>[!IMPORTANT]
Implementing your own plugins
"Plugins": [ { "path":"plugins.shared.pluginfolder.pluginfile" } ] } - "plugins" : do not modify, native plugins dirpath - "shared" : shared, or private directory, depending on plugins use - "pluginfolder" : name of your custom plugin folder - "pluginfile" : name of your custom plugin file, do not add .py extensionEnsure you place the
requirements.txtwith required dependencies alongside your plugins.
