Fixes loading, *Command system is broke* Will fix in the coming days.

This commit is contained in:
hondacrx
2022-06-02 17:00:58 -04:00
parent 0af9f22d70
commit 11e8c2f4f2
26 changed files with 268 additions and 137 deletions
@@ -48,7 +48,7 @@ namespace Game.Networking.Packets
uint knownPetSize = _worldPacket.ReadUInt32();
MaxPetLevel = _worldPacket.ReadInt8();
int sizeLimit = CliDB.BattlePetSpeciesStorage.Count / 8 +1;
uint sizeLimit = CliDB.BattlePetSpeciesStorage.GetNumRows() / 8 + 1;
if (knownPetSize >= sizeLimit)
throw new System.Exception($"Attempted to read more array elements from packet {knownPetSize} than allowed {sizeLimit}");
@@ -776,7 +776,7 @@ namespace Game.Networking.Packets
public sbyte ArenaSlot;
}
struct BattlegroundCapturePointInfo
class BattlegroundCapturePointInfo
{
public ObjectGuid Guid;
public Vector2 Pos;
@@ -680,7 +680,7 @@ namespace Game.Networking.Packets
public DeclinedName DeclinedNames = new();
}
public struct NameCacheUnused920
public class NameCacheUnused920
{
public uint Unused1;
public ObjectGuid Unused2;
@@ -700,23 +700,23 @@ namespace Game.Networking.Packets
public struct NameCacheLookupResult
{
public ObjectGuid Player;
public byte Result = 0; // 0 - full packet, != 0 - only guid
public byte Result; // 0 - full packet, != 0 - only guid
public PlayerGuidLookupData Data;
public NameCacheUnused920? Unused920;
public NameCacheUnused920 Unused920;
public void Write(WorldPacket data)
{
data.WriteUInt8(Result);
data.WritePackedGuid(Player);
data.WriteBit(Data != null);
data.WriteBit(Unused920.HasValue);
data.WriteBit(Unused920 != null);
data.FlushBits();
if (Data != null)
Data.Write(data);
if (Unused920.HasValue)
Unused920.Value.Write(data);
if (Unused920 != null)
Unused920.Write(data);
}
}