|
From: <r6e...@us...> - 2012-10-24 00:29:51
|
Revision: 771
http://seq.svn.sourceforge.net/seq/?rev=771&view=rev
Author: r6express
Date: 2012-10-24 00:29:43 +0000 (Wed, 24 Oct 2012)
Log Message:
-----------
- Changed charProfileStruct population to be dynamic due to September patch
- Updated positional structs to match latest October patch
- message.h now include stddef.h
Modified Paths:
--------------
showeq/trunk/conf/zoneopcodes.xml
showeq/trunk/src/everquest.h
showeq/trunk/src/interface.cpp
showeq/trunk/src/message.h
showeq/trunk/src/spawnshell.cpp
showeq/trunk/src/zonemgr.cpp
showeq/trunk/src/zonemgr.h
Modified: showeq/trunk/conf/zoneopcodes.xml
===================================================================
--- showeq/trunk/conf/zoneopcodes.xml 2012-09-01 01:39:41 UTC (rev 770)
+++ showeq/trunk/conf/zoneopcodes.xml 2012-10-24 00:29:43 UTC (rev 771)
@@ -3,7 +3,7 @@
<seqopcodes>
<!-- Critical opcodes used directly by ShowEQ -->
- <opcode id="226b" name="OP_NpcMoveUpdate" updated="08/17/12">
+ <opcode id="5675" name="OP_NpcMoveUpdate" updated="10/23/12">
<comment>Position updates</comment>
<payload dir="server" typename="uint8_t" sizechecktype="none"/>
</opcode>
@@ -11,16 +11,16 @@
<comment>Movement data... rewind info?</comment>
<payload dir="client" typename="uint8_t" sizechecktype="none"/>
</opcode>
- <opcode id="4b82" name="OP_DeleteSpawn" updated="08/17/12">
+ <opcode id="06c9" name="OP_DeleteSpawn" updated="10/23/12">
<comment>DeleteSpawnCode</comment>
<payload dir="both" typename="deleteSpawnStruct" sizechecktype="match"/>
</opcode>
- <opcode id="4938" name="OP_ZoneEntry" updated="08/17/12">
+ <opcode id="3257" name="OP_ZoneEntry" updated="10/23/12">
<comment>ZoneEntryCode</comment>
<payload dir="client" typename="ClientZoneEntryStruct" sizechecktype="match"/>
<payload dir="server" typename="uint8_t" sizechecktype="none"/>
</opcode>
- <opcode id="42ef" name="OP_GuildMOTD" updated="08/17/12">
+ <opcode id="0fc6" name="OP_GuildMOTD" updated="10/23/12">
<comment>GuildMOTD</comment>
<payload dir="server" typename="guildMOTDStruct" sizechecktype="none"/>
</opcode>
@@ -28,7 +28,7 @@
<comment>InspectDataCode</comment>
<payload dir="both" typename="inspectDataStruct" sizechecktype="match"/>
</opcode>
- <opcode id="4885" name="OP_TargetMouse" updated="08/17/12">
+ <opcode id="5401" name="OP_TargetMouse" updated="10/23/12">
<comment>Targeting a person - old ClientTargetCode</comment>
<payload dir="both" typename="clientTargetStruct" sizechecktype="match"/>
</opcode>
@@ -88,7 +88,7 @@
<comment>Receiving AA experience. Also when percent to AA changes.</comment>
<payload dir="server" typename="altExpUpdateStruct" sizechecktype="match"/>
</opcode>
- <opcode id="7c94" name="OP_HPUpdate" updated="08/17/12">
+ <opcode id="61d0" name="OP_HPUpdate" updated="10/23/12">
<comment>NpcHpUpdateCode Update HP % of a PC or NPC</comment>
<payload dir="both" typename="hpNpcUpdateStruct" sizechecktype="match"/>
</opcode>
@@ -134,7 +134,7 @@
<payload dir="server" typename="uint8_t" sizechecktype="none"/>
<comment>Bazaar search tool</comment>
</opcode>
- <opcode id="3c02" name="OP_SpawnUpdate" updated="08/17/12">
+ <opcode id="51dc" name="OP_SpawnUpdate" updated="10/23/12">
<comment>SpawnUpdateCode</comment>
<payload dir="both" typename="SpawnUpdateStruct" sizechecktype="match"/>
</opcode>
@@ -142,11 +142,11 @@
<comment>Server updating on hunger/thirst</comment>
<payload dir="server" typename="staminaStruct" sizechecktype="match"/>
</opcode>
- <opcode id="7705" name="OP_Consider" updated="08/17/12">
+ <opcode id="2ad3" name="OP_Consider" updated="10/23/12">
<comment>ConsiderCode</comment>
<payload dir="both" typename="considerStruct" sizechecktype="match"/>
</opcode>
- <opcode id="3401" name="OP_NewZone" updated="08/17/12">
+ <opcode id="0d60" name="OP_NewZone" updated="10/23/12">
<comment>NewZoneCode</comment>
<payload dir="server" typename="newZoneStruct" sizechecktype="match"/>
</opcode>
@@ -155,11 +155,11 @@
<payload dir="server" typename="makeDropStruct" sizechecktype="none"/>
<payload dir="client" typename="uint8_t" sizechecktype="none"/>
</opcode>
- <opcode id="1044" name="OP_RemoveSpawn" updated="08/17/12">
+ <opcode id="212b" name="OP_RemoveSpawn" updated="10/23/12">
<comment>Remove spawn from zone</comment>
<payload dir="both" typename="removeSpawnStruct" sizechecktype="none"/>
</opcode>
- <opcode id="0402" name="OP_Death" updated="08/17/12">
+ <opcode id="2f00" name="OP_Death" updated="10/23/12">
<comment>old NewCorpseCode</comment>
<payload dir="server" typename="newCorpseStruct" sizechecktype="match"/>
</opcode>
@@ -205,15 +205,15 @@
<comment>MoneyOnCorpseCode</comment>
<payload dir="server" typename="moneyOnCorpseStruct" sizechecktype="match"/>
</opcode>
- <opcode id="078e" name="OP_PlayerProfile" updated="08/17/12">
+ <opcode id="1603" name="OP_PlayerProfile" updated="10/23/12">
<comment>CharProfileCode</comment>
- <payload dir="server" typename="charProfileStruct" sizechecktype="match"/>
+ <payload dir="server" typename="uint8_t" sizechecktype="none"/>
</opcode>
<opcode id="6015" name="OP_TimeOfDay" updated="08/17/12">
<comment>TimeOfDayCode</comment>
<payload dir="server" typename="timeOfDayStruct" sizechecktype="match"/>
</opcode>
- <opcode id="7062" name="OP_ClientUpdate" updated="08/17/12">
+ <opcode id="44ef" name="OP_ClientUpdate" updated="10/23/12">
<comment>Position updates</comment>
<payload dir="server" typename="playerSpawnPosStruct" sizechecktype="match"/>
<payload dir="both" typename="playerSelfPosStruct" sizechecktype="match"/>
@@ -297,15 +297,15 @@
<comment>List of group members - Variable length</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
- <opcode id="51da" name="OP_GuildMemberList" updated="08/17/12">
+ <opcode id="4ea3" name="OP_GuildMemberList" updated="10/23/12">
<comment>List of guild members - Variable length</comment>
<payload dir="server" typename="uint8_t" sizechecktype="none"/>
</opcode>
- <opcode id="5851" name="OP_ManaUpdate" updated="08/17/12">
+ <opcode id="1390" name="OP_ManaUpdate" updated="10/23/12">
<comment>Mana Update opcode - 10 bytes</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
- <opcode id="3365" name="OP_EndUpdate" updated="08/17/12">
+ <opcode id="794b" name="OP_EndUpdate" updated="10/23/12">
<comment>Endurance Update opcode - 10 bytes</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
@@ -333,15 +333,15 @@
<comment>Contents of claims window - Guessing variable length</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
- <opcode id="27ac" name="OP_VoiceChat" updated="08/17/12">
+ <opcode id="5147" name="OP_VoiceChat" updated="10/23/12">
<comment>Voice chat server info - Variable length (Data sent when joining group,raid etc)</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
- <opcode id="6d76" name="OP_PollQuestions" updated="08/17/12">
+ <opcode id="0000" name="OP_PollQuestions" updated="10/23/12">
<comment>SOE in-game player poll questions - Variable length</comment>
<payload dir="both" typename="unknown" sizechecktype="none"/>
</opcode>
- <opcode id="54fe" name="OP_PollResponses" updated="08/17/12">
+ <opcode id="648d" name="OP_PollResponses" updated="10/23/12">
<comment>Poll response choices - Variable length</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
@@ -357,7 +357,7 @@
<comment>Fellowship information - 2552 bytes</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
- <opcode id="7adb" name="OP_ExpandedGuildInfo" updated="08/17/12">
+ <opcode id="611f" name="OP_ExpandedGuildInfo" updated="10/23/12">
<comment>Guild ranks and other misc guild data - Variable length</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
@@ -385,19 +385,19 @@
<comment>Tradeskill combine using old tradeskill window - 24 Bytes</comment>
<payload dir="both" typename="uint8_t" sizechecktype="none"/>
</opcode>
- <opcode id="5ed3" name="OP_ItemPlayerPacket" updated="08/17/12">
+ <opcode id="0926" name="OP_ItemPlayerPacket" updated="10/23/12">
<comment>Inventory/bank items coming over during zone - Variable length</comment>
<payload dir="both" typename="uint8_t" sizechecktype="none"/>
</opcode>
- <opcode id="47ea" name="OP_TaskDescription" updated="08/17/12">
+ <opcode id="67a7" name="OP_TaskDescription" updated="10/23/12">
<comment>Task descriptions coming down for task window - Variable length</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
- <opcode id="2d25" name="OP_TaskActivity" updated="08/17/12">
+ <opcode id="351f" name="OP_TaskActivity" updated="10/23/12">
<comment>Task activity descriptions coming down for task window - Variable length</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
- <opcode id="488b" name="OP_CompletedTasks" updated="08/17/12">
+ <opcode id="17f0" name="OP_CompletedTasks" updated="10/23/12">
<comment>Task history for task window - Variable length</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
@@ -565,11 +565,11 @@
<comment>Client clicks off buff - 8 bytes</comment>
<payload dir="client" typename="unknown" sizechecktype="none"/>
</opcode>
- <opcode id="02fc" name="OP_HouseAddress" updated="08/17/12">
+ <opcode id="4716" name="OP_HouseAddress" updated="10/23/12">
<comment>House and guildhall address information - Variable length</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
- <opcode id="24f5" name="OP_HouseContents" updated="08/17/12">
+ <opcode id="447e" name="OP_HouseContents" updated="10/23/12">
<comment>Server sending house information and contents - variable length</comment>
<payload dir="server" typename="unknown" sizechecktype="none"/>
</opcode>
Modified: showeq/trunk/src/everquest.h
===================================================================
--- showeq/trunk/src/everquest.h 2012-09-01 01:39:41 UTC (rev 770)
+++ showeq/trunk/src/everquest.h 2012-10-24 00:29:43 UTC (rev 771)
@@ -102,9 +102,9 @@
//Maximum limits of certain types of data
#define MAX_KNOWN_SKILLS 100
-#define MAX_SPELL_SLOTS 12
-#define MAX_KNOWN_LANGS 26
-#define MAX_SPELLBOOK_SLOTS 400
+#define MAX_SPELL_SLOTS 16
+#define MAX_KNOWN_LANGS 32
+#define MAX_SPELLBOOK_SLOTS 720
#define MAX_GROUP_MEMBERS 6
#define MAX_BUFFS 42
#define MAX_GUILDS 8192
@@ -112,7 +112,7 @@
#define MAX_BANDOLIERS 20
#define MAX_POTIONS_IN_BELT 5
#define MAX_TRIBUTES 5
-#define MAX_DISCIPLINES 100
+#define MAX_DISCIPLINES 200
//Item Flags
#define ITEM_NORMAL 0x0000
@@ -664,10 +664,10 @@
*/
struct playerProfileStruct
{
-/*00004*/ uint32_t gender; // Player Gender - 0 Male, 1 Female
+/*00004*/ uint16_t gender; // Player Gender - 0 Male, 1 Female
/*00008*/ uint32_t race; // Player race
/*00012*/ uint32_t class_; // Player class
-/*00016*/ uint8_t unknown00016[40]; // ***Placeholder
+/*00016*/ uint8_t unknown00016[44]; // ***Placeholder
/*00056*/ uint8_t level; // Level of player
/*00057*/ uint8_t level1; // Level of player (again?)
/*00058*/ uint8_t unknown00058[2]; // ***Placeholder
@@ -697,9 +697,10 @@
/*00376*/ EquipStruct equip_primary; // Equipment: Main visual
/*00396*/ EquipStruct equip_secondary; // Equipment: Off visual
} equip;
- /*00416*/ EquipStruct equipment[9];
+ /*00416*/ EquipStruct equipment[22];
};
/*00416*/ uint8_t unknown00416[268]; // *** Placeholder
+/*00416*/ uint8_t unknowntmp[30]; // *** Placeholder
/*00688*/ Color_Struct item_tint[9]; // RR GG BB 00
/*00724*/ AA_Array aa_array[MAX_AA]; // AAs
/*04324*/ uint32_t points; // Unspent Practice points
@@ -717,8 +718,8 @@
/*04396*/ uint8_t unknown04396[180]; // *** Placeholder
/*04576*/ int32_t sSpellBook[729]; // List of the Spells in spellbook
/*07492*/ int32_t sMemSpells[MAX_SPELL_SLOTS]; // List of spells memorized
-/*07540*/ uint8_t unknown07540[20]; // *** Placeholder
-/*07560*/ uint32_t platinum; // Platinum Pieces on player
+/*07540*/ uint8_t unknown07540[17]; // *** Placeholder
+/*07585*/ uint32_t platinum; // Platinum Pieces on player
/*07564*/ uint32_t gold; // Gold Pieces on player
/*07568*/ uint32_t silver; // Silver Pieces on player
/*07572*/ uint32_t copper; // Copper Pieces on player
@@ -752,8 +753,8 @@
/*
** Player Profile
-** Length: 33904 Octets
-** OpCode: CharProfileCode
+** Length: Variable
+** OpCode: OP_PlayerProfile
*/
struct charProfileStruct
{
@@ -1071,19 +1072,18 @@
{
struct
{
-/*0000*/ signed padding0000:12; // ***Placeholder
- signed deltaX:13; // change in x
- signed padding0005:7; // ***Placeholder
-/*0000*/ signed deltaHeading:10; // change in heading
- signed deltaY:13; // change in y
- signed padding0006:9; // ***Placeholder
-/*0000*/ signed y:19; // y coord
- signed animation:13; // animation
-/*0000*/ unsigned heading:12; // heading
- signed x:19; // x coord
- signed padding0014:1; // ***Placeholder
-/*0000*/ signed z:19; // z coord
- signed deltaZ:13; // change in z
+ signed padding0000:12; // ***Placeholder
+ signed deltaHeading:10; // change in heading
+ signed padding0005:10; // ***Placeholder
+ signed z:19; // z coord
+ signed deltaZ:13; // change in z
+ signed deltaY:13; // change in y
+ signed y:19; // y coord
+ signed x:19; // x coord
+ signed deltaX:13; // change in x
+ unsigned heading:12; // heading
+ signed animation:10; // animation
+ signed padding0006:10; // ***Placeholder
};
int32_t posData[5];
};
@@ -2329,21 +2329,19 @@
struct playerSpawnPosStruct
{
/*0000*/ uint16_t spawnId;
- uint8_t unk[2]; // BSH 13 Apr 2011
-/*0002*/ signed padding0000:12; // ***Placeholder
+/*0002*/ uint8_t unk[2]; // BSH 13 Apr 2011
+/*0004*/ signed padding0000:12; // ***Placeholder
+ signed deltaHeading:10; // change in heading
+ signed padding0005:10; // ***Placeholder
+/*0008*/ signed z:19; // z coord
+ signed deltaZ:13; // change in z
+/*0012*/ signed deltaY:13; // change in y
+ signed y:19; // y coord
+/*0016*/ signed x:19; // x coord
signed deltaX:13; // change in x
- signed padding0005:7; // ***Placeholder
-/*0006*/ signed deltaHeading:10; // change in heading
- signed deltaY:13; // change in y
- signed padding0006:9; // ***Placeholder
-/*0010*/ signed y:19; // y coord
+/*0020*/ unsigned heading:12; // heading
signed animation:10; // animation
- signed padding0010:3; // ***Placeholder
-/*0014*/ unsigned heading:12; // heading
- signed x:19; // x coord
- signed padding0014:1; // ***Placeholder
-/*0020*/ signed z:19; // z coord
- signed deltaZ:13; // change in z
+ signed padding0006:10; // ***Placeholder
/*0024*/
};
@@ -2358,19 +2356,15 @@
/*0000*/ uint16_t spawnId; // Player's spawn id
/*0002*/ uint8_t unknown0002[2]; // ***Placeholder (update time counter?)
/*0004*/ uint8_t unknown0004[6]; // ***Placeholder -- BSH 13 Apr 2011
-/*0010*/ float x; // x coord (2nd loc value)
-/*0014*/ float y; // y coord (1st loc value)
-/*0018*/ signed deltaHeading:10; // change in heading
- unsigned animation:10; // animation
- unsigned padding0016:12; // ***Placeholder
-/*0022*/ float deltaX; // Change in x
-/*0026*/ float deltaY; // Change in y
-/*0030*/ float z; // z coord (3rd loc value)
-/*0034*/ float deltaZ; // Change in z
-/*0038*/ unsigned padding0036:10; // ***Placeholder
+/*0010*/ float y; // y coord (1st loc value)
+/*0014*/ float deltaY;
+ signed deltaHeading:10; // change in heading
unsigned heading:12; // Directional heading
- unsigned padding0037:10; // ***Placeholder
-/*0042*/
+ unsigned animation:10; // animation
+/*0022*/ float deltaX;
+/*0026*/ float deltaZ;
+/*0030*/ float x; // x coord (2nd loc value)
+/*0034*/ float z; // z coord (3rd loc value)
};
Modified: showeq/trunk/src/interface.cpp
===================================================================
--- showeq/trunk/src/interface.cpp 2012-09-01 01:39:41 UTC (rev 770)
+++ showeq/trunk/src/interface.cpp 2012-10-24 00:29:43 UTC (rev 771)
@@ -1644,8 +1644,8 @@
"ClientZoneEntryStruct", SZC_Match,
m_zoneMgr, SLOT(zoneEntryClient(const uint8_t*, size_t, uint8_t)));
m_packet->connect2("OP_PlayerProfile", SP_Zone, DIR_Server,
- "charProfileStruct", SZC_Match,
- m_zoneMgr, SLOT(zonePlayer(const uint8_t*)));
+ "uint8_t", SZC_None,
+ m_zoneMgr, SLOT(zonePlayer(const uint8_t*, size_t)));
m_packet->connect2("OP_ZoneChange", SP_Zone, DIR_Client|DIR_Server,
"zoneChangeStruct", SZC_Match,
m_zoneMgr, SLOT(zoneChange(const uint8_t*, size_t, uint8_t)));
Modified: showeq/trunk/src/message.h
===================================================================
--- showeq/trunk/src/message.h 2012-09-01 01:39:41 UTC (rev 770)
+++ showeq/trunk/src/message.h 2012-10-24 00:29:43 UTC (rev 771)
@@ -12,6 +12,7 @@
#define _MESSAGE_H_
#include <stdint.h>
+#include <stddef.h>
#include <qstring.h>
#include <qdatetime.h>
Modified: showeq/trunk/src/spawnshell.cpp
===================================================================
--- showeq/trunk/src/spawnshell.cpp 2012-09-01 01:39:41 UTC (rev 770)
+++ showeq/trunk/src/spawnshell.cpp 2012-10-24 00:29:43 UTC (rev 771)
@@ -637,7 +637,7 @@
name = netStream.readText();
- if(name.length())
+ if(name.length() > 0 && name.length() < sizeof(spawn->lastName))
{
strcpy(spawn->lastName, name.latin1());
}
Modified: showeq/trunk/src/zonemgr.cpp
===================================================================
--- showeq/trunk/src/zonemgr.cpp 2012-09-01 01:39:41 UTC (rev 770)
+++ showeq/trunk/src/zonemgr.cpp 2012-10-24 00:29:43 UTC (rev 771)
@@ -19,6 +19,7 @@
#include "main.h"
#include "everquest.h"
#include "diagnosticmessages.h"
+#include "netstream.h"
#include <qfile.h>
#include <qdatastream.h>
@@ -183,9 +184,335 @@
saveZoneState();
}
-void ZoneMgr::zonePlayer(const uint8_t* data)
+int32_t ZoneMgr::fillProfileStruct(charProfileStruct *player, const uint8_t *data, size_t len, bool checkLen)
{
- const charProfileStruct* player = (const charProfileStruct*)data;
+ /*
+ This reads data from the variable-length charPlayerProfile struct
+ */
+ NetStream netStream(data, len);
+ int32_t retVal;
+ QString name;
+
+ player->checksum = netStream.readUInt32NC();
+
+ player->profile.gender = netStream.readUInt16();
+ player->profile.race = netStream.readUInt32NC();
+ player->profile.class_ = netStream.readUInt32NC();
+
+ // Unknown
+ netStream.skipBytes(44);
+
+ player->profile.level = netStream.readUInt8();
+ player->profile.level1 = netStream.readUInt8();
+
+ // Really, everything after the level is not critical for operation. If
+ // needed, skip the rest to get up and running quickly after patch day.
+#if 1
+ // Bind points
+ int bindCount = netStream.readUInt32NC();
+ for (int i = 0; i < bindCount; i++) {
+ memcpy(&player->profile.binds[i], netStream.pos(), sizeof(player->profile.binds[i]));
+ netStream.skipBytes(sizeof(player->profile.binds[i]));
+ }
+
+ player->profile.deity = netStream.readUInt32NC();
+ player->profile.intoxication = netStream.readUInt32NC();
+
+ // Spell slot refresh
+ int spellRefreshCount = netStream.readUInt32NC();
+ for (int i = 0; i < spellRefreshCount; i++) {
+ player->profile.spellSlotRefresh[i] = netStream.readUInt32NC();
+ }
+
+ player->profile.haircolor = netStream.readUInt8();
+ player->profile.beardcolor = netStream.readUInt8();
+
+ // Unknown
+ netStream.skipBytes(6);
+
+ player->profile.eyecolor1 = netStream.readUInt8();
+ player->profile.eyecolor2 = netStream.readUInt8();
+ player->profile.hairstyle = netStream.readUInt8();
+ player->profile.beard = netStream.readUInt8();
+
+ // Unknown
+ netStream.skipBytes(11);
+
+ // Equipment
+ int equipCount = netStream.readUInt32NC();
+ for (int i = 0; i < equipCount; i++) {
+ memcpy(&player->profile.equipment[i], netStream.pos(), sizeof(player->profile.equipment[i]));
+ netStream.skipBytes(sizeof(player->profile.equipment[i]));
+ }
+
+ // Visible equipment tints (dye color)
+ int tintCount = netStream.readUInt32NC();
+ for (int i = 0; i < tintCount; i++) {
+ player->profile.item_tint[i].color = netStream.readUInt32NC();
+ }
+
+ // AAs
+ int aaCount = netStream.readUInt32NC();
+ for (int i = 0; i < aaCount; i++) {
+ player->profile.aa_array[i].AA = netStream.readUInt32NC();
+ player->profile.aa_array[i].value = netStream.readUInt32NC();
+ player->profile.aa_array[i].unknown008 = netStream.readUInt32NC();
+ }
+
+ player->profile.points = netStream.readUInt32NC();
+ player->profile.MANA = netStream.readUInt32NC();
+ player->profile.curHp = netStream.readUInt32NC();
+ player->profile.STR = netStream.readUInt32NC();
+ player->profile.STA = netStream.readUInt32NC();
+ player->profile.CHA = netStream.readUInt32NC();
+ player->profile.DEX = netStream.readUInt32NC();
+ player->profile.INT = netStream.readUInt32NC();
+ player->profile.AGI = netStream.readUInt32NC();
+ player->profile.WIS = netStream.readUInt32NC();
+
+ // Unknown
+ netStream.skipBytes(28);
+
+ player->profile.face = netStream.readUInt32NC();
+
+ // Unknown
+ netStream.skipBytes(221);
+
+ // Spellbook
+ int spellBookSlots = netStream.readUInt32NC();
+ for (int i = 0; i < spellBookSlots; i++) {
+ player->profile.sSpellBook[i] = netStream.readInt32();
+ }
+
+ int spellMemSlots = netStream.readUInt32NC();
+ for (int i = 0; i < spellMemSlots; i++) {
+ player->profile.sMemSpells[i] = netStream.readInt32();
+ }
+
+ int coinCounts = netStream.readUInt8();
+ player->profile.platinum = netStream.readUInt32NC();
+ player->profile.gold = netStream.readUInt32NC();
+ player->profile.silver = netStream.readUInt32NC();
+ player->profile.copper = netStream.readUInt32NC();
+
+ player->profile.platinum_cursor = netStream.readUInt32NC();
+ player->profile.gold_cursor = netStream.readUInt32NC();
+ player->profile.silver_cursor = netStream.readUInt32NC();
+ player->profile.copper_cursor = netStream.readUInt32NC();
+
+ int skillCount = netStream.readUInt32NC();
+ for (int i = 0; i < skillCount; i++) {
+ player->profile.skills[i] = netStream.readUInt32NC();
+ }
+
+ int innateSkillCount = netStream.readUInt32NC();
+ for (int i = 0; i < innateSkillCount; i++) {
+ player->profile.innateSkills[i] = netStream.readUInt32NC();
+ }
+
+ // Unknown
+ netStream.skipBytes(16);
+
+ player->profile.toxicity = netStream.readUInt32NC();
+ player->profile.thirst = netStream.readUInt32NC();
+ player->profile.hunger = netStream.readUInt32NC();
+
+ // Unknown
+ netStream.skipBytes(20);
+
+ int buffCount = netStream.readUInt32NC();
+ for (int i = 0; i < buffCount; i++) {
+ netStream.skipBytes(80);
+ }
+
+ int disciplineCount = netStream.readUInt32NC();
+ for (int i = 0; i < disciplineCount; i++) {
+ player->profile.disciplines[i] = netStream.readUInt32NC();
+ }
+
+ int recastTypes = netStream.readUInt32NC();
+ for (int i = 0; i < recastTypes; i++) {
+ player->profile.recastTimers[i] = netStream.readUInt32NC();
+ }
+
+ int somethingCount = netStream.readUInt32NC();
+ for (int i = 0; i < somethingCount; i++) {
+ int something = netStream.readUInt32NC();
+ }
+
+ int somethingElseCount = netStream.readUInt32NC();
+ for (int i = 0; i < somethingElseCount; i++) {
+ int something = netStream.readUInt32NC();
+ }
+
+ player->profile.endurance = netStream.readUInt32NC();
+ player->profile.aa_spent = netStream.readUInt32NC();
+
+ // Unknown
+ netStream.skipBytes(4);
+
+ player->profile.aa_assigned = netStream.readUInt32NC();
+
+ // Unknown
+ netStream.skipBytes(22);
+
+ int bandolierCount = netStream.readUInt32NC();
+ for (int i = 0; i < bandolierCount; i++) {
+ name = netStream.readText();
+ if(name.length()) {
+ strncpy(player->profile.bandoliers[i].bandolierName, name.latin1(), 32);
+ }
+
+ // Mainhand
+ name = netStream.readText();
+ if(name.length()) {
+ strncpy(player->profile.bandoliers[i].mainHand.itemName, name.latin1(), 64);
+ }
+ player->profile.bandoliers[i].mainHand.itemId = netStream.readUInt32NC();
+ player->profile.bandoliers[i].mainHand.icon = netStream.readUInt32NC();
+
+ // Offhand
+ name = netStream.readText();
+ if(name.length()) {
+ strncpy(player->profile.bandoliers[i].offHand.itemName, name.latin1(), 64);
+ }
+ player->profile.bandoliers[i].offHand.itemId = netStream.readUInt32NC();
+ player->profile.bandoliers[i].offHand.icon = netStream.readUInt32NC();
+
+ // Range
+ name = netStream.readText();
+ if(name.length()) {
+ strncpy(player->profile.bandoliers[i].range.itemName, name.latin1(), 64);
+ }
+ player->profile.bandoliers[i].range.itemId = netStream.readUInt32NC();
+ player->profile.bandoliers[i].range.icon = netStream.readUInt32NC();
+
+ // Ammo
+ name = netStream.readText();
+ if(name.length()) {
+ strncpy(player->profile.bandoliers[i].ammo.itemName, name.latin1(), 64);
+ }
+ player->profile.bandoliers[i].ammo.itemId = netStream.readUInt32NC();
+ player->profile.bandoliers[i].ammo.icon = netStream.readUInt32NC();
+ }
+
+ int potionCount = netStream.readUInt32NC();
+ for (int i = 0; i < potionCount; i++) {
+ name = netStream.readText();
+ if(name.length()) {
+ strncpy(player->profile.potionBelt[i].itemName, name.latin1(), 64);
+ }
+ player->profile.potionBelt[i].itemId = netStream.readUInt32NC();
+ player->profile.potionBelt[i].icon = netStream.readUInt32NC();
+ }
+
+ // Unknown
+ netStream.skipBytes(96);
+
+ memcpy(player->name, netStream.pos(), 64);
+ netStream.skipBytes(64);
+
+ memcpy(player->lastName, netStream.pos(), 32);
+ netStream.skipBytes(32);
+
+ // Unknown
+ netStream.skipBytes(8);
+
+ player->guildID = netStream.readInt32();
+ player->birthdayTime = netStream.readUInt32NC();
+ player->lastSaveTime = netStream.readUInt32NC();
+ player->timePlayedMin = netStream.readUInt32NC();
+
+ // Unknown
+ netStream.skipBytes(4);
+
+ player->pvp = netStream.readUInt8();
+ player->anon = netStream.readUInt8();
+ player->gm = netStream.readUInt8();
+ player->guildstatus = netStream.readInt8();
+
+ // Unknown
+ netStream.skipBytes(14);
+
+ player->exp = netStream.readUInt32NC();
+
+ // Unknown
+ netStream.skipBytes(8);
+
+ int langCount = netStream.readUInt32NC();
+ for (int i = 0; i < langCount; i++) {
+ player->languages[i] = netStream.readUInt8();
+ }
+
+ memcpy(&player->x, netStream.pos(), sizeof(player->x));
+ netStream.skipBytes(sizeof(player->x));
+
+ memcpy(&player->y, netStream.pos(), sizeof(player->y));
+ netStream.skipBytes(sizeof(player->y));
+
+ memcpy(&player->z, netStream.pos(), sizeof(player->z));
+ netStream.skipBytes(sizeof(player->z));
+
+ memcpy(&player->heading, netStream.pos(), sizeof(player->heading));
+ netStream.skipBytes(sizeof(player->heading));
+
+ player->standState = netStream.readUInt8();
+ player->platinum_bank = netStream.readUInt32NC();
+ player->gold_bank = netStream.readUInt32NC();
+ player->silver_bank = netStream.readUInt32NC();
+ player->copper_bank = netStream.readUInt32NC();
+ player->platinum_shared = netStream.readUInt32NC();
+
+ // Unknown
+ netStream.skipBytes(12);
+
+ // Unknown (41)
+ int doubleIntCount = netStream.readUInt32NC();
+ for (int i = 0; i < doubleIntCount; i++) {
+ int something = netStream.readUInt32NC();
+ int somethingElse = netStream.readUInt32NC();
+ }
+
+ // Unknown (64)
+ int byteCount = netStream.readUInt32NC();
+ for (int i = 0; i < byteCount; i++) {
+ char something = netStream.readUInt8();
+ }
+
+ player->expansions = netStream.readUInt32NC();
+
+ // Unknown
+ netStream.skipBytes(11);
+
+ player->autosplit = netStream.readUInt8();
+
+ // Unknown
+ netStream.skipBytes(14);
+
+ player->zoneId = netStream.readUInt16NC();
+ player->zoneInstance = netStream.readUInt16NC();
+
+ // Still more to do, but it's really of little value
+#endif
+
+ retVal = netStream.pos() - netStream.data();
+ if (checkLen && (int32_t)len != retVal)
+ {
+ seqDebug("SpawnShell::fillProfileStruct - expected length: %d, read: %d for player '%s'", len, retVal, player->name);
+ }
+
+ return retVal;
+}
+
+
+void ZoneMgr::zonePlayer(const uint8_t* data, size_t len)
+{
+ charProfileStruct *player = new charProfileStruct;
+
+ memset(player,0,sizeof(charProfileStruct));
+
+ fillProfileStruct(player,data,len,true);
+
m_shortZoneName = zoneNameFromID(player->zoneId);
m_longZoneName = zoneLongNameFromID(player->zoneId);
m_zone_exp_multiplier = defaultZoneExperienceMultiplier;
Modified: showeq/trunk/src/zonemgr.h
===================================================================
--- showeq/trunk/src/zonemgr.h 2012-09-01 01:39:41 UTC (rev 770)
+++ showeq/trunk/src/zonemgr.h 2012-10-24 00:29:43 UTC (rev 771)
@@ -58,12 +58,13 @@
protected slots:
void zoneEntryClient(const uint8_t* zsentry, size_t, uint8_t);
- void zonePlayer(const uint8_t* zsentry);
+ void zonePlayer(const uint8_t* zsentry, size_t len);
void zoneChange(const uint8_t* zoneChange, size_t, uint8_t);
void zoneNew(const uint8_t* zoneNew, size_t, uint8_t);
void zonePoints(const uint8_t* zp, size_t, uint8_t);
void dynamicZonePoints(const uint8_t *data, size_t len, uint8_t);
void dynamicZoneInfo(const uint8_t *data, size_t len, uint8_t);
+ int32_t fillProfileStruct(charProfileStruct *player, const uint8_t *data, size_t len, bool checkLen);
signals:
void zoneBegin();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|