Long story short, I want to improve my Cocoa and objective-c skill set. 
I've combined 2 of my favorite FOSS projects together. 1 (obviously) is 
netrek and the other is Adium (http://adium.im/).

What I want to get out of this coding adventure is an Adium plugin that 
can connect to a netrek server and act as an observer.

I got the view (gui) stuff and socket stuff done (gratitious concepts 
takes from pygame and MacTrek).

What I'm failing to get to work properly is the "game packet" processing.

Looking at packet.h there's a general protocol state outline.

Starting states
        CP_SOCKET
        CP_FEATURE, optional, to indicate feature packets are known
        SP_MOTD
        SP_FEATURE, only if CP_FEATURE was seen
        SP_QUEUE, optional, repeats until slot is available
        SP_YOU, indicates slot number assigned

Login states
        CP_LOGIN
        CP_FEATURE
        SP_LOGIN
        SP_YOU
        SP_PLAYER_INFO

My netrek-game-protocol-fu is rusty (working in objective-c isn't 
helping me).  I assume "short-cut" some states if all I want to do is 
connect as observer?

My packet trace looks nothing like a real client so I'm looking for 
help on what I'm doing wrong (pseudocode):

connect to server port 2593
send CP_SOCKET
assume I don't need to send CP_FEATURE?
read SP_MOTD

Assuming the above is correct, the problem  is I get a 1340 byte 
payload and the first byte is not 0x0b (11, aka SP_MOTD) so either my 
state stuff is wrong OR my socket code is wrong.

I see a spiffy tool called lurk.py (James?) in the cow code base. Sadly 
it doesn't work on Mountain Lion/Python 2.7.2 (haven't really looked at 
it yet). If I read the code right is this effectively a netrek-game 
protocol sniffer?

Thanks.
-- 
Bob Tanner <basic at us.netrek.org>          
Key fingerprint = 9906 320A 8BB6 64AD 96A7  7785 CBFB 10BF 568B F98C