Friday, May 16, 2008

Scanner changes for Issue 12

As I mentioned in my previous post, Issue 12 has changed the way things work in the chat message system. This has necessitated some fairly major changes in the HeroStats scanner as of version 4.1.0.6.

For HeroStats Users

If you're a HeroStats user, you'll notice the changes in your hero configuration options. The Channels and Globals tabs are gone - you can no longer choose which channels you'd like HeroStats to scan. Taking their place is a Scanner tab. There are two options here.

First, there is a checkbox which allows you to choose whether HeroStats should ignore any chat tabs that display only "chat-type" messages, which are messages that don't contain any statistics information. Typically this means things from your global chat channels, local chat, etc.

Second, you can enter the name of a tab that you would like HeroStats to scan while ignoring all others. This is very handy to increase performance. The name of this is "HSData" by default, although you can change it to whatever you like. If the name given here doesn't exist, HeroStats will fall back to the default behavior of scanning all tabs. The image below shows a sample setup of the HSData tab for best performance (this is on Test, but a Live setup would be the same minus the new Pet and Hit Rolls channels).


For Developers

If you're a developer who has used the HeroStats scanner in your own program, you'll need to make a few changes with versions 4.1.0.6 and above. The first thing you'll likely notice is that the CohScanner class no longer has properties to set which channels to scan. If you were using those, you'll need to remove that code.

There are some new properties on the CohScanner class, too. The boolean IgnoreChatTypeMessages property and the string HSDataTabName property implement the two hero configuration options described above. Both of these are static properties, so you'll need to set them on the CohScanner class (rather than an instance). You can update these while the scanner is running if you like, it'll recognize the changes.

If you'd like some more control over what chat tabs are being scanned, you can access the list of available tabs using the AvailableTabs property. This one's not static, so access it through your CohScanner instance. AvailableTabs is a List of ChatTab objects, each of which represents one of the user's chat tabs. You can get the tab name from the Name property, and the number of messages on the tab from the MessageCount property. You can also set whether a tab should be scanned with the IsScannable property; if true, the scanner will ignore this tab (unless it's the one specified in HSDataTabName).

Internally, the old ChatChannel class in the scanner has been greatly reduced. Most of its functionality is now in the new ChatTab class. The old channel types still exist, but they're really used only for looking at which channels should be on each tab. There is also a new property on the MemlocFinder class called IsLiveCode, which is used throughout the scanner to drive logic that's different between Live and Test servers.

Wednesday, May 14, 2008

Issue 12 beta changes

So Issue 12 is in open beta now, and there's a ton of changes. Lots of quality-of-life improvements, many of which relate to chat messages. Unfortunately, those changes mean much of what HeroStats does has to be changed in order to work with I12.

By far the biggest change is how message channel is identified. Pre-I12, the channel type was hardcoded to a particular value, and each message was tagged with the appropriate channel type value. Now that's no longer the case. Messages are instead stored in the client memory with pseudo-HTML tags that set the message color and other attributes. This is great for the game client - it enables the linking you see in I12, and the ability to change the color of each channel on your tabs. But it's not so good for HeroStats, because there's now no good way to take a message and figure out which channel it came from. Those pseudo-HTML tags don't help, because they can be changed by the user at will.

So, we're going back to an approach that I tried once before - scanning each tab of the chat message window, rather than looking for individual channels. This can potentially give us better performance, but does require that the users have their chat tabs set up in certain ways. I'm working on a way to make this transparent to the user, or at the very least use the new I12 feature to load tab settings from a file to make it easy to set up.

This also means that we no longer know which channel a particular message belongs to. Previously the channel was used to 1) let people choose which channels that HeroStats would log and 2) filter out messages on channels that never contained any information needed for stats gathering. Both of those features will no longer be available with the new system.

I haven't had as much time as I'd like to work on this, so the new scanning system isn't completely ready for prime time just yet. I'm hoping to have it finished before Memorial Day, hopefully prior to I12 actually going live.