function apply_rules() { $new_world = []; $_SESSION['last_world'] = $_SESSION['world']; for ($x = 0; $x < SIZE; $x++) { for ($y = 0; $y < SIZE; $y++) { $num_of_neighbors = num_of_neighbors($x, $y); $new_world[$x][$y] = $_SESSION["world"][$x][$y] ? alive($num_of_neighbors) : dead($num_of_neighbors); } } $_SESSION['world'] = $new_world; should_it_continue(); }
travelto($do[1]); } elseif ($do[0] == "move") { include 'explore.php'; move(); } elseif ($do[0] == "fight") { include 'fight.php'; fight(); } elseif ($do[0] == "victory") { include 'fight.php'; victory(); } elseif ($do[0] == "drop") { include 'fight.php'; drop(); } elseif ($do[0] == "dead") { include 'fight.php'; dead(); } elseif ($do[0] == "duelo") { include 'duelo.php'; duelo(); } elseif ($do[0] == "verify") { header("Location: users.php?do=verify"); die; } elseif ($do[0] == "spell") { include 'heal.php'; healspells($do[1]); } elseif ($do[0] == "showchar") { showchar(); } elseif ($do[0] == "onlinechar") { onlinechar($do[1]); } elseif ($do[0] == "showmap") { showmap();
<br> <div align="center"> <button class="btn waves-effect waves-light <?php echo $_SESSION['USER_COLOUR']; ?> " type="submit" name="action">Generate</button> </div> </form> <?php break; case 'statistics': if (!($link = db_init(false))) { dead(mysqli_error($link)); } $result = mysqli_query($link, 'SELECT * FROM `meta`;'); $meta = @mysqli_fetch_all($result, MYSQLI_ASSOC)[0]; mysqli_free_result($result); mysqli_close($link); unset($link); ?> <h6>Server statistics</h6> <br> <div align="center"> <?php echo 'Atlas ' . INFO_ATLAS_VERSION . '-' . INFO_ATLAS_STAGE . '<br>' . PHP_EOL; echo 'Built ' . INFO_ATLAS_BUILDDATE . '<br>' . PHP_EOL; echo 'Installed ' . getHumanDate(new DateTime($meta['installed']), new DateTime(date('Y-n-d H:i:s', time()))) . '<br>' . PHP_EOL; ?>
case 'png': imagepng($artwork_fin, $artwork_destination); break; } imagedestroy($artwork_fin); } mysqli_close($link); unset($link); break; } if (empty($errors)) { redirect('edit.php?success&type=' . $type . '&id=' . $id, false); die; } if (!empty($errors)) { dead($errors, true); } } else { if (isset($_GET['success'])) { $CURRENT_PAGE = 'Edit'; $PAGE_TITLE = PAGE_DEFAULT_TITLE . ' | Edit' . ($type == 'user' || $type == 'torrent' ? ' ' . $type : ''); $NAVBAR = NAVBAR_MINIMAL; require_once 'header.php'; ?> <body> <br> <br> <div class="container"> <div class="card-panel"> <h5>Edit successful</h5> <?php
private function verify_repeat_caller() { $row = $this->db_mysql_query_single_row("SELECT Count(sessions.SessionID) AS Count FROM sessions GROUP BY \n\t\t\tsessions.SessionID, sessions.TempKey HAVING (((sessions.SessionID)={$_POST['RecordID']}) AND\n\t\t\t((sessions.TempKey)={$_POST['Verify']}))", 'verify_repeat_caller'); $row['Count'] == '1' || dead("Client verification failed!"); }
if ($user_id == 0) { dead('Deletion failed | Superadmin cannot be deleted.'); } if (!($link = db_init())) { dead('Deletion failed! | MySQL error! | ' . mysqli_connect_error()); } $result = mysqli_query($link, 'SELECT * FROM `users` WHERE `id`=' . mysqli_real_escape_string($link, $user_id) . ';'); if (!$result) { dead('Deletion failed! | MySQL error! | ' . mysqli_connect_error()); } $user = @mysqli_fetch_all($result, MYSQLI_ASSOC)[0]; mysqli_free_result($result); $result = mysqli_query($link, 'DELETE FROM `users` WHERE `id`=' . mysqli_real_escape_string($link, $user_id) . ';'); if (!$result) { dead('Deletion failed! | MySQL error! | ' . mysqli_connect_error()); } mysqli_close($link); unset($link); redirect('index.php', false); die; } else { dead('Deletion failed! | No user specified.'); } } else { dead('Deletion failed! | You are not an administrator.'); } break; } } else { dead('No action specified.'); }