Had you found an answer to your question? Let us know about your experience it might help someone else.Quote:
Ty guys :handsdown:, now getting packets works, but sending packet is buggy, what should i do to send right encoded packet? Better question is, what is the server encoding? :)
The correct encoding for Czech is Windows-1250.Quote:
Well i fount, that the right encoding for czech server is Latin 1, probably for other servers too, i am encoding the output of decryptGamePacket function, but sending chars from Latin 1 is still not working :(. I tried encode the input to encrypt function, the output too, with different encodings (latin 1,cp1250,cp1252), but the result on nostale server is "?" or space, sometimes when i write character from Latin 1, it cuts the packet, so if i send "say abcčd" i see "abc", but sometimes it is "abc?d" or "abc d"
I've solved my problem. I was really dumb :D. I converted the buf string into byte array with the coding, and then converted the byte array to string. In java String has only UTF16 internlal coding. So it is working :cool:.Quote:
The correct encoding for Czech is Windows-1250.
I think there's a problem with your encryption algorithm.
I suggest to use the C++ crypto for testing: pass a random string to the C++ encryption, compile it, do the same with your Java algorithm and check if the output is the same (encoding here doesn't matter, compare bytes from buffers). If not, compare step by step your algorithm with the C++ one.