Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Ramaraunt's Scriptset for PW 4.5.
- // Copyright 2017 with MIT Licsence (see LISCENCE.txt for details)
- /*
- Purpose:
- To give a player online status, and to tell the game server if a new player is
- necessary.
- */
- //get passes and stuff
- include 'config.php';
- //check if password is valid
- if($valid == 1)
- {
- $unique_id = $_GET['guid'];
- $connection = mysqli_connect($db_address, $db_user, $db_pass, $database_name);
- $query = mysqli_query($connection,"SELECT guid FROM account WHERE guid = '$unique_id';") or die(mysqli_error($connection));
- mysqli_store_result($connection);
- $number_of_players_with_guid = msqli_numbers_rows($query);
- if ($number_of_players_with_guid == 0)
- {
- //create a new player in the database. Need to tell the game server the player doesnt exist.
- echo "1|$unique_id|";
- }
- else
- {
- //Let's set the player's status to online.
- mysqli_query($connection,"UPDATE account SET status='1' WHERE guid='$unique_id';");
- }
- //close the connection
- mysqli_close($connection);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement