Up to Main Index                          Up to Journal for December, 2018

                  JOURNAL FOR WEDNESDAY 19TH DECEMBER, 2018
______________________________________________________________________________

SUBJECT: Improved veto handling + data race fix
   DATE: Wed 19 Dec 21:21:14 GMT 2018

Just completed the work to improve veto handling. When checking for vetoes all
sources of vetoes are now considered, previously only the first veto source
found was checked. All veto checking has been updated to use the new
Vetoes.FindAllVetoes method and the older Vetoes.FindVetoes method has been
dropped.

A few of the veto checks have also been updated for specific commands:


     DROP - In addition to checking the item being dropped and receiving
            inventory the item’s current inventory is checked.

      GET - In addition to checking the item being picked up and the item’s
            current inventory the receiving inventory is checked.

  EXAMINE - In addition to checking the item being examined, the current
            location is checked. In the future this will let a location veto
            based on amount of light available

      PUT - No longer checks for DROP being vetoed.

     TAKE - No longer checks for GET being vetoed.


In addition, the PUT and TAKE commands now check for the new PUTIN/TAKEOUT
pseudo commands. PUTIN and TAKEOUT can be vetoed on containers allowing for
one-way containers to be created. PUTIN vetoes putting anything into a
container and TAKEOUT vetoes taking items out of a container.

Some examples of PUTIN and TAKEOUT:


  %%
          Ref: BIN
         Name: a rubbish bin
        Alias: BIN
    Inventory:
         Veto: TAKEOUT→You put rubbish into a bin, not take it out.

  This is a simple rubbish bin, you put your rubbish into it.
  %%
          Ref: VENDMACH
         Name: a vending machine
        Alias: VENDOR MACHINE
    Inventory: CANDY
         Veto: PUTIN→You take treats from a vending machine. You don't try to
               put them back again.

  This is a vending machine full of candies.
  %%
          Ref: CANDY
         Name: a candy
        Alias: CANDY
      Cleanup: AFTER→1s
        Reset: AFTER→1s SPAWN
      Onreset: There is a soft plink! and another candy appears.

  This is a yummy candy!
  %%


Note that these are only examples and will not be pushed to the public dev
branch.

While testing vetoes I had the race detector thow a data race warning. This
time when linking zones in the loader. That’s been fixed, but why was it not
detected until now? None of the code there has changed recently, but I did
upgrade to Go 1.11.4 recently which may explain it?

All changes are on the public dev branch. I think I might even be ready to
start putting together the next release :)

--
Diddymus


  Up to Main Index                          Up to Journal for December, 2018