Up to Main Index                           Up to Journal for October, 2016

                   JOURNAL FOR WEDNESDAY 26TH OCTOBER, 2016
______________________________________________________________________________

SUBJECT: More updates, more stability and scripting
   DATE: Wed 26 Oct 22:49:13 BST 2016

More updates have just hit the public dev branch.

A lot of the changes are to do with improved error handling.

Errors accepting connections will no longer terminate the server, only the
connection causing problems will be terminated.

We also have a new configuration flag: server.Debug, which defaults to false.

Previously a panicking client goroutine would bubble up the call stack and
terminate the server. If the new server.Debug flag is false the panic will be
recovered and an attempt will be made to close down the client connection and
clean up associated resources. If server.Debug is set to true - for example
during development - the panic will terminate the server with a stack trace
still.

When a player quits the server any items they are carrying are now
automatically dropped. Previously they would be removed from the world and
garbage collected. This could mean you ended up with an empty world and
nothing interesting for the players to interact with.

In order to implement the item dropping a new script method has been added to
the state type. The script method is modelled after the older silent method
but is more powerful and more versatile. As a result the script method has
replaced the listen method - which now been removed.

The script method lets commands execute other commands. For example when a
player quits the server the inventory of the player is examined and for each
item a "DROP <item>" is executed using all of the existing drop command logic.
A "GIVE <player> <item>" command might be implemented by scripting a sequence
of "DROP <item>" and "GET <item>". This would have the advantage of reusing
all of the logic of dropping an item and the associated checks, as well as the
logic of getting an item and all of the associated checks - for example is the
player already carrying too much?

The script method has flags to suppress messages to specific recipients in the
same way that the listen method had. In the "GIVE" example above you wouldn't
actually want to see the messages about dropping and getting the item, but you
would want a "Diddymus gives you a pumpkin." message, for example.

I now need to look at the commands already implemented and see if any can take
advantage of the new script method. For now that will have to wait until after
the release.

Only 4 days left till Halloween... /\oo/\

--
Diddymus


  Up to Main Index                           Up to Journal for October, 2016