From: Tom P. <to...@ts...> - 2001-01-22 23:56:36
|
Could anyone provide details on the protocol? I think there is something I'm missing. From all the documentation and code I have gone through, this is what I understand: A message consists of: Type (8 bits) SubType (8 bits) Length (8 bits) Data (length determined by Length parameter above) The GeneralMessage class is extended by specialized messages, but in the end a transmitted message consists of the above converted into AVector type and sent through the TCP connection. (I see that AVector can grow to fit more data, but it's not clear why the messages aren't just put into a single chunk of memory malloc'ed for the message. For example, *char type. Is it because the same messages are reused, thus avoiding repeated mallocs and frees? If so, why not define a maximum message length, malloc an appropriate chunk, and eliminate the C++ class overhead?) Two possible types are ARIANNE_ADMIN (0x00) and ARIANNE_GAME (0x03). Two possible ARIANNE_ADMIN subtypes are LOGIN (0x00) and LOGOUT (0x01). Two possible ARIANNE_GAME subtypes are ARIANNE_ACTION (0x00) and ARIANNE_PERCEPTION (0x01). (I found these in defines.h.) I cannot find any sort of state diagram for the protocol, however. Sniffing traffic sent by the client I find the following data sent from the client to the server: 0x00 0x00 0x01 0x00 0x00 0x00 0x2B 0x00 0x29 "Arianne 1.0.0 ALPHA 1 -- Release Pandora" 0x00 Could someone explain what is going on with this transmission? 0x29 is the length of the null-terminated client identification string, but the other data don't make sense when applying the above message format. (I saw discussion of priorities and message identifiers. Are these now present in the protocol?) Also, could someone explain the data carried by different messages, and provide some sort of state diagram? (For example, C2S_LOGIN is followed by which possible S2C messages?) Thanks, Tom |