This is a pretty easy edit, and it’s all server-sided.
First, go to modConstants and chuck this anywhere.
Public Const TIMEOUT_DURATION As Long = 5000 ' 5 seconds
Now, go to modTypes and look for TempPlayerRec. Add this at the bottom.
LastActive As Long
Look for the sub “HandleData(ByVal index As Long, ByRef Data() As Byte)”
CallWindowProc HandleDataSub(MsgType), index, Buffer.ReadBytes(Buffer.Length), 0, 0
TempPlayer(index).LastActive = GetTickCount
Finally, go to your gameloop and look for the lines
' Check for disconnections every half second If Tick > tmr500 Then For i = 1 To MAX_PLAYERS
Put this right after it.
If IsPlaying(i) Then ' Check to see if they've been inactive for too long. If Tick - TempPlayer(i).LastActive > TIMEOUT_DURATION And TempPlayer(i).LastActive <> 0 Then Call CloseSocket(i) End If
Save, and compile; you’re done!