New release. Lots and lots of changes. New class CCUsers that stores the “WhoList” (list of users that are connected and logged in) as an array of hashes. That is, there’s an ordered list of users (the array), and for each user (array item), there’s three named pieces of information (hash items): the nickname, the address, and the group.
The beauty of this is that we can have methods like “give me all users that have this particular address”. If you read the before closely, you’ll notice that this is one more thing current clients (that I know of) don’t do: trolls have a tendency to log in under multiple names in order to create the (short-lived) illusion that they are, indeed, multiple personæ. Of course, you can manually check their addresses and figure out what’s really going on (or take an educated guess, anyway*). Thanks to nicksForAddress() (which gives you all nicknames for a certain address, as an array), nicksForAddressAsString() (which does the same, but converts it into a string delimited by “, “, e.g. “chucker, someoneElse, Yet Another Person”) and, most importantly, multipleNicksForAddress?() (which returns true when given an address that multiple users/nicknames are logged in under), we can make this all a little more convenient to figure out.
What I’m picturing (should we one day have a GUI) is a tree view — rather than a linear user list — that will create a branch if an address has multiple nicknames, and underneath that branch, it will list all nicknames. If you have no idea what I’m talking about, that’s okay too. I could provide a mockup screenshot, I suppose, but maybe this helps:
- Aaron
- Dave
- Jill
- 1890354812390
- Someone
- SomeoneSupposedlyDifferent
- Tyler
- Vanessa
Notice how the fourth item in that list expands into a sub-list, and how it doesn’t show the nickname, but the address? That’s our feature at work. You easily get to see if people are trying to fool you this way.
*) There are, of course, some rare cases where multiple people will legitimately have the same address. I.e. one CC user staying at another CC user’s place. It has happened before…
So what else is there? Not much that I can think of, actually. I’ve spent most of the time trying to clean some things up — to boot, I’ve found one nasty bug whereby the settings file was updated much, much more often than it had to be — , and trying to figure out this whole Windows situation thing. Which, sadly, I still quite haven’t. It’s a little discouraging as I can’t even be sure if I will be able to publish this code on Windows in a remotely usable way. Demanding people install Cygwin on their own is simply not an option. But the current problem doesn’t occur if I use RubyScript2Exe without Cygwin, nor does it appear if I use Cygwin without RubyScript2Exe, nor if I use neither; only if I use both. Talk about confusing.
I really dig(g) the beauty in which Ruby handles OOP. Once you get into it, some things just feel so natural. Not sure if the settings file is up-to-date? Just call @settings.refresh. What about the user list? @users.refresh. Enumerate all users? @users.to_s, where to_s means “convert to String”.
This has been keeping me busy, and that’s goooooood. Windows frustrations aside, I’m quite enjoying this.
Oh yeah. New version. Here you go; enjoy.