iHero Posted June 21, 2015 Author Share Posted June 21, 2015 **Description**When a player disconnects, the Player_HighIndex is not updated.**Server~Side**> modServerTCPIn _S__ub CloseSocket_ below:```Call ClearPlayer(index)```Add:``` Dim i As Integer ' re-set the high index Player_HighIndex = 0 For i = MAX_PLAYERS To 1 Step -1 If IsConnected(i) Then Player_HighIndex = i Exit For End If Next ' send the new highindex to all logged in players SendHighIndex```**Credits**Me Link to comment Share on other sites More sharing options...
Alerd Posted June 21, 2015 Share Posted June 21, 2015 ```Dim i As Long```**All sub**```Sub CloseSocket(ByVal Index As Long) Dim i As Long If Index > 0 Then Call LeftGame(Index) Call TextAdd("Connection from " & GetPlayerIP(Index) & " has been terminated.") frmServer.Socket(Index).Close Call UpdateCaption Call ClearPlayer(Index) ' re-set the high index Player_HighIndex = 0 For i = MAX_PLAYERS To 1 Step -1 If IsConnected(i) Then Player_HighIndex = i Exit For End If Next ' send the new highindex to all logged in players SendHighIndex End IfEnd Sub``` Link to comment Share on other sites More sharing options...
iHero Posted June 21, 2015 Author Share Posted June 21, 2015 Thanks! 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