-
Notifications
You must be signed in to change notification settings - Fork 0
/
play_game.php
executable file
·88 lines (69 loc) · 2.38 KB
/
play_game.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
error_reporting(E_ALL);
//ob_start();
session_start();
//header_remove();
include "play_pages.php";
include "connectvars.php";
include "header.php";
if(isset($_SESSION["SAVE_NAME"]) && isset($_SESSION["username"])){
$_SESSION["save"] = fetchSaveID($_SESSION["username"],$_SESSION["SAVE_NAME"]);
$_SESSION["SAVE_WORLD"] = fetchSaveWorld($_SESSION["save"]);
//echo $_SESSION["SAVE_NAME"];
//echo "->" . $_SESSION["save"] . "<-";
}
$pickup = new AutoForm(
"PICK UP","pickUp",array(
new AutoEntry("item","text","regular","",true),
new AutoEntry("save","number","autoget","",true),
new AutoEntry("SAVE_WORLD","number","autoget","",true)
),false
);
$drop = new AutoForm(
"DROP","dropItem",array(
new AutoEntry("item","text","regular","",true),
new AutoEntry("save","number","autoget","",true),
new AutoEntry("SAVE_WORLD","number","autoget","",true)
),false
);
$lookat = new AutoForm(
"LOOK AT","lookAt",array(
new AutoEntry("thing","text","regular","",false),
new AutoEntry("save","number","autoget","",true),
new AutoEntry("SAVE_WORLD","number","autoget","",true)
),false
);
$govia = new AutoForm(
"GO VIA","goVia",array(
new AutoEntry("path","text","regular","",true),
new AutoEntry("save","number","autoget","",true),
new AutoEntry("SAVE_WORLD","number","autoget","",true)
),false
);
$inventory = new AutoForm(
"INVENTORY","showInventory",array(
new AutoEntry("save","number","autoget","",true),
new AutoEntry("SAVE_WORLD","number","autoget","",true)
),false
);
$currLocation = new AutoForm(
"CURRENT ROOM","showLocation",array(
new AutoEntry("save","number","autoget","",true),
new AutoEntry("SAVE_WORLD","number","autoget","",true)
),false
);
$load = new AutoForm(
"LOAD","loadGame",array(
new AutoEntry("SAVE_NAME","text","autoset","",true),
new AutoEntry("username","text","autoget","",true)
),false
);
$forms = array( $pickup, $drop, $lookat, $govia, $load );//, $currLocation, $inventory );
$aGets = array( array("username","You need to be logged in to play a game"),
array("SAVE_WORLD","World of selected save has been altered or deleted. Select a different save."),
array("SAVE_NAME","You need to load a save before playing") );
$hasTable = false;
$hasLog = true;
$page = new AutoPage("QUEST DATABASE","Play Game",$forms,$content,$aGets,$hasTable,$hasLog);
$page->generatePage();
?>