Author |
Message |
SOS Server Help Squatter
Joined: Dec 02 2002 Posts: 329 Offline
|
Posted: Thu Jan 16, 2003 11:24 am Post subject: MGB: LVZ object packets |
 |
|
|
|
What are the LVZ object C2S packets? (off/on, move, set, etc) _________________ 3y3 4m l33t h4x0r
j0! 3y3 4m t4lking to j00!
fux0red 5cr1pt k1dd13.
-"l33t h41ku" |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Thu Jan 16, 2003 3:18 pm Post subject: |
 |
|
|
|
Below is what it SHOULD be, just note that the client doesn't support any of them except the single on/off packet, and the server doesn't even do the last one yet. Assumes that your function gets char *Packet and int PacketSize.
Toggle Object - 0x35
Loop through the packet and reading every 2 bytes as a 16bit value. If it is negitive (if you read it as signed, else you can do this check: Val & 0x8000), then the object is turned off. Else, its turned on.
int i;
short id;
for (i = 1; i + 2 < PacketSize; i += 2)
{
id = *(short*)(Packet + i);
if (id & 0x8000)
{
id ^= 0x8000; //Removes the first bit
/* Whatever you do to handle that obj #id is now turned off */
}
else
{
/* Whatever you do to handle that obj #id is now turned on */
}
} |
Receive Object - 0x36
The Move/Edit objects isn't supported anywhere except in ASSS. If you understand how the .lvz file itself works, you should notice that this is very similar. Otherwise, learn how to read a .lvz. The first byte will be the 0x36, then you just keep looping through the packet like before, just with a different width that you read in.
struct PacketObjectInfo {
unsigned short mapobject : 1; //If its a map object or not
unsigned short id : 15; //Which object
short x; //X location it will go to
short y; //Y location it will go to
char imagenumber; //Which image number will effect
char layer; //Which layer it is on
unsigned short displaytime : 12; //Time it will be displayed, in 1/10th seconds
unsigned short timermode : 4; //Which timer it will be used
}; |
|
|
Back to top |
|
 |
SOS Server Help Squatter
Joined: Dec 02 2002 Posts: 329 Offline
|
Posted: Thu Jan 16, 2003 3:26 pm Post subject: |
 |
|
|
|
I thought so about moving not being in the server... but PriitK said today it is possible... humm? Or maybe he was just saying it's possible to send the packets, but they don't do anything? lol |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Thu Jan 16, 2003 3:38 pm Post subject: |
 |
|
|
|
A sysop can send an outgoing packet to the server like that one, and the server should send it back to the clients you requested it sent to, but it screens the packets up, so even if the client supported it (doesn't), it wouldn't work. |
|
Back to top |
|
 |
|