Skip to content

Commit ea5c9a0

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

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,25 @@ public override string ToString()
155155
if (Low == 0 && High == 0)
156156
return "Full: 0x0";
157157

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

0 commit comments

Comments
 (0)