Added full source code
This commit is contained in:
commit
33f8586698
1377 changed files with 123808 additions and 0 deletions
admin
60
admin/cg_step11.php
Normal file
60
admin/cg_step11.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
set_magic_quotes_runtime(false);
|
||||
|
||||
session_start();
|
||||
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
|
||||
echo "Sorry, can't do that.";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
include("config.inc");
|
||||
include('as_manager.inc');
|
||||
|
||||
/* Insert "silent admins" into the new game's player table */
|
||||
$cnx = __dbConnect();
|
||||
if (!$cnx) {
|
||||
$argh = "Could not connect to the database";
|
||||
} else {
|
||||
$ns = $_SESSION['lw_new_game']['found_id'];
|
||||
$error = false;
|
||||
foreach ($_SESSION['lw_new_game']['silent'] as $aId) {
|
||||
if (!pg_query($cnx, "INSERT INTO \"{$ns}\".player (userid, first_planet, hidden) VALUES ($aId, 1, TRUE)")) {
|
||||
$error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($error) {
|
||||
$argh = "Failed to insert silent admin data";
|
||||
} else {
|
||||
$argh = null;
|
||||
}
|
||||
pg_close($cnx);
|
||||
}
|
||||
|
||||
if (!is_null($argh)) {
|
||||
include('cg_argh.inc');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
if (__isManagerRunning()) {
|
||||
$op = array(
|
||||
"pc" => 90,
|
||||
"text" => "Restarting ticks",
|
||||
"delay" => 1,
|
||||
"to" => "cg_step12.php"
|
||||
);
|
||||
} else {
|
||||
$op = array(
|
||||
"pc" => 100,
|
||||
"text" => "Cleaning up",
|
||||
"delay" => 1,
|
||||
"to" => "cg_done.php"
|
||||
);
|
||||
}
|
||||
|
||||
include('cg_operation.inc');
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue