Server Help

General Questions - MGB: LVZ object packets

SOS - 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)
Mine GO BOOM - 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.

Code: Show/Hide
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.

Code: Show/Hide
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
};

SOS - 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
Mine GO BOOM - 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.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group