-
Notifications
You must be signed in to change notification settings - Fork 0
/
goodbye.php
47 lines (34 loc) · 1.14 KB
/
goodbye.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/***********************************************
Zurich Water Game: internet version
Author: Nigel Gilbert and the FIRMA project
--------------------------------------------
goodbye.php
Logs out the user
Version 1.0 6 August 2001
Version 1.1 1 September 2001
Version 2.0 10 November 2001
**********************************************/
include("constants.php");
include("common.php");
include("query.php");
include("objects.php");
$resume_x = get_param('resume_x');
$quit_x = get_param('quit_x');
$player = $_COOKIE['player'];
if ($resume_x) { /* user pressed the resume button on leave.php */
header("Location: main.php");
exit;
}
db_open($database);
$zurich = db_retrieve("Zurich", "objects");
$zurich->players[$player]->loggedin = FALSE;
log_and_confirm("left the game", $player, 2);
if ($quit_x) { /* user pressed the quit button on leave.php */
setcookie("player",'', -3600);
unset($zurich->players[$player]->realname);
unset($zurich->players[$player]->email);
}
// save a serialized copy of all objects
db_save($zurich, "Zurich", "objects");
header("Location: index.html");