Up to Main Index Up to Journal for January, 2017 JOURNAL FOR WEDNESDAY 18TH JANUARY, 2017 ______________________________________________________________________________ SUBJECT: RecordJar has new data types + working vetoes DATE: Wed 18 Jan 20:52:06 GMT 2017 Very busy with work again but I have also been working on WolfMUD a bit :) In my last entry I was wittering on about RecordJar files and how to handle multiple string values for a field[1]. I have now settled on an implementation which adds three new record data types: String List, Keyed String and Keyed String List. A string list uses a colon (ASCII 0x38, ‘:’) to separate the strings in a list. For example actions could now be specified as: Actions: The rabbit hops around a bit. : You see the rabbit twitch its little nose, Ahh... This is my preferred format, but you can put the colon anywhere in the string. A less clear / more confusing example: Actions: The rabbit hops around a bit. : You see the rabbit twitch its little nose, Ahh... I suppose this could be used for short strings: Actions: The rabbit hops. : The rabbit twitches : The rabbit squeaks. Leading and trailing white space around the colon will be removed. At the moment there is no way to escape a colon and have it as part of a string. Next new type is a keyed string. A keyed string is a single word, followed by any non-letter or non-digit separator, followed by a string. I’ll show a working example shortly, for now an imaginary example: Example: TEST→This is the string for the key TEST. Here we have the string “This is the string for the key TEST.” with the key “TEST”, the separator used is the ‘→’. Again leading and trailing white space will be removed around the colon and the separator. This is similar to the Pair List which is used to represents exits: Exits: E→L3 SE→L4 S→L2 The main difference between a keyed string and a pair list is that a pair list cannot have white space around the separator. Last of all we have a keyed string list which combines string list and keyed string. An example for this could be: Vetoes: GET→The rabbit does not appreciate being picked up. : PUT→The rabbit does not want to be put anywhere. Here we have two keyed strings in a string list. I’ve actually implemented this for vetoes now and vetoes can be defined as above in zone files. If you have a copy of WolfMUD and look in the sample zinara.wrj file I have added a few examples. All of the changes described including updates to documentation, vetoes, zone files and the rewritten recordjar.Read method are now available from the public Git dev branch[2]. -- Diddymus [1] Journal for 8th January: ./8.html [2] For WolfMUD Git repository see: ../../../downloads/index.html Up to Main Index Up to Journal for January, 2017