print_header("New Account - {$game_info['name']}"); echo $st[805]; echo "<p /><a href='javascript:history.back()'>" . $st[806] . "</a>"; print_footer(); } #determine if that username is already in user by another player in the game, or another player as a server name. db("select pu.login_name, u.login_name as alternate_name from {$db_name}_users u, user_accounts pu where u.login_id != '{$p_user['login_id']}' && pu.login_id != '{$p_user['login_id']}' && (u.login_name = '{$in_game_name}' || pu.login_name = '{$in_game_name}')"); $test_name = dbr(1); if ($test_name['login_name'] || $test_name['alternate_name']) { print_header($cw['choose_username']); echo $st[807]; $rs = "<br /><br /><a href='javascript:history.back()'>" . $st[808] . "</a>"; print_footer(); } $show_sigs = 1; $ship_id = give_first_ship($p_user['login_id'], 0, $_POST['ship_name']); //create user account within game dbn("insert into {$db_name}_users (login_id, login_name, joined_game, turns, cash, explored_sys, ship_id, location, tech) VALUES ('{$p_user['login_id']}', '{$in_game_name}', '" . time() . "', '{$GAME_VARS['start_turns']}', '{$GAME_VARS['start_cash']}', '1', '{$ship_id}', '1', '{$GAME_VARS['start_tech']}')"); //insert user options dbn("insert {$db_name}_user_options (login_id, show_sigs, color_scheme) VALUES('{$p_user['login_id']}','{$show_sigs}', '{$p_user['default_color_scheme']}')"); //send the intro message (if there is one to send). if (!empty($game_info['intro_message'])) { $game_info['intro_message'] = nl2br($game_name['intro_message']); dbn("insert into {$db_name}_messages (sender_id,sender_name,text,login_id,timestamp) values ('1','Admin','{$game_name['intro_message']}','{$p_user['login_id']}','" . time() . "')"); } insert_history($login_id, $cw['joined_game']); post_news("<b class='b1'>{$in_game_name}</b> " . $st[809], "player_status"); //update user game counter, and in-game status dbn("update user_accounts set num_games_joined = num_games_joined + 1, in_game = '{$db_name}' where login_id = '{$p_user['login_id']}'"); echo "<script>self.location='location.php';</script>"; exit;
function wipe_player($unfortunate_id, $clan_id) { global $db_name, $GAME_VARS, $cw, $st; //erase all ships (though in all likelyhood the player won't have any at this point). dbn("delete from {$db_name}_ships where login_id = '{$unfortunate_id}'"); //reset bilkos items that the player has bid on but not won dbn("update {$db_name}_bilkos set bidder_id = 0 where bidder_id = '{$unfortunate_id}' && active = 1"); //delete bilko's items that the player won dbn("delete from {$db_name}_bilkos where bidder_id = '{$unfortunate_id}' && active = 0"); //set planets to unowned. dbn("update {$db_name}_planets set login_name = 'Un-Owned', login_id = 4, pass='', clan_id = 0 where login_id = '{$unfortunate_id}'"); //game is not in SD, so can restart if ($GAME_VARS['sudden_death'] != 1) { send_message($unfortunate_id, $st[167]); $new_ship = give_first_ship($unfortunate_id, $clan_id); } else { //game in SD, so in a ship destroyed. $new_ship = 1; } //resest some of the account details dbn("update {$db_name}_users set cash = '{$GAME_VARS['start_cash']}', tech = '{$GAME_VARS['start_tech']}', turns = '{$GAME_VARS['start_turns']}', ship_id = '{$new_ship}', location = 1, genesis = 0, terra_imploder = 0, alpha=0, gamma = 0, delta = 0, turns_run = 0 where login_id = '{$unfortunate_id}'"); insert_history($unfortunate_id, $cw['account wiped']); }