fix(net): Clean up for mobile packets (#338)

### Breaking Change
- [X] `Mobile.GetOldPacketFlags()` no longer exists. Instead there is a flag for `Mobile.GetPacketFlags()`.

### Non-Breaking Changes
- [X] Consolidates move to world for mobiles
- [X] Consolidates mobile packets between stygian abyss and older

This PR supersedes changes in #337. That PR will need to be redone and broken out anyway.
This commit is contained in:
Kamron Batman 2020-12-10 17:46:58 -08:00 • committed by GitHub
parent 4b2e4fbd36
commit d71856ddbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 234 additions and 932 deletions

View file

@ -118,7 +118,7 @@ namespace Server.Commands
{
if (targ.CanSee(pm))
{
ns.Send(MobileIncoming.Create(ns, targ, pm));
ns.Send(new MobileIncoming(ns, targ, pm));
pm.SendOPLPacketTo(ns);

View file

@ -983,21 +983,9 @@ namespace Server.Mobiles
return true;
}
public override int GetPacketFlags()
public override int GetPacketFlags(bool stygianAbyss)
{
var flags = base.GetPacketFlags();
if (m_IgnoreMobiles)
{
flags |= 0x10;
}
return flags;
}
public override int GetOldPacketFlags()
{
var flags = base.GetOldPacketFlags();
var flags = base.GetPacketFlags(stygianAbyss);
if (m_IgnoreMobiles)
{
@ -4287,17 +4275,7 @@ namespace Server.Mobiles
{
var ns = NetState;
if (ns != null)
{
if (ns.StygianAbyss)
{
ns.Send(new MobileMoving(m, Notoriety.Compute(this, m)));
}
else
{
ns.Send(new MobileMovingOld(m, Notoriety.Compute(this, m)));
}
}
ns?.Send(new MobileMoving(m, Notoriety.Compute(this, m), ns.StygianAbyss));
}
}
}

View file

@ -2196,7 +2196,7 @@ namespace Server.Multis
Stream.Write((byte)m.Direction);
Stream.Write((short)m.Hue);
Stream.Write((byte)m.GetPacketFlags());
Stream.Write((byte)m.GetPacketFlags(true));
}
else if (ent is Item item)
{