A help and how to fix packages

07/22/2011 13:45 benco#16
Quote:
Originally Posted by lesderid View Post
By the way, SRO uses Little Endian.
it's depends on silkroad language version
07/22/2011 14:30 ruancarlosbr#17
02 32 02 23 4 bytes = int32 ??? correct ?
07/22/2011 14:44 bootdisk#18
@ruancarlosbr: if you've windows7, just open the calculator and put it in programmer mode, there you can see bytes. Sides you can see how many bytes and bits does a word has, etc.

but yes, 4 bytes = int32 but careful with floats.

Edit: remember it starts counting from 0, naming it int32 is a bit tricky because you can play with 31bits (including the bit 0).
07/22/2011 14:44 ruancarlosbr#19
FALAR[C -> S][7576]
01 ................
00 ................
00 ................
02 00 ................


PacketWriter Writer = new PacketWriter();
Writer.Create(0x7576);
Writer.UInt8(1);
Writer.UInt8(0);
Writer.UInt8(0);
Writer.UInt16(2);

Correct ??

exapmple ?
07/22/2011 15:01 benco#20
1 byte = 8bits.
01 = 1 byte = 8 bits
00 = 1 byte = 8 bits = UInt8<--- nbr bits
02 00 = 2 bytes = 16 bits (2x8 bits) = UInt16
UInt8 Byte, start from 0 up to 255
UInt16 Unsigned Short, start from 0 up to 65535
....
07/22/2011 16:03 ruancarlosbr#21
EXAMPLE:
53 69 6C 6B 72 6F 61 64 5F 4B 6F 72 65 61 5F 59 Silkroad_Korea_Y
61 68 6F 6F 5F 4F 66 66 69 63 69 61 6C ahoo_Official..

HX
53 = S
HX
69 = i
HX
6C = l




8 bits => word 1 byte 09 = int8

16 bits => word 2 bytes 00 00 int16

32 bits => word 4 bytes 30 55 52 30 int32
07/22/2011 19:52 benco#22
in bytes data there's no string value. it's char or char array
look in my source code posted previousely. the best way in your exemple is to peek data in byte array type and convert it with :
System.Encoding.GetEncoding("UTF-8").GetString(bytesStr)
UTF-8 is just exemple, use good string encoding of Sro_client.exe
07/23/2011 11:03 lesderid#23
Quote:
Originally Posted by benco View Post
in bytes data there's no string value. it's char or char array
look in my source code posted previousely. the best way in your exemple is to peek data in byte array type and convert it with :
System.Encoding.GetEncoding("UTF-8").GetString(bytesStr)
UTF-8 is just exemple, use good string encoding of Sro_client.exe
UTF8 is a member of the Encoding class.
If you use that static member instead of the method to get the Encoding, it's faster.
07/23/2011 12:07 benco#24
Quote:
Originally Posted by lesderid View Post
UTF8 is a member of the Encoding class.
If you use that static member instead of the method to get the Encoding, it's faster.
I know there is utf8. As I said, it's just an exemple to show how to use different encoding ^^
07/23/2011 13:53 lesderid#25
Quote:
Originally Posted by benco View Post
I know there is utf8. As I said, it's just an exemple to show how to use different encoding ^^
SRO only uses UTF-8 and UTF-16 (aka. Unicode), which are both members of the Encoding class.

But okay.
07/23/2011 19:23 benco#26
for ISRO yes it's utf-8, but csro use GB18030
07/23/2011 19:55 lesderid#27
Quote:
Originally Posted by benco View Post
for ISRO yes it's utf-8, but csro use GB18030
Oh, I see. I didn't know that.
07/23/2011 20:10 Yo123#28
i kinda love how the coding corner evolves.
seriously... been a great idea of mine.
sorry for moderational off topic :D
07/23/2011 21:22 lesderid#29
Quote:
Originally Posted by Yo123 View Post
i kinda love how the coding corner evolves.
seriously... been a great idea of mine.
sorry for moderational off topic :D
Dude, it's pretty much dead. xD

Even more offtopic: Work on Lua decompiler! Naw!
07/24/2011 00:00 sarkoplata#30
Quote:
Originally Posted by ruancarlosbr View Post
FALAR[C -> S][7576]
01 ................
00 ................
00 ................
02 00 ................


PacketWriter Writer = new PacketWriter();
Writer.Create(0x7576);
Writer.UInt8(1);
Writer.UInt8(0);
Writer.UInt8(0);
Writer.UInt16(2);

Correct ??

exapmple ?
Yea , thats correct