Validated up to OP_WorldObjectsSent

This commit is contained in:
dannuic 2026-04-16 15:59:54 -06:00
parent 767f04731b
commit f29d87aced
4 changed files with 680 additions and 675 deletions

View File

@ -23,6 +23,7 @@
#include <numeric>
#include <cassert>
#include <cinttypes>
#include <set>
#include "world/sof_char_create_data.h"
@ -217,19 +218,22 @@ namespace TOB
ENCODE(OP_BlockedBuffs)
{
ENCODE_LENGTH_EXACT(BlockedBuffs_Struct);
SETUP_DIRECT_ENCODE(BlockedBuffs_Struct, structs::BlockedBuffs_Struct);
// Blocked buffs are a major change. They are stored in a resizable array in TOB, so this sends size, then
// spells, then the final two bools -- see 0x140202750
SETUP_VAR_ENCODE(BlockedBuffs_Struct);
for (uint32 i = 0; i < BLOCKED_BUFF_COUNT; ++i)
eq->SpellID[i] = emu->SpellID[i];
// size is uint32 + count * int32 + uint8 + uint8
uint32 sz = 6 + emu->Count * 4;
__packet->size = sz;
__packet->pBuffer = new unsigned char[sz];
memset(__packet->pBuffer, 0, sz);
for (uint32 i = BLOCKED_BUFF_COUNT; i < structs::BLOCKED_BUFF_COUNT; ++i)
eq->SpellID[i] = -1;
__packet->WriteUInt32(emu->Count);
for (int i = 0; i < emu->Count; i++)
__packet->WriteSInt32(emu->SpellID[i]);
OUT(Count);
OUT(Pet);
OUT(Initialise);
OUT(Flags);
__packet->WriteUInt8(emu->Pet);
__packet->WriteUInt8(emu->Initialise);
FINISH_ENCODE();
}
@ -981,6 +985,7 @@ namespace TOB
ENCODE(OP_NewSpawn) { ENCODE_FORWARD(OP_ZoneSpawns); }
ENCODE(OP_NewZone) {
// zoneHeader
EQApplicationPacket* in = *p;
*p = nullptr;
@ -2903,7 +2908,7 @@ namespace TOB
buf.WriteString(new_message);
auto outapp = new EQApplicationPacket(OP_SpecialMesg, buf);
auto outapp = new EQApplicationPacket(OP_SpecialMesg, std::move(buf));
dest->FastQueuePacket(&outapp, ack_req);
delete in;
@ -2934,14 +2939,14 @@ namespace TOB
return;
}
auto outapp = new EQApplicationPacket(OP_ChangeSize, sizeof(ChangeSize_Struct));
auto outapp = new EQApplicationPacket(OP_ChangeSize, sizeof(structs::ChangeSize_Struct));
ChangeSize_Struct* css = (ChangeSize_Struct*)outapp->pBuffer;
structs::ChangeSize_Struct* css = (structs::ChangeSize_Struct*)outapp->pBuffer;
css->EntityID = sas->spawn_id;
css->Size = (float)sas->parameter;
css->Unknown08 = 0;
css->Unknown12 = 1.0f;
css->CameraOffset = 0;
css->AnimationSpeedRelated = 1.0f;
dest->FastQueuePacket(&outapp, ack_req);
delete in;
@ -3574,18 +3579,28 @@ namespace TOB
DECODE(OP_BlockedBuffs)
{
DECODE_LENGTH_EXACT(structs::BlockedBuffs_Struct);
SETUP_DIRECT_DECODE(BlockedBuffs_Struct, structs::BlockedBuffs_Struct);
uint32 count = __packet->ReadUInt32();
std::vector<int32> blocked_spell_ids;
blocked_spell_ids.reserve(count);
for (int i = 0; i < count; ++i)
blocked_spell_ids.push_back(static_cast<int32>(__packet->ReadUInt32()));
for (uint32 i = 0; i < BLOCKED_BUFF_COUNT; ++i)
emu->SpellID[i] = eq->SpellID[i];
bool pet = __packet->ReadUInt8() == 1;
bool init = __packet->ReadUInt8() == 1;
IN(Count);
IN(Pet);
IN(Initialise);
IN(Flags);
__packet->SetReadPosition(0); // reset the packet read to pass it along
FINISH_DIRECT_DECODE();
__packet->size = sizeof(BlockedBuffs_Struct);
__packet->pBuffer = new unsigned char[__packet->size]{};
BlockedBuffs_Struct* emu = (BlockedBuffs_Struct*)__packet->pBuffer;
memset(emu->SpellID, -1, sizeof(emu->SpellID));
for (int i = 0; i < count; ++i)
emu->SpellID[i] = blocked_spell_ids[i];
emu->Count = count;
emu->Pet = pet;
emu->Initialise = init;
}
DECODE(OP_CastSpell)

View File

@ -12,7 +12,7 @@ namespace TOB {
static const uint32 MAX_PP_UNKNOWN_ABILITIES = 25;
static const uint32 MAX_RECAST_TYPES = 25;
static const uint32 MAX_ITEM_RECAST_TYPES = 100;
static const uint32 BLOCKED_BUFF_COUNT = 40;
static const uint32 BLOCKED_BUFF_COUNT = 60; // this might not be needed?
static const uint32 BUFF_COUNT = 62;
static const uint32 MAX_PP_LANGUAGE = 32;
#pragma pack(1)
@ -274,7 +274,6 @@ namespace TOB {
Unknown39,
Unknown40,
Unknown41,
Unknown42,
Birthdate,
EncounterLock
};
@ -288,6 +287,15 @@ namespace TOB {
/*0024*/
};
struct ChangeSize_Struct
{
/*00*/ uint32 EntityID;
/*04*/ float Size;
/*08*/ float CameraOffset;
/*12*/ float AnimationSpeedRelated;
/*16*/
};
struct Spawn_Struct_Bitfields
{
union {
@ -400,14 +408,14 @@ namespace TOB {
/*056*/ float X;
/*060*/ float Z;
/*064*/ float Heading;
/*068*/ float DoorAngle; //not sure if this is actually a float; it might be a uint32 like DefaultDoorAngle
/*068*/ float DoorAngle;
/*072*/ uint32 ScaleFactor; //rof2's size
/*076*/ uint32 Unknown76; //client doesn't seem to read this
/*080*/ uint8 Id; //doorid
/*081*/ uint8 Type; //opentype
/*082*/ uint8 State; //state_at_spawn
/*083*/ uint8 DefaultState; //invert_state
/*084*/ int32 Param; //door_param
/*084*/ int32 Param; //door_param (spell id?)
/*088*/ uint32 AdventureDoorId;
/*092*/ uint32 DynDoorID;
/*096*/ uint32 RealEstateDoorID;
@ -549,15 +557,6 @@ namespace TOB {
/*024*/
};
struct ChangeSize_Struct
{
/*00*/ uint32 EntityID;
/*04*/ float Size;
/*08*/ uint32 Unknown08; // Observed 0
/*12*/ float Unknown12; // Observed 1.0f
/*16*/
};
struct SpawnHPUpdate_Struct
{
/*00*/ int16 spawn_id;
@ -837,15 +836,6 @@ namespace TOB {
/*009*/ uint8 unknown009[3];
};
struct BlockedBuffs_Struct
{
/*000*/ int32 SpellID[BLOCKED_BUFF_COUNT];
/*120*/ uint32 Count;
/*124*/ uint8 Pet;
/*125*/ uint8 Initialise;
/*126*/ uint16 Flags;
};
struct ZonePlayerToBind_Struct {
//Same structure as the binds in PlayerProfile_Struct
//Assembly calls the same function

View File

@ -349,7 +349,7 @@ RULE_STRING(World, MOTD, "", "Server MOTD sent on login, change from empty to ha
RULE_STRING(World, Rules, "", "Server Rules, change from empty to have this be used instead of variables table 'rules' value, lines are pipe (|) separated, example: A|B|C")
RULE_BOOL(World, EnableAutoLogin, false, "Enables or disables auto login of characters, allowing people to log characters in directly from loginserver to ingame")
RULE_BOOL(World, EnablePVPRegions, true, "Enables or disables PVP Regions automatically setting your PVP flag")
RULE_STRING(World, SupportedClients, "RoF2", "Comma-delimited list of clients to restrict to. Supported values are Titanium | SoF | SoD | UF | RoF | RoF2. Example: Titanium,RoF2")
RULE_STRING(World, SupportedClients, "RoF2,TOB", "Comma-delimited list of clients to restrict to. Supported values are Titanium | SoF | SoD | UF | RoF | RoF2 | TOB. Example: Titanium,RoF2,TOB")
RULE_STRING(World, CustomFilesKey, "", "Enable if the server requires custom files and sends a key to validate. Empty string to disable. Example: eqcustom_v1")
RULE_STRING(World, CustomFilesUrl, "github.com/knervous/eqnexus/releases", "URL to display at character select if client is missing custom files")
RULE_INT(World, CustomFilesAdminLevel, 20, "Admin level at which custom file key is not required when CustomFilesKey is specified")

File diff suppressed because it is too large Load Diff