It turned out that some of the territory-sync code I've recently written in the last week or two created packets that collided with the SyncRandomNumber functionality of the RakNet networking library which I use in the game.
It should be noted that I'm using a old version of RakNet, while the lib is currently on v3.0 There were far too many changes for me to consider moving all my functionality over to 3.0 though the irony is that it might have been easier/faster in this case...
Anyways, inside the RakClient::Receive() function there are some special cases for handling client related functionality. One such special case is a SyncRandomNumber packet, this is a special packet sent every ~9 seconds to allow clients to have nearly perfectly synced random numbers over the network.
It turns out that some of my [empty] territory packets [first byte == 23, size == 14 bytes] were being confused as random number packets, and much crashery ensued. When the packet would come out of the Client::Receive() function it's packet identifier was out of the range of my valid packets. Also the data pointer in the packet was no longer valid, so calling the DeallocatePacket() function caused a heap corruption.
Yea 4 days right there...though it seems so simple/easy in hindsight.
I sent my findings to the creator of RakNet, and it turns out this is was a known bug. Anyways I'm very glad that I finally got that sorted out. Now I can get back to working on the actual game...
Also I'm working on the next illegal business, the illegal casino. It looks like it will be the coolest illegal business so far but it's too early to tell [grin].
[As a side note...my journal is so fux0red becase of all those un-thumbnailed 1280x1024 screenshots below [grin]]