Merge branch 'master' into StringFormatting.

Cleaned up the problems. Tested on Linux. Still need to test on windows.

Conflicts:
	common/CMakeLists.txt
	common/MiscFunctions.cpp
	common/MiscFunctions.h
	common/debug.cpp
	world/Adventure.cpp
This commit is contained in:
Arthur Ice
2013-05-19 18:56:21 -07:00
618 changed files with 38225 additions and 38967 deletions
+51 -51
View File
@@ -20,7 +20,7 @@ static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
char *SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth);
void Register(EQStreamIdentifier &into) {
//create our opcode manager if we havent already
if(opcodes == nullptr) {
@@ -36,35 +36,35 @@ void Register(EQStreamIdentifier &into) {
return;
}
}
//ok, now we have what we need to register.
EQStream::Signature signature;
string pname;
//register our world signature.
pname = string(name) + "_world";
signature.ignore_eq_opcode = 0;
signature.first_length = sizeof(structs::LoginInfo_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_SendLoginInfo);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
//register our zone signature.
pname = string(name) + "_zone";
signature.ignore_eq_opcode = opcodes->EmuToEQ(OP_AckPacket);
signature.first_length = sizeof(structs::ClientZoneEntry_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_ZoneEntry);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
_log(NET__IDENTIFY, "Registered patch %s", name);
}
void Reload() {
//we have a big problem to solve here when we switch back to shared memory
//opcode managers because we need to change the manager pointer, which means
//we need to go to every stream and replace it's manager.
if(opcodes != nullptr) {
//TODO: get this file name from the config file
string opfile = "patch_";
@@ -139,10 +139,10 @@ ENCODE(OP_SendCharInfo) {
ENCODE(OP_SendAATable) {
ENCODE_LENGTH_ATLEAST(SendAA_Struct);
SETUP_VAR_ENCODE(SendAA_Struct);
ALLOC_VAR_ENCODE(structs::SendAA_Struct, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability));
// Check clientver field to verify this AA should be sent for SoF
// clientver 1 is for all clients and 2 is for 6.2
if (emu->clientver <= 2 )
@@ -179,7 +179,7 @@ ENCODE(OP_SendAATable) {
OUT(abilities[r].slot);
}
}
FINISH_ENCODE();
}
@@ -200,19 +200,19 @@ ENCODE(OP_DeleteSpawn) {
ENCODE(OP_PlayerProfile) {
SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct);
uint32 r;
memset(eq->unknown3224, 0xff, 448);
memset(eq->unknown3704, 0xff, 32);
// OUT(checksum);
OUT(gender);
OUT(race);
OUT(class_);
OUT(level);
eq->level2 = emu->level;
eq->bind_zone_id = emu->binds[0].zoneId;
eq->bind_x[0] = emu->binds[0].x;
eq->bind_y[0] = emu->binds[0].y;
@@ -223,8 +223,8 @@ ENCODE(OP_PlayerProfile) {
eq->zone_safe_y = emu->binds[4].y;
eq->zone_safe_z = emu->binds[4].z;
eq->zone_safe_heading = emu->binds[4].heading;
OUT(deity);
OUT(intoxication);
OUT_array(spellSlotRefresh, structs::MAX_PP_MEMSPELL);
@@ -362,10 +362,10 @@ ENCODE(OP_PlayerProfile) {
OUT(raidAutoconsent);
OUT(guildAutoconsent);
// OUT(showhelm);
//set the checksum...
CRC32::SetEQChecksum(__packet->pBuffer, sizeof(structs::PlayerProfile_Struct)-4);
FINISH_ENCODE();
}
@@ -409,11 +409,11 @@ ENCODE(OP_ZoneSpawns) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Spawn_Struct *emu = (Spawn_Struct *) __emu_buffer;
//determine and verify length
int entrycount = in->size / sizeof(Spawn_Struct);
if(entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
@@ -421,16 +421,16 @@ ENCODE(OP_ZoneSpawns) {
delete in;
return;
}
//make the EQ struct.
in->size = sizeof(structs::Spawn_Struct)*entrycount;
in->pBuffer = new unsigned char[in->size];
structs::Spawn_Struct *eq = (structs::Spawn_Struct *) in->pBuffer;
//zero out the packet. We could avoid this memset by setting all fields (including unknowns)
//in the loop.
memset(in->pBuffer, 0, in->size);
//do the transform...
int r;
int k;
@@ -493,7 +493,7 @@ ENCODE(OP_ZoneSpawns) {
eq->lfg = emu->lfg;
eq->flymode = emu->flymode;
}
//kill off the emu structure and send the eq packet.
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
@@ -504,7 +504,7 @@ ENCODE(OP_ItemPacket) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
ItemPacket_Struct *old_item_pkt=(ItemPacket_Struct *)__emu_buffer;
@@ -533,7 +533,7 @@ ENCODE(OP_CharInventory) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
@@ -544,7 +544,7 @@ ENCODE(OP_CharInventory) {
return;
}
InternalSerializedItem_Struct *eq = (InternalSerializedItem_Struct *) in->pBuffer;
//do the transform...
int r;
string serial_string;
@@ -557,7 +557,7 @@ ENCODE(OP_CharInventory) {
} else {
_log(NET__STRUCTS, "Serialization failed on item slot %d during OP_CharInventory. Item skipped.",eq->slot_id);
}
}
in->size = serial_string.length();
@@ -572,39 +572,39 @@ ENCODE(OP_GuildMemberList) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Internal_GuildMembers_Struct *emu = (Internal_GuildMembers_Struct *) in->pBuffer;
//make a new EQ buffer.
uint32 pnl = strlen(emu->player_name);
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
emu->count*sizeof(structs::GuildMemberEntry_Struct)
+ emu->name_length + emu->note_length;
in->pBuffer = new uint8[length];
in->size = length;
//no memset since we fill every byte.
uint8 *buffer;
buffer = in->pBuffer;
//easier way to setup GuildMembers_Struct
//set prefix name
strcpy((char *)buffer, emu->player_name);
buffer += pnl;
*buffer = '\0';
buffer++;
//add member count.
*((uint32 *) buffer) = htonl( emu->count );
buffer += sizeof(uint32);
if(emu->count > 0) {
Internal_GuildMemberEntry_Struct *emu_e = emu->member;
const char *emu_name = (const char *) (__emu_buffer +
const char *emu_name = (const char *) (__emu_buffer +
sizeof(Internal_GuildMembers_Struct) + //skip header
emu->count * sizeof(Internal_GuildMemberEntry_Struct) //skip static length member data
);
@@ -612,14 +612,14 @@ ENCODE(OP_GuildMemberList) {
emu->name_length + //skip name contents
emu->count //skip string terminators
);
structs::GuildMemberEntry_Struct *e = (structs::GuildMemberEntry_Struct *) buffer;
uint32 r;
for(r = 0; r < emu->count; r++, emu_e++) {
//the order we set things here must match the struct
//nice helper macro
/*#define SlideStructString(field, str) \
strcpy(e->field, str.c_str()); \
@@ -633,7 +633,7 @@ ENCODE(OP_GuildMemberList) {
}
#define PutFieldN(field) \
e->field = htonl(emu_e->field)
SlideStructString( name, emu_name );
PutFieldN(level);
PutFieldN(banker);
@@ -648,7 +648,7 @@ ENCODE(OP_GuildMemberList) {
e->zone_id = htons(emu_e->zone_id);
#undef SlideStructString
#undef PutFieldN
e++;
}
}
@@ -662,9 +662,9 @@ ENCODE(OP_ReadBook) {
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
BookText_Struct *emu_BookText_Struct = (BookText_Struct *)__emu_buffer;
in->size = sizeof(structs::BookText_Struct) + strlen(emu_BookText_Struct->booktext);
@@ -858,14 +858,14 @@ DECODE(OP_ItemLinkClick) {
DECODE_LENGTH_EXACT(structs::ItemViewRequest_Struct);
SETUP_DIRECT_DECODE(ItemViewRequest_Struct, structs::ItemViewRequest_Struct);
MEMSET_IN(ItemViewRequest_Struct);
IN(item_id);
int r;
for (r = 0; r < 5; r++) {
IN(augments[r]);
}
IN(link_hash);
FINISH_DIRECT_DECODE();
}
@@ -919,7 +919,7 @@ DECODE(OP_WhoAllRequest) {
IN(lvlhigh);
IN(gmlookup);
emu->type = 3;
FINISH_DIRECT_DECODE();
}
@@ -984,7 +984,7 @@ char *SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 d
}
}
*length=MakeAnyLenString(&serialization,
"%.*s%s" // For leading quotes (and protection) if a subitem;
"%s" // Instance data
+10 -10
View File
@@ -7,31 +7,31 @@
class EQStreamIdentifier;
namespace Client62 {
//these are the only public member of this namespace.
extern void Register(EQStreamIdentifier &into);
extern void Reload();
//you should not directly access anything below..
//you should not directly access anything below..
//I just dont feel like making a seperate header for it.
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "SSDeclare.h"
#include "Client62_ops.h"
};
};
#endif /*CLIENT62_H_*/
+56 -56
View File
@@ -62,7 +62,7 @@ struct DuelResponse_Struct
};
/*
Cofruben:
Adventure stuff,not a net one,just one for our use
Adventure stuff,not a net one,just one for our use
*/
static const uint32 ADVENTURE_COLLECT = 0;
static const uint32 ADVENTURE_MASSKILL = 1;
@@ -155,15 +155,15 @@ struct CharacterSelect_Struct {
**
*/
/*
** Generic Spawn Struct
** Length: 383 Octets
** Used in:
/*
** Generic Spawn Struct
** Length: 383 Octets
** Used in:
** spawnZoneStruct
** dbSpawnStruct
** petStruct
** newSpawnStruct
*/
*/
struct Spawn_Struct
{
/*0000*/ uint8 NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse,a
@@ -188,9 +188,9 @@ struct Spawn_Struct
signed padding0070:19; // ***Placeholder
/*0074*/ uint16 deity; // Player's Deity
/*0076*/ uint8 unknown[2];
/*0078*/ union
/*0078*/ union
{
struct
struct
{
/*0078*/ uint32 equip_helmet; // Equipment: Helmet Visual
/*0082*/ uint32 equip_chest; // Equipment: Chest Visual
@@ -223,9 +223,9 @@ struct Spawn_Struct
/*0166*/ uint8 is_npc; // 0=no, 1=yes
/*0167*/ uint8 flymode; //seems to be 3 for 'useable' npc classes
/*0168*/ uint32 guildID; // Current guild
/*0172*/ union
/*0172*/ union
{
struct
struct
{
/*0172*/ Color_Struct color_helmet; // Color of helmet item
/*0176*/ Color_Struct color_chest; // Color of chest item
@@ -246,12 +246,12 @@ struct Spawn_Struct
/*0217*/ uint8 beardcolor; // Beard color
/*0218*/ float size; // Model size
/*0222*/ uint8 findable; // 0=can't be found, 1=can be found
/*0223*/ float unknown_float;
/*0223*/ float unknown_float;
/*0227*/ char suffix[32]; // Player's suffix (of Veeshan, etc.)
/*0259*/ uint8 unknown0259[4]; //[0] is sometimes 100
/*0263*/ uint8 guildrank; // 0=normal, 1=officer, 2=leader
/*0264*/ uint8 unknown0264[3];
union
union
{
/*0267*/ uint8 equip_chest2; // Second place in packet for chest texture (usually 0xFF in live packets)
// Not sure why there are 2 of them, but it effects chest texture!
@@ -337,9 +337,9 @@ struct NewZone_Struct {
** Length: 12 Bytes
**
*/
struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc)
struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc)
uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming
uint32 unknown12;
};
@@ -373,20 +373,20 @@ struct DeleteSpell_Struct
};
struct ManaChange_Struct
{
{
uint32 new_mana; // New Mana AMount
uint32 stamina;
uint32 spell_id;
uint32 unknown12;
};
struct SwapSpell_Struct
{
uint32 from_slot;
uint32 to_slot;
struct SwapSpell_Struct
{
uint32 from_slot;
uint32 to_slot;
};
};
struct BeginCast_Struct
{
@@ -526,8 +526,8 @@ struct CharCreate_Struct
/*0092*/ int32 hairstyle;
/*0096*/ uint32 deity;
///*0072*/ int32 deity;
// 0 = odus
// 1 = qeynos
// 2 = halas
@@ -563,7 +563,7 @@ struct CharCreate_Struct
struct AA_Array
{
uint32 AA;
uint32 value;
uint32 value;
};
@@ -603,7 +603,7 @@ struct Bandolier_Struct {
struct PotionBelt_Struct {
BandolierItem_Struct items[MAX_PLAYER_BANDOLIER_ITEMS];
};
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
static const uint32 MAX_RAID_LEADERSHIP_AA_ARRAY = 16;
static const uint32 MAX_LEADERSHIP_AA_ARRAY = (MAX_GROUP_LEADERSHIP_AA_ARRAY+MAX_RAID_LEADERSHIP_AA_ARRAY);
@@ -650,17 +650,17 @@ struct PlayerProfile_Struct
/*0200*/ float bind_heading[4]; //
/*0216*/ float zone_safe_heading;
/*0220*/ uint32 deity; // deity
/*0224*/ uint32 guild_id;
/*0224*/ uint32 guild_id;
/*0228*/ uint32 birthday; // characters bday
/*0232*/ uint32 lastlogin; // last login or zone time
/*0236*/ uint32 timePlayedMin; // in minutes
/*0240*/ uint8 pvp;
/*0240*/ uint8 pvp;
/*0241*/ uint8 level2; //no idea why this is here, but thats how it is on live
/*0242*/ uint8 anon; // 2=roleplay, 1=anon, 0=not anon
/*0243*/ uint8 gm;
/*0244*/ uint8 guildrank;
/*0245*/ uint8 unknown0245[7]; //
/*0252*/ uint32 intoxication;
/*0252*/ uint32 intoxication;
/*0256*/ uint32 spellSlotRefresh[MAX_PP_MEMSPELL]; //in ms
/*0292*/ uint32 abilitySlotRefresh;
/*0296*/ uint8 haircolor; // Player hair color
@@ -684,7 +684,7 @@ struct PlayerProfile_Struct
/*2416*/ char suffix[32]; //length might be wrong
/*2448*/ uint32 guildid2; //
/*2452*/ uint32 exp; // Current Experience
/*2456*/ uint32 unknown1496;
/*2456*/ uint32 unknown1496;
/*2460*/ uint32 points; // Unspent Practice points
/*2464*/ uint32 mana; // current mana
/*2468*/ uint32 cur_hp; // current hp
@@ -701,7 +701,7 @@ struct PlayerProfile_Struct
/*2552*/ uint8 languages[MAX_PP_LANGUAGE];
/*2580*/ uint8 unknown1620[4];
/*2584*/ uint32 spell_book[MAX_PP_SPELLBOOK];
/*4184*/ uint8 unknown3224[448]; // all 0xff
/*4184*/ uint8 unknown3224[448]; // all 0xff
/*4632*/ uint32 mem_spells[MAX_PP_MEMSPELL];
/*4668*/ uint8 unknown3704[32]; //
/*4700*/ float y; // Player y position
@@ -741,7 +741,7 @@ struct PlayerProfile_Struct
/*5476*/ int32 hunger_level;
/*5480*/ int32 thirst_level;
/*5484*/ uint32 ability_up;
/*5488*/ char unknown4524[16];
/*5488*/ char unknown4524[16];
/*5504*/ uint16 zone_id; // Current zone of the player
/*5506*/ uint16 zoneInstance; // Instance ID
/*5508*/ SpellBuff_Struct buffs[BUFF_COUNT]; // Buffs currently on the player
@@ -900,7 +900,7 @@ struct BindWound_Struct
/*
** Type: Zone Change Request (before hand)
** Length: 88 bytes
** Length: 88 bytes
** OpCode: a320
*/
@@ -923,7 +923,7 @@ struct RequestClientZoneChange_Struct {
/*08*/ float x;
/*12*/ float z;
/*16*/ float heading;
/*20*/ uint32 type; //unknown... values
/*20*/ uint32 type; //unknown... values
};
struct Animation_Struct {
@@ -1203,13 +1203,13 @@ struct TradeMoneyUpdate_Struct{
** Surname struct
** Size: 100 bytes
*/
struct Surname_Struct
{
struct Surname_Struct
{
/*0000*/ char name[64];
/*0064*/ uint32 unknown0064;
/*0068*/ char lastname[32];
/*0100*/
};
};
struct GuildsListEntry_Struct {
char name[64];
@@ -1465,7 +1465,7 @@ struct Merchant_Click_Struct {
/*000*/ uint32 npcid; // Merchant NPC's entity id
/*004*/ uint32 playerid;
/*008*/ uint32 command; //1=open, 0=cancel/close
/*012*/ float rate; //cost multiplier, dosent work anymore
/*012*/ float rate; //cost multiplier, dosent work anymore
};
/*
Unknowns:
@@ -1584,7 +1584,7 @@ struct Illusion_Struct {
/*068*/ uint16 race;
/*070*/ char unknown070[2];
/*072*/ uint8 gender;
/*073*/ uint8 texture;
/*073*/ uint8 texture;
/*074*/ uint8 helmtexture;
/*075*/ uint8 unknown075;
/*076*/ uint32 face;
@@ -1636,14 +1636,14 @@ struct GroupCancel_Struct {
uint8 toggle;
};
struct GroupUpdate_Struct {
struct GroupUpdate_Struct {
/*0000*/ uint32 action;
/*0004*/ char yourname[64];
/*0068*/ char membername[5][64];
/*0388*/ char leadersname[64];
};
struct GroupUpdate2_Struct {
struct GroupUpdate2_Struct {
/*0000*/ uint32 action;
/*0004*/ char yourname[64];
/*0068*/ char membername[5][64];
@@ -1652,7 +1652,7 @@ struct GroupUpdate2_Struct {
/*0580*/ uint8 unknown[188];
/*0768*/
};
struct GroupJoin_Struct {
struct GroupJoin_Struct {
/*0000*/ uint32 action;
/*0004*/ char yourname[64];
/*0068*/ char membername[64];
@@ -1666,10 +1666,10 @@ struct FaceChange_Struct {
/*003*/ uint8 eyecolor2;
/*004*/ uint8 hairstyle;
/*005*/ uint8 beard; // vesuvias
/*006*/ uint8 face;
/*006*/ uint8 face;
//vesuvias:
//there are only 10 faces for barbs changing woad just
//increase the face value by ten so if there were 8 woad
//increase the face value by ten so if there were 8 woad
//designs then there would be 80 barb faces
};
@@ -1751,11 +1751,11 @@ struct Who_All_Struct { // 76 length total
/*140*/
};
struct Stun_Struct { // 4 bytes total
struct Stun_Struct { // 4 bytes total
uint32 duration; // Duration of stun
};
struct AugmentItem_Struct {
struct AugmentItem_Struct {
/*00*/ int16 container_slot;
/*02*/ char unknown02[2];
/*04*/ int32 augment_slot;
@@ -1769,11 +1769,11 @@ struct Emote_Struct {
/*1028*/
};
// Inspect
struct Inspect_Struct {
uint16 TargetID;
uint16 PlayerID;
};
// Inspect
struct Inspect_Struct {
uint16 TargetID;
uint16 PlayerID;
};
//OP_InspectAnswer
struct InspectResponse_Struct{//Cofruben:need to send two of this for the inspect response.
/*000*/ uint32 TargetID;
@@ -1958,7 +1958,7 @@ struct CloseContainer_Struct {
/*
** Generic Door Struct
** Length: 52 Octets
** Used in:
** Used in:
** cDoorSpawnsStruct(f721)
**
*/
@@ -2557,7 +2557,7 @@ struct Split_Struct
** Last Updated: Oct-15-2003
**
*/
struct NewCombine_Struct {
struct NewCombine_Struct {
/*00*/ int16 container_slot;
/*02*/ char unknown02[2];
/*04*/
@@ -2862,7 +2862,7 @@ struct RaidDetails_Struct {
/*000*/ uint32 action; //=6,20
/*004*/ char leader_name[64];
/*068*/ uint32 unknown68[4];
/*084*/ LeadershipAA_Struct abilities; //ranks in backwards byte order
/*084*/ LeadershipAA_Struct abilities; //ranks in backwards byte order
/*128*/ uint8 unknown128[142];
/*354*/ uint32 leader_id;
};
@@ -3022,7 +3022,7 @@ struct AA_Action {
};
struct AA_Skills { //this should be removed and changed to AA_Array
/*00*/ uint32 aa_skill;
/*00*/ uint32 aa_skill;
/*04*/ uint32 aa_value;
};
@@ -3053,13 +3053,13 @@ struct AATable_Struct {
struct Weather_Struct {
uint32 val1; //generall 0x000000FF
uint32 type; //0x31=rain, 0x02=snow(i think), 0 = normal
uint32 mode;
uint32 mode;
};
struct ZoneInUnknown_Struct {
uint32 val1;
uint32 val2;
uint32 val3;
uint32 val3;
};
struct MobHealth_Struct {
+115 -115
View File
@@ -23,7 +23,7 @@ static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth);
void Register(EQStreamIdentifier &into) {
//create our opcode manager if we havent already
if(opcodes == nullptr) {
@@ -39,37 +39,37 @@ void Register(EQStreamIdentifier &into) {
return;
}
}
//ok, now we have what we need to register.
EQStream::Signature signature;
string pname;
//register our world signature.
pname = string(name) + "_world";
signature.ignore_eq_opcode = 0;
signature.first_length = sizeof(structs::LoginInfo_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_SendLoginInfo);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
//register our zone signature.
pname = string(name) + "_zone";
signature.ignore_eq_opcode = opcodes->EmuToEQ(OP_AckPacket);
signature.first_length = sizeof(structs::ClientZoneEntry_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_ZoneEntry);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
_log(NET__IDENTIFY, "Registered patch %s", name);
}
void Reload() {
//we have a big problem to solve here when we switch back to shared memory
//opcode managers because we need to change the manager pointer, which means
//we need to go to every stream and replace it's manager.
if(opcodes != nullptr) {
//TODO: get this file name from the config file
string opfile = "patch_";
@@ -104,7 +104,7 @@ const EQClientVersion Strategy::ClientVersion() const
{
return EQClientRoF;
}
#include "SSDefine.h"
// Converts Titanium Slot IDs to RoF Slot IDs for use in Encodes
@@ -135,7 +135,7 @@ static inline structs::ItemSlotStruct TitaniumToRoFSlot(uint32 TitaniumSlot)
{
RoFSlot.MainSlot += 1;
}
}
/*else if (TitaniumSlot < 51) // Cursor Buffer
{
@@ -431,13 +431,13 @@ ENCODE(OP_TaskHistoryReply)
// Skip past Text2
while(in->ReadUInt8())
++Text2Length;
in->ReadUInt32();
in->ReadUInt32();
in->ReadUInt32();
uint32 ZoneID = in->ReadUInt32();
in->ReadUInt32();
// Skip past Text3
while(in->ReadUInt8())
++Text3Length;
@@ -445,7 +445,7 @@ ENCODE(OP_TaskHistoryReply)
char ZoneNumber[10];
sprintf(ZoneNumber, "%i", ZoneID);
OutboundPacketSize += (24 + Text1Length + 1 + Text2Length + Text3Length + 1 + 7 + (strlen(ZoneNumber) * 2));
}
@@ -479,7 +479,7 @@ ENCODE(OP_TaskHistoryReply)
outapp->WriteUInt32(Text2Length);
in->SetReadPosition(CurrentPosition);
// Copy Text2
while(uint8 c = in->ReadUInt8())
outapp->WriteUInt8(c);
@@ -495,11 +495,11 @@ ENCODE(OP_TaskHistoryReply)
sprintf(ZoneNumber, "%i", ZoneID);
outapp->WriteUInt32(2);
outapp->WriteUInt8(0x2d); // "-"
outapp->WriteUInt8(0x2d); // "-"
outapp->WriteUInt8(0x31); // "1"
outapp->WriteUInt32(2);
outapp->WriteUInt8(0x2d); // "-"
outapp->WriteUInt8(0x2d); // "-"
outapp->WriteUInt8(0x31); // "1"
outapp->WriteString(ZoneNumber);
@@ -510,7 +510,7 @@ ENCODE(OP_TaskHistoryReply)
outapp->WriteUInt8(c);
outapp->WriteUInt8(0); // Text3 has a null terminator
outapp->WriteUInt8(0x31); // "1"
outapp->WriteString(ZoneNumber);
}
@@ -566,7 +566,7 @@ ENCODE(OP_OpenNewTasksWindow) {
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
__emu_AvailableTaskHeader = (AvailableTaskHeader_Struct*)__emu_buffer;
@@ -602,7 +602,7 @@ ENCODE(OP_OpenNewTasksWindow) {
__eq_AvailableTaskData1->TaskID = __emu_AvailableTaskData1->TaskID;
// This next unknown seems to affect the colour of the task title. 0x3f80000 is what I have seen
// in RoF packets. Changing it to 0x3f000000 makes the title red.
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
__eq_AvailableTaskData1->TimeLimit = __emu_AvailableTaskData1->TimeLimit;
__eq_AvailableTaskData1->unknown2 = __emu_AvailableTaskData1->unknown2;
@@ -661,7 +661,7 @@ ENCODE(OP_OpenNewTasksWindow) {
}
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
*/
@@ -669,8 +669,8 @@ ENCODE(OP_OpenNewTasksWindow) {
ENCODE(OP_SendCharInfo) {
ENCODE_LENGTH_EXACT(CharacterSelect_Struct);
SETUP_VAR_ENCODE(CharacterSelect_Struct);
//EQApplicationPacket *packet = *p;
//const CharacterSelect_Struct *emu = (CharacterSelect_Struct *) packet->pBuffer;
@@ -689,10 +689,10 @@ ENCODE(OP_SendCharInfo) {
+ namelen;
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, total_length);
//unsigned char *eq_buffer = new unsigned char[total_length];
//structs::CharacterSelect_Struct *eq_head = (structs::CharacterSelect_Struct *) eq_buffer;
eq->char_count = char_count;
//eq->total_chars = 10;
@@ -748,9 +748,9 @@ ENCODE(OP_SendCharInfo) {
}
bufptr += sizeof(structs::CharacterSelectEntry_Struct);
}
FINISH_ENCODE();
}
ENCODE(OP_ZoneServerInfo) {
@@ -781,10 +781,10 @@ ENCODE(OP_SendZonepoints) {
ENCODE(OP_SendAATable) {
ENCODE_LENGTH_ATLEAST(SendAA_Struct);
SETUP_VAR_ENCODE(SendAA_Struct);
ALLOC_VAR_ENCODE(structs::SendAA_Struct, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability));
// Check clientver field to verify this AA should be sent for SoF
// clientver 1 is for all clients and 5 is for Live
if (emu->clientver <= 5 )
@@ -870,9 +870,9 @@ ENCODE(OP_PlayerProfile)
outapp->WriteUInt8(emu->level); // Level
outapp->WriteUInt8(emu->level); // Level1
outapp->WriteUInt32(5); // Bind count
for(int r = 0; r < 5; r++)
{
outapp->WriteUInt32(emu->binds[r].zoneId);
@@ -886,7 +886,7 @@ ENCODE(OP_PlayerProfile)
outapp->WriteUInt32(emu->intoxication);
outapp->WriteUInt32(10); // Unknown count
for(int r = 0; r < 10; r++)
{
outapp->WriteUInt32(0); // Unknown
@@ -1073,7 +1073,7 @@ ENCODE(OP_PlayerProfile)
}
outapp->WriteUInt32(structs::MAX_PP_SPELLBOOK); // Spellbook slots
for(uint32 r = 0; r < MAX_PP_SPELLBOOK; r++)
{
outapp->WriteUInt32(emu->spell_book[r]);
@@ -1470,7 +1470,7 @@ ENCODE(OP_PlayerProfile)
outapp->WriteUInt32(emu->air_remaining); // ?
// PVP Stats
outapp->WriteUInt32(emu->PVPKills);
outapp->WriteUInt32(emu->PVPDeaths);
outapp->WriteUInt32(emu->PVPCurrentPoints);
@@ -1480,7 +1480,7 @@ ENCODE(OP_PlayerProfile)
outapp->WriteUInt32(emu->PVPCurrentKillStreak);
// Last PVP Kill
outapp->WriteString(emu->PVPLastKill.Name);
outapp->WriteUInt32(emu->PVPLastKill.Level);
outapp->WriteUInt32(emu->PVPLastKill.Race);
@@ -1490,7 +1490,7 @@ ENCODE(OP_PlayerProfile)
outapp->WriteUInt32(emu->PVPLastKill.Points);
// Last PVP Death
outapp->WriteString(emu->PVPLastDeath.Name);
outapp->WriteUInt32(emu->PVPLastDeath.Level);
outapp->WriteUInt32(emu->PVPLastDeath.Race);
@@ -1556,7 +1556,7 @@ ENCODE(OP_PlayerProfile)
outapp->size = outapp->GetWritePosition();
outapp->SetWritePosition(4);
outapp->WriteUInt32(outapp->size - 9);
CRC32::SetEQChecksum(outapp->pBuffer, outapp->size - 1, 8);
//_hex(NET__ERROR, outapp->pBuffer, outapp->size);
@@ -1602,7 +1602,7 @@ ENCODE(OP_NewZone) {
OUT(SuspendBuffs);
eq->FogDensity = emu->fog_density;
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown800 = -1;
eq->unknown844 = 600;
@@ -1685,7 +1685,7 @@ ENCODE(OP_PetBuffWindow)
__packet->size = sz;
__packet->pBuffer = new unsigned char[sz];
memset(__packet->pBuffer, 0, sz);
__packet->WriteUInt32(emu->petid);
__packet->WriteUInt32(0); // PlayerID ?
__packet->WriteUInt8(1); // 1 indicates all buffs on the pet (0 to add or remove a single buff)
@@ -1699,7 +1699,7 @@ ENCODE(OP_PetBuffWindow)
__packet->WriteUInt32(emu->spellid[i]);
__packet->WriteUInt32(emu->ticsremaining[i]);
__packet->WriteUInt32(0); // Unknown
__packet->WriteString("");
__packet->WriteString("");
}
}
__packet->WriteUInt8(0); // Unknown
@@ -1745,7 +1745,7 @@ ENCODE(OP_Barter)
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
ENCODE(OP_BazaarSearch)
@@ -1809,11 +1809,11 @@ ENCODE(OP_ZoneSpawns)
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Spawn_Struct *emu = (Spawn_Struct *) __emu_buffer;
//determine and verify length
int entrycount = in->size / sizeof(Spawn_Struct);
if(entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
@@ -1822,7 +1822,7 @@ ENCODE(OP_ZoneSpawns)
return;
}
//_log(NET__STRUCTS, "Spawn name is [%s]", emu->name);
emu = (Spawn_Struct *) __emu_buffer;
@@ -1831,7 +1831,7 @@ ENCODE(OP_ZoneSpawns)
char *Buffer = (char *) in->pBuffer, *BufferStart;
int r;
int k;
for(r = 0; r < entrycount; r++, emu++) {
@@ -1849,7 +1849,7 @@ ENCODE(OP_ZoneSpawns)
if(strlen(emu->suffix))
PacketSize += strlen(emu->suffix) + 1;
bool ShowName = 1;
if(emu->bodytype >= 66)
{
@@ -1903,7 +1903,7 @@ ENCODE(OP_ZoneSpawns)
Bitfields->targetable = 1;
Bitfields->targetable_with_hotkey = (emu->IsMercenary ? 0 : 1);
Bitfields->showname = ShowName;
// Not currently found
// Bitfields->statue = 0;
// Bitfields->buyer = 0;
@@ -1913,7 +1913,7 @@ ENCODE(OP_ZoneSpawns)
uint8 OtherData = 0;
if(strlen(emu->title))
OtherData = OtherData | 16;
OtherData = OtherData | 16;
if(strlen(emu->suffix))
OtherData = OtherData | 32;
@@ -1950,7 +1950,7 @@ ENCODE(OP_ZoneSpawns)
VARSTRUCT_ENCODE_TYPE(float, Buffer, emu->runspeed);
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->race);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // ShowEQ calls this 'Holding'
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->deity);
if(emu->NPC)
@@ -2042,7 +2042,7 @@ ENCODE(OP_ZoneSpawns)
Position->deltaZ = emu->deltaZ;
Buffer += sizeof(structs::Spawn_Struct_Position);
if(strlen(emu->title))
{
VARSTRUCT_ENCODE_STRING(Buffer, emu->title);
@@ -2053,7 +2053,7 @@ ENCODE(OP_ZoneSpawns)
VARSTRUCT_ENCODE_STRING(Buffer, emu->suffix);
}
Buffer += 8;
Buffer += 8;
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->IsMercenary);
VARSTRUCT_ENCODE_STRING(Buffer, "0000000000000000");
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0xffffffff);
@@ -2068,7 +2068,7 @@ ENCODE(OP_ZoneSpawns)
//_hex(NET__ERROR, outapp->pBuffer, outapp->size);
dest->FastQueuePacket(&outapp, ack_req);
}
delete in;
}
@@ -2076,7 +2076,7 @@ ENCODE(OP_MercenaryDataResponse) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
MercenaryMerchantList_Struct *emu = (MercenaryMerchantList_Struct *) __emu_buffer;
@@ -2140,7 +2140,7 @@ ENCODE(OP_MercenaryDataUpdate) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
MercenaryDataUpdate_Struct *emu = (MercenaryDataUpdate_Struct *) __emu_buffer;
@@ -2220,7 +2220,7 @@ ENCODE(OP_ItemPacket) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
ItemPacket_Struct *old_item_pkt=(ItemPacket_Struct *)__emu_buffer;
InternalSerializedItem_Struct *int_struct=(InternalSerializedItem_Struct *)(old_item_pkt->SerializedItem);
@@ -2262,7 +2262,7 @@ ENCODE(OP_CharInventory) {
return;
}
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
@@ -2270,7 +2270,7 @@ ENCODE(OP_CharInventory) {
if(ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
delete in;
@@ -2283,7 +2283,7 @@ ENCODE(OP_CharInventory) {
in->pBuffer = new uchar[4];
*(uint32 *)in->pBuffer = ItemCount;
in->size = 4;
for(int r = 0; r < ItemCount; r++, eq++) {
@@ -2327,42 +2327,42 @@ ENCODE(OP_GuildMemberList) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Internal_GuildMembers_Struct *emu = (Internal_GuildMembers_Struct *) in->pBuffer;
//make a new EQ buffer.
uint32 pnl = strlen(emu->player_name);
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
emu->count*sizeof(structs::GuildMemberEntry_Struct)
+ emu->name_length + emu->note_length;
in->pBuffer = new uint8[length];
in->size = length;
//no memset since we fill every byte.
uint8 *buffer;
buffer = in->pBuffer;
//easier way to setup GuildMembers_Struct
//set prefix name
strcpy((char *)buffer, emu->player_name);
buffer += pnl;
*buffer = '\0';
buffer++;
// Guild ID
buffer += sizeof(uint32);
//add member count.
*((uint32 *) buffer) = htonl( emu->count );
buffer += sizeof(uint32);
if(emu->count > 0) {
Internal_GuildMemberEntry_Struct *emu_e = emu->member;
const char *emu_name = (const char *) (__emu_buffer +
const char *emu_name = (const char *) (__emu_buffer +
sizeof(Internal_GuildMembers_Struct) + //skip header
emu->count * sizeof(Internal_GuildMemberEntry_Struct) //skip static length member data
);
@@ -2370,12 +2370,12 @@ ENCODE(OP_GuildMemberList) {
emu->name_length + //skip name contents
emu->count //skip string terminators
);
structs::GuildMemberEntry_Struct *e = (structs::GuildMemberEntry_Struct *) buffer;
uint32 r;
for(r = 0; r < emu->count; r++, emu_e++) {
//the order we set things here must match the struct
//nice helper macro
@@ -2388,7 +2388,7 @@ ENCODE(OP_GuildMemberList) {
}
#define PutFieldN(field) \
e->field = htonl(emu_e->field)
SlideStructString( name, emu_name );
PutFieldN(level);
PutFieldN(banker);
@@ -2405,15 +2405,15 @@ ENCODE(OP_GuildMemberList) {
e->zone_id = htons(emu_e->zone_id);
e->unknown_one2 = htonl(1);
e->unknown04 = 0;
#undef SlideStructString
#undef PutFieldN
e++;
}
}
delete[] __emu_buffer;
@@ -2466,7 +2466,7 @@ ENCODE(OP_GroundSpawn)
in->size = strlen(emu->object_name) + sizeof(Object_Struct) - 1;
in->pBuffer = new unsigned char[in->size];
char *OutBuffer = (char *)in->pBuffer;
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->drop_id);
@@ -2485,7 +2485,7 @@ ENCODE(OP_GroundSpawn)
VARSTRUCT_ENCODE_TYPE(int32, OutBuffer, emu->object_type); // Unknown, observed 0x00000014
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
@@ -2505,7 +2505,7 @@ ENCODE(OP_ClickObjectAction) {
ENCODE(OP_SendMembership) {
ENCODE_LENGTH_EXACT(Membership_Struct);
SETUP_DIRECT_ENCODE(Membership_Struct, structs::Membership_Struct);
eq->membership = emu->membership;
eq->races = emu->races;
eq->classes = emu->classes;
@@ -2678,7 +2678,7 @@ ENCODE(OP_LogServer) {
ENCODE_LENGTH_EXACT(LogServer_Struct);
SETUP_DIRECT_ENCODE(LogServer_Struct, structs::LogServer_Struct);
strncpy(eq->worldshortname, emu->worldshortname, sizeof(eq->worldshortname));
//OUT(enablevoicemacros); // These two are lost, but must be one of the 1s in unknown[249]
//OUT(enablemail);
OUT(enable_pvp);
@@ -3031,7 +3031,7 @@ ENCODE(OP_Stun) {
FINISH_ENCODE();
}
ENCODE(OP_ZonePlayerToBind)
ENCODE(OP_ZonePlayerToBind)
{
ENCODE_LENGTH_ATLEAST(ZonePlayerToBind_Struct);
ZonePlayerToBind_Struct *zps = (ZonePlayerToBind_Struct*)(*p)->pBuffer;
@@ -3084,7 +3084,7 @@ ENCODE(OP_AdventureMerchantSell) {
FINISH_ENCODE();
}
ENCODE(OP_RaidUpdate)
ENCODE(OP_RaidUpdate)
{
EQApplicationPacket *inapp = *p;
*p = nullptr;
@@ -3097,7 +3097,7 @@ ENCODE(OP_RaidUpdate)
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
add_member->raidGen.action = in_add_member->raidGen.action;
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
@@ -3174,7 +3174,7 @@ ENCODE(OP_VetRewardsAvaliable)
old_data += sizeof(InternalVeteranReward);
data += sizeof(structs::VeteranReward);
}
dest->FastQueuePacket(&outapp_create);
delete inapp;
}
@@ -3332,7 +3332,7 @@ ENCODE(OP_GroupUpdate)
EQApplicationPacket *in = *p;
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
//_log(NET__ERROR, "Received outgoing OP_GroupUpdate with action code %i", gjs->action);
if((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
{
@@ -3378,10 +3378,10 @@ ENCODE(OP_GroupUpdate)
{
// Group Update2
//_log(NET__ERROR, "Struct is GroupUpdate2");
unsigned char *__emu_buffer = in->pBuffer;
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*) __emu_buffer;
//_log(NET__ERROR, "Yourname is %s", gu2->yourname);
int MemberCount = 1;
@@ -3403,7 +3403,7 @@ ENCODE(OP_GroupUpdate)
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
char *Buffer = (char *)outapp->pBuffer;
// Header
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // Think this should be SpawnID, but it doesn't seem to matter
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, MemberCount);
@@ -3411,7 +3411,7 @@ ENCODE(OP_GroupUpdate)
// Leader
//
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0);
VARSTRUCT_ENCODE_STRING(Buffer, gu2->yourname);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0);
@@ -3453,7 +3453,7 @@ ENCODE(OP_GroupUpdate)
GLAAus->NPCMarkerID = gu2->NPCMarkerID;
memcpy(&GLAAus->LeaderAAs, &gu2->leader_aas, sizeof(GLAAus->LeaderAAs));
dest->FastQueuePacket(&outapp);
delete in;
@@ -3491,7 +3491,7 @@ ENCODE(OP_ChannelMessage)
in->size = strlen(emu->sender) + 1 + strlen(emu->targetname) + 1 + strlen(emu->message) + 1 + 36;
in->pBuffer = new unsigned char[in->size];
char *OutBuffer = (char *)in->pBuffer;
VARSTRUCT_ENCODE_STRING(OutBuffer, emu->sender);
@@ -3539,7 +3539,7 @@ ENCODE(OP_GuildsList)
}
InBuffer += 64;
}
PacketSize++; // Appears to be an extra 0x00 at the very end.
in->size = PacketSize;
@@ -3626,7 +3626,7 @@ ENCODE(OP_DzMemberList)
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
@@ -3683,7 +3683,7 @@ ENCODE(OP_DzLeaderStatus)
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//1
ss.write((const char*)&client_id, sizeof(uint32));
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
@@ -3709,7 +3709,7 @@ ENCODE(OP_BuffCreate)
__packet->size = sz;
__packet->pBuffer = new unsigned char[sz];
memset(__packet->pBuffer, 0, sz);
__packet->WriteUInt32(emu->entity_id);
__packet->WriteUInt32(0); // PlayerID ?
__packet->WriteUInt8(1); // 1 indicates all buffs on the player (0 to add or remove a single buff)
@@ -3728,7 +3728,7 @@ ENCODE(OP_BuffCreate)
__packet->WriteUInt32(emu->entries[i].spell_id);
__packet->WriteUInt32(emu->entries[i].tics_remaining);
__packet->WriteUInt32(0); // Unknown
__packet->WriteString("");
__packet->WriteString("");
}
__packet->WriteUInt8(0); // Unknown
@@ -3780,7 +3780,7 @@ ENCODE(OP_SpawnAppearance)
dest->FastQueuePacket(&in, ack_req);
return;
}
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ChangeSize, sizeof(ChangeSize_Struct));
ChangeSize_Struct *css = (ChangeSize_Struct *)outapp->pBuffer;
@@ -3791,7 +3791,7 @@ ENCODE(OP_SpawnAppearance)
css->Unknown12 = 1.0f;
dest->FastQueuePacket(&outapp, ack_req);
delete in;
}
@@ -3858,7 +3858,7 @@ ENCODE(OP_RespondAA) {
FINISH_ENCODE();
}
ENCODE(OP_AltCurrencySell)
ENCODE(OP_AltCurrencySell)
{
ENCODE_LENGTH_EXACT(AltCurrencySellItem_Struct);
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
@@ -3881,7 +3881,7 @@ ENCODE(OP_AltCurrency)
if(opcode == 8) {
AltCurrencyPopulate_Struct *populate = (AltCurrencyPopulate_Struct*)emu_buffer;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(structs::AltCurrencyPopulate_Struct)
EQApplicationPacket *outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(structs::AltCurrencyPopulate_Struct)
+ sizeof(structs::AltCurrencyPopulateEntry_Struct) * populate->count);
structs::AltCurrencyPopulate_Struct *out_populate = (structs::AltCurrencyPopulate_Struct*)outapp->pBuffer;
@@ -4065,7 +4065,7 @@ DECODE(OP_PetCommands)
FINISH_DIRECT_DECODE();
}
DECODE(OP_AltCurrencySellSelection)
DECODE(OP_AltCurrencySellSelection)
{
DECODE_LENGTH_EXACT(structs::AltCurrencySelectItem_Struct);
SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct);
@@ -4074,7 +4074,7 @@ DECODE(OP_AltCurrencySellSelection)
FINISH_DIRECT_DECODE();
}
DECODE(OP_AltCurrencySell)
DECODE(OP_AltCurrencySell)
{
DECODE_LENGTH_EXACT(structs::AltCurrencySellItem_Struct);
SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
@@ -4095,7 +4095,7 @@ DECODE(OP_ShopRequest) {
FINISH_DIRECT_DECODE();
}
DECODE(OP_GuildRemove)
DECODE(OP_GuildRemove)
{
DECODE_LENGTH_EXACT(structs::GuildCommand_Struct);
SETUP_DIRECT_DECODE(GuildCommand_Struct, structs::GuildCommand_Struct);
@@ -4106,7 +4106,7 @@ DECODE(OP_GuildRemove)
FINISH_DIRECT_DECODE();
}
DECODE(OP_GuildDemote)
DECODE(OP_GuildDemote)
{
DECODE_LENGTH_EXACT(structs::GuildDemoteStruct);
SETUP_DIRECT_DECODE(GuildDemoteStruct, structs::GuildDemoteStruct);
@@ -4145,7 +4145,7 @@ DECODE(OP_InspectRequest) {
/*DECODE(OP_InspectAnswer) {
DECODE_LENGTH_EXACT(structs::InspectResponse_Struct);
SETUP_DIRECT_DECODE(InspectResponse_Struct, structs::InspectResponse_Struct);
IN(TargetID);
IN(playerid);
@@ -4279,7 +4279,7 @@ DECODE(OP_ItemLinkClick) {
DECODE_LENGTH_EXACT(structs::ItemViewRequest_Struct);
SETUP_DIRECT_DECODE(ItemViewRequest_Struct, structs::ItemViewRequest_Struct);
MEMSET_IN(ItemViewRequest_Struct);
IN(item_id);
int r;
for (r = 0; r < 5; r++) {
@@ -4288,7 +4288,7 @@ DECODE(OP_ItemLinkClick) {
// Max Augs is now 6, but no code to support that many yet
IN(link_hash);
IN(icon);
FINISH_DIRECT_DECODE();
}
@@ -4332,7 +4332,7 @@ DECODE(OP_ShopPlayerBuy)
}
DECODE(OP_ClientUpdate) {
// for some odd reason, there is an extra byte on the end of this on occasion..
// for some odd reason, there is an extra byte on the end of this on occasion..
DECODE_LENGTH_ATLEAST(structs::PlayerPositionUpdateClient_Struct);
SETUP_DIRECT_DECODE(PlayerPositionUpdateClient_Struct, structs::PlayerPositionUpdateClient_Struct);
IN(spawn_id);
@@ -4352,7 +4352,7 @@ DECODE(OP_ClientUpdate) {
DECODE(OP_CharacterCreate) {
DECODE_LENGTH_EXACT(structs::CharCreate_Struct);
SETUP_DIRECT_DECODE(CharCreate_Struct, structs::CharCreate_Struct);
IN(gender);
IN(race);
IN(class_);
@@ -4362,7 +4362,7 @@ DECODE(OP_CharacterCreate) {
emu->start_zone = RuleI(World, TutorialZoneID);
else
emu->start_zone = eq->start_zone;
IN(haircolor);
IN(beard);
IN(beardcolor);
@@ -4397,7 +4397,7 @@ DECODE(OP_WhoAllRequest) {
IN(gmlookup);
IN(guildid);
IN(type);
FINISH_DIRECT_DECODE();
}
@@ -4843,7 +4843,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
const Item_Struct *item = inst->GetItem();
//_log(NET__ERROR, "Serialize called for: %s", item->Name);
RoF::structs::ItemSerializationHeader hdr;
//sprintf(hdr.unknown000, "06e0002Y1W00");
@@ -5091,7 +5091,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
//_log(NET__ERROR, "ItemBody tertiary struct is %i bytes", sizeof(RoF::structs::ItemTertiaryBodyStruct));
RoF::structs::ItemTertiaryBodyStruct itbs;
memset(&itbs, 0, sizeof(RoF::structs::ItemTertiaryBodyStruct));
itbs.loregroup = item->LoreGroup;
itbs.artifact = item->ArtifactFlag;
itbs.summonedflag = item->SummonedFlag;
@@ -5307,7 +5307,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
uint32 SubLengths[10];
for(int x = 0; x < 10; ++x) {
SubSerializations[x] = nullptr;
const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x);
+10 -10
View File
@@ -6,30 +6,30 @@
class EQStreamIdentifier;
namespace RoF {
//these are the only public member of this namespace.
extern void Register(EQStreamIdentifier &into);
extern void Reload();
//you should not directly access anything below..
//you should not directly access anything below..
//I just dont feel like making a seperate header for it.
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "SSDeclare.h"
#include "RoF_ops.h"
};
};
+68 -68
View File
@@ -32,21 +32,21 @@ struct WorldObjectsSent_Struct {
struct ItemSlotStruct {
/*000*/ int16 SlotType; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
/*002*/ int16 Unknown02;
/*004*/ int16 MainSlot;
/*004*/ int16 MainSlot;
/*006*/ int16 SubSlot;
/*008*/ int16 AugSlot; // Guessing - Seen 0xffff
/*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID
/*012*/
/*012*/
};
// New for RoF - Used for Merchant_Purchase_Struct
// Can't sellfrom other than main inventory so Slot Type is not needed.
struct MainInvItemSlotStruct {
/*000*/ int16 MainSlot;
/*000*/ int16 MainSlot;
/*002*/ int16 SubSlot;
/*004*/ int16 AugSlot;
/*006*/ int16 Unknown01;
/*008*/
/*008*/
};
/* Name Approval Struct */
@@ -217,7 +217,7 @@ struct Membership_Entry_Struct
{
/*000*/ uint32 purchase_id; // Seen 1, then increments 90287 to 90300
/*004*/ uint32 bitwise_entry; // Seen 16 to 65536 - Skips 4096
/*008*/
/*008*/
};
struct Membership_Setting_Struct
@@ -225,7 +225,7 @@ struct Membership_Setting_Struct
/*000*/ uint32 setting_index; // 0, 1, or 2
/*004*/ uint32 setting_id; // 0 to 21
/*008*/ int32 setting_value; // All can be 0, 1, or -1
/*012*/
/*012*/
};
struct Membership_Details_Struct
@@ -249,7 +249,7 @@ struct Membership_Struct
/*008*/ uint32 classes; // Seen ff ff 01 01
/*012*/ uint32 entrysize; // Seen 22
/*016*/ int32 entries[22]; // Most -1, 1, and 0 for Gold Status
/*104*/
/*104*/
};
@@ -328,7 +328,7 @@ struct Spawn_Struct_Position
signed padding0001:1;
/*004*/ signed deltaX:13; // change in x
signed deltaHeading:10;// change in heading
signed deltaHeading:10;// change in heading
signed padding0008:9;
/*008*/ signed deltaY:13;
@@ -343,7 +343,7 @@ struct Spawn_Struct_Position
signed padding0020:7;
};
/*
/*
struct Spawn_Struct_Position
{
signed padding0000:12; // ***Placeholder
@@ -461,7 +461,7 @@ struct Spawn_Struct
/*0000*/ //char suffix[0]; // only read if(hasTitleOrSuffix & 8)
char unknown20[8];
uint8 IsMercenary; // If NPC == 1 and this == 1, then the NPC name is Orange.
/*0000*/ char unknown21[55];
/*0000*/ char unknown21[55];
};
@@ -638,7 +638,7 @@ struct BeginCast_Struct
/*000*/ uint32 spell_id;
/*004*/ uint16 caster_id;
/*006*/ uint32 cast_time; // in miliseconds
/*010*/
/*010*/
};
struct CastSpell_Struct
@@ -707,7 +707,7 @@ struct SpellBuffFade_Struct_Live {
/*008*/ float unknown008;
/*012*/ uint32 spellid;
/*016*/ uint32 duration;
/*020*/ uint32 playerId; // Global player ID?
/*020*/ uint32 playerId; // Global player ID?
/*024*/ uint8 unknown0028[68];
/*092*/ uint32 slotid;
/*096*/ uint32 bufffade;
@@ -917,10 +917,10 @@ struct BindStruct {
struct PlayerProfile_Struct
{
/*00000*/ uint32 checksum; //
/*00004*/ uint32 checksum_size; // Value = ( Packet Size - 9 )
/*00008*/ uint8 checksum_byte; //
/*00009*/ uint8 unknown_rof1[3]; //
/*00012*/ uint32 unknown_rof2; //
/*00004*/ uint32 checksum_size; // Value = ( Packet Size - 9 )
/*00008*/ uint8 checksum_byte; //
/*00009*/ uint8 unknown_rof1[3]; //
/*00012*/ uint32 unknown_rof2; //
/*00016*/ uint8 gender; // Player Gender - 0 Male, 1 Female
/*00017*/ uint32 race; // Player race
/*00021*/ uint8 class_; // Player class
@@ -959,7 +959,7 @@ union
/*00544*/ EquipStruct equip_ring2; // Equiptment: Non-visual
/*00564*/ EquipStruct equip_waist; // Equiptment: Non-visual
/*00584*/ EquipStruct equip_powersource; // Equiptment: Non-visual
/*00604*/ EquipStruct equip_ammo; // Equiptment: Non-visual
/*00604*/ EquipStruct equip_ammo; // Equiptment: Non-visual
} equip;
/*00184*/ EquipStruct equipment[22];
};
@@ -980,10 +980,10 @@ union
/*00899*/ uint32 drakkin_heritage; //
/*00903*/ uint32 drakkin_tattoo; //
/*00907*/ uint32 drakkin_details; //
/*00911*/ uint8 unknown_rof6; //
/*00911*/ uint8 unknown_rof6; //
/*00912*/ int8 unknown_rof7; // seen -1
/*00913*/ uint8 unknown_rof8; //
/*00914*/ uint8 unknown_rof9; //
/*00913*/ uint8 unknown_rof8; //
/*00914*/ uint8 unknown_rof9; //
/*00915*/ uint8 unknown_rof10; // Seen 1 or 0 (on a female?)
/*00916*/ float height; // Seen 7.0 (barb), 5.0 (woodelf), 5.5 (halfelf)
/*00920*/ float unknown_rof11; // Seen 3.0
@@ -1035,7 +1035,7 @@ union
/*12897*/ uint32 copper_cursor; // Copper Pieces on cursor
/*12901*/ uint32 intoxication; // Alcohol level (in ticks till sober?) - Position Guessed
/*12905*/ uint32 toxicity; // Potion Toxicity (15=too toxic, each potion adds 3) - Position Guessed
/*12909*/ uint32 unknown_rof19; //
/*12909*/ uint32 unknown_rof19; //
/*12913*/ uint32 thirst_level; // Drink (ticks till next drink) - Position Guessed
/*12917*/ uint32 hunger_level; // Food (ticks till next eat) - Position Guessed
/*12921*/ uint32 aapoints_spent; // Number of spent AA points
@@ -1046,7 +1046,7 @@ union
/*12941*/ uint32 aa_spent_class; // Seen 103
/*12945*/ uint32 aa_spent_special; // Seen 0
/*12949*/ uint32 aapoints; // Unspent AA points - Seen 1
/*12953*/ uint16 unknown_rof20; //
/*12953*/ uint16 unknown_rof20; //
/*12955*/ uint32 bandolier_count; // Seen 20
/*12959*/ Bandolier_Struct bandoliers[MAX_PLAYER_BANDOLIER]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
/*13699*/ uint32 potionbelt_count; // Seen 5
@@ -1057,15 +1057,15 @@ union
/*13760*/ int32 mana_total; // Guessed - Only seen on casters so far - Matches above field if caster
/*13764*/ uint32 unknown_rof22[12]; // Same for all seen PPs - 48 bytes:
/*
19 00 00 00 19 00 00 00 19 00 00 00 0f 00 00 00
0f 00 00 00 0f 00 00 00 0f 00 00 00 1f 85 eb 3e
19 00 00 00 19 00 00 00 19 00 00 00 0f 00 00 00
0f 00 00 00 0f 00 00 00 0f 00 00 00 1f 85 eb 3e
33 33 33 3f 08 00 00 00 02 00 00 00 01 00 00 00
*/
/*13812*/ uint32 unknown_rof23; // Seen 5, 19, and 20 in examples
/*13816*/ uint32 unknown_rof24[4]; //
/*13816*/ uint32 unknown_rof24[4]; //
/*13832*/ uint32 unknown_rof25[2]; // Seen random numbers from 0 to 2165037
/*13840*/ uint32 unknown_rof26; // Seen 106
//END SUB-STRUCT used for shrouding.
//END SUB-STRUCT used for shrouding.
/*13844*/ uint32 name_str_len; // Seen 64
/*13848*/ char name[64]; // Name of player - 19960 for Live 1180 difference
/*13912*/ uint32 last_name_str_len; // Seen 32
@@ -1086,34 +1086,34 @@ union
/*14024*/ float heading; // Players heading
/*14028*/ uint32 air_remaining; // Air supply (seconds)
/*14032*/ int32 unknown_rof28; // Seen -1
/*14036*/ uint8 unknown_rof29[10]; //
/*14036*/ uint8 unknown_rof29[10]; //
/*14046*/ uint32 unknown_rof30; // Random large number or 0
/*14050*/ uint32 unknown_rof31; //
/*14054*/ uint32 unknown32_count; // Seen 5
/*14058*/ uint8 unknown_rof32[29]; //
/*14050*/ uint32 unknown_rof31; //
/*14054*/ uint32 unknown32_count; // Seen 5
/*14058*/ uint8 unknown_rof32[29]; //
/*14087*/ uint32 unknown33_count; // Seen 32 for melee/hybrid and 21 for druid, 34 for mage
/*14091*/ uint32 unknown_rof33[64]; // Struct contains 2 ints, so double 32 count (Variable Sized)
// Position Varies after this point - Really starts varying at Bandolier names, but if no names set it starts here
/*00000*/ int32 unknown_rof34; // Seen -1
/*00000*/ int32 unknown_rof35; // Seen -1
/*00000*/ uint8 unknown_rof36[18]; //
/*00000*/ uint8 unknown_rof36[18]; //
/*00000*/ uint32 unknown37_count; // Seen 5
/*00000*/ int32 unknown_rof37[10]; // Alternates -1 and 0 - Struct contains 2 ints
/*00000*/ uint32 unknown38_count; // Seen 10
/*00000*/ int32 unknown_rof38[20]; // Alternates -1 and 0 - Struct contains 2 ints
/*00000*/ uint8 unknown_rof39[137]; //
/*00000*/ uint8 unknown_rof39[137]; //
/*00000*/ float unknown_rof40; // Seen 1.0
/*00000*/ uint32 unknown_rof41[9]; //
/*00000*/ uint32 unknown_rof41[9]; //
/*00000*/ uint32 unknown_rof42; // Seen 0 or 1
/*00000*/ uint32 unknown_string1_count; // Seen 64
/*00000*/ char unknown_string1[64]; //
/*00000*/ uint8 unknown_rof43[30]; //
/*00000*/ char unknown_string1[64]; //
/*00000*/ uint8 unknown_rof43[30]; //
/*00000*/ uint32 unknown_string2_count; // Seen 64
/*00000*/ char unknown_string2[64]; //
/*00000*/ char unknown_string2[64]; //
/*00000*/ uint32 unknown_string3_count; // Seen 64
/*00000*/ char unknown_string3[64]; //
/*00000*/ char unknown_string3[64]; //
/*00000*/ uint32 unknown_rof44; // Seen 0 or 50
/*00000*/ uint8 unknown_rof45[663]; //
/*00000*/ uint8 unknown_rof45[663]; //
/*00000*/ uint32 char_id; // Guessed based on char creation date and values
/*00000*/ uint8 unknown_rof46; // Seen 0 or 1
/*00000*/ uint32 unknown_rof47; // Seen 6
@@ -1121,7 +1121,7 @@ union
/*00000*/ uint32 unknown_rof49; // Seen 64
/*00000*/ uint8 unknown_rof50[256]; // Seen mostly 0s, but one example had a 2 in the middle
/*00000*/ uint32 unknown_rof51; // Seen 100 or 0
/*00000*/ uint8 unknown_rof52[82]; //
/*00000*/ uint8 unknown_rof52[82]; //
/*00000*/ uint32 unknown_rof53; // Seen 50
uint8 unknown_rof54[1325]; // Unknown Section
@@ -1418,7 +1418,7 @@ struct CombatDamage_Struct
/* 21 */ uint8 unknown19[9]; // was [9]
/* 30 */
};
/*
** Consider Struct
@@ -1431,7 +1431,7 @@ struct Consider_Struct{
/*012*/ uint32 level; // Level
/*016*/ uint8 pvpcon; // Pvp con flag 0/1
/*017*/ uint8 unknown017[3]; //
/*020*/
/*020*/
};
/*
@@ -1526,7 +1526,7 @@ struct PlayerPositionUpdateServer_Struct
signed y_pos:19; // y coord
unsigned padding:1;
/*0008*/ signed delta_x:13; // change in x
signed delta_heading:10;// change in heading
signed delta_heading:10;// change in heading
signed padding0008:9;
/*0012*/ signed delta_y:13; // change in y
signed z_pos:19; // z coord
@@ -1555,14 +1555,14 @@ struct PlayerPositionUpdateClient_Struct
/*0014*/ float x_pos; // x coord (2nd loc value)
/*0018*/ float y_pos; // y coord (1st loc value)
/*0022*/ signed delta_heading:10; // change in heading
unsigned animation:10; // ***Placeholder
unsigned animation:10; // ***Placeholder
unsigned padding0024:12; // animation
/*0026*/ float delta_z; // Change in z
/*0030*/ float delta_x; // Change in x
/*0034*/ float z_pos; // z coord (3rd loc value)
/*0038*/ unsigned heading:12; // Directional heading
unsigned padding0040:10; // ***Placeholder
unsigned padding0041:10; // ***Placeholder
unsigned padding0040:10; // ***Placeholder
unsigned padding0041:10; // ***Placeholder
/*0042*/
};
@@ -2004,7 +2004,7 @@ struct Merchant_Click_Struct {
/*012*/ float rate; // cost multiplier, dosent work anymore
/*016*/ int32 unknown01; // Seen 3 from Server or -1 from Client
/*020*/ int32 unknown02; // Seen 2592000 from Server or -1 from Client
/*024*/
/*024*/
};
/*
Unknowns:
@@ -2097,7 +2097,7 @@ struct AltCurrencyUpdate_Struct {
/*084*/ uint32 unknown084; //seen 0
};
//Client -> Server
//Client -> Server
//When an item is selected while the alt currency merchant window is open
struct AltCurrencySelectItem_Struct {
/*000*/ uint32 merchant_entity_id;
@@ -2128,7 +2128,7 @@ struct AltCurrencySelectItem_Struct {
//eg: "I will give you no doubloons for a cloth cap."
//Probably also sends amounts somewhere
struct AltCurrencySelectItemReply_Struct {
/*000*/ uint32 unknown000;
/*000*/ uint32 unknown000;
/*004*/ uint8 unknown004; //0xff
/*005*/ uint8 unknown005; //0xff
/*006*/ uint8 unknown006; //0xff
@@ -2232,7 +2232,7 @@ struct AdventureLeaderboard_Struct
/*008*/ uint32 success;
/*012*/ uint32 failure;
/*016*/ uint32 our_rank;
/*020*/
/*020*/
};
/*struct Item_Shop_Struct {
@@ -2501,7 +2501,7 @@ struct Who_All_Struct { // 156 length total
/*080*/ uint32 gmlookup; // FF FF = not doing /who all gm
/*084*/ uint32 guildid; // Also used for Buyer/Trader/LFG
/*152*/ uint32 type; // 0 = /who 3 = /who all
/*156*/
/*156*/
};
struct Stun_Struct { // 8 bytes total
@@ -2637,9 +2637,9 @@ struct BookRequest_Struct {
/*0000*/ uint32 window; // where to display the text (0xFFFFFFFF means new window).
/*0004*/ uint16 invslot; // Is the slot, but the RoF conversion causes it to fail. Turned to 0 since it isnt required anyway.
/*0008*/ uint32 unknown006; // Seen FFFFFFFF
/*0010*/ uint16 unknown008; // seen 0000
/*0010*/ uint16 unknown008; // seen 0000
/*0012*/ uint32 type; // 0 = Scroll, 1 = Book, 2 = Item Info. Possibly others
/*0016*/ uint32 unknown0012;
/*0016*/ uint32 unknown0012;
/*0020*/ uint16 unknown0016;
/*0022*/ char txtfile[8194];
};
@@ -2735,7 +2735,7 @@ struct Door_Struct
/*0054*/ uint8 unknown0054[4]; // 00 00 00 00
/*0060*/ uint8 doorId; // door's id #
/*0061*/ uint8 opentype;
/*0062*/ uint8 state_at_spawn;
/*0062*/ uint8 state_at_spawn;
/*0063*/ uint8 invert_state; // if this is 1, the door is normally open
/*0064*/ uint32 door_param; // normally ff ff ff ff (-1)
/*0068*/ uint32 unknown0068; // 00 00 00 00
@@ -3046,7 +3046,7 @@ struct Tracking_Struct_New {
struct Track_Struct_New {
uint16 entityid; // Entity ID
uint16 unknown002; // 00 00
uint32 unknown004; //
uint32 unknown004; //
uint8 level; // level of mob
uint8 unknown009; // 01 maybe type of mob? player/npc?
char name[1]; // name of mob
@@ -3242,13 +3242,13 @@ struct GuildMemberEntry_Struct {
char name[1]; // variable length
uint32 level;
uint32 banker; // 1=yes, 0=no
uint32 class_;
uint32 rank;
uint32 time_last_on;
uint32 tribute_enable;
uint32 class_;
uint32 rank;
uint32 time_last_on;
uint32 tribute_enable;
uint32 unknown01; // Seen 0
uint32 total_tribute; // total guild tribute donated, network byte order
uint32 last_tribute; // unix timestamp
uint32 last_tribute; // unix timestamp
uint32 unknown_one; // unknown, set to 1
char public_note[1]; // variable length.
uint16 zoneinstance; // Seen 0s or -1 in RoF
@@ -3258,7 +3258,7 @@ struct GuildMemberEntry_Struct {
};
//just for display purposes, this is not actually used in the message encoding other than for size.
struct GuildMembers_Struct {
struct GuildMembers_Struct {
char player_name[1]; // variable length.
uint32 guildid; // Was unknown02 - network byte order
uint32 count; // network byte order
@@ -3695,7 +3695,7 @@ struct TaskDescription_Struct {
/*044*/ uint16 unknown39;
/*046*/ char reward_link[1]; //variable length, 0 terminated
/*047*/ uint32 unknown43; //maybe crystal count?
/*051*/
/*051*/
};
#endif
@@ -3724,7 +3724,7 @@ struct TaskActivity_Struct {
/*032*/ char Text1[1]; // Variable length - Null terminated
/*000*/ uint32 Text2Len; // Lenth of the following string
/*000*/ char Text2[1]; // Variable length - not Null terminated
/*000*/ uint32 GoalCount;
/*000*/ uint32 GoalCount;
/*000*/ uint32 String1Len; // Lenth of the following string - Seen 2
/*000*/ char String1[1]; // Numeric String - Seen "-1" - not Null terminated
/*000*/ uint32 String2Len; // Lenth of the following string - Seen 2
@@ -4338,7 +4338,7 @@ struct ItemBodyStruct
uint32 icon;
uint8 unknown1;
uint8 unknown2;
uint32 BenefitFlag;
uint32 BenefitFlag;
uint8 tradeskills;
int8 CR;
int8 DR;
@@ -4468,9 +4468,9 @@ struct ItemTertiaryBodyStruct
uint8 no_transfer;
uint16 expendablearrow;
uint32 unknown8;
uint32 unknown9;
uint32 unknown10;
uint32 unknown8;
uint32 unknown9;
uint32 unknown10;
uint32 unknown11;
uint8 unknown12;
uint8 unknown13;
@@ -4549,7 +4549,7 @@ struct ItemQuaternaryBodyStruct
int32 clairvoyance;
uint8 unknown18; //Power Source Capacity or evolve filename?
uint32 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown19;
uint8 unknown19;
uint32 unknown20; // Bard Stuff?
//uint32 unknown21;
uint8 unknown22;
@@ -4559,7 +4559,7 @@ struct ItemQuaternaryBodyStruct
float unknown26;
float unknown27;
uint32 unknown_RoF6; // 0 New to March 21 2012 client
uint32 unknown28; // 0xffffffff
uint32 unknown28; // 0xffffffff
uint16 unknown29;
uint32 unknown30; // 0xffffffff
uint16 unknown31;
+8 -8
View File
@@ -1,5 +1,5 @@
#define ENCODE(x) void Strategy::Encode_##x(EQApplicationPacket **p, EQStream *dest, bool ack_req)
#define ENCODE(x) void Strategy::Encode_##x(EQApplicationPacket **p, EQStream *dest, bool ack_req)
#define DECODE(x) void Strategy::Decode_##x(EQApplicationPacket *__packet)
#define StructDist(in, f1, f2) (uint32(&in->f2)-uint32(&in->f1))
@@ -10,9 +10,9 @@
/*
*
*
* for encoders
*
*
*/
//more complex operations and variable length packets
#define FASTQUEUE(packet) dest->FastQueuePacket(&packet, ack_req);
@@ -55,7 +55,7 @@
#define FAIL_ENCODE() \
delete[] __emu_buffer; \
delete __packet;
//call to finish an encoder using SETUP_DIRECT_ENCODE
#define FINISH_ENCODE() \
delete[] __emu_buffer; \
@@ -93,9 +93,9 @@
/*
*
*
* for decoders:
*
*
*/
//simple buffer-to-buffer movement for fixed length packets
@@ -118,10 +118,10 @@
#define FAIL_DIRECT_DECODE() \
delete[] __eq_buffer; \
p->SetOpcode(OP_Unknown);
//call to finish an encoder using SETUP_DIRECT_DECODE
#define FINISH_DIRECT_DECODE() \
delete[] __eq_buffer;
delete[] __eq_buffer;
//check length of packet before decoding. Call before setup.
#define DECODE_LENGTH_EXACT(struct_) \
+101 -101
View File
@@ -23,7 +23,7 @@ static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth);
void Register(EQStreamIdentifier &into) {
//create our opcode manager if we havent already
if(opcodes == nullptr) {
@@ -39,37 +39,37 @@ void Register(EQStreamIdentifier &into) {
return;
}
}
//ok, now we have what we need to register.
EQStream::Signature signature;
string pname;
//register our world signature.
pname = string(name) + "_world";
signature.ignore_eq_opcode = 0;
signature.first_length = sizeof(structs::LoginInfo_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_SendLoginInfo);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
//register our zone signature.
pname = string(name) + "_zone";
signature.ignore_eq_opcode = opcodes->EmuToEQ(OP_AckPacket);
signature.first_length = sizeof(structs::ClientZoneEntry_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_ZoneEntry);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
_log(NET__IDENTIFY, "Registered patch %s", name);
}
void Reload() {
//we have a big problem to solve here when we switch back to shared memory
//opcode managers because we need to change the manager pointer, which means
//we need to go to every stream and replace it's manager.
if(opcodes != nullptr) {
//TODO: get this file name from the config file
string opfile = "patch_";
@@ -99,7 +99,7 @@ std::string Strategy::Describe() const {
r += name;
return(r);
}
const EQClientVersion Strategy::ClientVersion() const
{
return EQClientSoD;
@@ -116,7 +116,7 @@ static inline uint32 TitaniumToSoDSlot(uint32 TitaniumSlot) {
{
SoDSlot = TitaniumSlot + 1;
}
else if(TitaniumSlot >= 251 && TitaniumSlot <= 340) // Bag Slots for Normal Inventory and Cursor
else if(TitaniumSlot >= 251 && TitaniumSlot <= 340) // Bag Slots for Normal Inventory and Cursor
{
SoDSlot = TitaniumSlot + 11;
}
@@ -135,20 +135,20 @@ static inline uint32 TitaniumToSoDSlot(uint32 TitaniumSlot) {
else
{
SoDSlot = TitaniumSlot;
}
}
return SoDSlot;
}
// Converts SoD Slot IDs to Titanium Slot IDs for use in Decodes
static inline uint32 SoDToTitaniumSlot(uint32 SoDSlot) {
uint32 TitaniumSlot = 0;
if(SoDSlot >= 22 && SoDSlot <= 54) // Cursor/Ammo/Power Source and Normal Inventory Slots
{
TitaniumSlot = SoDSlot - 1;
}
else if(SoDSlot >= 262 && SoDSlot <= 351) // Bag Slots for Normal Inventory and Cursor
else if(SoDSlot >= 262 && SoDSlot <= 351) // Bag Slots for Normal Inventory and Cursor
{
TitaniumSlot = SoDSlot - 11;
}
@@ -187,7 +187,7 @@ ENCODE(OP_OpenNewTasksWindow) {
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
__emu_AvailableTaskHeader = (AvailableTaskHeader_Struct*)__emu_buffer;
@@ -223,7 +223,7 @@ ENCODE(OP_OpenNewTasksWindow) {
__eq_AvailableTaskData1->TaskID = __emu_AvailableTaskData1->TaskID;
// This next unknown seems to affect the colour of the task title. 0x3f80000 is what I have seen
// in Live packets. Changing it to 0x3f000000 makes the title red.
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
__eq_AvailableTaskData1->TimeLimit = __emu_AvailableTaskData1->TimeLimit;
__eq_AvailableTaskData1->unknown2 = __emu_AvailableTaskData1->unknown2;
@@ -282,7 +282,7 @@ ENCODE(OP_OpenNewTasksWindow) {
}
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
@@ -290,8 +290,8 @@ ENCODE(OP_OpenNewTasksWindow) {
ENCODE(OP_SendCharInfo) {
ENCODE_LENGTH_EXACT(CharacterSelect_Struct);
SETUP_VAR_ENCODE(CharacterSelect_Struct);
//EQApplicationPacket *packet = *p;
//const CharacterSelect_Struct *emu = (CharacterSelect_Struct *) packet->pBuffer;
@@ -310,10 +310,10 @@ ENCODE(OP_SendCharInfo) {
+ namelen;
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, total_length);
//unsigned char *eq_buffer = new unsigned char[total_length];
//structs::CharacterSelect_Struct *eq_head = (structs::CharacterSelect_Struct *) eq_buffer;
eq->char_count = char_count;
eq->total_chars = 10;
@@ -360,9 +360,9 @@ ENCODE(OP_SendCharInfo) {
}
bufptr += sizeof(structs::CharacterSelectEntry_Struct);
}
FINISH_ENCODE();
}
ENCODE(OP_ZoneServerInfo) {
@@ -370,8 +370,8 @@ ENCODE(OP_ZoneServerInfo) {
OUT_str(ip);
OUT(port);
FINISH_ENCODE();
//this is SUCH bullshit to be doing from down here. but the
//this is SUCH bullshit to be doing from down here. but the
// new client requires us to close immediately following this
// packet, so do it.
//dest->Close();
@@ -380,17 +380,17 @@ ENCODE(OP_ZoneServerInfo) {
//hack hack hack
ENCODE(OP_SendZonepoints) {
ENCODE_LENGTH_ATLEAST(ZonePoints);
SETUP_VAR_ENCODE(ZonePoints);
ALLOC_VAR_ENCODE(structs::ZonePoints, __packet->size);
memcpy(eq, emu, __packet->size);
FINISH_ENCODE();
// unknown0xxx[24];
//this is utter crap... the client is waiting for this
//certain 0 length opcode to come after the reqclientspawn
//stuff... so this is a dirty way to put it in there.
//stuff... so this is a dirty way to put it in there.
// this needs to be done better
//EQApplicationPacket hack_test(OP_PetitionUnCheckout, 0);
@@ -400,10 +400,10 @@ ENCODE(OP_SendZonepoints) {
ENCODE(OP_SendAATable) {
ENCODE_LENGTH_ATLEAST(SendAA_Struct);
SETUP_VAR_ENCODE(SendAA_Struct);
ALLOC_VAR_ENCODE(structs::SendAA_Struct, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability));
// Check clientver field to verify this AA should be sent for SoF
// clientver 1 is for all clients and 5 is for SoD
if (emu->clientver <= 5 )
@@ -460,13 +460,13 @@ ENCODE(OP_LeadershipExpUpdate) {
ENCODE(OP_PlayerProfile) {
SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct);
uint32 r;
eq->available_slots=0xffffffff;
memset(eq->unknown4184, 0xff, sizeof(eq->unknown4184));
memset(eq->unknown04396, 0xff, sizeof(eq->unknown04396));
// OUT(checksum);
OUT(gender);
OUT(race);
@@ -559,7 +559,7 @@ ENCODE(OP_PlayerProfile) {
OUT(aapoints_spent);
OUT(aapoints);
// OUT(unknown06160[4]);
//NOTE: new client supports 20 bandoliers, our internal rep
//NOTE: new client supports 20 bandoliers, our internal rep
//only supports 4..
for(r = 0; r < 4; r++) {
OUT_str(bandoliers[r].name);
@@ -682,12 +682,12 @@ const uint8 bytes[] = {
};
memcpy(eq->unknown12864, bytes, sizeof(bytes));
//set the checksum...
CRC32::SetEQChecksum(__packet->pBuffer, sizeof(structs::PlayerProfile_Struct)-4);
FINISH_ENCODE();
}
@@ -722,7 +722,7 @@ ENCODE(OP_NewZone) {
OUT_str(zone_short_name2);
OUT(zone_id);
OUT(zone_instance);
OUT(SuspendBuffs);
OUT(SuspendBuffs);
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown800 = -1;
eq->unknown844 = 600;
@@ -868,7 +868,7 @@ ENCODE(OP_Barter)
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
ENCODE(OP_InspectRequest) {
@@ -947,11 +947,11 @@ ENCODE(OP_ZoneSpawns) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Spawn_Struct *emu = (Spawn_Struct *) __emu_buffer;
//determine and verify length
int entrycount = in->size / sizeof(Spawn_Struct);
if(entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
@@ -960,7 +960,7 @@ ENCODE(OP_ZoneSpawns) {
return;
}
//_log(NET__STRUCTS, "Spawn name is [%s]", emu->name);
emu = (Spawn_Struct *) __emu_buffer;
@@ -969,7 +969,7 @@ ENCODE(OP_ZoneSpawns) {
char *Buffer = (char *) in->pBuffer;
int r;
int k;
for(r = 0; r < entrycount; r++, emu++) {
@@ -1142,7 +1142,7 @@ ENCODE(OP_ZoneSpawns) {
{
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0);
}
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->curHp);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->haircolor);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->beardcolor);
@@ -1200,8 +1200,8 @@ ENCODE(OP_ZoneSpawns) {
Position->deltaZ = emu->deltaZ;
Buffer += sizeof(structs::Spawn_Struct_Position);
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for(k = 0; k < 9; ++k)
{
@@ -1255,7 +1255,7 @@ ENCODE(OP_ZoneSpawns) {
dest->FastQueuePacket(&outapp, ack_req);
}
delete in;
}
@@ -1263,7 +1263,7 @@ ENCODE(OP_MercenaryDataResponse) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
MercenaryMerchantList_Struct *emu = (MercenaryMerchantList_Struct *) __emu_buffer;
@@ -1330,7 +1330,7 @@ ENCODE(OP_MercenaryDataUpdate) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
MercenaryDataUpdate_Struct *emu = (MercenaryDataUpdate_Struct *) __emu_buffer;
@@ -1401,7 +1401,7 @@ ENCODE(OP_ItemPacket) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
ItemPacket_Struct *old_item_pkt=(ItemPacket_Struct *)__emu_buffer;
InternalSerializedItem_Struct *int_struct=(InternalSerializedItem_Struct *)(old_item_pkt->SerializedItem);
@@ -1443,7 +1443,7 @@ ENCODE(OP_CharInventory) {
return;
}
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
@@ -1451,7 +1451,7 @@ ENCODE(OP_CharInventory) {
if(ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
delete in;
@@ -1464,7 +1464,7 @@ ENCODE(OP_CharInventory) {
in->pBuffer = new uchar[4];
*(uint32 *)in->pBuffer = ItemCount;
in->size = 4;
for(int r = 0; r < ItemCount; r++, eq++) {
@@ -1508,39 +1508,39 @@ ENCODE(OP_GuildMemberList) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Internal_GuildMembers_Struct *emu = (Internal_GuildMembers_Struct *) in->pBuffer;
//make a new EQ buffer.
uint32 pnl = strlen(emu->player_name);
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
emu->count*sizeof(structs::GuildMemberEntry_Struct)
+ emu->name_length + emu->note_length;
in->pBuffer = new uint8[length];
in->size = length;
//no memset since we fill every byte.
uint8 *buffer;
buffer = in->pBuffer;
//easier way to setup GuildMembers_Struct
//set prefix name
strcpy((char *)buffer, emu->player_name);
buffer += pnl;
*buffer = '\0';
buffer++;
//add member count.
*((uint32 *) buffer) = htonl( emu->count );
buffer += sizeof(uint32);
if(emu->count > 0) {
Internal_GuildMemberEntry_Struct *emu_e = emu->member;
const char *emu_name = (const char *) (__emu_buffer +
const char *emu_name = (const char *) (__emu_buffer +
sizeof(Internal_GuildMembers_Struct) + //skip header
emu->count * sizeof(Internal_GuildMemberEntry_Struct) //skip static length member data
);
@@ -1548,12 +1548,12 @@ ENCODE(OP_GuildMemberList) {
emu->name_length + //skip name contents
emu->count //skip string terminators
);
structs::GuildMemberEntry_Struct *e = (structs::GuildMemberEntry_Struct *) buffer;
uint32 r;
for(r = 0; r < emu->count; r++, emu_e++) {
//the order we set things here must match the struct
//nice helper macro
@@ -1569,7 +1569,7 @@ ENCODE(OP_GuildMemberList) {
}
#define PutFieldN(field) \
e->field = htonl(emu_e->field)
SlideStructString( name, emu_name );
PutFieldN(level);
PutFieldN(banker);
@@ -1583,15 +1583,15 @@ ENCODE(OP_GuildMemberList) {
SlideStructString( public_note, emu_note );
e->zoneinstance = 0;
e->zone_id = htons(emu_e->zone_id);
#undef SlideStructString
#undef PutFieldN
e++;
}
}
delete[] __emu_buffer;
@@ -1742,16 +1742,16 @@ ENCODE(OP_LogServer) {
ENCODE_LENGTH_EXACT(LogServer_Struct);
SETUP_DIRECT_ENCODE(LogServer_Struct, structs::LogServer_Struct);
strcpy(eq->worldshortname, emu->worldshortname);
OUT(enablevoicemacros);
OUT(enablemail);
OUT(enable_pvp);
OUT(enable_FV);
// These next two need to be set like this for the Tutorial Button to work.
eq->unknown263[0] = 0;
eq->unknown263[2] = 1;
FINISH_ENCODE();
}
@@ -1978,7 +1978,7 @@ ENCODE(OP_Stun) {
FINISH_ENCODE();
}
ENCODE(OP_ZonePlayerToBind)
ENCODE(OP_ZonePlayerToBind)
{
ENCODE_LENGTH_ATLEAST(ZonePlayerToBind_Struct);
ZonePlayerToBind_Struct *zps = (ZonePlayerToBind_Struct*)(*p)->pBuffer;
@@ -2031,7 +2031,7 @@ ENCODE(OP_AdventureMerchantSell) {
FINISH_ENCODE();
}
ENCODE(OP_RaidUpdate)
ENCODE(OP_RaidUpdate)
{
EQApplicationPacket *inapp = *p;
*p = nullptr;
@@ -2044,7 +2044,7 @@ ENCODE(OP_RaidUpdate)
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
add_member->raidGen.action = in_add_member->raidGen.action;
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
@@ -2121,7 +2121,7 @@ ENCODE(OP_VetRewardsAvaliable)
old_data += sizeof(InternalVeteranReward);
data += sizeof(structs::VeteranReward);
}
dest->FastQueuePacket(&outapp_create);
delete inapp;
}
@@ -2274,7 +2274,7 @@ ENCODE(OP_DzMemberList)
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
@@ -2331,7 +2331,7 @@ ENCODE(OP_DzLeaderStatus)
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//1
ss.write((const char*)&client_id, sizeof(uint32));
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
@@ -2360,7 +2360,7 @@ ENCODE(OP_TargetBuffs)
uchar *ptr = __packet->pBuffer;
*((uint32*)ptr) = emu->entity_id;
ptr += sizeof(uint32);
*((uint16*)ptr) = emu->count;
ptr += sizeof(uint16);
@@ -2402,7 +2402,7 @@ ENCODE(OP_GroupUpdate)
EQApplicationPacket *in = *p;
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
//_log(NET__ERROR, "Received outgoing OP_GroupUpdate with action code %i", gjs->action);
if((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
{
@@ -2448,10 +2448,10 @@ ENCODE(OP_GroupUpdate)
{
// Group Update2
//_log(NET__ERROR, "Struct is GroupUpdate2");
unsigned char *__emu_buffer = in->pBuffer;
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*) __emu_buffer;
//_log(NET__ERROR, "Yourname is %s", gu2->yourname);
int MemberCount = 1;
@@ -2473,7 +2473,7 @@ ENCODE(OP_GroupUpdate)
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
char *Buffer = (char *)outapp->pBuffer;
// Header
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // Think this should be SpawnID, but it doesn't seem to matter
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, MemberCount);
@@ -2481,7 +2481,7 @@ ENCODE(OP_GroupUpdate)
// Leader
//
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0);
VARSTRUCT_ENCODE_STRING(Buffer, gu2->yourname);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0);
@@ -2523,7 +2523,7 @@ ENCODE(OP_GroupUpdate)
GLAAus->NPCMarkerID = gu2->NPCMarkerID;
memcpy(&GLAAus->LeaderAAs, &gu2->leader_aas, sizeof(GLAAus->LeaderAAs));
dest->FastQueuePacket(&outapp);
delete in;
@@ -2549,7 +2549,7 @@ ENCODE(OP_GroupUpdate)
dest->FastQueuePacket(&outapp);
}
ENCODE(OP_AltCurrencySell)
ENCODE(OP_AltCurrencySell)
{
ENCODE_LENGTH_EXACT(AltCurrencySellItem_Struct);
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
@@ -2690,7 +2690,7 @@ DECODE(OP_ItemLinkClick) {
DECODE_LENGTH_EXACT(structs::ItemViewRequest_Struct);
SETUP_DIRECT_DECODE(ItemViewRequest_Struct, structs::ItemViewRequest_Struct);
MEMSET_IN(ItemViewRequest_Struct);
IN(item_id);
int r;
for (r = 0; r < 5; r++) {
@@ -2698,7 +2698,7 @@ DECODE(OP_ItemLinkClick) {
}
IN(link_hash);
IN(icon);
FINISH_DIRECT_DECODE();
}
@@ -2741,7 +2741,7 @@ DECODE(OP_ShopPlayerBuy)
}
DECODE(OP_ClientUpdate) {
// for some odd reason, there is an extra byte on the end of this on occasion..
// for some odd reason, there is an extra byte on the end of this on occasion..
DECODE_LENGTH_ATLEAST(structs::PlayerPositionUpdateClient_Struct);
SETUP_DIRECT_DECODE(PlayerPositionUpdateClient_Struct, structs::PlayerPositionUpdateClient_Struct);
IN(spawn_id);
@@ -2772,7 +2772,7 @@ DECODE(OP_CharacterCreate) {
emu->start_zone = RuleI(World, TutorialZoneID);
else
emu->start_zone = eq->start_zone;
IN(haircolor);
IN(deity);
IN(STR);
@@ -2804,7 +2804,7 @@ DECODE(OP_WhoAllRequest) {
IN(gmlookup);
IN(guildid);
IN(type);
FINISH_DIRECT_DECODE();
}
@@ -3278,7 +3278,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
SoD::structs::ItemTertiaryBodyStruct itbs;
memset(&itbs, 0, sizeof(SoD::structs::ItemTertiaryBodyStruct));
itbs.loregroup = item->LoreGroup;
itbs.artifact = item->ArtifactFlag;
itbs.summonedflag = item->SummonedFlag;
@@ -3453,7 +3453,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
uint32 SubLengths[10];
for(int x = 0; x < 10; ++x) {
SubSerializations[x] = nullptr;
const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x);
@@ -3513,11 +3513,11 @@ DECODE(OP_Bug)
strn0cpy(emu->target_name, eq->target_name, sizeof(emu->target_name));
strn0cpy(emu->bug, eq->bug, sizeof(emu->bug));
strn0cpy(emu->system_info, eq->system_info, sizeof(emu->system_info));
FINISH_DIRECT_DECODE();
}
DECODE(OP_AltCurrencySellSelection)
DECODE(OP_AltCurrencySellSelection)
{
DECODE_LENGTH_EXACT(structs::AltCurrencySelectItem_Struct);
SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct);
@@ -3526,7 +3526,7 @@ DECODE(OP_AltCurrencySellSelection)
FINISH_DIRECT_DECODE();
}
DECODE(OP_AltCurrencySell)
DECODE(OP_AltCurrencySell)
{
DECODE_LENGTH_EXACT(structs::AltCurrencySellItem_Struct);
SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
+10 -10
View File
@@ -6,30 +6,30 @@
class EQStreamIdentifier;
namespace SoD {
//these are the only public member of this namespace.
extern void Register(EQStreamIdentifier &into);
extern void Reload();
//you should not directly access anything below..
//you should not directly access anything below..
//I just dont feel like making a seperate header for it.
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "SSDeclare.h"
#include "SoD_ops.h"
};
};
+25 -25
View File
@@ -621,7 +621,7 @@ struct CharCreate_Struct
{
/*0000*/ uint32 class_;
/*0004*/ uint32 haircolor;
/*0008*/ uint32 beard;
/*0008*/ uint32 beard;
/*0012*/ uint32 beardcolor;
/*0016*/ uint32 gender;
/*0020*/ uint32 race;
@@ -845,7 +845,7 @@ struct PlayerProfile_Struct
/*04160*/ uint32 INT; // Intelligence - 3c 00 00 00 - 60
/*04164*/ uint32 AGI; // Agility - 5f 00 00 00 - 95
/*04168*/ uint32 WIS; // Wisdom - 46 00 00 00 - 70
/*04172*/ uint8 unknown04172[28]; //
/*04172*/ uint8 unknown04172[28]; //
/*04200*/ uint8 face; // Player face
/*04201*/ uint8 unknown02264[147]; // was [175]
/*04348*/ uint32 spell_book[MAX_PP_SPELLBOOK]; // List of the Spells in spellbook 480 = 60 pages [1920]
@@ -967,7 +967,7 @@ struct PlayerProfile_Struct
/*22448*/ uint32 level3; // SoF looks at the level here to determine how many leadership AA you can bank.
/*22452*/ uint32 showhelm; // 0=no, 1=yes
/*22456*/ uint32 RestTimer;
/*22460*/ uint8 unknown19584[1028]; // ***Placeholder (2/13/2007) was[1028]or[940]or[1380] - END of Struct
/*22460*/ uint8 unknown19584[1028]; // ***Placeholder (2/13/2007) was[1028]or[940]or[1380] - END of Struct
/*23488*/
};
@@ -1223,7 +1223,7 @@ struct Consider_Struct{
/*012*/ uint32 level; // Level
/*016*/ uint8 pvpcon; // Pvp con flag 0/1
/*017*/ uint8 unknown017[3]; //
/*020*/
/*020*/
};
/*
@@ -1346,14 +1346,14 @@ struct PlayerPositionUpdateClient_Struct
/*0012*/ float y_pos; // y coord (1st loc value)
/*0016*/ signed delta_heading:10; // change in heading
unsigned padding0036:10; // animation
unsigned padding0016:12; // ***Placeholder
unsigned padding0016:12; // ***Placeholder
/*0020*/ float delta_x; // Change in x
/*0024*/ float delta_y; // Change in y
/*0028*/ float z_pos; // z coord (3rd loc value)
/*0032*/ float delta_z; // Change in z
/*0036*/ unsigned animation:10; // ***Placeholder
/*0036*/ unsigned animation:10; // ***Placeholder
unsigned heading:12; // Directional heading
unsigned padding0037:10; // ***Placeholder
unsigned padding0037:10; // ***Placeholder
/*0040*/
};
@@ -1900,7 +1900,7 @@ struct AdventureLeaderboard_Struct
/*008*/ uint32 success;
/*012*/ uint32 failure;
/*016*/ uint32 our_rank;
/*020*/
/*020*/
};
/*struct Item_Shop_Struct {
@@ -1925,15 +1925,15 @@ struct Illusion_Struct { //size: 256
/*079*/ uint8 unknown079; //
/*080*/ uint32 face; //
/*084*/ uint8 hairstyle; // Some Races don't change Hair Style Properly in SoF
/*085*/ uint8 haircolor; //
/*086*/ uint8 beard; //
/*087*/ uint8 beardcolor; //
/*088*/ float size; //
/*085*/ uint8 haircolor; //
/*086*/ uint8 beard; //
/*087*/ uint8 beardcolor; //
/*088*/ float size; //
/*092*/ uint8 unknown092[148];
/*240*/ uint32 unknown240; // Removes armor?
/*244*/ uint32 drakkin_heritage; //
/*248*/ uint32 drakkin_tattoo; //
/*252*/ uint32 drakkin_details; //
/*244*/ uint32 drakkin_heritage; //
/*248*/ uint32 drakkin_tattoo; //
/*252*/ uint32 drakkin_details; //
/*256*/
};
@@ -2291,7 +2291,7 @@ struct BookRequest_Struct {
/*0000*/ uint32 window; // where to display the text (0xFFFFFFFF means new window).
/*0004*/ uint32 invslot; // The inventory slot the book is in. Not used, but echoed in the response packet.
/*0008*/ uint32 type; // 0 = Scroll, 1 = Book, 2 = Item Info. Possibly others
/*0012*/ uint32 unknown0012;
/*0012*/ uint32 unknown0012;
/*0016*/ uint16 unknown0016;
/*0018*/ char txtfile[8194];
};
@@ -2392,7 +2392,7 @@ struct Door_Struct
/*0054*/ uint8 unknown0054[4]; // 00 00 00 00
/*0060*/ uint8 doorId; // door's id #
/*0061*/ uint8 opentype;
/*0062*/ uint8 state_at_spawn;
/*0062*/ uint8 state_at_spawn;
/*0063*/ uint8 invert_state; // if this is 1, the door is normally open
/*0064*/ uint32 door_param; // normally ff ff ff ff (-1)
/*0068*/ uint32 unknown0068; // 00 00 00 00
@@ -2694,7 +2694,7 @@ struct Tracking_Struct_New {
struct Track_Struct_New {
uint16 entityid; // Entity ID
uint16 unknown002; // 00 00
uint32 unknown004; //
uint32 unknown004; //
uint8 level; // level of mob
uint8 unknown009; // 01 maybe type of mob? player/npc?
char name[1]; // name of mob
@@ -3893,7 +3893,7 @@ struct ItemBodyStruct
uint32 icon;
uint8 unknown1;
uint8 unknown2;
uint32 BenefitFlag;
uint32 BenefitFlag;
uint8 tradeskills;
int8 CR;
int8 DR;
@@ -3963,7 +3963,7 @@ struct ItemBodyStruct
uint32 FactionMod4;
int32 FactionAmt4;
//int16 unknown14;
};
struct AugSlotStruct
@@ -3998,9 +3998,9 @@ struct ItemTertiaryBodyStruct
uint8 no_transfer;
uint16 expendablearrow;
uint32 unknown8;
uint32 unknown9;
uint32 unknown10;
uint32 unknown8;
uint32 unknown9;
uint32 unknown10;
uint32 unknown11;
uint8 unknown12;
uint8 unknown13;
@@ -4205,7 +4205,7 @@ struct AltCurrencySellItem_Struct {
};
struct MercenaryGrade_Struct {
uint32 GradeCountEntry;
uint32 GradeCountEntry;
};
// Used by MercenaryListEntry_Struct
@@ -4267,7 +4267,7 @@ struct MercenaryData_Struct {
// [OPCode: 0x6537] On Live as of April 2 2012 [Server->Client]
// Should be named OP_MercenaryDataResponse, but the current opcode using that name should be renamed first
// Size varies if mercenary is hired or if browsing Mercenary Merchant
// This may also be the response for Client->Server 0x0327 (size 0) packet On Live as of April 2 2012
// This may also be the response for Client->Server 0x0327 (size 0) packet On Live as of April 2 2012
struct MercenaryDataUpdate_Struct {
/*0000*/ int32 MercStatus; // Seen 0 with merc and -1 with no merc hired
/*0004*/ uint32 MercCount; // Seen 1 with 1 merc hired and 0 with no merc hired
+93 -93
View File
@@ -22,7 +22,7 @@ static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth);
void Register(EQStreamIdentifier &into) {
//create our opcode manager if we havent already
if(opcodes == nullptr) {
@@ -38,37 +38,37 @@ void Register(EQStreamIdentifier &into) {
return;
}
}
//ok, now we have what we need to register.
EQStream::Signature signature;
string pname;
//register our world signature.
pname = string(name) + "_world";
signature.ignore_eq_opcode = 0;
signature.first_length = sizeof(structs::LoginInfo_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_SendLoginInfo);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
//register our zone signature.
pname = string(name) + "_zone";
signature.ignore_eq_opcode = opcodes->EmuToEQ(OP_AckPacket);
signature.first_length = sizeof(structs::ClientZoneEntry_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_ZoneEntry);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
_log(NET__IDENTIFY, "Registered patch %s", name);
}
void Reload() {
//we have a big problem to solve here when we switch back to shared memory
//opcode managers because we need to change the manager pointer, which means
//we need to go to every stream and replace it's manager.
if(opcodes != nullptr) {
//TODO: get this file name from the config file
string opfile = "patch_";
@@ -98,7 +98,7 @@ std::string Strategy::Describe() const {
r += name;
return(r);
}
const EQClientVersion Strategy::ClientVersion() const
{
return EQClientSoF;
@@ -115,7 +115,7 @@ static inline uint32 TitaniumToSoFSlot(uint32 TitaniumSlot) {
{
SoFSlot = TitaniumSlot + 1;
}
else if(TitaniumSlot >= 251 && TitaniumSlot <= 340) // Bag Slots for Normal Inventory and Cursor
else if(TitaniumSlot >= 251 && TitaniumSlot <= 340) // Bag Slots for Normal Inventory and Cursor
{
SoFSlot = TitaniumSlot + 11;
}
@@ -134,20 +134,20 @@ static inline uint32 TitaniumToSoFSlot(uint32 TitaniumSlot) {
else
{
SoFSlot = TitaniumSlot;
}
}
return SoFSlot;
}
// Converts Sof Slot IDs to Titanium Slot IDs for use in Decodes
static inline uint32 SoFToTitaniumSlot(uint32 SoFSlot) {
uint32 TitaniumSlot = 0;
if(SoFSlot >= 22 && SoFSlot <= 54) // Cursor/Ammo/Power Source and Normal Inventory Slots
{
TitaniumSlot = SoFSlot - 1;
}
else if(SoFSlot >= 262 && SoFSlot <= 351) // Bag Slots for Normal Inventory and Cursor
else if(SoFSlot >= 262 && SoFSlot <= 351) // Bag Slots for Normal Inventory and Cursor
{
TitaniumSlot = SoFSlot - 11;
}
@@ -186,7 +186,7 @@ ENCODE(OP_OpenNewTasksWindow) {
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
__emu_AvailableTaskHeader = (AvailableTaskHeader_Struct*)__emu_buffer;
@@ -222,7 +222,7 @@ ENCODE(OP_OpenNewTasksWindow) {
__eq_AvailableTaskData1->TaskID = __emu_AvailableTaskData1->TaskID;
// This next unknown seems to affect the colour of the task title. 0x3f80000 is what I have seen
// in Live packets. Changing it to 0x3f000000 makes the title red.
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
__eq_AvailableTaskData1->TimeLimit = __emu_AvailableTaskData1->TimeLimit;
__eq_AvailableTaskData1->unknown2 = __emu_AvailableTaskData1->unknown2;
@@ -281,7 +281,7 @@ ENCODE(OP_OpenNewTasksWindow) {
}
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
@@ -289,8 +289,8 @@ ENCODE(OP_OpenNewTasksWindow) {
ENCODE(OP_SendCharInfo) {
ENCODE_LENGTH_EXACT(CharacterSelect_Struct);
SETUP_VAR_ENCODE(CharacterSelect_Struct);
//EQApplicationPacket *packet = *p;
//const CharacterSelect_Struct *emu = (CharacterSelect_Struct *) packet->pBuffer;
@@ -309,10 +309,10 @@ ENCODE(OP_SendCharInfo) {
+ namelen;
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, total_length);
//unsigned char *eq_buffer = new unsigned char[total_length];
//structs::CharacterSelect_Struct *eq_head = (structs::CharacterSelect_Struct *) eq_buffer;
eq->char_count = char_count;
eq->total_chars = 10;
@@ -359,9 +359,9 @@ ENCODE(OP_SendCharInfo) {
}
bufptr += sizeof(structs::CharacterSelectEntry_Struct);
}
FINISH_ENCODE();
}
ENCODE(OP_ZoneServerInfo) {
@@ -369,8 +369,8 @@ ENCODE(OP_ZoneServerInfo) {
OUT_str(ip);
OUT(port);
FINISH_ENCODE();
//this is SUCH bullshit to be doing from down here. but the
//this is SUCH bullshit to be doing from down here. but the
// new client requires us to close immediately following this
// packet, so do it.
//dest->Close();
@@ -379,17 +379,17 @@ ENCODE(OP_ZoneServerInfo) {
//hack hack hack
ENCODE(OP_SendZonepoints) {
ENCODE_LENGTH_ATLEAST(ZonePoints);
SETUP_VAR_ENCODE(ZonePoints);
ALLOC_VAR_ENCODE(structs::ZonePoints, __packet->size);
memcpy(eq, emu, __packet->size);
FINISH_ENCODE();
// unknown0xxx[24];
//this is utter crap... the client is waiting for this
//certain 0 length opcode to come after the reqclientspawn
//stuff... so this is a dirty way to put it in there.
//stuff... so this is a dirty way to put it in there.
// this needs to be done better
//EQApplicationPacket hack_test(OP_PetitionUnCheckout, 0);
@@ -399,10 +399,10 @@ ENCODE(OP_SendZonepoints) {
ENCODE(OP_SendAATable) {
ENCODE_LENGTH_ATLEAST(SendAA_Struct);
SETUP_VAR_ENCODE(SendAA_Struct);
ALLOC_VAR_ENCODE(structs::SendAA_Struct, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability));
// Check clientver field to verify this AA should be sent for SoF
// clientver 1 is for all clients and 4 is for SoF
if (emu->clientver <= 4 )
@@ -459,13 +459,13 @@ ENCODE(OP_LeadershipExpUpdate) {
ENCODE(OP_PlayerProfile) {
SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct);
uint32 r;
eq->available_slots=0xffffffff;
memset(eq->unknown4184, 0xff, sizeof(eq->unknown4184));
memset(eq->unknown04396, 0xff, sizeof(eq->unknown04396));
// OUT(checksum);
OUT(gender);
OUT(race);
@@ -558,7 +558,7 @@ ENCODE(OP_PlayerProfile) {
OUT(aapoints_spent);
OUT(aapoints);
// OUT(unknown06160[4]);
//NOTE: new client supports 20 bandoliers, our internal rep
//NOTE: new client supports 20 bandoliers, our internal rep
//only supports 4..
for(r = 0; r < 4; r++) {
OUT_str(bandoliers[r].name);
@@ -681,12 +681,12 @@ const uint8 bytes[] = {
};
memcpy(eq->unknown12864, bytes, sizeof(bytes));
//set the checksum...
CRC32::SetEQChecksum(__packet->pBuffer, sizeof(structs::PlayerProfile_Struct)-4);
FINISH_ENCODE();
}
@@ -722,7 +722,7 @@ ENCODE(OP_NewZone) {
OUT(zone_id);
OUT(zone_instance);
OUT(SuspendBuffs);
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown796 = -1;
eq->unknown840 = 600;
@@ -784,11 +784,11 @@ ENCODE(OP_ZoneSpawns) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Spawn_Struct *emu = (Spawn_Struct *) __emu_buffer;
//determine and verify length
int entrycount = in->size / sizeof(Spawn_Struct);
if(entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
@@ -796,16 +796,16 @@ ENCODE(OP_ZoneSpawns) {
delete in;
return;
}
//make the EQ struct.
in->size = sizeof(structs::Spawn_Struct)*entrycount;
in->pBuffer = new unsigned char[in->size];
structs::Spawn_Struct *eq = (structs::Spawn_Struct *) in->pBuffer;
//zero out the packet. We could avoid this memset by setting all fields (including unknowns)
//in the loop.
memset(in->pBuffer, 0, in->size);
//do the transform...
int r;
int k;
@@ -931,7 +931,7 @@ ENCODE(OP_ZoneSpawns) {
}
char hex[] = "0123456789ABCDEF";
eq->lastName[len + 0] = ' ';
eq->lastName[len + 1] = code;
eq->lastName[len + 2] = '0' + ((ofs / 1000) % 10);
@@ -997,14 +997,14 @@ ENCODE(OP_ZoneSpawns) {
}
}*/
}
//kill off the emu structure and send the eq packet.
delete[] __emu_buffer;
//_log(NET__ERROR, "Sending zone spawns");
//_hex(NET__ERROR, in->pBuffer, in->size);
dest->FastQueuePacket(&in, ack_req);
}
@@ -1013,7 +1013,7 @@ ENCODE(OP_ItemPacket) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
ItemPacket_Struct *old_item_pkt=(ItemPacket_Struct *)__emu_buffer;
InternalSerializedItem_Struct *int_struct=(InternalSerializedItem_Struct *)(old_item_pkt->SerializedItem);
@@ -1055,7 +1055,7 @@ ENCODE(OP_CharInventory) {
return;
}
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
@@ -1063,7 +1063,7 @@ ENCODE(OP_CharInventory) {
if(ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
delete in;
@@ -1076,7 +1076,7 @@ ENCODE(OP_CharInventory) {
in->pBuffer = new uchar[4];
*(uint32 *)in->pBuffer = ItemCount;
in->size = 4;
for(int r = 0; r < ItemCount; r++, eq++) {
@@ -1120,39 +1120,39 @@ ENCODE(OP_GuildMemberList) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Internal_GuildMembers_Struct *emu = (Internal_GuildMembers_Struct *) in->pBuffer;
//make a new EQ buffer.
uint32 pnl = strlen(emu->player_name);
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
emu->count*sizeof(structs::GuildMemberEntry_Struct)
+ emu->name_length + emu->note_length;
in->pBuffer = new uint8[length];
in->size = length;
//no memset since we fill every byte.
uint8 *buffer;
buffer = in->pBuffer;
//easier way to setup GuildMembers_Struct
//set prefix name
strcpy((char *)buffer, emu->player_name);
buffer += pnl;
*buffer = '\0';
buffer++;
//add member count.
*((uint32 *) buffer) = htonl( emu->count );
buffer += sizeof(uint32);
if(emu->count > 0) {
Internal_GuildMemberEntry_Struct *emu_e = emu->member;
const char *emu_name = (const char *) (__emu_buffer +
const char *emu_name = (const char *) (__emu_buffer +
sizeof(Internal_GuildMembers_Struct) + //skip header
emu->count * sizeof(Internal_GuildMemberEntry_Struct) //skip static length member data
);
@@ -1160,12 +1160,12 @@ ENCODE(OP_GuildMemberList) {
emu->name_length + //skip name contents
emu->count //skip string terminators
);
structs::GuildMemberEntry_Struct *e = (structs::GuildMemberEntry_Struct *) buffer;
uint32 r;
for(r = 0; r < emu->count; r++, emu_e++) {
//the order we set things here must match the struct
//nice helper macro
@@ -1181,7 +1181,7 @@ ENCODE(OP_GuildMemberList) {
}
#define PutFieldN(field) \
e->field = htonl(emu_e->field)
SlideStructString( name, emu_name );
PutFieldN(level);
PutFieldN(banker);
@@ -1195,15 +1195,15 @@ ENCODE(OP_GuildMemberList) {
SlideStructString( public_note, emu_note );
e->zoneinstance = 0;
e->zone_id = htons(emu_e->zone_id);
#undef SlideStructString
#undef PutFieldN
e++;
}
}
delete[] __emu_buffer;
@@ -1325,16 +1325,16 @@ ENCODE(OP_LogServer) {
ENCODE_LENGTH_EXACT(LogServer_Struct);
SETUP_DIRECT_ENCODE(LogServer_Struct, structs::LogServer_Struct);
strcpy(eq->worldshortname, emu->worldshortname);
OUT(enablevoicemacros);
OUT(enablemail);
OUT(enable_pvp);
OUT(enable_FV);
// These next two need to be set like this for the Tutorial Button to work.
eq->unknown263[0] = 0;
eq->unknown263[2] = 1;
FINISH_ENCODE();
}
@@ -1476,7 +1476,7 @@ ENCODE(OP_BazaarSearch) {
//determine and verify length
int entrycount = in->size / sizeof(BazaarSearchResults_Struct);
if(entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) {
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
delete in;
return;
@@ -1615,7 +1615,7 @@ ENCODE(OP_Stun) {
FINISH_ENCODE();
}
ENCODE(OP_ZonePlayerToBind)
ENCODE(OP_ZonePlayerToBind)
{
ENCODE_LENGTH_ATLEAST(ZonePlayerToBind_Struct);
ZonePlayerToBind_Struct *zps = (ZonePlayerToBind_Struct*)(*p)->pBuffer;
@@ -1668,7 +1668,7 @@ ENCODE(OP_AdventureMerchantSell) {
FINISH_ENCODE();
}
ENCODE(OP_RaidUpdate)
ENCODE(OP_RaidUpdate)
{
EQApplicationPacket *inapp = *p;
*p = nullptr;
@@ -1681,7 +1681,7 @@ ENCODE(OP_RaidUpdate)
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
add_member->raidGen.action = in_add_member->raidGen.action;
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
@@ -1758,7 +1758,7 @@ ENCODE(OP_VetRewardsAvaliable)
old_data += sizeof(InternalVeteranReward);
data += sizeof(structs::VeteranReward);
}
dest->FastQueuePacket(&outapp_create);
delete inapp;
}
@@ -1819,7 +1819,7 @@ ENCODE(OP_DzMemberList)
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
@@ -1876,7 +1876,7 @@ ENCODE(OP_DzLeaderStatus)
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//1
ss.write((const char*)&client_id, sizeof(uint32));
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
@@ -1940,7 +1940,7 @@ ENCODE(OP_OnLevelMessage)
FINISH_ENCODE();
}
ENCODE(OP_AltCurrencySell)
ENCODE(OP_AltCurrencySell)
{
ENCODE_LENGTH_EXACT(AltCurrencySellItem_Struct);
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
@@ -2078,7 +2078,7 @@ DECODE(OP_ItemLinkClick) {
DECODE_LENGTH_EXACT(structs::ItemViewRequest_Struct);
SETUP_DIRECT_DECODE(ItemViewRequest_Struct, structs::ItemViewRequest_Struct);
MEMSET_IN(ItemViewRequest_Struct);
IN(item_id);
int r;
for (r = 0; r < 5; r++) {
@@ -2086,7 +2086,7 @@ DECODE(OP_ItemLinkClick) {
}
IN(link_hash);
IN(icon);
FINISH_DIRECT_DECODE();
}
@@ -2115,7 +2115,7 @@ DECODE(OP_Consider) {
}
DECODE(OP_ClientUpdate) {
// for some odd reason, there is an extra byte on the end of this on occasion..
// for some odd reason, there is an extra byte on the end of this on occasion..
DECODE_LENGTH_ATLEAST(structs::PlayerPositionUpdateClient_Struct);
SETUP_DIRECT_DECODE(PlayerPositionUpdateClient_Struct, structs::PlayerPositionUpdateClient_Struct);
IN(spawn_id);
@@ -2146,7 +2146,7 @@ DECODE(OP_CharacterCreate) {
emu->start_zone = RuleI(World, TutorialZoneID);
else
emu->start_zone = eq->start_zone;
IN(haircolor);
IN(deity);
IN(STR);
@@ -2178,7 +2178,7 @@ DECODE(OP_WhoAllRequest) {
IN(gmlookup);
IN(guildid);
IN(type);
FINISH_DIRECT_DECODE();
}
@@ -2596,7 +2596,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
SoF::structs::ItemTertiaryBodyStruct itbs;
memset(&itbs, 0, sizeof(SoF::structs::ItemTertiaryBodyStruct));
itbs.loregroup = item->LoreGroup;
itbs.artifact = item->ArtifactFlag;
itbs.summonedflag = item->SummonedFlag;
@@ -2771,7 +2771,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
uint32 SubLengths[10];
for(int x = 0; x < 10; ++x) {
SubSerializations[x] = nullptr;
const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x);
@@ -2817,7 +2817,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
return item_serial;
}
DECODE(OP_AltCurrencySellSelection)
DECODE(OP_AltCurrencySellSelection)
{
DECODE_LENGTH_EXACT(structs::AltCurrencySelectItem_Struct);
SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct);
@@ -2826,7 +2826,7 @@ DECODE(OP_AltCurrencySellSelection)
FINISH_DIRECT_DECODE();
}
DECODE(OP_AltCurrencySell)
DECODE(OP_AltCurrencySell)
{
DECODE_LENGTH_EXACT(structs::AltCurrencySellItem_Struct);
SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
+10 -10
View File
@@ -6,30 +6,30 @@
class EQStreamIdentifier;
namespace SoF {
//these are the only public member of this namespace.
extern void Register(EQStreamIdentifier &into);
extern void Reload();
//you should not directly access anything below..
//you should not directly access anything below..
//I just dont feel like making a seperate header for it.
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "SSDeclare.h"
#include "SoF_ops.h"
};
};
+1 -1
View File
@@ -3,7 +3,7 @@
// This File is not used in the build, but here as a reference for SoF.
// This should be a complete list of all opcodes for SoF.
// The list was generated from IDA using a script from the ShowEQ project.
// This file can be removed at any time.
// This file can be removed at any time.
// It is only a reference the project to upgrade the emulator to use SoF.
0x10ff, OP_SenseTraps
+19 -19
View File
@@ -253,7 +253,7 @@ struct Spawn_Struct {
/*0614*/ uint8 unknown0614[11];
/*0625*/ uint8 bodytype2; //New Field - Seems to do the same thing as bodytype
/*0626*/ uint8 unknown0626[28];
union
union
{
/*0654*/ uint8 equip_chest2; // This is Texture for NPCs
/*0654*/ uint8 mount_color; // This should be merged into 1 field, "texture"
@@ -599,7 +599,7 @@ struct CharCreate_Struct
{
/*0000*/ uint32 class_;
/*0004*/ uint32 haircolor;
/*0008*/ uint32 beard;
/*0008*/ uint32 beard;
/*0012*/ uint32 beardcolor;
/*0016*/ uint32 gender;
/*0020*/ uint32 race;
@@ -1200,7 +1200,7 @@ struct Consider_Struct{
/*012*/ uint32 level; // Level
/*016*/ uint8 pvpcon; // Pvp con flag 0/1
/*017*/ uint8 unknown017[3]; //
/*020*/
/*020*/
};
/*
@@ -1874,7 +1874,7 @@ struct AdventureLeaderboard_Struct
/*008*/ uint32 success;
/*012*/ uint32 failure;
/*016*/ uint32 our_rank;
/*020*/
/*020*/
};
/*struct Item_Shop_Struct {
@@ -1899,15 +1899,15 @@ struct Illusion_Struct { //size: 256
/*079*/ uint8 unknown079; //
/*080*/ uint32 face; //
/*084*/ uint8 hairstyle; // Some Races don't change Hair Style Properly in SoF
/*085*/ uint8 haircolor; //
/*086*/ uint8 beard; //
/*087*/ uint8 beardcolor; //
/*088*/ float size; //
/*085*/ uint8 haircolor; //
/*086*/ uint8 beard; //
/*087*/ uint8 beardcolor; //
/*088*/ float size; //
/*092*/ uint8 unknown092[148];
/*240*/ uint32 unknown240; // Removes armor?
/*244*/ uint32 drakkin_heritage; //
/*248*/ uint32 drakkin_tattoo; //
/*252*/ uint32 drakkin_details; //
/*244*/ uint32 drakkin_heritage; //
/*248*/ uint32 drakkin_tattoo; //
/*252*/ uint32 drakkin_details; //
/*256*/
};
@@ -2225,7 +2225,7 @@ struct BookRequest_Struct {
/*0000*/ uint32 window; // where to display the text (0xFFFFFFFF means new window).
/*0004*/ uint32 invslot; // The inventory slot the book is in. Not used, but echoed in the response packet.
/*0008*/ uint32 type; // 0 = Scroll, 1 = Book, 2 = Item Info. Possibly others
/*0012*/ uint32 unknown0012;
/*0012*/ uint32 unknown0012;
/*0016*/ uint16 unknown0016;
/*0018*/ char txtfile[8194];
};
@@ -2326,7 +2326,7 @@ struct Door_Struct
/*0054*/ uint8 unknown0054[4]; // 00 00 00 00
/*0060*/ uint8 doorId; // door's id #
/*0061*/ uint8 opentype;
/*0062*/ uint8 state_at_spawn;
/*0062*/ uint8 state_at_spawn;
/*0063*/ uint8 invert_state; // if this is 1, the door is normally open
/*0064*/ uint32 door_param; // normally ff ff ff ff (-1)
/*0068*/ uint32 unknown0068; // 00 00 00 00
@@ -2591,7 +2591,7 @@ struct Tracking_Struct_New {
struct Track_Struct_New {
uint16 entityid; // Entity ID
uint16 unknown002; // 00 00
uint32 unknown004; //
uint32 unknown004; //
uint8 level; // level of mob
uint8 unknown009; // 01 maybe type of mob? player/npc?
char name[1]; // name of mob
@@ -3750,7 +3750,7 @@ struct ItemBodyStruct
uint32 icon;
uint8 unknown1;
uint8 unknown2;
uint32 BenefitFlag;
uint32 BenefitFlag;
uint8 tradeskills;
int8 CR;
int8 DR;
@@ -3819,7 +3819,7 @@ struct ItemBodyStruct
int32 FactionAmt3;
uint32 FactionMod4;
int32 FactionAmt4;
};
struct AugSlotStruct
@@ -3854,9 +3854,9 @@ struct ItemTertiaryBodyStruct
uint8 no_transfer;
uint16 expendablearrow;
uint32 unknown8;
uint32 unknown9;
uint32 unknown10;
uint32 unknown8;
uint32 unknown9;
uint32 unknown10;
uint32 unknown11;
uint8 unknown12;
uint8 unknown13;
+63 -63
View File
@@ -20,7 +20,7 @@ static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
char *SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth);
void Register(EQStreamIdentifier &into) {
//create our opcode manager if we havent already
if(opcodes == nullptr) {
@@ -36,37 +36,37 @@ void Register(EQStreamIdentifier &into) {
return;
}
}
//ok, now we have what we need to register.
EQStream::Signature signature;
string pname;
//register our world signature.
pname = string(name) + "_world";
signature.ignore_eq_opcode = 0;
signature.first_length = sizeof(structs::LoginInfo_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_SendLoginInfo);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
//register our zone signature.
pname = string(name) + "_zone";
signature.ignore_eq_opcode = opcodes->EmuToEQ(OP_AckPacket);
signature.first_length = sizeof(structs::ClientZoneEntry_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_ZoneEntry);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
_log(NET__IDENTIFY, "Registered patch %s", name);
}
void Reload() {
//we have a big problem to solve here when we switch back to shared memory
//opcode managers because we need to change the manager pointer, which means
//we need to go to every stream and replace it's manager.
if(opcodes != nullptr) {
//TODO: get this file name from the config file
string opfile = "patch_";
@@ -96,7 +96,7 @@ std::string Strategy::Describe() const {
r += name;
return(r);
}
const EQClientVersion Strategy::ClientVersion() const
{
return EQClientTitanium;
@@ -147,10 +147,10 @@ ENCODE(OP_SendCharInfo) {
ENCODE(OP_SendAATable) {
ENCODE_LENGTH_ATLEAST(SendAA_Struct);
SETUP_VAR_ENCODE(SendAA_Struct);
ALLOC_VAR_ENCODE(structs::SendAA_Struct, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability));
// Check clientver field to verify this AA should be sent for Titanium
// clientver 1 is for all clients and 3 is for Titanium
if (emu->clientver <= 3 )
@@ -202,13 +202,13 @@ ENCODE(OP_LeadershipExpUpdate) {
ENCODE(OP_PlayerProfile) {
SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct);
uint32 r;
eq->available_slots=0xffffffff;
memset(eq->unknown4184, 0xff, sizeof(eq->unknown4184));
memset(eq->unknown04396, 0xff, sizeof(eq->unknown04396));
// OUT(checksum);
OUT(gender);
OUT(race);
@@ -409,12 +409,12 @@ const uint8 bytes[] = {
0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x14
};
memcpy(eq->unknown12864, bytes, sizeof(bytes));
//set the checksum...
CRC32::SetEQChecksum(__packet->pBuffer, sizeof(structs::PlayerProfile_Struct)-4);
FINISH_ENCODE();
}
@@ -458,11 +458,11 @@ ENCODE(OP_ZoneSpawns) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Spawn_Struct *emu = (Spawn_Struct *) __emu_buffer;
//determine and verify length
int entrycount = in->size / sizeof(Spawn_Struct);
if(entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
@@ -470,16 +470,16 @@ ENCODE(OP_ZoneSpawns) {
delete in;
return;
}
//make the EQ struct.
in->size = sizeof(structs::Spawn_Struct)*entrycount;
in->pBuffer = new unsigned char[in->size];
structs::Spawn_Struct *eq = (structs::Spawn_Struct *) in->pBuffer;
//zero out the packet. We could avoid this memset by setting all fields (including unknowns)
//in the loop.
memset(in->pBuffer, 0, in->size);
//do the transform...
int r;
int k;
@@ -571,7 +571,7 @@ ENCODE(OP_ZoneSpawns) {
eq->spawnId = emu->spawnId;
// eq->unknown0344[4] = emu->unknown0344[4];
eq->lfg = emu->lfg;
/*
if (emu->face == 99) {eq->face = 0;}
if (emu->eyecolor1 == 99) {eq->eyecolor1 = 0;}
@@ -583,8 +583,8 @@ ENCODE(OP_ZoneSpawns) {
*/
}
//kill off the emu structure and send the eq packet.
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
@@ -595,7 +595,7 @@ ENCODE(OP_ItemPacket) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
ItemPacket_Struct *old_item_pkt=(ItemPacket_Struct *)__emu_buffer;
@@ -625,7 +625,7 @@ ENCODE(OP_CharInventory) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
@@ -636,7 +636,7 @@ ENCODE(OP_CharInventory) {
return;
}
InternalSerializedItem_Struct *eq = (InternalSerializedItem_Struct *) in->pBuffer;
//do the transform...
int r;
string serial_string;
@@ -649,7 +649,7 @@ ENCODE(OP_CharInventory) {
} else {
_log(NET__STRUCTS, "Serialization failed on item slot %d during OP_CharInventory. Item skipped.",eq->slot_id);
}
}
in->size = serial_string.length();
@@ -682,7 +682,7 @@ ENCODE(OP_BazaarSearch) {
//determine and verify length
int entrycount = in->size / sizeof(BazaarSearchResults_Struct);
if(entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) {
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
delete in;
return;
@@ -746,39 +746,39 @@ ENCODE(OP_GuildMemberList) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Internal_GuildMembers_Struct *emu = (Internal_GuildMembers_Struct *) in->pBuffer;
//make a new EQ buffer.
uint32 pnl = strlen(emu->player_name);
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
emu->count*sizeof(structs::GuildMemberEntry_Struct)
+ emu->name_length + emu->note_length;
in->pBuffer = new uint8[length];
in->size = length;
//no memset since we fill every byte.
uint8 *buffer;
buffer = in->pBuffer;
//easier way to setup GuildMembers_Struct
//set prefix name
strcpy((char *)buffer, emu->player_name);
buffer += pnl;
*buffer = '\0';
buffer++;
//add member count.
*((uint32 *) buffer) = htonl( emu->count );
buffer += sizeof(uint32);
if(emu->count > 0) {
Internal_GuildMemberEntry_Struct *emu_e = emu->member;
const char *emu_name = (const char *) (__emu_buffer +
const char *emu_name = (const char *) (__emu_buffer +
sizeof(Internal_GuildMembers_Struct) + //skip header
emu->count * sizeof(Internal_GuildMemberEntry_Struct) //skip static length member data
);
@@ -786,12 +786,12 @@ ENCODE(OP_GuildMemberList) {
emu->name_length + //skip name contents
emu->count //skip string terminators
);
structs::GuildMemberEntry_Struct *e = (structs::GuildMemberEntry_Struct *) buffer;
uint32 r;
for(r = 0; r < emu->count; r++, emu_e++) {
//the order we set things here must match the struct
//nice helper macro
@@ -807,7 +807,7 @@ ENCODE(OP_GuildMemberList) {
}
#define PutFieldN(field) \
e->field = htonl(emu_e->field)
SlideStructString( name, emu_name );
PutFieldN(level);
PutFieldN(banker);
@@ -821,15 +821,15 @@ ENCODE(OP_GuildMemberList) {
SlideStructString( public_note, emu_note );
e->zoneinstance = 0;
e->zone_id = htons(emu_e->zone_id);
#undef SlideStructString
#undef PutFieldN
e++;
}
}
delete[] __emu_buffer;
@@ -840,9 +840,9 @@ ENCODE(OP_ReadBook) {
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
BookText_Struct *emu_BookText_Struct = (BookText_Struct *)__emu_buffer;
in->size = sizeof(structs::BookText_Struct) + strlen(emu_BookText_Struct->booktext);
@@ -915,7 +915,7 @@ ENCODE(OP_VetRewardsAvaliable)
old_data += sizeof(InternalVeteranReward);
data += sizeof(structs::VeteranReward);
}
dest->FastQueuePacket(&outapp_create);
delete inapp;
}
@@ -1027,7 +1027,7 @@ ENCODE(OP_DzMemberList)
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
@@ -1084,7 +1084,7 @@ ENCODE(OP_DzLeaderStatus)
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//1
ss.write((const char*)&client_id, sizeof(uint32));
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
@@ -1182,7 +1182,7 @@ DECODE(OP_InspectRequest) {
DECODE(OP_InspectAnswer) {
DECODE_LENGTH_EXACT(structs::InspectResponse_Struct);
SETUP_DIRECT_DECODE(InspectResponse_Struct, structs::InspectResponse_Struct);
IN(TargetID);
IN(playerid);
@@ -1194,7 +1194,7 @@ DECODE(OP_InspectAnswer) {
// move arrow item up to last element in server array
strn0cpy(emu->itemnames[21], "", sizeof(emu->itemnames[21]));
strn0cpy(emu->itemnames[22], eq->itemnames[21], sizeof(emu->itemnames[22]));
int k;
for (k = 0; k <= 20; k++) {
IN(itemicons[k]);
@@ -1221,13 +1221,13 @@ ENCODE(OP_LFGuild)
dest->FastQueuePacket(&in, ack_req);
return;
}
EQApplicationPacket *outapp = new EQApplicationPacket(OP_LFGuild, sizeof(structs::LFGuild_PlayerToggle_Struct));
memcpy(outapp->pBuffer, in->pBuffer, sizeof(structs::LFGuild_PlayerToggle_Struct));
dest->FastQueuePacket(&outapp, ack_req);
delete in;
}
@@ -1264,14 +1264,14 @@ DECODE(OP_ItemLinkClick) {
DECODE_LENGTH_EXACT(structs::ItemViewRequest_Struct);
SETUP_DIRECT_DECODE(ItemViewRequest_Struct, structs::ItemViewRequest_Struct);
MEMSET_IN(ItemViewRequest_Struct);
IN(item_id);
int r;
for (r = 0; r < 5; r++) {
IN(augments[r]);
}
IN(link_hash);
FINISH_DIRECT_DECODE();
}
@@ -1322,7 +1322,7 @@ DECODE(OP_WhoAllRequest) {
IN(lvlhigh);
IN(gmlookup);
emu->type = 3;
FINISH_DIRECT_DECODE();
}
@@ -1401,7 +1401,7 @@ char *SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 d
}
}
*length=MakeAnyLenString(&serialization,
"%.*s%s" // For leading quotes (and protection) if a subitem;
"%s" // Instance data
+10 -10
View File
@@ -6,30 +6,30 @@
class EQStreamIdentifier;
namespace Titanium {
//these are the only public member of this namespace.
extern void Register(EQStreamIdentifier &into);
extern void Reload();
//you should not directly access anything below..
//you should not directly access anything below..
//I just dont feel like making a seperate header for it.
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "SSDeclare.h"
#include "Titanium_ops.h"
};
};
+83 -83
View File
@@ -63,7 +63,7 @@ struct DuelResponse_Struct
};
/*
Cofruben:
Adventure stuff,not a net one,just one for our use
Adventure stuff,not a net one,just one for our use
*/
static const uint32 ADVENTURE_COLLECT = 0;
static const uint32 ADVENTURE_MASSKILL = 1;
@@ -158,10 +158,10 @@ struct CharacterSelect_Struct {
**
*/
/*
** Generic Spawn Struct
** Length: 383 Octets
** Used in:
/*
** Generic Spawn Struct
** Length: 383 Octets
** Used in:
** spawnZoneStruct
** dbSpawnStruct
** petStruct
@@ -214,14 +214,14 @@ struct Spawn_Struct {
/*0147*/ uint8 unknown0147[4];
/*0151*/ uint8 level; // Spawn Level
/*0152*/ uint8 unknown0259[4]; // ***Placeholder
/*0156*/ uint8 beard; // Beard style
/*0156*/ uint8 beard; // Beard style
/*0157*/ char suffix[32]; // Player's suffix (of Veeshan, etc.)
/*0189*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner
/*0193*/ uint8 guildrank; // 0=normal, 1=officer, 2=leader
/*0194*/ uint8 unknown0194[3];
/*0197*/ union
/*0197*/ union
{
struct
struct
{
/*0197*/ uint32 equip_helmet; // Equipment: Helmet Visual
/*0201*/ uint32 equip_chest; // Equipment: Chest Visual
@@ -255,7 +255,7 @@ struct Spawn_Struct {
/*0334*/ uint8 gender; // Gender (0=male, 1=female)
/*0335*/ uint8 bodytype; // Bodytype
/*0336*/ uint8 unknown0336[3];
union
union
{
/*0339*/ uint8 equip_chest2; // Second place in packet for chest texture (usually 0xFF in live packets)
// Not sure why there are 2 of them, but it effects chest texture!
@@ -264,9 +264,9 @@ union
};
/*0340*/ uint32 spawnId; // Spawn Id
/*0344*/ uint8 unknown0344[4];
/*0348*/ union
/*0348*/ union
{
struct
struct
{
/*0348*/ Color_Struct color_helmet; // Color of helmet item
/*0352*/ Color_Struct color_chest; // Color of chest item
@@ -350,9 +350,9 @@ struct NewZone_Struct {
** Length: 12 Bytes
**
*/
struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc)
struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc)
uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming
uint32 unknown12;
};
@@ -386,20 +386,20 @@ struct DeleteSpell_Struct
};
struct ManaChange_Struct
{
{
uint32 new_mana; // New Mana AMount
uint32 stamina;
uint32 spell_id;
uint32 unknown12;
};
struct SwapSpell_Struct
{
uint32 from_slot;
uint32 to_slot;
struct SwapSpell_Struct
{
uint32 from_slot;
uint32 to_slot;
};
};
struct BeginCast_Struct
{
@@ -571,7 +571,7 @@ struct CharCreate_Struct
struct AA_Array
{
uint32 AA;
uint32 value;
uint32 value;
};
@@ -611,7 +611,7 @@ struct Bandolier_Struct {
struct PotionBelt_Struct {
BandolierItem_Struct items[MAX_PLAYER_BANDOLIER_ITEMS];
};
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
static const uint32 MAX_RAID_LEADERSHIP_AA_ARRAY = 16;
static const uint32 MAX_LEADERSHIP_AA_ARRAY = (MAX_GROUP_LEADERSHIP_AA_ARRAY+MAX_RAID_LEADERSHIP_AA_ARRAY);
@@ -625,18 +625,18 @@ struct RaidLeadershipAA_Struct {
uint32 ranks[MAX_RAID_LEADERSHIP_AA_ARRAY];
};
/**
* A bind point.
* Size: 20 Octets
*/
struct BindStruct {
/*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
/*016*/ float heading;
/*020*/
};
/**
* A bind point.
* Size: 20 Octets
*/
struct BindStruct {
/*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
/*016*/ float heading;
/*020*/
};
/*
@@ -698,8 +698,8 @@ sed -e 's/_t//g' -e 's/MAX_AA/MAX_PP_AA_ARRAY/g' \
-e 's/thirst/thirst_level/g' \
-e 's/guildstatus/guildrank/g' \
-e 's/airRemaining/air_remaining/g' \
*/
struct PlayerProfile_Struct
@@ -741,7 +741,7 @@ struct PlayerProfile_Struct
/*02264*/ uint8 face; // Player face
/*02265*/ uint8 unknown02264[47];
/*02312*/ uint32 spell_book[MAX_PP_SPELLBOOK]; // List of the Spells in spellbook
/*03912*/ uint8 unknown4184[448]; // all 0xff after last spell
/*03912*/ uint8 unknown4184[448]; // all 0xff after last spell
/*04360*/ uint32 mem_spells[MAX_PP_MEMSPELL]; // List of spells memorized
/*04396*/ uint8 unknown04396[32];
/*04428*/ uint32 platinum; // Platinum Pieces on player
@@ -752,7 +752,7 @@ struct PlayerProfile_Struct
/*04448*/ uint32 gold_cursor; // Gold Pieces on cursor
/*04452*/ uint32 silver_cursor; // Silver Pieces on cursor
/*04456*/ uint32 copper_cursor; // Copper Pieces on cursor
/*04460*/ uint32 skills[MAX_PP_SKILL]; // List of skills
/*04460*/ uint32 skills[MAX_PP_SKILL]; // List of skills
/*04760*/ uint8 unknown04760[236];
/*04996*/ uint32 toxicity; // Potion Toxicity (15=too toxic, each potion adds 3)
/*05000*/ uint32 thirst_level; // Drink (ticks till next drink)
@@ -778,7 +778,7 @@ struct PlayerProfile_Struct
/*13044*/ uint32 lastlogin; // character last save time
/*13048*/ uint32 timePlayedMin; // time character played
/*13052*/ uint8 pvp; // 1=pvp, 0=not pvp
/*13053*/ uint8 anon; // 2=roleplay, 1=anon, 0=not anon
/*13053*/ uint8 anon; // 2=roleplay, 1=anon, 0=not anon
/*13054*/ uint8 gm; // 0=no, 1=yes (guessing!)
/*13055*/ uint8 guildrank; // 0=member, 1=officer, 2=guildleader
/*13056*/ uint32 guildbanker;
@@ -791,7 +791,7 @@ struct PlayerProfile_Struct
/*13116*/ float x; // Players x position
/*13120*/ float y; // Players y position
/*13124*/ float z; // Players z position
/*13128*/ float heading; // Players heading
/*13128*/ float heading; // Players heading
/*13132*/ uint8 unknown13132[4]; // ***Placeholder
/*13136*/ uint32 platinum_bank; // Platinum Pieces in Bank
/*13140*/ uint32 gold_bank; // Gold Pieces in Bank
@@ -805,7 +805,7 @@ struct PlayerProfile_Struct
/*13260*/ uint8 unknown13260[16];
/*13276*/ uint16 zone_id; // see zones.h
/*13278*/ uint16 zoneInstance; // Instance id
/*13280*/ char groupMembers[MAX_GROUP_MEMBERS][64];// all the members in group, including self
/*13280*/ char groupMembers[MAX_GROUP_MEMBERS][64];// all the members in group, including self
/*13664*/ char groupLeader[64]; // Leader of the group ?
/*13728*/ uint8 unknown13728[656];
/*14384*/ uint32 entityid;
@@ -826,7 +826,7 @@ struct PlayerProfile_Struct
/*14572*/ uint32 tribute_active; // 0 = off, 1=on
/*14576*/ Tribute_Struct tributes[MAX_PLAYER_TRIBUTES]; // Current tribute loadout
/*14616*/ uint32 unknown14616;
/*14620*/ double group_leadership_exp;
/*14620*/ double group_leadership_exp;
/*14628*/ double raid_leadership_exp;
/*14640*/ uint32 group_leadership_points; // Unspent group lead AA points
/*14644*/ uint32 raid_leadership_points; // Unspent raid lead AA points
@@ -858,7 +858,7 @@ struct PlayerProfile_Struct
/*19580*/ uint32 showhelm; // 0=no, 1=yes
/*19584*/ uint8 unknown19584[4]; // ***Placeholder (10/27/2005)
/*19588*/ uint32 unknown19588; // *** Placeholder
/*19584*/
/*19584*/
};
@@ -969,7 +969,7 @@ struct BindWound_Struct
/*
** Type: Zone Change Request (before hand)
** Length: 88 bytes
** Length: 88 bytes
** OpCode: a320
*/
@@ -992,7 +992,7 @@ struct RequestClientZoneChange_Struct {
/*08*/ float x;
/*12*/ float z;
/*16*/ float heading;
/*20*/ uint32 type; //unknown... values
/*20*/ uint32 type; //unknown... values
};
struct Animation_Struct {
@@ -1272,13 +1272,13 @@ struct TradeMoneyUpdate_Struct{
** Surname struct
** Size: 100 bytes
*/
struct Surname_Struct
{
struct Surname_Struct
{
/*0000*/ char name[64];
/*0064*/ uint32 unknown0064;
/*0068*/ char lastname[32];
/*0100*/
};
};
struct GuildsListEntry_Struct {
char name[64];
@@ -1534,7 +1534,7 @@ struct Merchant_Click_Struct {
/*000*/ uint32 npcid; // Merchant NPC's entity id
/*004*/ uint32 playerid;
/*008*/ uint32 command; //1=open, 0=cancel/close
/*012*/ float rate; //cost multiplier, dosent work anymore
/*012*/ float rate; //cost multiplier, dosent work anymore
};
/*
Unknowns:
@@ -1635,7 +1635,7 @@ struct Illusion_Struct {
/*068*/ uint16 race;
/*070*/ char unknown070[2];
/*072*/ uint8 gender;
/*073*/ uint8 texture;
/*073*/ uint8 texture;
/*074*/ uint8 helmtexture;
/*075*/ uint8 unknown075;
/*076*/ uint32 face;
@@ -1686,14 +1686,14 @@ struct GroupCancel_Struct {
uint8 toggle;
};
struct GroupUpdate_Struct {
struct GroupUpdate_Struct {
/*0000*/ uint32 action;
/*0004*/ char yourname[64];
/*0068*/ char membername[5][64];
/*0388*/ char leadersname[64];
};
struct GroupUpdate2_Struct {
struct GroupUpdate2_Struct {
/*0000*/ uint32 action;
/*0004*/ char yourname[64];
/*0068*/ char membername[5][64];
@@ -1702,7 +1702,7 @@ struct GroupUpdate2_Struct {
/*0580*/ uint8 unknown[188];
/*0768*/
};
struct GroupJoin_Struct {
struct GroupJoin_Struct {
/*0000*/ uint32 action;
/*0004*/ char yourname[64];
/*0068*/ char membername[64];
@@ -1716,10 +1716,10 @@ struct FaceChange_Struct {
/*003*/ uint8 eyecolor2;
/*004*/ uint8 hairstyle;
/*005*/ uint8 beard; // vesuvias
/*006*/ uint8 face;
/*006*/ uint8 face;
//vesuvias:
//there are only 10 faces for barbs changing woad just
//increase the face value by ten so if there were 8 woad
//increase the face value by ten so if there were 8 woad
//designs then there would be 80 barb faces
};
@@ -1801,11 +1801,11 @@ struct Who_All_Struct { // 76 length total
/*140*/
};
struct Stun_Struct { // 4 bytes total
struct Stun_Struct { // 4 bytes total
uint32 duration; // Duration of stun
};
struct AugmentItem_Struct {
struct AugmentItem_Struct {
/*00*/ int16 container_slot;
/*02*/ char unknown02[2];
/*04*/ int32 augment_slot;
@@ -1819,11 +1819,11 @@ struct Emote_Struct {
/*1028*/
};
// Inspect
struct Inspect_Struct {
uint32 TargetID;
uint32 PlayerID;
};
// Inspect
struct Inspect_Struct {
uint32 TargetID;
uint32 PlayerID;
};
//OP_InspectAnswer
struct InspectResponse_Struct{//Cofruben:need to send two of this for the inspect response.
/*000*/ uint32 TargetID;
@@ -2005,7 +2005,7 @@ struct CloseContainer_Struct {
/*
** Generic Door Struct
** Length: 52 Octets
** Used in:
** Used in:
** cDoorSpawnsStruct(f721)
**
*/
@@ -2616,7 +2616,7 @@ struct Split_Struct
** Last Updated: Oct-15-2003
**
*/
struct NewCombine_Struct {
struct NewCombine_Struct {
/*00*/ int16 container_slot;
/*02*/ char unknown02[2];
/*04*/
@@ -2882,21 +2882,21 @@ struct UpdateLeadershipAA_Struct {
/*12*/
};
/**
* Leadership AA update
* Length: 32 Octets
* OpCode: LeadExpUpdate
*/
struct leadExpUpdateStruct {
/*0000*/ uint32 unknown0000; // All zeroes?
/*0004*/ uint32 group_leadership_exp; // Group leadership exp value
/*0008*/ uint32 group_leadership_points; // Unspent group points
/*0012*/ uint32 unknown0012; // Type?
/*0016*/ uint32 unknown0016; // All zeroes?
/*0020*/ uint32 raid_leadership_exp; // Raid leadership exp value
/*0024*/ uint32 raid_leadership_points; // Unspent raid points
/*0028*/ uint32 unknown0028;
};
/**
* Leadership AA update
* Length: 32 Octets
* OpCode: LeadExpUpdate
*/
struct leadExpUpdateStruct {
/*0000*/ uint32 unknown0000; // All zeroes?
/*0004*/ uint32 group_leadership_exp; // Group leadership exp value
/*0008*/ uint32 group_leadership_points; // Unspent group points
/*0012*/ uint32 unknown0012; // Type?
/*0016*/ uint32 unknown0016; // All zeroes?
/*0020*/ uint32 raid_leadership_exp; // Raid leadership exp value
/*0024*/ uint32 raid_leadership_points; // Unspent raid points
/*0028*/ uint32 unknown0028;
};
@@ -2939,7 +2939,7 @@ struct RaidDetails_Struct {
/*000*/ uint32 action; //=6,20
/*004*/ char leader_name[64];
/*068*/ uint32 unknown68[4];
/*084*/ LeadershipAA_Struct abilities; //ranks in backwards byte order
/*084*/ LeadershipAA_Struct abilities; //ranks in backwards byte order
/*128*/ uint8 unknown128[142];
/*354*/ uint32 leader_id;
};
@@ -3100,7 +3100,7 @@ struct AA_Action {
};
struct AA_Skills { //this should be removed and changed to AA_Array
/*00*/ uint32 aa_skill;
/*00*/ uint32 aa_skill;
/*04*/ uint32 aa_value;
};
@@ -3131,13 +3131,13 @@ struct AATable_Struct {
struct Weather_Struct {
uint32 val1; //generall 0x000000FF
uint32 type; //0x31=rain, 0x02=snow(i think), 0 = normal
uint32 mode;
uint32 mode;
};
struct ZoneInUnknown_Struct {
uint32 val1;
uint32 val2;
uint32 val3;
uint32 val3;
};
struct MobHealth_Struct {
+100 -100
View File
@@ -24,7 +24,7 @@ static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth);
void Register(EQStreamIdentifier &into) {
//create our opcode manager if we havent already
if(opcodes == nullptr) {
@@ -40,37 +40,37 @@ void Register(EQStreamIdentifier &into) {
return;
}
}
//ok, now we have what we need to register.
EQStream::Signature signature;
string pname;
//register our world signature.
pname = string(name) + "_world";
signature.ignore_eq_opcode = 0;
signature.first_length = sizeof(structs::LoginInfo_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_SendLoginInfo);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
//register our zone signature.
pname = string(name) + "_zone";
signature.ignore_eq_opcode = opcodes->EmuToEQ(OP_AckPacket);
signature.first_length = sizeof(structs::ClientZoneEntry_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_ZoneEntry);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
_log(NET__IDENTIFY, "Registered patch %s", name);
}
void Reload() {
//we have a big problem to solve here when we switch back to shared memory
//opcode managers because we need to change the manager pointer, which means
//we need to go to every stream and replace it's manager.
if(opcodes != nullptr) {
//TODO: get this file name from the config file
string opfile = "patch_";
@@ -100,7 +100,7 @@ std::string Strategy::Describe() const {
r += name;
return(r);
}
const EQClientVersion Strategy::ClientVersion() const
{
return EQClientUnderfoot;
@@ -117,7 +117,7 @@ static inline uint32 TitaniumToUnderfootSlot(uint32 TitaniumSlot) {
{
UnderfootSlot = TitaniumSlot + 1;
}
else if(TitaniumSlot >= 251 && TitaniumSlot <= 340) // Bag Slots for Normal Inventory and Cursor
else if(TitaniumSlot >= 251 && TitaniumSlot <= 340) // Bag Slots for Normal Inventory and Cursor
{
UnderfootSlot = TitaniumSlot + 11;
}
@@ -136,20 +136,20 @@ static inline uint32 TitaniumToUnderfootSlot(uint32 TitaniumSlot) {
else
{
UnderfootSlot = TitaniumSlot;
}
}
return UnderfootSlot;
}
// Converts Underfoot Slot IDs to Titanium Slot IDs for use in Decodes
static inline uint32 UnderfootToTitaniumSlot(uint32 UnderfootSlot) {
uint32 TitaniumSlot = 0;
if(UnderfootSlot >= 22 && UnderfootSlot <= 54) // Cursor/Ammo/Power Source and Normal Inventory Slots
{
TitaniumSlot = UnderfootSlot - 1;
}
else if(UnderfootSlot >= 262 && UnderfootSlot <= 351) // Bag Slots for Normal Inventory and Cursor
else if(UnderfootSlot >= 262 && UnderfootSlot <= 351) // Bag Slots for Normal Inventory and Cursor
{
TitaniumSlot = UnderfootSlot - 11;
}
@@ -188,7 +188,7 @@ ENCODE(OP_OpenNewTasksWindow) {
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
__emu_AvailableTaskHeader = (AvailableTaskHeader_Struct*)__emu_buffer;
@@ -224,7 +224,7 @@ ENCODE(OP_OpenNewTasksWindow) {
__eq_AvailableTaskData1->TaskID = __emu_AvailableTaskData1->TaskID;
// This next unknown seems to affect the colour of the task title. 0x3f80000 is what I have seen
// in Underfoot packets. Changing it to 0x3f000000 makes the title red.
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
__eq_AvailableTaskData1->TimeLimit = __emu_AvailableTaskData1->TimeLimit;
__eq_AvailableTaskData1->unknown2 = __emu_AvailableTaskData1->unknown2;
@@ -283,7 +283,7 @@ ENCODE(OP_OpenNewTasksWindow) {
}
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
@@ -291,8 +291,8 @@ ENCODE(OP_OpenNewTasksWindow) {
ENCODE(OP_SendCharInfo) {
ENCODE_LENGTH_EXACT(CharacterSelect_Struct);
SETUP_VAR_ENCODE(CharacterSelect_Struct);
//EQApplicationPacket *packet = *p;
//const CharacterSelect_Struct *emu = (CharacterSelect_Struct *) packet->pBuffer;
@@ -311,10 +311,10 @@ ENCODE(OP_SendCharInfo) {
+ namelen;
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, total_length);
//unsigned char *eq_buffer = new unsigned char[total_length];
//structs::CharacterSelect_Struct *eq_head = (structs::CharacterSelect_Struct *) eq_buffer;
eq->char_count = char_count;
eq->total_chars = 10;
@@ -361,9 +361,9 @@ ENCODE(OP_SendCharInfo) {
}
bufptr += sizeof(structs::CharacterSelectEntry_Struct);
}
FINISH_ENCODE();
}
ENCODE(OP_ZoneServerInfo) {
@@ -394,10 +394,10 @@ ENCODE(OP_SendZonepoints) {
ENCODE(OP_SendAATable) {
ENCODE_LENGTH_ATLEAST(SendAA_Struct);
SETUP_VAR_ENCODE(SendAA_Struct);
ALLOC_VAR_ENCODE(structs::SendAA_Struct, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability));
// Check clientver field to verify this AA should be sent for SoF
// clientver 1 is for all clients and 6 is for Underfoot
if (emu->clientver <= 6 )
@@ -474,13 +474,13 @@ ENCODE(OP_RespondAA) {
ENCODE(OP_PlayerProfile) {
SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct);
uint32 r;
eq->available_slots=0xffffffff;
memset(eq->unknown06284, 0xff, sizeof(eq->unknown06284));
memset(eq->unknown07284, 0xff, sizeof(eq->unknown07284));
// OUT(checksum);
OUT(gender);
OUT(race);
@@ -555,7 +555,7 @@ ENCODE(OP_PlayerProfile) {
OUT(thirst_level);
OUT(hunger_level);
//PS this needs to be figured out more; but it was 'good enough'
for(r = 0; r < structs::BUFF_COUNT; r++)
for(r = 0; r < structs::BUFF_COUNT; r++)
{
if(emu->buffs[r].spellid != 0xFFFF && emu->buffs[r].spellid != 0)
{
@@ -585,7 +585,7 @@ ENCODE(OP_PlayerProfile) {
OUT(aapoints_spent);
OUT(aapoints);
// OUT(unknown06160[4]);
//NOTE: new client supports 20 bandoliers, our internal rep
//NOTE: new client supports 20 bandoliers, our internal rep
//only supports 4..
for(r = 0; r < 4; r++) {
OUT_str(bandoliers[r].name);
@@ -708,10 +708,10 @@ const uint8 bytes[] = {
};
memcpy(eq->unknown18020, bytes, sizeof(bytes));
//set the checksum...
CRC32::SetEQChecksum(__packet->pBuffer, sizeof(structs::PlayerProfile_Struct)-4);
FINISH_ENCODE();
}
@@ -749,7 +749,7 @@ ENCODE(OP_NewZone) {
OUT(SuspendBuffs);
eq->FogDensity = emu->fog_density;
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown800 = -1;
eq->unknown844 = 600;
@@ -896,7 +896,7 @@ ENCODE(OP_Barter)
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
ENCODE(OP_BazaarSearch)
@@ -959,11 +959,11 @@ ENCODE(OP_ZoneSpawns) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Spawn_Struct *emu = (Spawn_Struct *) __emu_buffer;
//determine and verify length
int entrycount = in->size / sizeof(Spawn_Struct);
if(entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
@@ -972,7 +972,7 @@ ENCODE(OP_ZoneSpawns) {
return;
}
//_log(NET__STRUCTS, "Spawn name is [%s]", emu->name);
emu = (Spawn_Struct *) __emu_buffer;
@@ -981,7 +981,7 @@ ENCODE(OP_ZoneSpawns) {
char *Buffer = (char *) in->pBuffer;
int r;
int k;
for(r = 0; r < entrycount; r++, emu++) {
@@ -1154,7 +1154,7 @@ ENCODE(OP_ZoneSpawns) {
{
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0);
}
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->curHp);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->haircolor);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->beardcolor);
@@ -1212,8 +1212,8 @@ ENCODE(OP_ZoneSpawns) {
Position->deltaZ = emu->deltaZ;
Buffer += sizeof(structs::Spawn_Struct_Position);
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for(k = 0; k < 9; ++k)
{
@@ -1266,7 +1266,7 @@ ENCODE(OP_ZoneSpawns) {
dest->FastQueuePacket(&outapp, ack_req);
}
delete in;
}
@@ -1274,7 +1274,7 @@ ENCODE(OP_MercenaryDataResponse) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
MercenaryMerchantList_Struct *emu = (MercenaryMerchantList_Struct *) __emu_buffer;
@@ -1337,7 +1337,7 @@ ENCODE(OP_MercenaryDataUpdate) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
MercenaryDataUpdate_Struct *emu = (MercenaryDataUpdate_Struct *) __emu_buffer;
@@ -1413,7 +1413,7 @@ ENCODE(OP_ItemPacket) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
ItemPacket_Struct *old_item_pkt=(ItemPacket_Struct *)__emu_buffer;
InternalSerializedItem_Struct *int_struct=(InternalSerializedItem_Struct *)(old_item_pkt->SerializedItem);
@@ -1455,7 +1455,7 @@ ENCODE(OP_CharInventory) {
return;
}
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
@@ -1463,7 +1463,7 @@ ENCODE(OP_CharInventory) {
if(ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
_log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
delete in;
@@ -1476,7 +1476,7 @@ ENCODE(OP_CharInventory) {
in->pBuffer = new uchar[4];
*(uint32 *)in->pBuffer = ItemCount;
in->size = 4;
for(int r = 0; r < ItemCount; r++, eq++) {
@@ -1520,39 +1520,39 @@ ENCODE(OP_GuildMemberList) {
//consume the packet
EQApplicationPacket *in = *p;
*p = nullptr;
//store away the emu struct
unsigned char *__emu_buffer = in->pBuffer;
Internal_GuildMembers_Struct *emu = (Internal_GuildMembers_Struct *) in->pBuffer;
//make a new EQ buffer.
uint32 pnl = strlen(emu->player_name);
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
uint32 length = sizeof(structs::GuildMembers_Struct) + pnl +
emu->count*sizeof(structs::GuildMemberEntry_Struct)
+ emu->name_length + emu->note_length;
in->pBuffer = new uint8[length];
in->size = length;
//no memset since we fill every byte.
uint8 *buffer;
buffer = in->pBuffer;
//easier way to setup GuildMembers_Struct
//set prefix name
strcpy((char *)buffer, emu->player_name);
buffer += pnl;
*buffer = '\0';
buffer++;
//add member count.
*((uint32 *) buffer) = htonl( emu->count );
buffer += sizeof(uint32);
if(emu->count > 0) {
Internal_GuildMemberEntry_Struct *emu_e = emu->member;
const char *emu_name = (const char *) (__emu_buffer +
const char *emu_name = (const char *) (__emu_buffer +
sizeof(Internal_GuildMembers_Struct) + //skip header
emu->count * sizeof(Internal_GuildMemberEntry_Struct) //skip static length member data
);
@@ -1560,12 +1560,12 @@ ENCODE(OP_GuildMemberList) {
emu->name_length + //skip name contents
emu->count //skip string terminators
);
structs::GuildMemberEntry_Struct *e = (structs::GuildMemberEntry_Struct *) buffer;
uint32 r;
for(r = 0; r < emu->count; r++, emu_e++) {
//the order we set things here must match the struct
//nice helper macro
@@ -1581,7 +1581,7 @@ ENCODE(OP_GuildMemberList) {
}
#define PutFieldN(field) \
e->field = htonl(emu_e->field)
SlideStructString( name, emu_name );
PutFieldN(level);
PutFieldN(banker);
@@ -1595,15 +1595,15 @@ ENCODE(OP_GuildMemberList) {
SlideStructString( public_note, emu_note );
e->zoneinstance = 0;
e->zone_id = htons(emu_e->zone_id);
#undef SlideStructString
#undef PutFieldN
e++;
}
}
delete[] __emu_buffer;
@@ -1656,7 +1656,7 @@ ENCODE(OP_GroundSpawn)
in->size = strlen(emu->object_name) + 58;
in->pBuffer = new unsigned char[in->size];
char *OutBuffer = (char *)in->pBuffer;
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->drop_id);
@@ -1669,7 +1669,7 @@ ENCODE(OP_GroundSpawn)
// This next field is actually a float. There is a groundspawn in freeportwest (sack of money sitting on some barrels) which requires this
// field to be set to (float)255.0 to appear at all, and also the size field below to be 5, to be the correct size. I think SoD has the same
// issue.
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, 0);
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, 0);
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, 0); // Unknown, observed 0
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, 0); // This appears to be the size field.
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->y);
@@ -1681,7 +1681,7 @@ ENCODE(OP_GroundSpawn)
VARSTRUCT_ENCODE_TYPE(uint8, OutBuffer, 0); // Unknown, observed 0x00
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
@@ -1775,7 +1775,7 @@ ENCODE(OP_LogServer) {
ENCODE_LENGTH_EXACT(LogServer_Struct);
SETUP_DIRECT_ENCODE(LogServer_Struct, structs::LogServer_Struct);
strcpy(eq->worldshortname, emu->worldshortname);
OUT(enablevoicemacros);
OUT(enablemail);
OUT(enable_pvp);
@@ -1796,7 +1796,7 @@ ENCODE(OP_LogServer) {
eq->unknown263[23] = 0x80;
eq->unknown263[24] = 0x3f;
eq->unknown263[33] = 1;
FINISH_ENCODE();
}
@@ -2038,7 +2038,7 @@ ENCODE(OP_Stun) {
FINISH_ENCODE();
}
ENCODE(OP_ZonePlayerToBind)
ENCODE(OP_ZonePlayerToBind)
{
ENCODE_LENGTH_ATLEAST(ZonePlayerToBind_Struct);
ZonePlayerToBind_Struct *zps = (ZonePlayerToBind_Struct*)(*p)->pBuffer;
@@ -2091,7 +2091,7 @@ ENCODE(OP_AdventureMerchantSell) {
FINISH_ENCODE();
}
ENCODE(OP_RaidUpdate)
ENCODE(OP_RaidUpdate)
{
EQApplicationPacket *inapp = *p;
*p = nullptr;
@@ -2104,7 +2104,7 @@ ENCODE(OP_RaidUpdate)
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
add_member->raidGen.action = in_add_member->raidGen.action;
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
@@ -2181,7 +2181,7 @@ ENCODE(OP_VetRewardsAvaliable)
old_data += sizeof(InternalVeteranReward);
data += sizeof(structs::VeteranReward);
}
dest->FastQueuePacket(&outapp_create);
delete inapp;
}
@@ -2289,7 +2289,7 @@ ENCODE(OP_GroupUpdate)
EQApplicationPacket *in = *p;
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
//_log(NET__ERROR, "Received outgoing OP_GroupUpdate with action code %i", gjs->action);
if((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
{
@@ -2335,10 +2335,10 @@ ENCODE(OP_GroupUpdate)
{
// Group Update2
//_log(NET__ERROR, "Struct is GroupUpdate2");
unsigned char *__emu_buffer = in->pBuffer;
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*) __emu_buffer;
//_log(NET__ERROR, "Yourname is %s", gu2->yourname);
int MemberCount = 1;
@@ -2360,7 +2360,7 @@ ENCODE(OP_GroupUpdate)
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
char *Buffer = (char *)outapp->pBuffer;
// Header
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // Think this should be SpawnID, but it doesn't seem to matter
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, MemberCount);
@@ -2368,7 +2368,7 @@ ENCODE(OP_GroupUpdate)
// Leader
//
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0);
VARSTRUCT_ENCODE_STRING(Buffer, gu2->yourname);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0);
@@ -2410,7 +2410,7 @@ ENCODE(OP_GroupUpdate)
GLAAus->NPCMarkerID = gu2->NPCMarkerID;
memcpy(&GLAAus->LeaderAAs, &gu2->leader_aas, sizeof(GLAAus->LeaderAAs));
dest->FastQueuePacket(&outapp);
delete in;
@@ -2448,7 +2448,7 @@ ENCODE(OP_ChannelMessage)
in->size = strlen(emu->sender) + 1 + strlen(emu->targetname) + 1 + strlen(emu->message) + 1 + 36;
in->pBuffer = new unsigned char[in->size];
char *OutBuffer = (char *)in->pBuffer;
VARSTRUCT_ENCODE_STRING(OutBuffer, emu->sender);
@@ -2496,7 +2496,7 @@ ENCODE(OP_GuildsList)
}
InBuffer += 64;
}
PacketSize++; // Appears to be an extra 0x00 at the very end.
in->size = PacketSize;
@@ -2583,7 +2583,7 @@ ENCODE(OP_DzMemberList)
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].status, sizeof(char));
}
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
@@ -2640,7 +2640,7 @@ ENCODE(OP_DzLeaderStatus)
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//1
ss.write((const char*)&client_id, sizeof(uint32));
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
@@ -2754,7 +2754,7 @@ ENCODE(OP_SpawnAppearance)
dest->FastQueuePacket(&in, ack_req);
return;
}
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ChangeSize, sizeof(ChangeSize_Struct));
ChangeSize_Struct *css = (ChangeSize_Struct *)outapp->pBuffer;
@@ -2765,7 +2765,7 @@ ENCODE(OP_SpawnAppearance)
css->Unknown12 = 1.0f;
dest->FastQueuePacket(&outapp, ack_req);
delete in;
}
@@ -2779,7 +2779,7 @@ ENCODE(OP_DisciplineUpdate)
FINISH_ENCODE();
}
ENCODE(OP_AltCurrencySell)
ENCODE(OP_AltCurrencySell)
{
ENCODE_LENGTH_EXACT(AltCurrencySellItem_Struct);
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
@@ -2802,7 +2802,7 @@ ENCODE(OP_AltCurrency)
if(opcode == 8) {
AltCurrencyPopulate_Struct *populate = (AltCurrencyPopulate_Struct*)emu_buffer;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(structs::AltCurrencyPopulate_Struct)
EQApplicationPacket *outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(structs::AltCurrencyPopulate_Struct)
+ sizeof(structs::AltCurrencyPopulateEntry_Struct) * populate->count);
structs::AltCurrencyPopulate_Struct *out_populate = (structs::AltCurrencyPopulate_Struct*)outapp->pBuffer;
@@ -2967,7 +2967,7 @@ DECODE(OP_ItemLinkClick) {
DECODE_LENGTH_EXACT(structs::ItemViewRequest_Struct);
SETUP_DIRECT_DECODE(ItemViewRequest_Struct, structs::ItemViewRequest_Struct);
MEMSET_IN(ItemViewRequest_Struct);
IN(item_id);
int r;
for (r = 0; r < 5; r++) {
@@ -2975,7 +2975,7 @@ DECODE(OP_ItemLinkClick) {
}
IN(link_hash);
IN(icon);
FINISH_DIRECT_DECODE();
}
@@ -3018,7 +3018,7 @@ DECODE(OP_ShopPlayerBuy)
}
DECODE(OP_ClientUpdate) {
// for some odd reason, there is an extra byte on the end of this on occasion..
// for some odd reason, there is an extra byte on the end of this on occasion..
DECODE_LENGTH_ATLEAST(structs::PlayerPositionUpdateClient_Struct);
SETUP_DIRECT_DECODE(PlayerPositionUpdateClient_Struct, structs::PlayerPositionUpdateClient_Struct);
IN(spawn_id);
@@ -3049,7 +3049,7 @@ DECODE(OP_CharacterCreate) {
emu->start_zone = RuleI(World, TutorialZoneID);
else
emu->start_zone = eq->start_zone;
IN(haircolor);
IN(deity);
IN(STR);
@@ -3081,7 +3081,7 @@ DECODE(OP_WhoAllRequest) {
IN(gmlookup);
IN(guildid);
IN(type);
FINISH_DIRECT_DECODE();
}
@@ -3683,7 +3683,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
Underfoot::structs::ItemTertiaryBodyStruct itbs;
memset(&itbs, 0, sizeof(Underfoot::structs::ItemTertiaryBodyStruct));
itbs.loregroup = item->LoreGroup;
itbs.artifact = item->ArtifactFlag;
itbs.summonedflag = item->SummonedFlag;
@@ -3881,7 +3881,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
uint32 SubLengths[10];
for(int x = 0; x < 10; ++x) {
SubSerializations[x] = nullptr;
const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x);
@@ -3927,7 +3927,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
return item_serial;
}
DECODE(OP_AltCurrencySellSelection)
DECODE(OP_AltCurrencySellSelection)
{
DECODE_LENGTH_EXACT(structs::AltCurrencySelectItem_Struct);
SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct);
@@ -3936,7 +3936,7 @@ DECODE(OP_AltCurrencySellSelection)
FINISH_DIRECT_DECODE();
}
DECODE(OP_AltCurrencySell)
DECODE(OP_AltCurrencySell)
{
DECODE_LENGTH_EXACT(structs::AltCurrencySellItem_Struct);
SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
+10 -10
View File
@@ -6,30 +6,30 @@
class EQStreamIdentifier;
namespace Underfoot {
//these are the only public member of this namespace.
extern void Register(EQStreamIdentifier &into);
extern void Reload();
//you should not directly access anything below..
//you should not directly access anything below..
//I just dont feel like making a seperate header for it.
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "SSDeclare.h"
#include "Underfoot_ops.h"
};
};
+29 -29
View File
@@ -331,7 +331,7 @@ struct Spawn_Struct
/*0000*/ //char suffix[0]; // only read if(hasTitleOrSuffix & 8)
char unknown20[8];
uint8 IsMercenary; // If NPC == 1 and this == 1, then the NPC name is Orange.
/*0000*/ char unknown21[28];
/*0000*/ char unknown21[28];
};
@@ -561,7 +561,7 @@ struct SpellBuffFade_Struct_Underfoot {
/*012*/ uint32 spellid;
/*016*/ uint32 duration;
/*020*/ uint32 unknown016;
/*024*/ uint32 playerId; // Global player ID?
/*024*/ uint32 playerId; // Global player ID?
/*028*/ uint32 unknown020;
/*032*/ uint8 unknown0028[48];
/*080*/ uint32 slotid;
@@ -645,7 +645,7 @@ struct CharCreate_Struct
{
/*0000*/ uint32 class_;
/*0004*/ uint32 haircolor;
/*0008*/ uint32 beard;
/*0008*/ uint32 beard;
/*0012*/ uint32 beardcolor;
/*0016*/ uint32 gender;
/*0020*/ uint32 race;
@@ -871,7 +871,7 @@ struct PlayerProfile_Struct
/*04176*/ uint32 INT; // Intelligence - 3c 00 00 00 - 60
/*04180*/ uint32 AGI; // Agility - 5f 00 00 00 - 95
/*04184*/ uint32 WIS; // Wisdom - 46 00 00 00 - 70
/*04188*/ uint8 unknown04188[28]; //
/*04188*/ uint8 unknown04188[28]; //
/*04216*/ uint8 face; // Player face - Actually uint32?
/*04217*/ uint8 unknown04217[147]; // was [175]
/*04364*/ uint32 spell_book[MAX_PP_SPELLBOOK]; // List of the Spells in spellbook 720 = 90 pages [2880] was [1920]
@@ -906,7 +906,7 @@ struct PlayerProfile_Struct
/*18008*/ uint8 unknown18008[8];
/*18016*/ uint32 available_slots;
/*18020*/ uint8 unknown18020[80]; //
//END SUB-STRUCT used for shrouding.
//END SUB-STRUCT used for shrouding.
/*18100*/ char name[64]; // Name of player
/*18164*/ char last_name[32]; // Last name of player
/*18196*/ uint8 unknown18196[8]; //#### Not In Titanium #### new to SoF[12]
@@ -1000,7 +1000,7 @@ struct PlayerProfile_Struct
/*25584*/ uint32 level3; // SoF looks at the level here to determine how many leadership AA you can bank.
/*25588*/ uint32 showhelm; // 0=no, 1=yes
/*25592*/ uint32 RestTimer;
/*25596*/ uint8 unknown25596[1036]; // ***Placeholder (2/13/2007) was[1028]or[940]or[1380] - END of Struct
/*25596*/ uint8 unknown25596[1036]; // ***Placeholder (2/13/2007) was[1028]or[940]or[1380] - END of Struct
/*26632*/
};
@@ -1247,7 +1247,7 @@ struct CombatDamage_Struct
/* 19 */ uint8 unknown19[9]; // was [9]
/* 28 */
};
/*
** Consider Struct
@@ -1260,7 +1260,7 @@ struct Consider_Struct{
/*012*/ uint32 level; // Level
/*016*/ uint8 pvpcon; // Pvp con flag 0/1
/*017*/ uint8 unknown017[3]; //
/*020*/
/*020*/
};
/*
@@ -1383,14 +1383,14 @@ struct PlayerPositionUpdateClient_Struct
/*0012*/ float y_pos; // y coord (1st loc value)
/*0016*/ signed delta_heading:10; // change in heading
unsigned padding0036:10; // animation
unsigned padding0016:12; // ***Placeholder
unsigned padding0016:12; // ***Placeholder
/*0020*/ float delta_x; // Change in x
/*0024*/ float delta_y; // Change in y
/*0028*/ float z_pos; // z coord (3rd loc value)
/*0032*/ float delta_z; // Change in z
/*0036*/ unsigned animation:10; // ***Placeholder
/*0036*/ unsigned animation:10; // ***Placeholder
unsigned heading:12; // Directional heading
unsigned padding0037:10; // ***Placeholder
unsigned padding0037:10; // ***Placeholder
/*0040*/
};
@@ -1937,7 +1937,7 @@ struct AdventureLeaderboard_Struct
/*008*/ uint32 success;
/*012*/ uint32 failure;
/*016*/ uint32 our_rank;
/*020*/
/*020*/
};
/*struct Item_Shop_Struct {
@@ -1962,15 +1962,15 @@ struct Illusion_Struct { //size: 256
/*079*/ uint8 unknown079; //
/*080*/ uint32 face; //
/*084*/ uint8 hairstyle; // Some Races don't change Hair Style Properly in SoF
/*085*/ uint8 haircolor; //
/*086*/ uint8 beard; //
/*087*/ uint8 beardcolor; //
/*088*/ float size; //
/*085*/ uint8 haircolor; //
/*086*/ uint8 beard; //
/*087*/ uint8 beardcolor; //
/*088*/ float size; //
/*092*/ uint8 unknown092[148];
/*240*/ uint32 unknown240; // Removes armor?
/*244*/ uint32 drakkin_heritage; //
/*248*/ uint32 drakkin_tattoo; //
/*252*/ uint32 drakkin_details; //
/*244*/ uint32 drakkin_heritage; //
/*248*/ uint32 drakkin_tattoo; //
/*252*/ uint32 drakkin_details; //
/*256*/
};
@@ -2330,7 +2330,7 @@ struct BookRequest_Struct {
/*0000*/ uint32 window; // where to display the text (0xFFFFFFFF means new window).
/*0004*/ uint32 invslot; // The inventory slot the book is in. Not used, but echoed in the response packet.
/*0008*/ uint32 type; // 0 = Scroll, 1 = Book, 2 = Item Info. Possibly others
/*0012*/ uint32 unknown0012;
/*0012*/ uint32 unknown0012;
/*0016*/ uint16 unknown0016;
/*0018*/ char txtfile[8194];
};
@@ -2431,7 +2431,7 @@ struct Door_Struct
/*0054*/ uint8 unknown0054[4]; // 00 00 00 00
/*0060*/ uint8 doorId; // door's id #
/*0061*/ uint8 opentype;
/*0062*/ uint8 state_at_spawn;
/*0062*/ uint8 state_at_spawn;
/*0063*/ uint8 invert_state; // if this is 1, the door is normally open
/*0064*/ uint32 door_param; // normally ff ff ff ff (-1)
/*0068*/ uint32 unknown0068; // 00 00 00 00
@@ -2735,7 +2735,7 @@ struct Tracking_Struct_New {
struct Track_Struct_New {
uint16 entityid; // Entity ID
uint16 unknown002; // 00 00
uint32 unknown004; //
uint32 unknown004; //
uint8 level; // level of mob
uint8 unknown009; // 01 maybe type of mob? player/npc?
char name[1]; // name of mob
@@ -3942,7 +3942,7 @@ struct ItemBodyStruct
uint32 icon;
uint8 unknown1;
uint8 unknown2;
uint32 BenefitFlag;
uint32 BenefitFlag;
uint8 tradeskills;
int8 CR;
int8 DR;
@@ -4045,9 +4045,9 @@ struct ItemTertiaryBodyStruct
uint8 no_transfer;
uint16 expendablearrow;
uint32 unknown8;
uint32 unknown9;
uint32 unknown10;
uint32 unknown8;
uint32 unknown9;
uint32 unknown10;
uint32 unknown11;
uint8 unknown12;
uint8 unknown13;
@@ -4148,7 +4148,7 @@ struct ItemQuaternaryBodyStruct
int32 clairvoyance;
uint8 unknown18; //Power Source Capacity or evolve filename?
uint32 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown19;
uint8 unknown19;
uint32 unknown20; // Bard Stuff?
uint32 unknown21;
uint32 unknown22;
@@ -4295,7 +4295,7 @@ struct MercenaryListEntry_Struct {
/*0041*/ uint32 MercUnk02; // Unknown (normally see 1, but sometimes 2 or 0)
/*0045*/ uint32 StanceCount; // Iterations of MercenaryStance_Struct - Normally 2 to 4 seen
/*0049*/ int32 MercUnk03; // Unknown (always 0 at merchant) - Seen on active merc: 93 a4 03 77, b8 ed 2f 26, 88 d5 8b c3, and 93 a4 ad 77
/*0053*/ uint8 MercUnk04; // Seen 1
/*0053*/ uint8 MercUnk04; // Seen 1
/*0054*/ MercenaryStance_Struct Stances[1]; // Count Varies, but hard set to 2 for now - From dbstr_us.txt - 1^24^Passive^0, 2^24^Balanced^0, etc (1 to 9 as of April 2012)
};
@@ -4342,7 +4342,7 @@ struct MercenaryData_Struct {
// [OPCode: 0x6537] On Live as of April 2 2012 [Server->Client]
// Should be named OP_MercenaryDataResponse, but the current opcode using that name should be renamed first
// Size varies if mercenary is hired or if browsing Mercenary Merchant
// This may also be the response for Client->Server 0x0327 (size 0) packet On Live as of April 2 2012
// This may also be the response for Client->Server 0x0327 (size 0) packet On Live as of April 2 2012
struct MercenaryDataUpdate_Struct {
/*0000*/ int32 MercStatus; // Seen 0 with merc and -1 with no merc hired
/*0004*/ uint32 MercCount; // Seen 1 with 1 merc hired and 0 with no merc hired
+13 -13
View File
@@ -12,7 +12,7 @@ namespace TEMPLATE {
static const char *name = "CHANGEME";
static OpcodeManager *opcodes = NULL;
static Strategy struct_strategy;
void Register(EQStreamIdentifier &into) {
//create our opcode manager if we havent already
if(opcodes == NULL) {
@@ -27,16 +27,16 @@ void Register(EQStreamIdentifier &into) {
return;
}
}
//ok, now we have what we need to register.
EQStream::Signature signature;
//register our world signature.
signature.first_length = sizeof(structs::LoginInfo_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_SendLoginInfo);
into.RegisterPatch(signature, name, &opcodes, &struct_strategy);
//register our zone signature.
signature.first_length = sizeof(structs::ClientZoneEntry_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_ZoneEntry);
@@ -44,11 +44,11 @@ void Register(EQStreamIdentifier &into) {
}
void Reload() {
//we have a big problem to solve here when we switch back to shared memory
//opcode managers because we need to change the manager pointer, which means
//we need to go to every stream and replace it's manager.
if(opcodes != NULL) {
//TODO: get this file name from the config file
string opfile = "patch_";
@@ -85,17 +85,17 @@ std::string Strategy::Describe() const {
/*ENCODE(OP_PlayerProfile) {
SETUP_DIRECT(PlayerProfile_Struct, structs::PlayerProfile_Struct);
FINISH_DIRECT();
}
ENCODE(OP_NewZone) {
SETUP_DIRECT(PlayerProfile_Struct, structs::PlayerProfile_Struct);
FINISH_DIRECT();
}*/
+10 -10
View File
@@ -6,30 +6,30 @@
class EQStreamIdentifier;
namespace TEMPLATE {
//these are the only public member of this namespace.
extern void Register(EQStreamIdentifier &into);
extern void Reload();
//you should not directly access anything below..
//you should not directly access anything below..
//I just dont feel like making a seperate header for it.
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcodes
#include "SSDeclare.h"
#include "TEMPLATE_ops.h"
};
};