New information regarding packets 0x54 and 0x7B

Here you can discuss packets, implementation and design, and software related to the packet sniffing and such. This is not the place to post packages for POL, but rather discuss the packet side of them.

Moderator: POL Developer

Post Reply
Folko
New User
Posts: 2
Joined: Mon Apr 20, 2015 10:15 am

New information regarding packets 0x54 and 0x7B

Post by Folko »

Hello,

I've discovered this some time ago and wanted to post it, but my account on this forum was gone. So I put it onto my TODO list and now it's time to catch up with it:

While implementing something for my server for the pre-alpha UO client from 1996, I did some reverse engineering in the later clients to figure out something and found some information regarding the packets 0x54 and 0x7B that are wrong in all packet guides I've found:

0x54 (Sound) has the following format, verified from client 1.25 to 7.0.21:
BYTE 0x54 (packet id)
BYTE ambient (if 0: sound is played as ambient sound - more quiet and repeating, used for background music in ancient days. otherwise: play normally. This is *not* a flag field but a boolean. I checked the name of the field - 'ambient' is used in the debug version of the clients)
WORD sfxID
WORD unused (this word is unused even in the oldest clients I found)
WORD X
WORD Y
WORD unknown (this is *not* Z and has never been. Z is always a single BYTE. This WORD ignored in the client code if not in sequence mode, see below)

0x7B is used to start a so-called sequence: a number of effects that can be sent to the client which will then be played in order without timing issues, also present since 1.25 or maybe even before:
BYTE 0x7B
BYTE loopCount: 0 starts a sequence, end the sequence with a value > 0 that's used as repeat count

So to create a nice sequence of effects, send 7B 00 and then any of the following packets in any amount and order: 0x70, 0x6E, 0x54, 0xC7, 0xC0. End the sequence by sending 7B nn where nn is the number of times you want the sequence to play.

Important: Make sure the sequences do not overlap, i.e. it's best to send the whole sequence 7B 00 ... 7B nn at once.

The sequence packet can be used to make sure a sound plays after an animation is done instead of approximating the animation time on the server side and then sending a sound packet. I did not test if this still works in recent clients.

I have yet to figure out what the unknown WORD in 0x54 does. Since it's only evaluated when 0x54 is sent in a sequence, I guess it's related to something with the sequence.

Regards

Folko
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: New information regarding packets 0x54 and 0x7B

Post by RusseL »

Very interessting information. Thank you!
Post Reply