Skip to content

Commit 9362480

Browse files
committed
Add housing guid parsing
1 parent 1b5d542 commit 9362480

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,12 @@ public enum HousingResult : byte
7979
TransactionFailure = 74,
8080
UnlockOperationFailed = 75
8181
}
82+
83+
public enum HousingGuidType : byte
84+
{
85+
Decor = 1,
86+
RoomComponent = 2,
87+
House = 3,
88+
Neighborhood = 4,
89+
}
8290
}

WowPacketParser/Misc/WowGuid.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,24 @@ public override string ToString()
155155
if (Low == 0 && High == 0)
156156
return "Full: 0x0";
157157

158+
string baseGuidPart = $"TypeName: {GetHighType()}; Full: 0x{High:X16}{Low:X16}";
159+
string endString = $"Low: {GetLow()}";
160+
switch (GetHighType())
161+
{
162+
case HighGuidType.Housing:
163+
{
164+
var subType = (HousingGuidType)((High >> 53) & 0x1F);
165+
return subType switch
166+
{
167+
HousingGuidType.Decor => $"{baseGuidPart}; SubType: {subType}; RealmID: {(High >> 32) & 0xFFFF}; DecorID: {High & 0xFFFFFFFF}; {endString}",
168+
HousingGuidType.Neighborhood => $"{baseGuidPart}; SubType: {subType}; NeighborhoodMapID: {(High >> 32) & 0xFFFF}; Arg2: {High & 0xFFFFFFFF}; {endString}",
169+
HousingGuidType.RoomComponent => $"{baseGuidPart}; SubType: {subType}; HouseRoomID: {High & 0xFFFFFFFF}; {endString}",
170+
HousingGuidType.House => $"{baseGuidPart}; SubType: {subType}; NeighborhoodMapID: {Low & 0x7FFF}; Arg2: {(Low >> 15) & 0x3F}; {endString}",
171+
_ => $"{baseGuidPart}; SubType: Unknown({(byte)subType}); {endString}",
172+
};
173+
}
174+
}
175+
158176
if (HasEntry())
159177
{
160178
StoreNameType type = StoreNameType.None;

0 commit comments

Comments
 (0)