Ramaraunt1

Untitled

Dec 8th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. //PHP NAMESERVER SCRIPT BY RAMARAUNT!
  2.  
  3. <?php
  4. header_remove();
  5. function set_content_length($output)
  6. {
  7. header("Content-Length: ".strlen($output));
  8. return $output;
  9. }
  10. ob_start("set_content_length");
  11. //the above part is for fixing a warband reading headers error
  12. if(isset($_GET['GUID']) && isset($_GET['name']) && isset($_GET['event']))
  13. {
  14. $name = $_GET["name"];
  15. $GUID = $_GET["GUID"];
  16.  
  17. $db_handle = mysqliconnect("127.0.0.1","root","usbw","nameserver") or die("|-1");
  18. if($db_handle)
  19. {
  20. if($_GET['event']==1)//check namelist or add if not there
  21. {
  22. $guid_of_name = mysqli_query($db_handle, "SELECT GUID FROM names WHERE name = '$name'" );
  23. if (isset('$guid_of_name')) //its in the list, so lets see if it matches
  24. {
  25. if ($guid_of_name = $GUID) //if they match, everything is ok.
  26. {
  27. echo "1";//we will echo 1, showing that everything is ok
  28. }
  29. else //if they don't match, everything is wrong. FUCK! kick player from server time!
  30. {
  31. echo "2";//we will echo 2, telling the server to kick the player
  32. }
  33. }
  34. else //its not in the list, so lets add it
  35. {
  36. mysqli_query($db_handle, "INSERT INTO names ('GUID','name') VALUES('$GUID', '$name')");
  37. echo "1";//we will echo 1, showing that everything is ok
  38. }
  39. }
  40. }
  41. mysqli_close($db_handle);
  42. }
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment