Matt Posted October 1, 2014 Author Share Posted October 1, 2014 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)"Right before```CallWindowProc HandleDataSub(MsgType), index, Buffer.ReadBytes(Buffer.Length), 0, 0```put there```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! Link to comment Share on other sites More sharing options...
Colonello Posted October 1, 2014 Share Posted October 1, 2014 Will this work for EO 3 also? Link to comment Share on other sites More sharing options...
Officer Johnson Posted October 1, 2014 Share Posted October 1, 2014 Yes Link to comment Share on other sites More sharing options...
Colonello Posted October 1, 2014 Share Posted October 1, 2014 > YesGreat :D Link to comment Share on other sites More sharing options...
abhi2011 Posted October 1, 2014 Share Posted October 1, 2014 Why check it every 25ms? Why not every second? Link to comment Share on other sites More sharing options...
Matt Posted October 1, 2014 Author Share Posted October 1, 2014 It's just a simple check inside a pre-existing for statement, so it won't really make a visible difference on performance. But, I suppose it would be proper to make it every second. I'll update the tutorial.EDIT: Actually, every half a second should be better. I updated the tutorial. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now