Up to Main Index Up to Journal for November, 2015 JOURNAL FOR THURSDAY 5TH NOVEMBER, 2015 ______________________________________________________________________________ SUBJECT: Locking, commands and marshmallow DATE: Thu 5 Nov 23:57:02 GMT 2015 Last night I had one of the most productive, relaxing WolfMUD Wednesdays I've had in a long time :) What was I doing? Solving puzzles. Specifically I was adding the BRL - big room lock - back into WolfMUD and solving the issues it threw up. This led me to practically reimplementing what I laughingly call the 'parser'[1] which has to handle a lot more state information now. That means reworking commands a bit again. Let me back up a bit. Last time[2] I said I was adding networking back into WolfMUD and to do that I needed to implement locking and unique identifiers. I had a few comments along the lines of 'Is that really all you need to do?' and of course it isn't. I simplified things, because... well I just did. In reality a lot more is required to add networking. For example, commands. At the moment you can type 'get box' and it responds 'You get a box'. With networking added you need to inform other players what is going on - 'You see Diddymus pick up a box'. What would happen if you typed 'give Tass box'? You would see 'You give Tass a box'. Tass would see 'Diddymus give you a box'. Other players in the location would see 'Diddymus gives Tass a box'. If the item is small the observers may see 'Diddymus gives Tass something' instead. As you can see this means handling up to three streams of text for different perspectives. The first and second streams are only sent to the participants and the third stream has to be sent to each observer. For actions like moving you may have two set of observers. Those seeing you leave you current location and those seeing you arrive at you new location. Now what should I call these streams? Maybe actor, participant and observers? I'm sure there are probably correct grammatical names I should use. With so much text I really should switch to using bytes.Buffer more instead of strings. It would also avoid a lot of string/[]byte conversions and reduce allocations. Hrm, my Nexus 7 (2013) tablet just dinged at me and is now installing Android Marshmallow :) -- Diddymus [1] What do you call the player you are currently parsing for? The parsee? Maybe the parsi? As a side note both 'Parsee' and 'Parsi' are worshipers of fire. Also called Gheber. Maybe Gheber then... [2] See: ../10/31.html Up to Main Index Up to Journal for November, 2015