EQEmu / Server

Open Source Fan-Based EverQuest Emulator Server project
https://docs.eqemu.io/
GNU General Public License v3.0
449 stars 416 forks source link

ZoneSelect support (aka /pick) #1615

Open xackery opened 3 years ago

xackery commented 3 years ago

I did a good chunk of the dirty work, but if someone else wants to PR and do the rest let me know. I'll work on this eventually otherwise.

RoF2 client has the opcode 0x72d8 when sent from server it'll cause a dialog to pop up asking a user for zone instances: image To generate the above, a packet of size 212 is required.

byte 64 (int64, but only 7 bytes long): SessionID to uniquely identify this request response byte 72 (int8): total options. 10 is the maximum that can fit on the fixed size 212 packet. byte 96 (int16): zoneID byte 98 (int16): Unknown byte 100 (int32): Player Count byte 104 (int32): instance ID (possibly? not displayed?) Then, repeat byte 96 to 104 ordering for the remaining zones. Or zero out if less than 10 options.

A packet generator example:

local pack = Packet(0x72d8, 212, true);
    pack:WriteInt64(64, 0x11223344556677); -- SessionID (reply packet contains it)
    pack:WriteInt8(72, 10); -- total options

    for i = 0,10,1 do
        pack:WriteInt16((i*12)+96, 280); -- ZoneID
        pack:WriteInt16((i*12)+98, 1); -- Unknown
        pack:WriteInt32((i*12)+100, i+1); -- Player Count
        pack:WriteInt32((i*12)+104, i+1); -- Instance ID (not displayed)
    end

    e.self:QueuePacket(pack);

There's a 10 second timer for the client to select an option. Once selected, and press OK client sends a 0xaaba packet in rof2 back to the server, with a size of 12 byte 1 to 7 is the session id the server sent for this request byte 8 is the selected zone option index, starting at 0

mackal commented 3 years ago

Tit: 0x161c SoF: 0x4e65 SoD: 0x7988 UF: 0x28ce RoF: 0x0d92

xackery commented 3 years ago

Titanium 0x161c confirmed, response is 0x0dfe same packet as rof2 both ways, likely other clients are unchanged bytes too

xackery commented 3 years ago

Added SessionID