mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-10 07:05:41 +12:00
push whatever is left before i go for the night lol
This commit is contained in:
parent
bd16f0386a
commit
2e1174efbb
1 changed files with 11 additions and 8 deletions
|
@ -93,7 +93,8 @@ namespace HISP.Server
|
||||||
LoggedinUser.Tiredness--;
|
LoggedinUser.Tiredness--;
|
||||||
}
|
}
|
||||||
|
|
||||||
minuteTimer.Change(oneMinute, oneMinute);
|
if(!isDisconnecting)
|
||||||
|
minuteTimer.Change(oneMinute, oneMinute);
|
||||||
dcLock = false;
|
dcLock = false;
|
||||||
}
|
}
|
||||||
private void keepAliveTimerTick(object state)
|
private void keepAliveTimerTick(object state)
|
||||||
|
@ -148,7 +149,7 @@ namespace HISP.Server
|
||||||
// HI1 Packets are terminates by 0x00 so we have to read until we receive that terminator
|
// HI1 Packets are terminates by 0x00 so we have to read until we receive that terminator
|
||||||
|
|
||||||
|
|
||||||
while(ClientSocket.Connected)
|
while(ClientSocket.Connected && !isDisconnecting)
|
||||||
{
|
{
|
||||||
if(isDisconnecting)
|
if(isDisconnecting)
|
||||||
break;
|
break;
|
||||||
|
@ -180,7 +181,7 @@ namespace HISP.Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(SocketException e)
|
catch(SocketException)
|
||||||
{
|
{
|
||||||
Disconnect();
|
Disconnect();
|
||||||
break;
|
break;
|
||||||
|
@ -188,10 +189,11 @@ namespace HISP.Server
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while(dcLock) { }; // Refuse to shut down until dcLock is cleared. (prevents TOCTOU issues.)
|
while (dcLock) { }; // Refuse to shut down until dcLock is cleared. (prevents TOCTOU issues.)
|
||||||
|
|
||||||
// Shutdown sockets
|
|
||||||
if(updateTimer != null)
|
// Stop Timers
|
||||||
|
if (updateTimer != null)
|
||||||
updateTimer.Dispose();
|
updateTimer.Dispose();
|
||||||
if(inactivityTimer != null)
|
if(inactivityTimer != null)
|
||||||
inactivityTimer.Dispose();
|
inactivityTimer.Dispose();
|
||||||
|
@ -200,14 +202,15 @@ namespace HISP.Server
|
||||||
if(kickTimer != null)
|
if(kickTimer != null)
|
||||||
kickTimer.Dispose();
|
kickTimer.Dispose();
|
||||||
|
|
||||||
|
// Call OnDisconnect
|
||||||
GameServer.OnDisconnect(this);
|
GameServer.OnDisconnect(this);
|
||||||
LoggedIn = false;
|
LoggedIn = false;
|
||||||
LoggedinUser = null;
|
LoggedinUser = null;
|
||||||
|
// Close Sockets
|
||||||
ClientSocket.Close();
|
ClientSocket.Close();
|
||||||
ClientSocket.Dispose();
|
ClientSocket.Dispose();
|
||||||
|
|
||||||
return isDisconnecting; // Stop the thread.
|
return isDisconnecting; // Stop the thread.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parsePackets(byte[] Packet)
|
private void parsePackets(byte[] Packet)
|
||||||
|
|
Loading…
Add table
Reference in a new issue