Remove custom OptionalType and use the default c# nullable type.

This commit is contained in:
hondacrx
2022-03-01 17:27:56 -05:00
parent cc08afe269
commit c14f1eb3dc
89 changed files with 924 additions and 976 deletions
+4 -4
View File
@@ -104,12 +104,12 @@ namespace Game.Arenas
if (IsRated())
{
pvpLogData.Ratings.Value = new();
pvpLogData.Ratings = new();
for (byte i = 0; i < SharedConst.PvpTeamsCount; ++i)
{
pvpLogData.Ratings.Value.Postmatch[i] = _arenaTeamScores[i].PostMatchRating;
pvpLogData.Ratings.Value.Prematch[i] = _arenaTeamScores[i].PreMatchRating;
pvpLogData.Ratings.Value.PrematchMMR[i] = _arenaTeamScores[i].PreMatchMMR;
pvpLogData.Ratings.Postmatch[i] = _arenaTeamScores[i].PostMatchRating;
pvpLogData.Ratings.Prematch[i] = _arenaTeamScores[i].PreMatchRating;
pvpLogData.Ratings.PrematchMMR[i] = _arenaTeamScores[i].PreMatchMMR;
}
}
}
+4 -4
View File
@@ -34,16 +34,16 @@ namespace Game.Arenas
base.BuildPvPLogPlayerDataPacket(out playerData);
if (PreMatchRating != 0)
playerData.PreMatchRating.Set(PreMatchRating);
playerData.PreMatchRating = PreMatchRating;
if (PostMatchRating != PreMatchRating)
playerData.RatingChange.Set((int)(PostMatchRating - PreMatchRating));
playerData.RatingChange = (int)(PostMatchRating - PreMatchRating);
if (PreMatchMMR != 0)
playerData.PreMatchMMR.Set(PreMatchMMR);
playerData.PreMatchMMR = PreMatchMMR;
if (PostMatchMMR != PreMatchMMR)
playerData.MmrChange.Set((int)(PostMatchMMR - PreMatchMMR));
playerData.MmrChange = (int)(PostMatchMMR - PreMatchMMR);
}
// For Logging purpose
+11 -10
View File
@@ -17,9 +17,10 @@
using Framework.Constants;
using Framework.Dynamic;
using Game.BattleGrounds;
using Game.Entities;
using Game.Networking.Packets;
using Game.BattleGrounds;
using System;
namespace Game.Arenas
{
@@ -44,7 +45,7 @@ namespace Game.Arenas
for (int i = DalaranSewersObjectTypes.Buff1; i <= DalaranSewersObjectTypes.Buff2; ++i)
SpawnBGObject(i, 60);
_events.ScheduleEvent(DalaranSewersEvents.WaterfallWarning, RandomHelper.URand(DalaranSewersData.WaterfallTimerMin, DalaranSewersData.WaterfallTimerMax));
_events.ScheduleEvent(DalaranSewersEvents.WaterfallWarning, DalaranSewersData.WaterfallTimerMin, DalaranSewersData.WaterfallTimerMax);
_events.ScheduleEvent(DalaranSewersEvents.PipeKnockback, DalaranSewersData.PipeKnockbackFirstDelay);
SpawnBGObject(DalaranSewersObjectTypes.Water2, BattlegroundConst.RespawnImmediately);
@@ -148,7 +149,7 @@ namespace Game.Arenas
DoorOpen(DalaranSewersObjectTypes.Water1);
DoorOpen(DalaranSewersObjectTypes.Water2);
_events.CancelEvent(DalaranSewersEvents.WaterfallKnockback);
_events.ScheduleEvent(DalaranSewersEvents.WaterfallWarning, RandomHelper.URand(DalaranSewersData.WaterfallTimerMin, DalaranSewersData.WaterfallTimerMax));
_events.ScheduleEvent(DalaranSewersEvents.WaterfallWarning, DalaranSewersData.WaterfallTimerMin, DalaranSewersData.WaterfallTimerMax);
break;
case DalaranSewersEvents.WaterfallKnockback:
{
@@ -218,14 +219,14 @@ namespace Game.Arenas
struct DalaranSewersData
{
// These values are NOT blizzlike... need the correct data!
public const uint WaterfallTimerMin = 30000;
public const uint WaterfallTimerMax = 60000;
public const uint WaterWarningDuration = 5000;
public const uint WaterfallDuration = 30000;
public const uint WaterfallKnockbackTimer = 1500;
public static TimeSpan WaterfallTimerMin = TimeSpan.FromSeconds(30);
public static TimeSpan WaterfallTimerMax = TimeSpan.FromSeconds(60);
public static TimeSpan WaterWarningDuration = TimeSpan.FromSeconds(5);
public static TimeSpan WaterfallDuration = TimeSpan.FromSeconds(30);
public static TimeSpan WaterfallKnockbackTimer = TimeSpan.FromSeconds(1.5);
public const uint PipeKnockbackFirstDelay = 5000;
public const uint PipeKnockbackDelay = 3000;
public static TimeSpan PipeKnockbackFirstDelay = TimeSpan.FromSeconds(5);
public static TimeSpan PipeKnockbackDelay = TimeSpan.FromSeconds(3);
public const uint PipeKnockbackTotalCount = 2;
public const uint NpcWaterSpout = 28567;
+6 -5
View File
@@ -17,9 +17,10 @@
using Framework.Constants;
using Framework.Dynamic;
using Game.BattleGrounds;
using Game.Entities;
using Game.Networking.Packets;
using Game.BattleGrounds;
using System;
namespace Game.Arenas
{
@@ -95,7 +96,7 @@ namespace Game.Arenas
DoorOpen(RingofValorObjectTypes.Elevator1);
DoorOpen(RingofValorObjectTypes.Elevator2);
_events.ScheduleEvent(RingofValorEvents.OpenFences, 20133);
_events.ScheduleEvent(RingofValorEvents.OpenFences, TimeSpan.FromSeconds(20));
// Should be false at first, TogglePillarCollision will do it.
TogglePillarCollision(true);
@@ -141,17 +142,17 @@ namespace Game.Arenas
// Open fire (only at game start)
for (byte i = RingofValorObjectTypes.Fire1; i <= RingofValorObjectTypes.Firedoor2; ++i)
DoorOpen(i);
_events.ScheduleEvent(RingofValorEvents.CloseFire, 5000);
_events.ScheduleEvent(RingofValorEvents.CloseFire, TimeSpan.FromSeconds(5));
break;
case RingofValorEvents.CloseFire:
for (byte i = RingofValorObjectTypes.Fire1; i <= RingofValorObjectTypes.Firedoor2; ++i)
DoorClose(i);
// Fire got closed after five seconds, leaves twenty seconds before toggling pillars
_events.ScheduleEvent(RingofValorEvents.SwitchPillars, 20000);
_events.ScheduleEvent(RingofValorEvents.SwitchPillars, TimeSpan.FromSeconds(20));
break;
case RingofValorEvents.SwitchPillars:
TogglePillarCollision(true);
_events.Repeat(25000);
_events.Repeat(TimeSpan.FromSeconds(25));
break;
}
});