Adds BufferReader and BufferWriter. Updates UOP handling. (#101)

This commit is contained in:
Kamron Batman 2020-04-12 21:33:24 -07:00 committed by GitHub
parent 2c0d97cd36
commit 038c3be258
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
98 changed files with 2458 additions and 2185 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Server.Engines.PartySystem;
using Server.Factions;
using Server.Gumps;
@ -160,7 +161,7 @@ namespace Server.Engines.ConPVP
if (spell is RecallSpell)
from.SendMessage("You may not cast this spell.");
string title = null;
string title;
string option;
switch (spell)
@ -498,7 +499,7 @@ namespace Server.Engines.ConPVP
DuelPlayer pl = Find(mob);
if (pl?.Eliminated == true || m_EventGame?.OnDeath(mob, corpse) == false)
if (pl?.Eliminated != false || m_EventGame?.OnDeath(mob, corpse) == false)
return;
pl.Eliminated = true;
@ -1075,30 +1076,13 @@ namespace Server.Engines.ConPVP
}
}
public static bool CheckCombat(Mobile m)
public static bool CheckCombat(Mobile m) =>
m.Aggressed.Any(info => info.Defender.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay) ||
m.Aggressors.Any(info => info.Attacker.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay);
private static void EventSink_Login(Mobile m)
{
for (int i = 0; i < m.Aggressed.Count; ++i)
{
AggressorInfo info = m.Aggressed[i];
if (info.Defender.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay)
return true;
}
for (int i = 0; i < m.Aggressors.Count; ++i)
{
AggressorInfo info = m.Aggressors[i];
if (info.Attacker.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay)
return true;
}
return false;
}
private static void EventSink_Login(LoginEventArgs e)
{
if (!(e.Mobile is PlayerMobile pm))
if (!(m is PlayerMobile pm))
return;
DuelContext dc = pm.DuelContext;