Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //PHP NAMESERVER SCRIPT BY RAMARAUNT!
- <?php
- header_remove();
- function set_content_length($output)
- {
- header("Content-Length: ".strlen($output));
- return $output;
- }
- ob_start("set_content_length");
- //the above part is for fixing a warband reading headers error
- if(isset($_GET['GUID']) && isset($_GET['name']) && isset($_GET['event']))
- {
- $name = $_GET["name"];
- $GUID = $_GET["GUID"];
- $db_handle = mysqliconnect("127.0.0.1","root","usbw","nameserver") or die("|-1");
- if($db_handle)
- {
- if($_GET['event']==1)//check namelist or add if not there
- {
- $guid_of_name = mysqli_query($db_handle, "SELECT GUID FROM names WHERE name = '$name'" );
- if (isset('$guid_of_name')) //its in the list, so lets see if it matches
- {
- if ($guid_of_name = $GUID) //if they match, everything is ok.
- {
- echo "1";//we will echo 1, showing that everything is ok
- }
- else //if they don't match, everything is wrong. FUCK! kick player from server time!
- {
- echo "2";//we will echo 2, telling the server to kick the player
- }
- }
- else //its not in the list, so lets add it
- {
- mysqli_query($db_handle, "INSERT INTO names ('GUID','name') VALUES('$GUID', '$name')");
- echo "1";//we will echo 1, showing that everything is ok
- }
- }
- }
- mysqli_close($db_handle);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment