fix(core): Removes disposable netstates. (#467)
- [X] Removes IDisposable from NetState - [X] Swaps Disconnect and Dispose methods
This commit is contained in:
parent
079eeb1b96
commit
67625ad249
49 changed files with 204 additions and 210 deletions
|
|
@ -140,7 +140,7 @@ namespace Server.Network
|
|||
|
||||
if (info == null || a == null || cityIndex < 0 || cityIndex >= info.Length)
|
||||
{
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -197,7 +197,7 @@ namespace Server.Network
|
|||
else
|
||||
{
|
||||
state.BlockAllPackets = false;
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -256,7 +256,7 @@ namespace Server.Network
|
|||
|
||||
if (a == null || charSlot < 0 || charSlot >= a.Length)
|
||||
{
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -277,11 +277,11 @@ namespace Server.Network
|
|||
|
||||
if (m == null)
|
||||
{
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
m.NetState?.Dispose();
|
||||
m.NetState?.Disconnect();
|
||||
|
||||
state.SendClientVersionRequest();
|
||||
|
||||
|
|
@ -382,7 +382,7 @@ namespace Server.Network
|
|||
{
|
||||
if (state.SentFirstPacket)
|
||||
{
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -397,7 +397,7 @@ namespace Server.Network
|
|||
)
|
||||
{
|
||||
state.WriteConsole("Invalid client detected, disconnecting");
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -424,7 +424,7 @@ namespace Server.Network
|
|||
}
|
||||
else
|
||||
{
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -436,7 +436,7 @@ namespace Server.Network
|
|||
|
||||
if (info == null || a == null || index < 0 || index >= info.Length)
|
||||
{
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -457,7 +457,7 @@ namespace Server.Network
|
|||
if (state._seed == 0)
|
||||
{
|
||||
state.WriteConsole("Invalid client detected, disconnecting");
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -473,7 +473,7 @@ namespace Server.Network
|
|||
{
|
||||
if (state.SentFirstPacket)
|
||||
{
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -512,7 +512,7 @@ namespace Server.Network
|
|||
private static void AccountLogin_ReplyRej(this NetState state, ALRReason reason)
|
||||
{
|
||||
state.SendAccountLoginRejected(reason);
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
}
|
||||
|
||||
private class LoginTimer : Timer
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ namespace Server.Network
|
|||
);
|
||||
}
|
||||
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ namespace Server.Network
|
|||
if (!buttonExists)
|
||||
{
|
||||
state.WriteConsole("Invalid gump response, disconnecting...");
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -381,7 +381,7 @@ namespace Server.Network
|
|||
if (switchCount < 0 || switchCount > gump.m_Switches)
|
||||
{
|
||||
state.WriteConsole("Invalid gump response, disconnecting...");
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -397,7 +397,7 @@ namespace Server.Network
|
|||
if (textCount < 0 || textCount > gump.m_TextEntries)
|
||||
{
|
||||
state.WriteConsole("Invalid gump response, disconnecting...");
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -411,7 +411,7 @@ namespace Server.Network
|
|||
if (textLength > 239)
|
||||
{
|
||||
state.WriteConsole("Invalid gump response, disconnecting...");
|
||||
state.Dispose();
|
||||
state.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -596,11 +596,11 @@ namespace Server.Network
|
|||
"Sent ingame packet (0xD7x{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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue