Skip to content

Instantly share code, notes, and snippets.

@JABirchall
Created March 13, 2014 00:21
Show Gist options
  • Save JABirchall/9519518 to your computer and use it in GitHub Desktop.
Save JABirchall/9519518 to your computer and use it in GitHub Desktop.
<?php
include('Socket/Server.php');
include('Socket/Client.php');
$address = "194.145.126.133";
$port = 1500;
$p = xml_parser_create();
$s = new Socket\Client($address,$port);
echo 'Writing to ',$address,':',$port,PHP_EOL;
//$p = hex2bin(str_replace(" ", "", "3C 63 6F 6E 6E 65 63 74 20 74 79 70 65 3D 22 54 22 20 69 64 3D 22 31 30 34 31 35 33 34 37 22 20 69 6E 66 6F 3D 22 30 31 66 33 34 39 65 30 30 61 65 34 38 39 63 30 34 65 65 64 37 30 63 66 66 34 38 62 33 38 38 63 34 61 32 31 36 61 39 64 34 66 31 66 39 63 22 20 65 6E 63 5F 73 65 73 73 3D 22 70 47 5A 32 62 68 43 37 75 4B 74 34 6A 32 6D 31 6B 76 75 64 53 50 43 50 55 62 48 54 57 4F 45 68 34 74 49 76 78 33 4E 76 4B 37 6A 35 70 78 39 35 45 57 2B 4E 7C 37 35 30 30 37 35 39 37 22 20 63 68 61 6E 6E 65 6C 3D 22 49 22 20 2F 3E 00"));
$p2 = '<connect type="T" id="10415347" info="01f349e00ae489c04eed70cff48b388c4a216a9d4f1f9c" enc_sess="pGZ2bhC7uKt4j2m1kvudSPCPUbHTWOEh4tIvx3NvK7j5px95EW+N|75007597" channel="I" />'.hex2bin("00");
$s->write($p2);
xml_parse_into_struct($p, $s->read(), $vals);
// var_dump($vals);
// Login check for success and few infomation
if(@$vals[1]["tag"] === "LOGIN" && @$vals[1]["type"] === "complete"){
print_r("LOGIN SUCCESS\nYou have joined a ".$vals[0]["type"]." table called ". $vals[2]["attributes"]["GAME_NAME"] ."\nYour username is ".$vals[1]["attributes"]["NICKNAME"]." Level ".$vals[1]["level"]."\n");
print_r("Min buy in: ".(float)($vals[2]["attributes"]["MIN_BUY_IN"] / 100).", Max buy in: ".(float)($vals[2]["attributes"]["MAX_BUY_IN"] / 100)."");
}
$address2 = "194.145.126.141";
$port2 = 2156;
$s = new Socket\Client($address,$port);
$s->write("S0001lTABLE0000000000!!!!!\"AXT*");
echo $s->read();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment