The server has a new command which replaces all of the awkward-to-use commands such as /create, /remove, /patch, /insert_into, etc - in essence, all of the DM commands that deal with object manipulation.
The command is "/console" and it is purely managed by Python and multi-threading, all in under 200 lines of code (with the previous object manipulation code commands being well over 2k lines, if not 3k). One can bring up the console session with a simple "/console" command, and start using the Python scripting interface right away, with the full power of Python, Python modules, Atrinik Python module, etc at one's fingertips:
All of the scripting possibilities are available when using the interface, and the "activator" object (the player that activated the /console command) is available in local namespace. Thus, in order to create an object for example, one can just type activator.CreateObject("beer")
in the interface to get a beer arch in their inventory.
The power of the interface comes in with raids and events - it is much more flexible and powerful for this than the old "/create", since one can just create functions prior to the raid that can spawn various different monsters, control them, make them say things, etc. It is also possible to take "ownership" of a mob and control them - make them move around with obj.Move(direction), make them speak with obj.Say(text), etc. All of the possibilities are detailed in the Atrinik Python Plugin Documentation Page
, and the Python docs can be found here
Client implements a "/console-load" command, which allows you to load up your script files directly into your console session - for example, "/console-load geyser.py" would load the code in ~/.atrinik/console/geyser.py into your console session (if it's not started yet, it will be started).
It is possible to macro various things and not have the console session come up, by using for example "/console noinf::fire_geyser()" or "/console noinf::activator.hp = activator.maxhp". Changing an object's message is much easier than it used to be, thanks to Python's string manipulation abilities.
Of course, just with like the previous object manipulation commands, it is still possible to cause a crash or worse with the console, so, with great power comes great responsibility (and on public servers, testing on local beforehand). One thing to probably avoid is threading -- I'm not quite sure how well it works in an interactive Python shell session (which is what the console is, effectively), so it could cause a deadlock if used without care.
The console is fully threaded, so running commands in it will not cause the server to lag/freeze, even if you try to run a loop with a few trillions counter (though it may take a while to complete). Each player's /console session is a unique thread, so several DM's using the command will not interfere with each other.
In other news, the text input history buffer has been rewritten to be more flexible (allowing any number of history lines, as set in the client options [default 40, used to be limited to 20 max due to static buffer]), and more generic - so it can be used for different inputs, not just the main player console, but also the interface, with its own history, separate from the text input console. A new minor but useful feature is that you can now use the down arrow key to erase your text input, but add it to the history buffer - very useful if you're writing a long line but want to quickly respond to something else, then resume writing (or when talking to multiple people at once, for example). Inspired by irssi behavior.