Added namespace Convert:: to contain all of the player profile and corpse related structs so that when any of the structs change else where in the code, it does not break the conversion scripts. These are self contained structs just for the conversion scripts.

This commit is contained in:
Akkadius 2014-11-24 01:12:12 -06:00
parent 3c2b8d13b9
commit a5207b58e1
2 changed files with 381 additions and 57 deletions

View File

@ -920,7 +920,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
unsigned int lengths;
unsigned int lengths_e;
std::string squery;
PlayerProfile_Struct* pp;
Convert::PlayerProfile_Struct* pp;
ExtendedProfile_Struct* e_pp;
uint32 pplen = 0;
uint32 i;
@ -1357,7 +1357,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
squery = StringFormat("SELECT `id`, `profile`, `name`, `level`, `account_id`, `firstlogon`, `lfg`, `lfp`, `mailkey`, `xtargets`, `inspectmessage`, `extprofile` FROM `character_` WHERE `id` = %i", atoi(row[0]));
auto results2 = QueryDatabase(squery);
auto row2 = results2.begin();
pp = (PlayerProfile_Struct*)row2[1];
pp = (Convert::PlayerProfile_Struct*)row2[1];
e_pp = (ExtendedProfile_Struct*)row2[11];
character_id = atoi(row[0]);
account_id = atoi(row2[4]);
@ -1371,13 +1371,13 @@ bool Database::CheckDatabaseConvertPPDeblob(){
/* Verify PP Integrity */
lengths = results2.LengthOfColumn(1);
if (lengths == sizeof(PlayerProfile_Struct)) { /* If PP is the size it is expected to be */
memcpy(pp, row2[1], sizeof(PlayerProfile_Struct));
if (lengths == sizeof(Convert::PlayerProfile_Struct)) { /* If PP is the size it is expected to be */
memcpy(pp, row2[1], sizeof(Convert::PlayerProfile_Struct));
}
/* Continue of PP Size does not match (Usually a created character never logged in) */
else {
// printf("%s ID: %i profile mismatch, not converting. PP %u - Profile Length %u \n", row2[2] ? row2[2] : "Unknown", character_id, sizeof(PlayerProfile_Struct), lengths);
std::cout << (row2[2] ? row2[2] : "Unknown") << " ID: " << character_id << " size mismatch. Expected Size: " << sizeof(PlayerProfile_Struct) << " Seen: " << lengths << std::endl;
std::cout << (row2[2] ? row2[2] : "Unknown") << " ID: " << character_id << " size mismatch. Expected Size: " << sizeof(Convert::PlayerProfile_Struct) << " Seen: " << lengths << std::endl;
continue;
}
@ -1730,7 +1730,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
e_pp->aa_effects,
e_pp->perAA,
e_pp->expended_aa
);
);
results = QueryDatabase(rquery);
@ -2065,8 +2065,8 @@ bool Database::CheckDatabaseConvertBotsPostPPDeblob(){
}
bool Database::CheckDatabaseConvertCorpseDeblob(){
DBPlayerCorpse_Struct_temp* dbpc;
classic_db_temp::DBPlayerCorpse_Struct_temp* dbpc_c;
Convert::DBPlayerCorpse_Struct_temp* dbpc;
Convert::classic_db_temp::DBPlayerCorpse_Struct_temp* dbpc_c;
uint32 in_datasize;
bool is_sof = false;
std::string c_type;
@ -2083,8 +2083,8 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){
auto results2 = QueryDatabase(squery);
for (auto row2 = results2.begin(); row2 != results2.end(); ++row2) {
in_datasize = results2.LengthOfColumn(2);
dbpc = (DBPlayerCorpse_Struct_temp*)row2[2];
dbpc_c = (classic_db_temp::DBPlayerCorpse_Struct_temp*)row2[2];
dbpc = (Convert::DBPlayerCorpse_Struct_temp*)row2[2];
dbpc_c = (Convert::classic_db_temp::DBPlayerCorpse_Struct_temp*)row2[2];
if (dbpc == nullptr)
continue;
@ -2093,8 +2093,8 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){
/* SoF+ */
uint32 esize1 = (sizeof(DBPlayerCorpse_Struct_temp)+(dbpc->itemcount * sizeof(player_lootitem_temp::ServerLootItem_Struct_temp)));
uint32 esize2 = (sizeof(classic_db_temp::DBPlayerCorpse_Struct_temp) + (dbpc_c->itemcount * sizeof(player_lootitem_temp::ServerLootItem_Struct_temp)));
uint32 esize1 = (sizeof(Convert::DBPlayerCorpse_Struct_temp) + (dbpc->itemcount * sizeof(Convert::player_lootitem_temp::ServerLootItem_Struct_temp)));
uint32 esize2 = (sizeof(Convert::classic_db_temp::DBPlayerCorpse_Struct_temp) + (dbpc_c->itemcount * sizeof(Convert::player_lootitem_temp::ServerLootItem_Struct_temp)));
/* SoF */
if (in_datasize == esize1) {

View File

@ -95,54 +95,345 @@ class PTimerList;
#pragma pack(1)
namespace player_lootitem_temp
{
struct ServerLootItem_Struct_temp {
uint32 item_id;
int16 equipSlot;
uint8 charges;
uint16 lootslot;
uint32 aug1;
uint32 aug2;
uint32 aug3;
uint32 aug4;
uint32 aug5;
/* Conversion Structs */
namespace Convert {
struct BindStruct {
/*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
/*016*/ float heading;
};
struct Color_Struct
{
union
{
struct
{
uint8 blue;
uint8 green;
uint8 red;
uint8 use_tint; // if there's a tint this is FF
} rgb;
uint32 color;
};
};
struct AA_Array
{
uint32 AA;
uint32 value;
};
struct SpellBuff_Struct
{
/*000*/ uint8 slotid; //badly named... seems to be 2 for a real buff, 0 otherwise
/*001*/ uint8 level;
/*002*/ uint8 bard_modifier;
/*003*/ uint8 effect; //not real
/*004*/ uint32 spellid;
/*008*/ uint32 duration;
/*012*/ uint32 counters;
/*016*/ uint32 player_id; //'global' ID of the caster, for wearoff messages
/*020*/
};
struct Tribute_Struct {
uint32 tribute;
uint32 tier;
};
struct Disciplines_Struct {
uint32 values[MAX_PP_DISCIPLINES];
};
struct GroupLeadershipAA_Struct {
union {
struct {
uint32 groupAAMarkNPC;
uint32 groupAANPCHealth;
uint32 groupAADelegateMainAssist;
uint32 groupAADelegateMarkNPC;
uint32 groupAA4;
uint32 groupAA5;
uint32 groupAAInspectBuffs;
uint32 groupAA7;
uint32 groupAASpellAwareness;
uint32 groupAAOffenseEnhancement;
uint32 groupAAManaEnhancement;
uint32 groupAAHealthEnhancement;
uint32 groupAAHealthRegeneration;
uint32 groupAAFindPathToPC;
uint32 groupAAHealthOfTargetsTarget;
uint32 groupAA15;
};
uint32 ranks[MAX_GROUP_LEADERSHIP_AA_ARRAY];
};
};
}
struct DBPlayerCorpse_Struct_temp {
uint32 crc;
bool locked;
uint32 itemcount;
uint32 exp;
float size;
uint8 level;
uint8 race;
uint8 gender;
uint8 class_;
uint8 deity;
uint8 texture;
uint8 helmtexture;
uint32 copper;
uint32 silver;
uint32 gold;
uint32 plat;
Color_Struct item_tint[9];
uint8 haircolor;
uint8 beardcolor;
uint8 eyecolor1;
uint8 eyecolor2;
uint8 hairstyle;
uint8 face;
uint8 beard;
uint32 drakkin_heritage;
uint32 drakkin_tattoo;
uint32 drakkin_details;
player_lootitem_temp::ServerLootItem_Struct_temp items[0];
};
struct RaidLeadershipAA_Struct {
union {
struct {
uint32 raidAAMarkNPC;
uint32 raidAANPCHealth;
uint32 raidAADelegateMainAssist;
uint32 raidAADelegateMarkNPC;
uint32 raidAA4;
uint32 raidAA5;
uint32 raidAA6;
uint32 raidAASpellAwareness;
uint32 raidAAOffenseEnhancement;
uint32 raidAAManaEnhancement;
uint32 raidAAHealthEnhancement;
uint32 raidAAHealthRegeneration;
uint32 raidAAFindPathToPC;
uint32 raidAAHealthOfTargetsTarget;
uint32 raidAA14;
uint32 raidAA15;
};
uint32 ranks[MAX_RAID_LEADERSHIP_AA_ARRAY];
};
};
struct LeadershipAA_Struct {
union {
struct {
Convert::GroupLeadershipAA_Struct group;
Convert::RaidLeadershipAA_Struct raid;
};
uint32 ranks[MAX_LEADERSHIP_AA_ARRAY];
};
};
typedef struct
{
/*00*/ char Name[64];
/*64*/ uint32 Level;
/*68*/ uint32 Race;
/*72*/ uint32 Class;
/*76*/ uint32 Zone;
/*80*/ uint32 Time;
/*84*/ uint32 Points;
/*88*/
} PVPStatsEntry_Struct;
struct BandolierItem_Struct {
uint32 item_id;
uint32 icon;
char item_name[64];
};
struct Bandolier_Struct {
char name[32];
Convert::BandolierItem_Struct items[EmuConstants::BANDOLIER_SIZE];
};
struct PotionBelt_Struct {
Convert::BandolierItem_Struct items[EmuConstants::POTION_BELT_SIZE];
};
struct SuspendedMinion_Struct
{
/*000*/ uint16 SpellID;
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ uint32 Items[_MaterialCount];
/*546*/ char Name[64];
/*610*/
};
struct PlayerProfile_Struct {
/*0000*/ uint32 checksum; // Checksum from CRC32::SetEQChecksum
/*0004*/ char name[64]; // Name of player sizes not right
/*0068*/ char last_name[32]; // Last name of player sizes not right
/*0100*/ uint32 gender; // Player Gender - 0 Male, 1 Female
/*0104*/ uint32 race; // Player race
/*0108*/ uint32 class_; // Player class
/*0112*/ uint32 unknown0112; //
/*0116*/ uint32 level; // Level of player (might be one byte)
/*0120*/ Convert::BindStruct binds[5]; // Bind points (primary is first, home city is fifth)
/*0220*/ uint32 deity; // deity
/*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;
/*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 guildbanker;
/*0246*/ uint8 unknown0246[6]; //
/*0252*/ uint32 intoxication;
/*0256*/ uint32 spellSlotRefresh[MAX_PP_REF_MEMSPELL]; //in ms
/*0292*/ uint32 abilitySlotRefresh;
/*0296*/ uint8 haircolor; // Player hair color
/*0297*/ uint8 beardcolor; // Player beard color
/*0298*/ uint8 eyecolor1; // Player left eye color
/*0299*/ uint8 eyecolor2; // Player right eye color
/*0300*/ uint8 hairstyle; // Player hair style
/*0301*/ uint8 beard; // Beard type
/*0302*/ uint8 ability_time_seconds; //The following four spots are unknown right now.....
/*0303*/ uint8 ability_number; //ability used
/*0304*/ uint8 ability_time_minutes;
/*0305*/ uint8 ability_time_hours; //place holder
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
/*0312*/ uint32 item_material[_MaterialCount]; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ Convert::Color_Struct item_tint[_MaterialCount];
/*0428*/ Convert::AA_Array aa_array[MAX_PP_AA_ARRAY];
/*2348*/ float unknown2384; //seen ~128, ~47
/*2352*/ char servername[32]; // length probably not right
/*2384*/ char title[32]; // length might be wrong
/*2416*/ char suffix[32]; // length might be wrong
/*2448*/ uint32 guildid2; //
/*2452*/ uint32 exp; // Current Experience
/*2456*/ uint32 unknown2492;
/*2460*/ uint32 points; // Unspent Practice points
/*2464*/ uint32 mana; // current mana
/*2468*/ uint32 cur_hp; // current hp
/*2472*/ uint32 unknown2508; // 0x05
/*2476*/ uint32 STR; // Strength
/*2480*/ uint32 STA; // Stamina
/*2484*/ uint32 CHA; // Charisma
/*2488*/ uint32 DEX; // Dexterity
/*2492*/ uint32 INT; // Intelligence
/*2496*/ uint32 AGI; // Agility
/*2500*/ uint32 WIS; // Wisdom
/*2504*/ uint8 face; // Player face
/*2505*/ uint8 unknown2541[47]; // ?
/*2552*/ uint8 languages[MAX_PP_LANGUAGE];
/*2580*/ uint8 unknown2616[4];
/*2584*/ uint32 spell_book[MAX_PP_REF_SPELLBOOK];
/*4504*/ uint8 unknown4540[128]; // Was [428] all 0xff
/*4632*/ uint32 mem_spells[MAX_PP_REF_MEMSPELL];
/*4668*/ uint8 unknown4704[32]; //
/*4700*/ float y; // Player y position
/*4704*/ float x; // Player x position
/*4708*/ float z; // Player z position
/*4712*/ float heading; // Direction player is facing
/*4716*/ uint8 unknown4752[4]; //
/*4720*/ int32 platinum; // Platinum Pieces on player
/*4724*/ int32 gold; // Gold Pieces on player
/*4728*/ int32 silver; // Silver Pieces on player
/*4732*/ int32 copper; // Copper Pieces on player
/*4736*/ int32 platinum_bank; // Platinum Pieces in Bank
/*4740*/ int32 gold_bank; // Gold Pieces in Bank
/*4744*/ int32 silver_bank; // Silver Pieces in Bank
/*4748*/ int32 copper_bank; // Copper Pieces in Bank
/*4752*/ int32 platinum_cursor; // Platinum on cursor
/*4756*/ int32 gold_cursor; // Gold on cursor
/*4760*/ int32 silver_cursor; // Silver on cursor
/*4764*/ int32 copper_cursor; // Copper on cursor
/*4768*/ int32 platinum_shared; // Platinum shared between characters
/*4772*/ uint8 unknown4808[24];
/*4796*/ uint32 skills[MAX_PP_SKILL]; // [400] List of skills // 100 dword buffer
/*5196*/ uint8 unknown5132[184];
/*5380*/ uint32 pvp2; //
/*5384*/ uint32 unknown5420; //
/*5388*/ uint32 pvptype; //
/*5392*/ uint32 unknown5428; //
/*5396*/ uint32 ability_down; // Guessing
/*5400*/ uint8 unknown5436[8]; //
/*5408*/ uint32 autosplit; //not used right now
/*5412*/ uint8 unknown5448[8];
/*5420*/ uint32 zone_change_count; // Number of times user has zoned in their career (guessing)
/*5424*/ uint8 unknown5460[16]; //
/*5440*/ uint32 drakkin_heritage; //
/*5444*/ uint32 drakkin_tattoo; //
/*5448*/ uint32 drakkin_details; //
/*5452*/ uint32 expansions; // expansion setting, bit field of expansions avaliable
/*5456*/ int32 toxicity; //from drinking potions, seems to increase by 3 each time you drink
/*5460*/ char unknown5496[16]; //
/*5476*/ int32 hunger_level;
/*5480*/ int32 thirst_level;
/*5484*/ uint32 ability_up;
/*5488*/ char unknown5524[16];
/*5504*/ uint16 zone_id; // Current zone of the player
/*5506*/ uint16 zoneInstance; // Instance ID
/*5508*/ Convert::SpellBuff_Struct buffs[BUFF_COUNT]; // Buffs currently on the player
/*6008*/ char groupMembers[6][64];//
/*6392*/ char unknown6428[656];
/*7048*/ uint32 entityid;
/*7052*/ uint32 leadAAActive;
/*7056*/ uint32 unknown7092;
/*7060*/ int32 ldon_points_guk; //client uses these as signed
/*7064*/ int32 ldon_points_mir;
/*7068*/ int32 ldon_points_mmc;
/*7072*/ int32 ldon_points_ruj;
/*7076*/ int32 ldon_points_tak;
/*7080*/ int32 ldon_points_available;
/*7084*/ int32 ldon_wins_guk;
/*7088*/ int32 ldon_wins_mir;
/*7092*/ int32 ldon_wins_mmc;
/*7096*/ int32 ldon_wins_ruj;
/*7100*/ int32 ldon_wins_tak;
/*7104*/ int32 ldon_losses_guk;
/*7108*/ int32 ldon_losses_mir;
/*7112*/ int32 ldon_losses_mmc;
/*7116*/ int32 ldon_losses_ruj;
/*7120*/ int32 ldon_losses_tak;
/*7124*/ uint8 unknown7160[72];
/*7196*/ uint32 tribute_time_remaining; //in miliseconds
/*7200*/ uint32 showhelm;
/*7204*/ uint32 career_tribute_points;
/*7208*/ uint32 unknown7244;
/*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active
/*7224*/ Convert::Tribute_Struct tributes[EmuConstants::TRIBUTE_SIZE];
/*7264*/ Convert::Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160];
/*7904*/ uint32 endurance;
/*7908*/ uint32 group_leadership_exp; //0-1000
/*7912*/ uint32 raid_leadership_exp; //0-2000
/*7916*/ uint32 group_leadership_points;
/*7920*/ uint32 raid_leadership_points;
/*7924*/ Convert::LeadershipAA_Struct leader_abilities;
/*8052*/ uint8 unknown8088[132];
/*8184*/ uint32 air_remaining;
/*8188*/ uint32 PVPKills;
/*8192*/ uint32 PVPDeaths;
/*8196*/ uint32 PVPCurrentPoints;
/*8200*/ uint32 PVPCareerPoints;
/*8204*/ uint32 PVPBestKillStreak;
/*8208*/ uint32 PVPWorstDeathStreak;
/*8212*/ uint32 PVPCurrentKillStreak;
/*8216*/ Convert::PVPStatsEntry_Struct PVPLastKill;
/*8304*/ Convert::PVPStatsEntry_Struct PVPLastDeath;
/*8392*/ uint32 PVPNumberOfKillsInLast24Hours;
/*8396*/ Convert::PVPStatsEntry_Struct PVPRecentKills[50];
/*12796*/ uint32 aapoints_spent;
/*12800*/ uint32 expAA;
/*12804*/ uint32 aapoints; //avaliable, unspent
/*12808*/ uint8 unknown12844[36];
/*12844*/ Convert::Bandolier_Struct bandoliers[EmuConstants::BANDOLIERS_COUNT];
/*14124*/ uint8 unknown14160[4506];
/*18630*/ Convert::SuspendedMinion_Struct SuspendedMinion; // No longer in use
/*19240*/ uint32 timeentitledonaccount;
/*19244*/ Convert::PotionBelt_Struct potionbelt; //there should be 3 more of these
/*19532*/ uint8 unknown19568[8];
/*19540*/ uint32 currentRadCrystals; // Current count of radiant crystals
/*19544*/ uint32 careerRadCrystals; // Total count of radiant crystals ever
/*19548*/ uint32 currentEbonCrystals;// Current count of ebon crystals
/*19552*/ uint32 careerEbonCrystals; // Total count of ebon crystals ever
/*19556*/ uint8 groupAutoconsent; // 0=off, 1=on
/*19557*/ uint8 raidAutoconsent; // 0=off, 1=on
/*19558*/ uint8 guildAutoconsent; // 0=off, 1=on
/*19559*/ uint8 unknown19595[5]; // ***Placeholder (6/29/2005)
/*19564*/ uint32 RestTimer;
/*19568*/
};
namespace player_lootitem_temp
{
struct ServerLootItem_Struct_temp {
uint32 item_id;
int16 equipSlot;
uint8 charges;
uint16 lootslot;
uint32 aug1;
uint32 aug2;
uint32 aug3;
uint32 aug4;
uint32 aug5;
};
}
namespace classic_db_temp
{
struct DBPlayerCorpse_Struct_temp {
uint32 crc;
bool locked;
@ -168,8 +459,41 @@ namespace classic_db_temp
uint8 hairstyle;
uint8 face;
uint8 beard;
uint32 drakkin_heritage;
uint32 drakkin_tattoo;
uint32 drakkin_details;
player_lootitem_temp::ServerLootItem_Struct_temp items[0];
};
namespace classic_db_temp {
struct DBPlayerCorpse_Struct_temp {
uint32 crc;
bool locked;
uint32 itemcount;
uint32 exp;
float size;
uint8 level;
uint8 race;
uint8 gender;
uint8 class_;
uint8 deity;
uint8 texture;
uint8 helmtexture;
uint32 copper;
uint32 silver;
uint32 gold;
uint32 plat;
Color_Struct item_tint[9];
uint8 haircolor;
uint8 beardcolor;
uint8 eyecolor1;
uint8 eyecolor2;
uint8 hairstyle;
uint8 face;
uint8 beard;
player_lootitem_temp::ServerLootItem_Struct_temp items[0];
};
}
}
#pragma pack()