<?php

// Collect the ability variables from the request header, if they exist
$temp_player = !empty($_REQUEST['player']) ? $_REQUEST['player'] : '';
$temp_robot = !empty($_REQUEST['robot']) ? $_REQUEST['robot'] : '';
$temp_image = !empty($_REQUEST['image']) ? $_REQUEST['image'] : '';
// If key variables are not provided, kill the script in error
if (empty($temp_player) || empty($temp_robot) || empty($temp_image)) {
    die('error|request-error|' . preg_replace('/\\s+/', ' ', print_r($_REQUEST, true)));
}
// Collect the current robot favourites for this user
$temp_player_info = $allowed_edit_data[$temp_player];
$temp_robot_info = $allowed_edit_data[$temp_player]['player_robots'][$temp_robot];
// If player or robot info was not found, kill the script in error
if (empty($temp_player_info) || empty($temp_robot_info)) {
    die('error|request-notfound|' . preg_replace('/\\s+/', ' ', print_r($_REQUEST, true)));
}
// Regardless of what happened before, update this robot's image in the session and save
$temp_image_full = $temp_robot . ($temp_image != 'base' ? '_' . $temp_image : '');
$_SESSION[$session_token]['values']['battle_settings'][$temp_player]['player_robots'][$temp_robot]['robot_image'] = $temp_image_full;
rpg_game::save_session();
exit('success|image-updated|' . $temp_image_full);
Esempio n. 2
0
                 $html_form_verified = false;
                 $html_form_show_coppa = true;
             }
             // The password was correct! Update the session with these credentials
             $_SESSION['GAME']['DEMO'] = 0;
             $_SESSION['GAME']['USER'] = $this_user;
             // Load the save file into memory and overwrite the session
             rpg_game::load_session($temp_database_user['user_id']);
             // If this is an old, unused save file, reset the game automatically
             if (empty($_SESSION['GAME']['counters']['battle_points']) || empty($_SESSION['GAME']['values']['battle_rewards'])) {
                 rpg_game::reset_session();
             }
             // Update the file with the coppa approval flag and birthdate
             $_SESSION['GAME']['USER']['dateofbirth'] = strtotime($_REQUEST['dateofbirth']);
             $_SESSION['GAME']['USER']['approved'] = 1;
             rpg_game::save_session($temp_database_user['user_id']);
             // Update the form markup, then break from the loop
             $file_has_updated = true;
             break;
         }
     }
     // Break from the POST loop
     break;
 }
 // Update the header markup title
 $html_header_title .= 'Load Existing Game File';
 // Update the header markup text
 $html_header_text .= '<span style="color: red;">WARNING! This build of the game has many bugs that are in progress of being fixed! Do not report them!</span><br />';
 $html_header_text .= '<span style="color: red;">WARNING! Any progress made in this build WILL BE RESET! Data may accidentally be deleted by untested features!</span><br />';
 $html_header_text .= '<span style="color: red;">WARNING! Robots are currently unable to switch equipped abilities or items! This will be fixed soon!</span><br />';
 $html_header_text .= 'Please enter the username and password of your save file below. Passwords are case-sensitive, though usernames are not.';