Core/Calendar: Implement different timezone support for ingame calendar
Port From (https://github.com/TrinityCore/TrinityCore/commit/b888b1b09f71a8b8b4a9d45c804a1f164fb65ac3)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user