Targets .NET Core 3.0 (#39)

This commit is contained in:
Kamron Batman 2019-08-02 17:53:18 -07:00 • committed by GitHub
parent 0993c03b70
commit 08bf44af9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
125 changed files with 1473 additions and 14244 deletions

View file

@ -10,7 +10,6 @@ using Server.Engines.Craft;
using Server.Engines.Help;
using Server.Engines.MLQuests;
using Server.Engines.MLQuests.Gumps;
using Server.Engines.MyRunUO;
using Server.Engines.PartySystem;
using Server.Engines.Quests;
using Server.Ethics;
@ -155,15 +154,12 @@ namespace Server.Mobiles
m_GuildRank = RankDefinition.Lowest;
ChampionTitles = new ChampionTitleInfo();
InvalidateMyRunUO();
}
public PlayerMobile(Serial s) : base(s)
{
VisibilityList = new List<Mobile>();
m_AntiMacroTable = new Dictionary<Skill, Dictionary<object, CountAndTimeStamp>>();
InvalidateMyRunUO();
}
[CommandProperty(AccessLevel.GameMaster)]
@ -943,9 +939,6 @@ namespace Server.Mobiles
if ((flag & MobileDelta.Stat) != 0)
ValidateEquipment();
if ((flag & (MobileDelta.Name | MobileDelta.Hue)) != 0)
InvalidateMyRunUO();
}
private static void OnLogout(LogoutEventArgs e)
@ -1100,8 +1093,6 @@ namespace Server.Mobiles
if (NetState != null)
CheckLightLevels(false);
InvalidateMyRunUO();
}
public override void OnItemRemoved(Item item)
@ -1117,8 +1108,6 @@ namespace Server.Mobiles
if (NetState != null)
CheckLightLevels(false);
InvalidateMyRunUO();
}
private void AddArmorRating(ref double rating, Item armor)
@ -3095,11 +3084,7 @@ namespace Server.Mobiles
public bool PublicMyRunUO
{
get => GetFlag(PlayerFlag.PublicMyRunUO);
set
{
SetFlag(PlayerFlag.PublicMyRunUO, value);
InvalidateMyRunUO();
}
set => SetFlag(PlayerFlag.PublicMyRunUO, value);
}
[CommandProperty(AccessLevel.GameMaster)]
@ -3868,45 +3853,29 @@ namespace Server.Mobiles
public bool ChangedMyRunUO{ get; set; }
public void InvalidateMyRunUO()
{
if (!Deleted && !ChangedMyRunUO)
{
ChangedMyRunUO = true;
MyRunUO.QueueMobileUpdate(this);
}
}
public override void OnKillsChange(int oldValue)
{
if (Young && Kills > oldValue) ((Account)Account)?.RemoveYoungStatus(0);
InvalidateMyRunUO();
}
public override void OnGenderChanged(bool oldFemale)
{
InvalidateMyRunUO();
}
public override void OnGuildChange(BaseGuild oldGuild)
{
InvalidateMyRunUO();
}
public override void OnGuildTitleChange(string oldTitle)
{
InvalidateMyRunUO();
}
public override void OnKarmaChange(int oldValue)
{
InvalidateMyRunUO();
}
public override void OnFameChange(int oldValue)
{
InvalidateMyRunUO();
}
public override void OnSkillChange(SkillName skill, double oldBase)
@ -3918,31 +3887,21 @@ namespace Server.Mobiles
if (MLQuestSystem.Enabled)
MLQuestSystem.HandleSkillGain(this, skill);
InvalidateMyRunUO();
}
public override void OnAccessLevelChanged(AccessLevel oldLevel)
{
if (AccessLevel == AccessLevel.Player)
IgnoreMobiles = false;
else
IgnoreMobiles = true;
InvalidateMyRunUO();
IgnoreMobiles = AccessLevel != AccessLevel.Player;
}
public override void OnRawStatChange(StatType stat, int oldValue)
{
InvalidateMyRunUO();
}
public override void OnDelete()
{
ReceivedHonorContext?.Cancel();
SentHonorContext?.Cancel();
InvalidateMyRunUO();
}
#endregion
@ -3979,17 +3938,17 @@ namespace Server.Mobiles
return running ? RunFoot : WalkFoot;
}
public static bool MovementThrottle_Callback(NetState ns)
public static TimeSpan MovementThrottle_Callback(NetState ns)
{
if (!(ns.Mobile is PlayerMobile pm) || !pm.UsesFastwalkPrevention)
return true;
return TimeSpan.Zero;
if (!pm.m_HasMoved)
{
// has not yet moved
pm.m_NextMovementTime = Core.TickCount;
pm.m_HasMoved = true;
return true;
return TimeSpan.Zero;
}
long ts = pm.m_NextMovementTime - Core.TickCount;
@ -3998,10 +3957,10 @@ namespace Server.Mobiles
{
// been a while since we've last moved
pm.m_NextMovementTime = Core.TickCount;
return true;
return TimeSpan.Zero;
}
return ts < FastwalkThreshold;
return ts < FastwalkThreshold ? TimeSpan.Zero : TimeSpan.FromTicks(ts);
}
#endregion