/
dump.php
118 lines (118 loc) · 4.11 KB
/
dump.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
// this file has been edited to produce its output in the same format as
// it has with previous versions, despite the new database format. coders
// should use the new xml.php to glean player info, which is much more
// suited to db changes.
header('Content-Type: text/plain');
include("commonfunctions.php");
include("config.php");
$file = file($irpg_db);
$header = explode("\t",$file[0]);
unset($header[1]); // password
unset($header[2]); // isadmin
unset($header[6]); // nickname
unset($header[10]); // x pos
unset($header[11]); // y pos
unset($header[31]); // alignment
echo join("\t",$header)."\n";
unset($file[0]);
/* specific character requested */
if ($_GET['player']) {
foreach ($file as $line) {
list($user) = explode("\t",trim($line));
if ($user == $_GET['player']) {
list($user,,,
$level,$class,$secs,,$uhost,$online,$idled,,,
$pen['mesg'],
$pen['nick'],
$pen['part'],
$pen['kick'],
$pen['quit'],
$pen['quest'],
$pen['logout'],
$created,
$lastlogin,
$item['amulet'],
$item['charm'],
$item['helm'],
$item['boots'],
$item['gloves'],
$item['ring'],
$item['leggings'],
$item['shield'],
$item['tunic'],
$item['weapon'],
) = explode("\t",trim($line));
echo join("\t",
array($user,$level,$class,$secs,$uhost,$online,$idled,
$pen['mesg'],
$pen['nick'],
$pen['part'],
$pen['kick'],
$pen['quit'],
$pen['quest'],
$pen['logout'],
$created,
$lastlogin,
$item['amulet'],
$item['charm'],
$item['helm'],
$item['boots'],
$item['gloves'],
$item['ring'],
$item['leggings'],
$item['shield'],
$item['tunic'],
$item['weapon']))."\n";
}
}
exit(0);
}
/* no specific character requested; list all */
usort($file,"cmp_level_desc");
foreach ($file as $line) {
list($user,,,
$level,$class,$secs,,$uhost,$online,$idled,,,
$pen['mesg'],
$pen['nick'],
$pen['part'],
$pen['kick'],
$pen['quit'],
$pen['quest'],
$pen['logout'],
$created,
$lastlogin,
$item['amulet'],
$item['charm'],
$item['helm'],
$item['boots'],
$item['gloves'],
$item['ring'],
$item['leggings'],
$item['shield'],
$item['tunic'],
$item['weapon'],
) = explode("\t",trim($line));
echo join("\t",
array($user,$level,$class,$secs,$uhost,$online,$idled,
$pen['mesg'],
$pen['nick'],
$pen['part'],
$pen['kick'],
$pen['quit'],
$pen['quest'],
$pen['logout'],
$created,
$lastlogin,
$item['amulet'],
$item['charm'],
$item['helm'],
$item['boots'],
$item['gloves'],
$item['ring'],
$item['leggings'],
$item['shield'],
$item['tunic'],
$item['weapon']))."\n";
}
?>