Auto Relog Function (Bot DC)

12/11/2016 21:30 Mr.Awesome1337#1
Hey Guys, i need to make a Auto Relog Function when the clientless (bot) god dc automatic relog again the problem i face it about the packet i used this packet

if (current.Opcode == 0xB010 && current.ReadUInt8() == 0x01)
}
Globals.MainWindow.Log.Add("Got DC");
{

this Opcode got it from Analayzer

[IMG=expandable: 1][Only registered and activated users can see links. Click Here To Register...][/IMG]

BUT Nothin happen in My Log to recive this message "Got DC"
12/12/2016 02:56 florian0#2
There is no packet that tells you reliable: you are disconnected ... consider someone unplugging network interface. how would that packet reach your client? you should consider detecting a disconnect by the socket state (e.g. timeout).
12/13/2016 07:53 B1Q#3
Code:
 bool SocketConnected(Socket sock)
    {
        bool b1 = s.Poll(1000, SelectMode.SelectRead);
        bool b2 = (s.Available == 0);
        if (b1 && b2)
            return false;
        else
            return true;
    }
execute this method every 5-10 seconds using a timer?

use it like this

Code:
if(!SocketConnected(Agent.ag_socket))
{
 // Client Disconnected
// Restart Client or Reconnect
}
12/13/2016 11:09 Mr.Awesome1337#4
Quote:
Originally Posted by B1QB0SS :3 View Post
Code:
 bool SocketConnected(Socket sock)
    {
        bool b1 = s.Poll(1000, SelectMode.SelectRead);
        bool b2 = (s.Available == 0);
        if (b1 && b2)
            return false;
        else
            return true;
    }
execute this method every 5-10 seconds using a timer?

use it like this

Code:
if(!SocketConnected(Agent.ag_socket))
{
 // Client Disconnected
// Restart Client or Reconnect
}
Thank You for help
12/14/2016 08:35 Isoline#5
Actually, all of the above could work, however, if you know what these attributes means, i would not advise you to use them as they could lead to some integrity issues.
In that case, i would simply make a simple code snippet in the ping packet loop on the client outgoing traffic, that checks whats the last time the client pinged, obviously if the value is greater then 10, then client is obviously offline.