There's plenty of programs where the user will sometimes expect it, or it would be convenient, if something accepted a number range. For example: +bbread 5/6-9, if they want to read bboard 5, posts 6, 7, 8 and 9.
So, say we have an unsorted number range as follows:
5 7-10 3 8-9
And we want that to output:
3 5 7 8 9 10
Let's say you have the following list of numbers:
1 2 4 7
And you want it to output the 'missing numbers' in between. Like so:
3 5 6
It still needs some more work before getting checked in for p5, but I have SSL connections that persist across @shutdown/reboots instead of getting dropped up and running. Only a few years after working out the basic design. Can't work faster than that!
The big problem has been that OpenSSL doesn't have a way of saving internal state across a reboot so that the same connections can be reused. In general, from a security standpoint, this is a good thing. It's just frustrating for players who use SSL connections. The solution is to use a proxy process to handle the SSL connections.
Let's assume a game wants their conformat's players to be
displayed in three columns, thus as follows:
Players: Player 1 Player 2 Player 3 Player 4 Player 5 Player 6
The way to display each single name is:
The logic behind using 25 is because a name default can be 24 characters.
For anyone interested in hacking PennMUSH, you can now view the documentation for the PennMUSH source code (taken directly from the comments in the source) online, at http://doxygen.pennmush.org.
You can see the functions that exist, the arguments they take, and their expected return values, all with automatic links to which files they're found in, the members of the structures used, etc.
Let's assume you have a large player base, with say... ~255 players that actively get used. And let's assume they are all in an attribute, except for the staffers. This way, during this exercise, there will be a stable amount of output.
Now, let's assume we wanna display information about these players, and stick them into an align()ed area. Most new coders would use iter() or map() to show them all. But they run into a problem! Due to the way align() works, one reaches the buffer limit extremely fast, and one will be cut off around #118 or so.
Sure, one can increase the buffer length to twice its size by altering mushtype.h, but that is nowhere near ideal, and will crash your game over a 2x increase. So... how do you handle this?
This is perhaps a fairly simple thing, but does have a semi-decent amount of use on games:
Out of all the players on your game, pick one. That's it. Just pick one player, but do it /at random/.
In this post we handled a simple census command with limited attribute values. But what if the attribute value is /not/ pre-defined.
There are god knows how many where commands out there. But what many will often want is a where command that lists things with the location once, then all the players at that location?
Thus as follows:
location 1 player 1, player3, and player 5 location 2 player 2, and player 6 location 3 player 4
Let's leave the 'Unfindable' case out of this for now.
Ever had trouble setting up TinyFugue or a PennMUSH game to use the ISO-8859-1 (Latin-1) character set? Me too. On Debian, it's a simple "sudo dpkg-reconfigure locales", which offers a helpful menu. Ubuntu, defaulting to UTF-8 and not really wanting to let go, makes things a little messier. Here's how I got it to work, each and every time.
Step 1: Edit /var/lib/locales/supported.d/local with your favorite editor, and on the last line put "en_US.ISO-8859-1 ISO-8859-1". Mine looks like this: