-
Notifications
You must be signed in to change notification settings - Fork 6
/
configuration.php
450 lines (415 loc) · 21.3 KB
/
configuration.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
<?php
require_once("common.php");
require_once("lib/showform.php");
require_once("lib/http.php");
// translator ready
// addnews ready
// mail ready
check_su_access(SU_EDIT_CONFIG);
translator::tlschema("configuration");
$op = http::httpget('op');
$module=http::httpget('module');
if ($op=="save"){
include_once("lib/gamelog.php");
//loadsettings();
if ((int)httppost('blockdupemail') == 1 &&
(int)httppost('requirevalidemail') != 1) {
httppostset('requirevalidemail', "1");
output::doOutput("`brequirevalidemail has been set since blockdupemail was set.`b`n");
}
if ((int)httppost('requirevalidemail') == 1 &&
(int)httppost('requireemail') != 1) {
httppostset('requireemail', "1");
output::doOutput("`brequireemail has been set since requirevalidemail was set.`b`n");
}
$defsup = httppost("defaultsuperuser");
if ($defsup != "") {
$value = 0;
while(list($k, $v)=each($defsup)) {
if ($v) $value += (int)$k;
}
httppostset('defaultsuperuser', $value);
}
$tmp = stripslashes(httppost("villagename"));
if ($tmp && $tmp != $settings['villagename']) {
debug("Updating village name -- moving players");
$sql = "UPDATE " . db_prefix("accounts") . " SET location='".
httppost("villagename") . "' WHERE location='" .
addslashes($settings['villagename']) . "'";
db_query($sql);
if ($session['user']['location'] == $settings['villagename'])
$session['user']['location'] =
stripslashes(httppost('villagename'));
debug("Moving companions");
$sql = "UPDATE " . db_prefix("companions") . " SET companionlocation = '".
httppost("villagename") . "' WHERE companionlocation = '".
addslashes($settings['villagename']) . "'";
db_query($sql);
}
$tmp = stripslashes(httppost("innname"));
if ($tmp && $tmp != $settings['innname']) {
debug("Updating inn name -- moving players");
$sql = "UPDATE " . db_prefix("accounts") . " SET location='".
httppost("innname") . "' WHERE location='" .
addslashes($settings['innname']) . "'";
db_query($sql);
if ($session['user']['location'] == $settings['innname'])
$session['user']['location'] = stripslashes(httppost('innname'));
}
if (stripslashes(httppost("motditems")) != $settings['motditems']) {
invalidatedatacache("motd");
}
$post = httpallpost();
reset($post);
$old=$settings;
while (list($key,$val)=each($post)){
if (!isset($settings[$key]) ||
(stripslashes($val) != $settings[$key])) {
if (!isset($old[$key]))
$old[$key] = "";
savesetting($key,stripslashes($val));
output::doOutput("Setting %s to %s`n", $key, stripslashes($val));
gamelog("`@Changed core setting `^$key`@ from `#{$old[$key]}`@ to `&$val`0","settings");
// Notify every module
modules::modulehook("changesetting",
array("module"=>"core", "setting"=>$key,
"old"=>$old[$key], "new"=>$val), true);
}
}
output::doOutput("`^Settings saved.`0");
$op = "";
httpset($op, "");
}elseif($op=="modulesettings"){
include_once("lib/gamelog.php");
if (injectmodule($module,true)){
$save = http::httpget('save');
if ($save!=""){
load_module_settings($module);
$old = $module_settings[$module];
$post = httpallpost();
$post = modules::modulehook("validatesettings", $post, true, $module);
if (isset($post['validation_error'])) {
$post['validation_error'] =
translator::translate_inline($post['validation_error']);
output::doOutput("Unable to change settings:`\$%s`0",
$post['validation_error']);
} else {
reset($post);
while (list($key,$val)=each($post)){
$key = stripslashes($key);
$val = stripslashes($val);
set_module_setting($key,$val);
if (!isset($old[$key]) || $old[$key] != $val) {
output::doOutput("Setting %s to %s`n", $key, $val);
// Notify modules
if($key == "villagename") {
debug("Moving companions");
$sql = "UPDATE " . db_prefix("companions") . " SET companionlocation = '".
addslashes($val) . "' WHERE companionlocation = '".
addslashes($old[$key]) . "'";
db_query($sql);
}
$oldval = "";
if (isset($old[$key])) $oldval = $old[$key];
gamelog("`@Changed module(`5$module`@) setting `^$key`@ from `#$oldval`@ to `&$val`0","settings");
modules::modulehook("changesetting",
array("module"=>$module, "setting"=>$key,
"old"=>$oldval, "new"=>$val), true);
}
}
output::doOutput("`^Module %s settings saved.`0`n", $module);
}
$save = "";
httpset('save', "");
}
if ($save == "") {
$info = get_module_info($module);
if (count($info['settings'])>0){
load_module_settings($mostrecentmodule);
$msettings=array();
while (list($key,$val)=each($info['settings'])){
if (is_array($val)) {
$v = $val[0];
$x = explode("|", $v);
$val[0] = $x[0];
$x[0] = $val;
} else {
$x = explode("|",$val);
}
$msettings[$key]=$x[0];
if (!isset($module_settings[$mostrecentmodule][$key]) &&
isset($x[1])) {
$module_settings[$mostrecentmodule][$key]=$x[1];
}
}
$msettings = modules::modulehook("mod-dyn-settings", $msettings);
if (is_module_active($module)){
output::doOutput("This module is currently active: ");
$deactivate = translator::translate_inline("Deactivate");
rawoutput("<a href='modules.php?op=deactivate&module={$module}&cat={$info['category']}'>");
output_notl($deactivate);
rawoutput("</a>");
output::addnav("","modules.php?op=deactivate&module={$module}&cat={$info['category']}");
}else{
output::doOutput("This module is currently deactivated: ");
$deactivate = translator::translate_inline("Activate");
rawoutput("<a href='modules.php?op=activate&module={$module}&cat={$info['category']}'>");
output_notl($deactivate);
rawoutput("</a>");
output::addnav("","modules.php?op=activate&module={$module}&cat={$info['category']}");
}
rawoutput("<form action='configuration.php?op=modulesettings&module=$module&save=1' method='POST'>",true);
output::addnav("","configuration.php?op=modulesettings&module=$module&save=1");
translator::tlschema("module-$module");
showform($msettings,$module_settings[$mostrecentmodule]);
translator::tlschema();
rawoutput("</form>",true);
}else{
output::doOutput("The %s module does not appear to define any module settings.", $module);
}
}
}else{
output::doOutput("I was not able to inject the module %s. Sorry it didn't work out.", htmlentities($module, ENT_COMPAT, settings::getsetting("charset", "ISO-8859-1")));
}
}
page_header("Game Settings");
require_once("lib/superusernav.php");
superusernav();
output::addnav("Module Manager", "modules.php");
if ($module) {
$cat = $info['category'];
output::addnav(array("Module Category - `^%s`0", translator::translate_inline($cat)), "modules.php?cat=$cat");
}
output::addnav("Game Settings");
output::addnav("Standard settings", "configuration.php");
output::addnav("",$REQUEST_URI);
module_editor_navs('settings', 'configuration.php?op=modulesettings&module=');
if ($op == "") {
$enum="enumpretrans";
require_once("lib/datetime.php");
$details = gametimedetails();
$offset = settings::getsetting("gameoffsetseconds",0);
for ($i=0;$i<=86400 / settings::getsetting("daysperday",4);$i+=300){
$off = ($details['realsecstotomorrow'] - ($offset - $i));
if ($off < 0) $off += 86400;
$x = strtotime("+".$off." secs");
$str = translator::sprintf_translate("In %s at %s (+%s)",
reltime($x), date("h:i a", $x),date("H:i",$i));
$enum.=",$i,$str";
}
rawoutput(translator::tlbutton_clear());
$setup = array(
"Game Setup,title",
"loginbanner"=>"Login Banner (under login prompt: 255 chars)",
"maxonline"=>"Max # of players online (0 for unlimited), int",
"allowcreation"=>"Allow creation of new characters,bool",
"gameadminemail"=>"Admin Email",
"emailpetitions"=>"Should submitted petitions be emailed to Admin Email address?,bool",
"Enter languages here like this: `i(shortname 2 chars) comma (readable name of the language)`i and continue as long as you wish,note",
"serverlanguages"=>"Languages available on this server",
"defaultlanguage"=>"Default Language,enum,".settings::getsetting("serverlanguages","en,English,fr,Fran�ais,dk,Danish,de,Deutsch,es,Espa�ol,it,Italian"),
"edittitles"=>"Should DK titles be editable in user editor,bool",
"motditems"=>"How many items should be shown on the motdlist,int",
"Main Page Display,title",
"homeskinselect"=>"Should the skin selection widget be shown?,bool",
"homecurtime"=>"Should the current realm time be shown?,bool",
"homenewdaytime"=>"Should the time till newday be shown?,bool",
"homenewestplayer"=>"Should the newest player be shown?,bool",
"defaultskin"=>"What skin should be the default?,theme",
"impressum"=>"Tell the world something about the person running this server. (e.g. name and address),textarea",
"Beta Setup,title",
"beta"=>"Enable beta features for all players?,bool",
"betaperplayer"=>"Enable beta features per player?,bool",
"Account Creation,title",
"defaultsuperuser"=>
"Flags automatically granted to new players,bitfield," .
($session['user']['superuser'] | SU_ANYONE_CAN_SET)." ,".
SU_INFINITE_DAYS.",Infinite Days,".
SU_VIEW_SOURCE.",View Source Code,".
SU_DEVELOPER.",Developer Super Powers (special inc list; god mode; auto defeat master; etc),".
SU_DEBUG_OUTPUT. ",Debug Output",
"newplayerstartgold"=>"Amount of gold to start a new character with,int",
"maxrestartgold"=>"Maximum amount of gold a player will get after a dragonkill,int",
"maxrestartgems"=>"Maximum number of gems a player will get after a dragonkill,int",
"requireemail"=>"Require users to enter their email address,bool",
"requirevalidemail"=>"Require users to validate their email address,bool",
"blockdupeemail"=>"One account per email address,bool",
"spaceinname"=>"Allow spaces in user names,bool",
"allowoddadminrenames"=>"Allow admins to enter 'illegal' names in the user editor,bool",
"selfdelete"=>"Allow player to delete their character,bool",
"Commentary/Chat,title",
"soap"=>"Clean user posts (filters bad language and splits words over 45 chars long),bool",
"maxcolors"=>"Max # of color changes usable in one comment,range,5,40,1",
"postinglimit"=>"Limit posts to let one user post only up to 50% of the last posts (else turn it off),bool",
"Place names and People names,title",
"villagename"=>"Name for the main village",
"innname"=>"Name of the inn",
"barkeep"=>"Name of the barkeep",
"barmaid"=>"Name of the barmaid",
"bard"=>"Name of the bard",
"clanregistrar"=>"Name of the clan registrar",
"deathoverlord"=>"Name of the death overlord",
"Referral Settings,title",
"refereraward"=>"How many points will be awarded for a referral?,int",
"referminlevel"=>"What level does the referral need to reach to credit the referer?,int",
"Random events,title",
"forestchance"=>"Chance for Something Special in the Forest,range,0,100,1",
"villagechance"=>"Chance for Something Special in any village,range,0,100,1",
"innchance"=>"Chance for Something Special in the Inn,range,0,100,1",
"gravechance"=>"Chance for Something Special in the Graveyard,range,0,100,1",
"gardenchance"=>"Chance for Something Special in the Gardens,range,0,100,1",
"Paypal,title",
"paypalemail"=>"Email address of Admin's paypal account",
"paypalcurrency"=>"Currency type",
"paypalcountry-code"=>"What country's predominant language do you wish to have displayed in your PayPal screen?,enum
,US,United States,DE,Germany,AI,Anguilla,AR,Argentina,AU,Australia,AT,Austria,BE,Belgium,BR,Brazil,CA,Canada
,CL,Chile,C2,China,CR,Costa Rica,CY,Cyprus,CZ,Czech Republic,DK,Denmark,DO,Dominican Republic
,EC,Ecuador,EE,Estonia,FI,Finland,FR,France,GR,Greece,HK,Hong Kong,HU,Hungary,IS,Iceland,IN,India
,IE,Ireland,IL,Israel,IT,Italy,JM,Jamaica,JP,Japan,LV,Latvia,LT,Lithuania,LU,Luxembourg,MY,Malaysia
,MT,Malta,MX,Mexico,NL,Netherlands,NZ,New Zealand,NO,Norway,PL,Poland,PT,Portugal,SG,Singapore,SK,Slovakia
,SI,Slovenia,ZA,South Africa,KR,South Korea,ES,Spain,SE,Sweden,CH,Switzerland,TW,Taiwan,TH,Thailand,TR,Turkey
,GB,United Kingdom,UY,Uruguay,VE,Venezuela",
"paypaltext"=>"What text should be displayed as item name in the donations screen(player name will be added after it)?",
"(standard: 'Legend of the Green Dragon Site Donation from',note",
"General Combat,title",
"autofight"=>"Allow fighting multiple rounds automatically,bool",
"autofightfull"=>"Allow fighting until fight is over,enum,0,Never,1,Always,2,Only when not allowed to flee",
"Training,title",
"automaster"=>"Masters hunt down truant students,bool",
"multimaster"=>"Can players gain multiple levels (challenge multiple masters) per game day?,bool",
"displaymasternews"=>"Display news if somebody fought his master?,bool",
"Clans,title",
"allowclans"=>"Enable Clan System?,bool",
"goldtostartclan"=>"Gold to start a clan,int",
"gemstostartclan"=>"Gems to start a clan,int",
"officermoderate"=>"Can clan officers who are also moderators moderate their own clan even if they cannot moderate all clans?,bool",
"New Days,title",
"daysperday"=>"Game days per calendar day,range,1,6,1",
"specialtybonus"=>"Extra daily uses in specialty area,range,0,5,1",
"newdaycron"=>"Let the newday-runonce run via a cronjob,bool",
"The directory is necessary! Do not forget to set the correct one in cron.php in your main game folder!!! ONLY experienced admins should use cron jobbing here,note",
"`bAlso make sure you setup a cronjob on your machine using confixx/plesk/cpanel or any other admin panel pointing to the cron.php file in your main folder`b,note",
"If you do not know what a Cronjob is... leave it turned off. If you want to know more... check out: <a href='http://wiki.dragonprime.net/index.php?title=Cronjob'>http://wiki.dragonprime.net/index.php?title=Cronjob</a>,note",
"resurrectionturns"=>"Modify (+ or -) the number of turns deducted after a resurrection as an absolute (number) or relative (number followed by %),text",
"Forest,title",
"turns"=>"Forest Fights per day,range,5,30,1",
"dropmingold"=>"Forest Creatures drop at least 1/4 of max gold,bool",
"suicide"=>"Allow players to Seek Suicidally?,bool",
"suicidedk"=>"Minimum DKs before players can Seek Suicidally?,int",
"forestgemchance"=>"Player will find a gem one in X times,range,10,100,1",
"disablebonuses"=>"Should monsters which get buffed with extra HP/Att/Def get a gold+exp bonus?,bool",
"forestexploss"=>"What percentage of experience should be lost?,range,10,100,1",
"Multiple Enemies,title",
"multifightdk"=>"Multiple monsters will attack players above which amount of dragonkills?,range,8,50,1",
"multichance"=>"The chance for an attack from multiple enemies is,range,0,100,1",
"addexp"=>"Additional experience (%) per enemy during multifights?,range,0,15",
"instantexp"=>"During multi-fights hand out experience instantly?,bool",
"maxattacks"=>"How many enemies will attack per round (max. value),range,1,10",
"allowpackofmonsters"=>"Allow multiple monsters of the same type to appear in a battle?,bool",
"Random values for type of seeking is added to random base.,note",
"multibasemin"=>"The base number of multiple enemies at minimum is,range,1,100,2",
"multibasemax"=>"The base number of multiple enemies at maximum is,range,1,100,3",
"multislummin"=>"The number of multiple enemies at minimum for slumming is,range,0,100,0",
"multislummax"=>"The number of multiple enemies at maximum for slumming is,range,0,100,1",
"multithrillmin"=>"The number of multiple enemies at minimum for thrill seeking is,range,0,100,1",
"multithrillmax"=>"The number of multiple enemies at maximum for thrill seeking is,range,0,100,2",
"multisuimin"=>"The number of multiple enemies at minimum for suicide is,range,0,100,2",
"multisuimax"=>"The number of multiple enemies at maximum for suicide is,range,0,100,4",
"Stables,title",
"allowfeed"=>"Does Merick have feed onhand for creatures,bool",
"Companions/Mercenaries,title",
"enablecompanions"=>"Enable the usage of companions,bool",
"companionsallowed"=>"How many companions are allowed per player,int",
"Modules my alter this value on a per player basis!,note",
"companionslevelup"=>"Are companions allowed to level up?,bool",
"Bank Settings,title",
"fightsforinterest"=>"Max forest fights remaining to earn interest?,range,0,10,1",
"maxinterest"=>"Max Interest Rate (%),range,5,10,1",
"mininterest"=>"Min Interest Rate (%),range,0,5,1",
"maxgoldforinterest"=>"Over what amount of gold does the bank cease paying interest? (0 for unlimited),int",
"borrowperlevel"=>"Max player can borrow per level (val * level for max),range5,200,5",
"allowgoldtransfer"=>"Allow players to transfer gold,bool",
"transferperlevel"=>"Max player can receive from a transfer (val * level),range,5,100,5",
"mintransferlev"=>"Min level a player (0 DK's) needs to transfer gold,range,1,5,1",
"transferreceive"=>"Total transfers a player can receive in one day,range,0,5,1",
"maxtransferout"=>"Amount player can transfer to others (val * level),range,5,100,5",
"innfee"=>"Fee for express inn payment (x or x%),int",
"Mail Settings,title",
"mailsizelimit"=>"Message size limit per message,int",
"inboxlimit"=>"Limit # of messages in inbox,int",
"oldmail"=>"Automatically delete old messages after (days),int",
"superuseryommessage"=>"Warning to give when attempting to YoM an admin?",
"onlyunreadmails"=>"Only unread mail count towards the inbox limit?,bool",
"PvP,title",
"pvp"=>"Enable Slay Other Players,bool",
"pvpday"=>"Player Fights per day,range,1,10,1",
"pvpimmunity"=>"Days that new players are safe from PvP,range,1,5,1",
"pvpminexp"=>"Experience below which player is safe from PvP,int",
"pvpattgain"=>"Percent of victim experience attacker gains on win,floatrange,.25,20,.25",
"pvpattlose"=>"Percent of experience attacker loses on loss,floatrange,.25,20,.25",
"pvpdefgain"=>"Percent of attacker experience defender gains on win,floatrange,.25,20,.25",
"pvpdeflose"=>"Percent of experience defender loses on loss,floatrange,.25,20,.25",
"Content Expiration,title",
"expirecontent"=>"Days to keep comments and news? (0 = infinite),int",
"expiretrashacct"=>"Days to keep never logged-in accounts? (0 = infinite),int",
"expirenewacct"=>"Days to keep 1 level (0 dragon) accounts? (0 =infinite),int",
"expireoldacct"=>"Days to keep all other accounts? (0 = infinite),int",
"LOGINTIMEOUT"=>"Seconds of inactivity before auto-logoff,int",
"High Load Optimization,title",
"This has been moved to the dbconnect.php,note",
/*
"usedatacache"=>"Use Data Caching,bool",
"datacachepath"=>"Path to store data cache information`n`iNote`i when using in an environment where Safe Mode is enabled; this needs to be a path that has the same UID as the web server runs.",
//this has been put to the dbconnect.php
*/
"LoGDnet Setup,title",
"(LoGDnet requires your PHP configuration to have file wrappers enabled!!),note",
"logdnet"=>"Register with LoGDnet?,bool",
"serverurl"=>"Server URL",
"serverdesc"=>"Server Description (75 chars max)",
"logdnetserver"=>"Master LoGDnet Server (default http://logdnet.logd.com/)",
"curltimeout"=>"How long we wait for responses from logdnet.logd.com (in seconds),range,1,10,1|2",
"Game day Setup,title",
"dayduration"=>"Day Duration,viewonly",
"curgametime"=>"Current game time,viewonly",
"curservertime"=>"Current Server Time,viewonly",
"lastnewday"=>"Last new day,viewonly",
"nextnewday"=>"Next new day,viewonly",
"gameoffsetseconds"=>"Real time to offset new day,$enum",
"Translation Setup,title",
"enabletranslation"=>"Enable the use of the translation engine,bool",
"It is strongly recommended to leave this feature turned on.,note",
"cachetranslations"=>"Cache the translations (datacache must be turned on)?,bool",
"permacollect"=>"Permanently collect untranslated texts (overrides the next settings!),bool",
"collecttexts"=>"Are we currently collecting untranslated texts?,viewonly",
"tl_maxallowed"=>"Collect untranslated texts if you have fewer player than this logged in. (0 never collects),int",
"charset"=>"Which charset should be used for htmlentities?",
"Error Notification,title",
"Note: you MUST have data caching turned on if you want to use this feature. Also the first error within any 24 hour period will not generate a notice; I'm sorry: that's really just how it is for technical reasons.,note",
"show_notices"=>"Show PHP Notice output?,bool",
"notify_on_warn"=>"Send notification on site warnings?,bool",
"notify_on_error"=>"Send notification on site errors?,bool",
"notify_address"=>"Address to notify",
"notify_every"=>"Only notify every how many minutes for each distinct error?,int",
"Miscellaneous Settings,title",
"allowspecialswitch"=>"The Barkeeper may help you to switch your specialty?,bool",
"maxlistsize"=>"Maximum number of items to be shown in the warrior list,int",
);
$secstonewday = secondstonextgameday($details);
$useful_vals = array(
"dayduration"=>round(($details['dayduration']/60/60),0)." hours",
"curgametime"=>getgametime(),
"curservertime"=>date("Y-m-d h:i:s a"),
"lastnewday"=>date("h:i:s a",
strtotime("-{$details['realsecssofartoday']} seconds")),
"nextnewday"=>date("h:i:s a",
strtotime("+{$details['realsecstotomorrow']} seconds"))." (".date("H\\h i\\m s\\s",$secstonewday).")"
);
loadsettings();
$vals = $settings + $useful_vals;
rawoutput("<form action='configuration.php?op=save' method='POST'>");
output::addnav("","configuration.php?op=save");
showform($setup,$vals);
rawoutput("</form>");
}
page_footer();