Disconnect user from JoinServer via PHP

Results 1 to 2 of 2
  1. #1
    Don't be afraid to ask! RevolGaming is offline
    MemberRank
    Jun 2012 Join Date
    1,458Posts

    Disconnect user from JoinServer via PHP

    Hi,
    $dc = mssql_query("exec WZ_DISCONNECT_MEMB $user_auth_id");
    function ascii2hex($ascii)
    {
    $hex = '';
    for ($i = 0; $i < strlen($ascii); $i++)
    {
    $byte = strtoupper(dechex(ord($ascii{$i})));
    $byte = str_repeat('0', 2 - strlen($byte)).$byte;
    $hex .= $byte." ";
    }
    $hex = str_replace(" ", "", $hex);
    return $hex;
    }
    function hex2ascii($hex)
    {
    $ascii = '';
    $hex = str_replace(" ", "", $hex);
    for ($i = 0; $i < strlen($hex); $i = $i + 2) {
    $ascii .= chr(hexdec(substr($hex, $i, 2)));
    }
    return ($ascii);
    }
    function dc_user($host, $port, $user)
    {
    $mystring = "C11405";
    $mystring .= ascii2hex($user);
    $zeros = strlen($mystring);
    for ($i; $i <= 39 - $zeros; $i++){
    $mystring .= "0";
    }
    $packet = hex2ascii($mystring);
    $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
    if (!$x = @socket_connect($socket, $host, $port))
    {
    echo msg('0','Vyskytla sa neočakávaná chyba, akciu opakuj neskôr prosím.');
    }
    else
    {
    socket_write($socket, $packet, strlen($packet));
    socket_close($socket);
    }
    }
    dc_user("SRVIP", "56972", $user_auth_id);
    My friend give me this part of code. My problem is I want to send disconnect from website via PHP for user. The database disconnect part is okey. But I need to send disconnect to the joinserver too. So I dont know what to do??

    I need to send disconnect package on joinserver port. But how to do this?

    I know the 90% of the "developer" community is finished working on this old game. But I really want to do this, not because my user's stuck, Just for example if somebody get their account but doesnt change their password and they see their account is online they can disconnect it and change password fast. So its an important modul.

    I am using IIS with 5.4 php, the website CMS is webengine, but maybe just the login and the registration is the original.... I recoded everything and removed everything. So its a totally custom engine now. But after I turn on the php_socket.dll extension on the IIS's PHP the website die always after I click on any menu.

    How or what to do guys?:)


  2. #2
    Let's do this... navossoc is offline
    MemberRank
    Sep 2004 Join Date
    BrazilLocation
    305Posts

    Re: Disconnect user from JoinServer via PHP

    You shouldn't DC people this way...

    You will have a "security breach" allowing people to dupe easily on your server.

    It's best to spent your time fixing the "stuck problem" than doing this.

    []'s



Advertisement