RF ONLINE SERVER SIDE GUIDE (Creating structures )

We need:
1) The brain and direct hands
2) Dateditor
3) Notepad or any text editor
4) Knowledge of at least a client device and rfki dat files
Files with an extension of structures strs and open text editor
I. Types of data and their attributes
u8-integer occupy 1 byte (0 to 256)
u16-integer occupy 2 bytes (from 0 to 65535)
u32-integer occupies 4 bytes (from 0 to 16777215)
cstr-text
x8-16-decimal number occupy 1 byte (00 to FF)
x16-16-decimal number occupy 2 bytes (from 0000 to FFFF)
x32-16-decimal number is 4 bytes (from 0 to FFFFFFFF)
float - floating point number (http://ru.wikipedia.org/wiki/% D0% A7% ... 82% D0% BE% D0% B9)
Attributes for data types such as u * and x * and float
as) tag = "name", the name of the block
b) hidden = number-if the number = 1, then the block is hidden
Attributes for cstr
a) len = "number", text length in bytes (1 byte character coded)
For rfki server is running normally in Id were recorded with 64 and 32 in the client
Attributes are written in square brackets and separated by commas
Code:

Code

u32 [tag="----",hidden=1] DWORD;
float [tag="----",hidden=1] DWORD;
cstr [len=64] "Название";  
II.Making homogeneous structure
The first operator-åòî what file we will load
PHP Code:

Code

[filemask = "Name of the file.dat"]

Here you can specify * then be able to download any file ([filemask = "*. dat"])
Next comes the description of the structure of the file
For rfki files start with the number of blocks long u32 then the block size in length u32 (for the server goes beyond the file size length u32)
Continue loading frame structure
Code:
Code

struct "Name"
{
u32 nBlocks;
u32 nBlockSize
child Block [count=nBlocks];
}  

Attributes child
a) count - how many blocks will be given to the structure of the block
b) offset - Offset from which to begin the blocks with this structure
a) group = "name" - Name of the group of data blocks
Then we write the structure of the block with the name that we specified in the child
PHP Code:
Code

struct block
{
u32 [tag="----"] DWORD;
....
...
....
...
...
}  
Write structure may be adding (subtracting) count u32 blocks until you see the order in Dateditor and then changing all the values to see what has changed in the client
III.Sozdanie structure for a file consisting of several parts
(example: Item.edf Character.edf etc.)
This occurs when we wrote a homogeneous structure in the window display of the file in Dateditor see that the file is not over.

For this we need to seek an operator
He misses opredennyh number of bytes in the file (the reading of the structure begins with kakogoto offset rather than the beginning)
PHP Code:

Code

struct "Name"
{
u32 nBlocks1;
u32 nBlockSize1;
child Block1 [group="1",count=nBlocks1];
seek(nBlocks1*nBlockSize1 +8)
u32 nBlocks2;
u32 nBlockSize2;
child Block2 [group="2",count=nBlocks2,offset=nBlocks1*nBlockSize1 +16];
}  

Typically between parts of a file in the RF is 8 bytes long (although some have, and 4)
Code:

Code

seek(nBlocks1*nBlockSize1 +8)  
This means that we missed the first part of the file (the count blokov1 * size bloka1 + 8 bytes free)
Be sure to specify a group for child
Just a child for the second part of the specified Offset from which part of the ETA will begin (the count blokov1 * size bloka1 8 free bytes + 8 bytes charge count blokov2 and size bloka2)
After the structure for the block Block1 write the structure for the block Block2
Code:

Code

struct Block1
{
u32 [tag="----"] DWORD;
....
...
....
...
...
}
struct Block2
{
u32 [tag="----"] DWORD;
....
...
....
...
...
}  
So we get the structure of the form
Code:

Code

[filemask="Имя файла.dat"]
struct "Название"
{
u32 nBlocks1;
u32 nBlockSize1;
child Block1 [group="1",count=nBlocks1];
seek(nBlocks1*nBlockSize1 +8)
u32 nBlocks2;
u32 nBlockSize2;
child Block2 [group="2",count=nBlocks2,offset=nBlocks1*nBlockSize1 +16];
......
.....
}
struct Block1
{
u32 [tag="----"] DWORD;
....
...
....
...
...
}
struct Block2
{
u32 [tag="----"] DWORD;
....
...
....
...
...
}  
IV.Operator repeat
Also there operotor repeat-he repeats this block a few times
Example
Code:

Code

repeat 7
{
u32 [tag="----"] DWORD;
}  
And we shall see in Dateditor that he repeated 7 times
Åòî comfortable when we see that the same is repeated many times (eg Store, StoreList etc.) and that the structure was easier to read we can use this operator

Komentar

Postingan populer dari blog ini

RF ONLINE GUIDE 100 (POTION)

RF ONLINE SERVER SIDE GUIDE (GM COMMAND)

RF ONLINE GUIDE 94 (BELLATO AMULETS & RINGS)