fix(core): Removes disposable netstates. (#467)

- [X] Removes IDisposable from NetState
- [X] Swaps Disconnect and Dispose methods
This commit is contained in:
Kamron Batman 2021-02-05 14:33:35 -08:00 • committed by GitHub
parent 079eeb1b96
commit 67625ad249
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 204 additions and 210 deletions

View file

@ -216,7 +216,7 @@ namespace Server.Misc
{
if (!(state.Account is Account acct))
{
state.Dispose();
state.Disconnect();
return;
}

View file

@ -1250,7 +1250,7 @@ namespace Server.Commands.Generic
AddResponse($"They have been {(m_Ban ? "banned" : "kicked")}.");
targState.Dispose();
targState.Disconnect();
if (m_Ban)
{

View file

@ -2365,7 +2365,7 @@ namespace Server.Gumps
if (!hasAccess)
{
ns.Dispose();
ns.Disconnect();
++count;
}
}
@ -3736,7 +3736,7 @@ namespace Server.Gumps
"kicking",
CommandLogging.Format(m)
);
ns.Dispose();
ns.Disconnect();
notice = "They have been kicked.";
}
else
@ -3762,7 +3762,7 @@ namespace Server.Gumps
var ns = m.NetState;
ns?.Dispose();
ns?.Disconnect();
notice = "They have been banned.";
}

View file

@ -272,7 +272,7 @@ namespace Server.Gumps
{
focus.Say("I've been kicked!");
m_State.Dispose();
m_State.Disconnect();
CommandLogging.WriteLine(
from,

View file

@ -121,7 +121,7 @@ namespace Server.Items
pm.PlaceInBackpack(m_Bedroll);
pm.BedrollLogout = true;
sender.Dispose();
sender.Disconnect();
}
Campfire.RemoveEntry(m_Entry);

View file

@ -172,7 +172,7 @@ namespace Server.Misc
if (ns.Connection != null)
{
ns.WriteConsole("Disconnecting, bad version");
ns.Dispose();
ns.Disconnect();
}
}

View file

@ -99,7 +99,7 @@ namespace Server.Misc
return true;
case ProfanityAction.Disconnect:
{
from.NetState?.Dispose();
from.NetState?.Disconnect();
return false;
}

View file

@ -1287,7 +1287,7 @@ namespace Server.Mobiles
if (from.NetState != null)
{
Timer.DelayCall(TimeSpan.FromSeconds(1.0), from.NetState.Dispose);
Timer.DelayCall(TimeSpan.FromSeconds(1.0), from.NetState.Disconnect);
}
}
else if (from.AccessLevel >= AccessLevel.Administrator)

View file

@ -39,11 +39,11 @@ namespace Server.Network
if (ph.Ingame && state.Mobile == null)
{
state.WriteConsole("Sent in-game packet (0xBFx{0:X2}) before having been attached to a mobile", packetID);
state.Dispose();
state.Disconnect();
}
else if (ph.Ingame && state.Mobile.Deleted)
{
state.Dispose();
state.Disconnect();
}
else
{