Core/Calendar: Implement different timezone support for ingame calendar
Port From (https://github.com/TrinityCore/TrinityCore/commit/b888b1b09f71a8b8b4a9d45c804a1f164fb65ac3)
This commit is contained in:
@@ -60,7 +60,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WritePackedGuid(PlayerGUID);
|
||||
_worldPacket.WriteUInt32(Unused_10_1_5);
|
||||
_worldPacket.WriteUInt32(Flags);
|
||||
_worldPacket.WritePackedTime(CurrentTime);
|
||||
CurrentTime.Write(_worldPacket);
|
||||
_worldPacket.WriteInt64(ElapsedTime);
|
||||
_worldPacket.WriteInt64(CreationTime);
|
||||
_worldPacket.WriteBit(RafAcceptanceID.HasValue);
|
||||
@@ -75,7 +75,7 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid PlayerGUID;
|
||||
public uint Unused_10_1_5;
|
||||
public uint Flags;
|
||||
public long CurrentTime;
|
||||
public WowTime CurrentTime;
|
||||
public long ElapsedTime;
|
||||
public long CreationTime;
|
||||
public ulong? RafAcceptanceID;
|
||||
@@ -128,7 +128,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WritePackedGuid(Sender);
|
||||
_worldPacket.WritePackedGuid(Earner);
|
||||
_worldPacket.WriteUInt32(AchievementID);
|
||||
_worldPacket.WritePackedTime(Time);
|
||||
Time.Write(_worldPacket);
|
||||
_worldPacket.WriteUInt32(EarnerNativeRealm);
|
||||
_worldPacket.WriteUInt32(EarnerVirtualRealm);
|
||||
_worldPacket.WriteBit(Initial);
|
||||
@@ -139,7 +139,7 @@ namespace Game.Networking.Packets
|
||||
public uint EarnerNativeRealm;
|
||||
public uint EarnerVirtualRealm;
|
||||
public uint AchievementID;
|
||||
public long Time;
|
||||
public WowTime Time;
|
||||
public bool Initial;
|
||||
public ObjectGuid Sender;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteUInt32(progress.CriteriaID);
|
||||
_worldPacket.WriteInt64(progress.DateCreated);
|
||||
_worldPacket.WriteInt64(progress.DateStarted);
|
||||
_worldPacket.WritePackedTime(progress.DateUpdated);
|
||||
progress.DateUpdated.Write(_worldPacket);
|
||||
_worldPacket.WriteUInt32(0); // this is a hack. this is a packed time written as int64 (progress.DateUpdated)
|
||||
_worldPacket.WriteUInt64(progress.Quantity);
|
||||
_worldPacket.WritePackedGuid(progress.PlayerGUID);
|
||||
@@ -222,12 +222,12 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WritePackedGuid(GuildGUID);
|
||||
_worldPacket.WriteUInt32(AchievementID);
|
||||
_worldPacket.WritePackedTime(TimeDeleted);
|
||||
TimeDeleted.Write(_worldPacket);
|
||||
}
|
||||
|
||||
public ObjectGuid GuildGUID;
|
||||
public uint AchievementID;
|
||||
public long TimeDeleted;
|
||||
public WowTime TimeDeleted;
|
||||
}
|
||||
|
||||
public class GuildAchievementEarned : ServerPacket
|
||||
@@ -238,12 +238,12 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WritePackedGuid(GuildGUID);
|
||||
_worldPacket.WriteUInt32(AchievementID);
|
||||
_worldPacket.WritePackedTime(TimeEarned);
|
||||
TimeEarned.Write(_worldPacket);
|
||||
}
|
||||
|
||||
public uint AchievementID;
|
||||
public ObjectGuid GuildGUID;
|
||||
public long TimeEarned;
|
||||
public WowTime TimeEarned;
|
||||
}
|
||||
|
||||
public class AllGuildAchievements : ServerPacket
|
||||
@@ -301,14 +301,14 @@ namespace Game.Networking.Packets
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteUInt32(Id);
|
||||
data.WritePackedTime(Date);
|
||||
Date.Write(data);
|
||||
data.WritePackedGuid(Owner);
|
||||
data.WriteUInt32(VirtualRealmAddress);
|
||||
data.WriteUInt32(NativeRealmAddress);
|
||||
}
|
||||
|
||||
public uint Id;
|
||||
public long Date;
|
||||
public WowTime Date;
|
||||
public ObjectGuid Owner;
|
||||
public uint VirtualRealmAddress;
|
||||
public uint NativeRealmAddress;
|
||||
@@ -323,7 +323,7 @@ namespace Game.Networking.Packets
|
||||
data.WritePackedGuid(Player);
|
||||
data.WriteUInt32(Unused_10_1_5);
|
||||
data.WriteUInt32(Flags);
|
||||
data.WritePackedTime(Date);
|
||||
Date.Write(data);
|
||||
data.WriteInt64(TimeFromStart);
|
||||
data.WriteInt64(TimeFromCreate);
|
||||
data.WriteBit(RafAcceptanceID.HasValue);
|
||||
@@ -338,7 +338,7 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid Player;
|
||||
public uint Unused_10_1_5;
|
||||
public uint Flags;
|
||||
public long Date;
|
||||
public WowTime Date;
|
||||
public long TimeFromStart;
|
||||
public long TimeFromCreate;
|
||||
public ulong? RafAcceptanceID;
|
||||
@@ -349,7 +349,7 @@ namespace Game.Networking.Packets
|
||||
public uint CriteriaID;
|
||||
public long DateCreated;
|
||||
public long DateStarted;
|
||||
public long DateUpdated;
|
||||
public WowTime DateUpdated;
|
||||
public ulong Quantity;
|
||||
public ObjectGuid PlayerGUID;
|
||||
public int Unused_10_1_5;
|
||||
|
||||
@@ -101,13 +101,14 @@ namespace Game.Networking.Packets
|
||||
EventID = _worldPacket.ReadUInt64();
|
||||
ModeratorID = _worldPacket.ReadUInt64();
|
||||
EventClubID = _worldPacket.ReadUInt64();
|
||||
Date = _worldPacket.ReadPackedTime();
|
||||
Date = new();
|
||||
Date.Read(_worldPacket);
|
||||
}
|
||||
|
||||
public ulong ModeratorID;
|
||||
public ulong EventID;
|
||||
public ulong EventClubID;
|
||||
public long Date;
|
||||
public WowTime Date;
|
||||
}
|
||||
|
||||
class CalendarInviteAdded : ServerPacket
|
||||
@@ -122,14 +123,14 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteUInt8(Level);
|
||||
_worldPacket.WriteUInt8((byte)Status);
|
||||
_worldPacket.WriteUInt8(Type);
|
||||
_worldPacket.WritePackedTime(ResponseTime);
|
||||
ResponseTime.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteBit(ClearPending);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public ulong InviteID;
|
||||
public long ResponseTime;
|
||||
public WowTime ResponseTime;
|
||||
public byte Level = 100;
|
||||
public ObjectGuid InviteGuid;
|
||||
public ulong EventID;
|
||||
@@ -144,7 +145,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedTime(ServerTime);
|
||||
ServerTime.Write(_worldPacket);
|
||||
_worldPacket.WriteInt32(Invites.Count);
|
||||
_worldPacket.WriteInt32(Events.Count);
|
||||
_worldPacket.WriteInt32(RaidLockouts.Count);
|
||||
@@ -159,7 +160,7 @@ namespace Game.Networking.Packets
|
||||
Event.Write(_worldPacket);
|
||||
}
|
||||
|
||||
public long ServerTime;
|
||||
public WowTime ServerTime;
|
||||
public List<CalendarSendCalendarInviteInfo> Invites = new();
|
||||
public List<CalendarSendCalendarRaidLockoutInfo> RaidLockouts = new();
|
||||
public List<CalendarSendCalendarEventInfo> Events = new();
|
||||
@@ -177,9 +178,9 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteUInt8((byte)GetEventType);
|
||||
_worldPacket.WriteInt32(TextureID);
|
||||
_worldPacket.WriteUInt32((uint)Flags);
|
||||
_worldPacket.WritePackedTime(Date);
|
||||
_worldPacket.WriteUInt32((uint)LockDate);
|
||||
_worldPacket.WritePackedGuid(EventGuildID);
|
||||
Date.Write(_worldPacket);
|
||||
LockDate.Write(_worldPacket);
|
||||
_worldPacket.WriteUInt64(EventGuildID);
|
||||
_worldPacket.WriteInt32(Invites.Count);
|
||||
|
||||
_worldPacket.WriteBits(EventName.GetByteCount(), 8);
|
||||
@@ -194,10 +195,10 @@ namespace Game.Networking.Packets
|
||||
}
|
||||
|
||||
public ObjectGuid OwnerGuid;
|
||||
public ObjectGuid EventGuildID;
|
||||
public ulong EventGuildID;
|
||||
public ulong EventID;
|
||||
public long Date;
|
||||
public long LockDate;
|
||||
public WowTime Date;
|
||||
public WowTime LockDate;
|
||||
public CalendarFlags Flags;
|
||||
public int TextureID;
|
||||
public CalendarEventType GetEventType;
|
||||
@@ -214,11 +215,11 @@ namespace Game.Networking.Packets
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt64(EventID);
|
||||
_worldPacket.WritePackedTime(Date);
|
||||
Date.Write(_worldPacket);
|
||||
_worldPacket.WriteUInt32((uint)Flags);
|
||||
_worldPacket.WriteUInt8((byte)EventType);
|
||||
_worldPacket.WriteInt32(TextureID);
|
||||
_worldPacket.WritePackedGuid(EventGuildID);
|
||||
_worldPacket.WriteUInt64(EventClubID);
|
||||
_worldPacket.WriteUInt64(InviteID);
|
||||
_worldPacket.WriteUInt8((byte)Status);
|
||||
_worldPacket.WriteUInt8((byte)ModeratorStatus);
|
||||
@@ -233,12 +234,12 @@ namespace Game.Networking.Packets
|
||||
}
|
||||
|
||||
public ObjectGuid OwnerGuid;
|
||||
public ObjectGuid EventGuildID;
|
||||
public ulong EventClubID;
|
||||
public ObjectGuid InvitedByGuid;
|
||||
public ulong InviteID;
|
||||
public ulong EventID;
|
||||
public CalendarFlags Flags;
|
||||
public long Date;
|
||||
public WowTime Date;
|
||||
public int TextureID;
|
||||
public CalendarInviteStatus Status;
|
||||
public CalendarEventType EventType;
|
||||
@@ -295,10 +296,10 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WritePackedGuid(InviteGuid);
|
||||
_worldPacket.WriteUInt64(EventID);
|
||||
_worldPacket.WritePackedTime(Date);
|
||||
Date.Write(_worldPacket);
|
||||
_worldPacket.WriteUInt32((uint)Flags);
|
||||
_worldPacket.WriteUInt8((byte)Status);
|
||||
_worldPacket.WritePackedTime(ResponseTime);
|
||||
ResponseTime.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteBit(ClearPending);
|
||||
_worldPacket.FlushBits();
|
||||
@@ -308,8 +309,8 @@ namespace Game.Networking.Packets
|
||||
public ulong EventID;
|
||||
public CalendarInviteStatus Status;
|
||||
public bool ClearPending;
|
||||
public long ResponseTime;
|
||||
public long Date;
|
||||
public WowTime ResponseTime;
|
||||
public WowTime Date;
|
||||
public ObjectGuid InviteGuid;
|
||||
}
|
||||
|
||||
@@ -360,13 +361,13 @@ namespace Game.Networking.Packets
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt64(EventID);
|
||||
_worldPacket.WritePackedTime(Date);
|
||||
Date.Write(_worldPacket);
|
||||
_worldPacket.WriteUInt32((uint)Flags);
|
||||
_worldPacket.WriteUInt8((byte)Status);
|
||||
}
|
||||
|
||||
public ulong EventID;
|
||||
public long Date;
|
||||
public WowTime Date;
|
||||
public CalendarFlags Flags;
|
||||
public CalendarInviteStatus Status;
|
||||
}
|
||||
@@ -386,9 +387,9 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WriteUInt64(EventID);
|
||||
|
||||
_worldPacket.WritePackedTime(OriginalDate);
|
||||
_worldPacket.WritePackedTime(Date);
|
||||
_worldPacket.WriteUInt32((uint)LockDate);
|
||||
OriginalDate.Write(_worldPacket);
|
||||
Date.Write(_worldPacket);
|
||||
LockDate.Write(_worldPacket);
|
||||
_worldPacket.WriteUInt32((uint)Flags);
|
||||
_worldPacket.WriteInt32(TextureID);
|
||||
_worldPacket.WriteUInt8((byte)EventType);
|
||||
@@ -403,10 +404,10 @@ namespace Game.Networking.Packets
|
||||
}
|
||||
|
||||
public ulong EventID;
|
||||
public long Date;
|
||||
public WowTime Date;
|
||||
public CalendarFlags Flags;
|
||||
public long LockDate;
|
||||
public long OriginalDate;
|
||||
public WowTime LockDate;
|
||||
public WowTime OriginalDate;
|
||||
public int TextureID;
|
||||
public CalendarEventType EventType;
|
||||
public bool ClearPending;
|
||||
@@ -421,14 +422,14 @@ namespace Game.Networking.Packets
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt64(EventID);
|
||||
_worldPacket.WritePackedTime(Date);
|
||||
Date.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteBit(ClearPending);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public ulong EventID;
|
||||
public long Date;
|
||||
public WowTime Date;
|
||||
public bool ClearPending;
|
||||
}
|
||||
|
||||
@@ -576,7 +577,7 @@ namespace Game.Networking.Packets
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt64(InstanceID);
|
||||
_worldPacket.WriteUInt32(ServerTime);
|
||||
ServerTime.Write(_worldPacket);
|
||||
_worldPacket.WriteInt32(MapID);
|
||||
_worldPacket.WriteUInt32((uint)DifficultyID);
|
||||
_worldPacket.WriteInt32(TimeRemaining);
|
||||
@@ -585,7 +586,7 @@ namespace Game.Networking.Packets
|
||||
public ulong InstanceID;
|
||||
public Difficulty DifficultyID;
|
||||
public int TimeRemaining;
|
||||
public uint ServerTime;
|
||||
public WowTime ServerTime;
|
||||
public int MapID;
|
||||
}
|
||||
|
||||
@@ -611,14 +612,14 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedTime(ServerTime);
|
||||
ServerTime.Write(_worldPacket);
|
||||
_worldPacket.WriteInt32(MapID);
|
||||
_worldPacket.WriteUInt32(DifficultyID);
|
||||
_worldPacket.WriteInt32(OldTimeRemaining);
|
||||
_worldPacket.WriteInt32(NewTimeRemaining);
|
||||
}
|
||||
|
||||
public long ServerTime;
|
||||
public WowTime ServerTime;
|
||||
public int MapID;
|
||||
public uint DifficultyID;
|
||||
public int NewTimeRemaining;
|
||||
@@ -754,7 +755,7 @@ namespace Game.Networking.Packets
|
||||
ClubId = data.ReadUInt64();
|
||||
EventType = data.ReadUInt8();
|
||||
TextureID = data.ReadInt32();
|
||||
Time = data.ReadPackedTime();
|
||||
Time.Read(data);
|
||||
Flags = data.ReadUInt32();
|
||||
var InviteCount = data.ReadUInt32();
|
||||
|
||||
@@ -777,7 +778,7 @@ namespace Game.Networking.Packets
|
||||
public string Description;
|
||||
public byte EventType;
|
||||
public int TextureID;
|
||||
public long Time;
|
||||
public WowTime Time;
|
||||
public uint Flags;
|
||||
public CalendarAddEventInviteInfo[] Invites = new CalendarAddEventInviteInfo[(int)SharedConst.CalendarMaxInvites];
|
||||
}
|
||||
@@ -791,7 +792,8 @@ namespace Game.Networking.Packets
|
||||
ModeratorID = data.ReadUInt64();
|
||||
EventType = data.ReadUInt8();
|
||||
TextureID = data.ReadUInt32();
|
||||
Time = data.ReadPackedTime();
|
||||
Time = new();
|
||||
Time.Read(data);
|
||||
Flags = data.ReadUInt32();
|
||||
|
||||
byte titleLen = data.ReadBits<byte>(8);
|
||||
@@ -808,7 +810,7 @@ namespace Game.Networking.Packets
|
||||
public string Description;
|
||||
public byte EventType;
|
||||
public uint TextureID;
|
||||
public long Time;
|
||||
public WowTime Time;
|
||||
public uint Flags;
|
||||
}
|
||||
|
||||
@@ -856,7 +858,7 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
data.WriteUInt64(EventID);
|
||||
data.WriteUInt8((byte)EventType);
|
||||
data.WritePackedTime(Date);
|
||||
Date.Write(data);
|
||||
data.WriteUInt32((uint)Flags);
|
||||
data.WriteInt32(TextureID);
|
||||
data.WriteUInt64(EventClubID);
|
||||
@@ -870,7 +872,7 @@ namespace Game.Networking.Packets
|
||||
public ulong EventID;
|
||||
public string EventName;
|
||||
public CalendarEventType EventType;
|
||||
public long Date;
|
||||
public WowTime Date;
|
||||
public CalendarFlags Flags;
|
||||
public int TextureID;
|
||||
public ulong EventClubID;
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Game.Networking.Packets
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteInt32(NumAccounts);
|
||||
_worldPacket.WritePackedTime(CreateDate);
|
||||
CreateDate.Write(_worldPacket);
|
||||
_worldPacket.WriteInt32(GuildFlags);
|
||||
_worldPacket.WriteInt32(MemberData.Count);
|
||||
_worldPacket.WriteBits(WelcomeText.GetByteCount(), 11);
|
||||
@@ -128,7 +128,7 @@ namespace Game.Networking.Packets
|
||||
public List<GuildRosterMemberData> MemberData;
|
||||
public string WelcomeText;
|
||||
public string InfoText;
|
||||
public uint CreateDate;
|
||||
public WowTime CreateDate;
|
||||
public int NumAccounts;
|
||||
public int GuildFlags;
|
||||
}
|
||||
@@ -1765,7 +1765,7 @@ namespace Game.Networking.Packets
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteInt32(Id);
|
||||
data.WritePackedTime(CompletedDate);
|
||||
CompletedDate.Write(data);
|
||||
data.WriteInt32(Type);
|
||||
data.WriteInt32(Flags);
|
||||
|
||||
@@ -1786,7 +1786,7 @@ namespace Game.Networking.Packets
|
||||
}
|
||||
|
||||
public int Id;
|
||||
public uint CompletedDate;
|
||||
public WowTime CompletedDate;
|
||||
public int Type;
|
||||
public int Flags;
|
||||
public int[] Data = new int[2];
|
||||
|
||||
@@ -62,8 +62,8 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedTime(ServerTime);
|
||||
_worldPacket.WritePackedTime(GameTime);
|
||||
ServerTime.Write(_worldPacket);
|
||||
GameTime.Write(_worldPacket);
|
||||
_worldPacket.WriteFloat(NewSpeed);
|
||||
_worldPacket.WriteInt32(ServerTimeHolidayOffset);
|
||||
_worldPacket.WriteInt32(GameTimeHolidayOffset);
|
||||
@@ -71,8 +71,8 @@ namespace Game.Networking.Packets
|
||||
|
||||
public float NewSpeed;
|
||||
public int ServerTimeHolidayOffset;
|
||||
public uint GameTime;
|
||||
public uint ServerTime;
|
||||
public WowTime GameTime;
|
||||
public WowTime ServerTime;
|
||||
public int GameTimeHolidayOffset;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user