09-22-2009, 06:05 AM
I am in the process of developing my iPhone RIVA client. I have managed to get far enough to log in successfully, which is good. Some notes and questions:
I'm glad that I took my friend Rob's suggestion to look at the .Net RIVA code after banging my head against the wall trying to figure out how to get the Blowfish code working. I see in your code that you are converting your 16-byte blocks into 4-byte chunks using big-endian encoding. I hadn't anticipated that. When I switched to do likewise, it magically started working. Is there a reason why you do it that way? It would be good to make a note in the documentation, for the benefit of future generations of RIVA developers.
It appears that you are using four-byte lengths for the strings that appear after the message structure. The header file reflects this. But the documentation states that the lengths are stored in two bytes. That should be corrected.
On the same subject, I would have thought from the documentation that only messages containing a text string would have the length bytes and string at the end. But, looking at what the server is sending as a LoginChallenge, I see that the payload includes four extra bytes, which I presume are a string length, even though there's no string in a LoginChallenge. Is it the case, then, that all messages include a length, which is set to 0 if there's no string? Should I likewise always include a length in my messages, and set it to 0 if unused?
How does the TException message look? Does it have seven length-and-string pairs, or does it actually have an eighth length at the end set to 0, like a null termination? Is there a way to get the server to generate a TException, so I can test my code?
On a purely cosmetic level, while I was playing around trying to figure out the length byte thing, I deliberately sent a Ping message first, instead of a LoginRequest, to see what would happen. The server logged an error saying that it received a LoginRequest opcode when it was expecting a Ping opcode (the reverse of what actually happened).
Thanks.
I'm glad that I took my friend Rob's suggestion to look at the .Net RIVA code after banging my head against the wall trying to figure out how to get the Blowfish code working. I see in your code that you are converting your 16-byte blocks into 4-byte chunks using big-endian encoding. I hadn't anticipated that. When I switched to do likewise, it magically started working. Is there a reason why you do it that way? It would be good to make a note in the documentation, for the benefit of future generations of RIVA developers.
It appears that you are using four-byte lengths for the strings that appear after the message structure. The header file reflects this. But the documentation states that the lengths are stored in two bytes. That should be corrected.
On the same subject, I would have thought from the documentation that only messages containing a text string would have the length bytes and string at the end. But, looking at what the server is sending as a LoginChallenge, I see that the payload includes four extra bytes, which I presume are a string length, even though there's no string in a LoginChallenge. Is it the case, then, that all messages include a length, which is set to 0 if there's no string? Should I likewise always include a length in my messages, and set it to 0 if unused?
How does the TException message look? Does it have seven length-and-string pairs, or does it actually have an eighth length at the end set to 0, like a null termination? Is there a way to get the server to generate a TException, so I can test my code?
On a purely cosmetic level, while I was playing around trying to figure out the length byte thing, I deliberately sent a Ping message first, instead of a LoginRequest, to see what would happen. The server logged an error saying that it received a LoginRequest opcode when it was expecting a Ping opcode (the reverse of what actually happened).
Thanks.