mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-29 00:54:31 +00:00
General fixes
+Added the possibility to start a maintenance (no user will be banned)
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename maintenance.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
if(isset($_POST['startMaint_x'])) {
|
||||
$database->setUsersOk(2);
|
||||
$error = "The maintenance has started";
|
||||
}
|
||||
elseif($_POST['removeMaint_x']) {
|
||||
$database->setUsersOk(0);
|
||||
$error = "The maintenance has been removed";
|
||||
}
|
||||
|
||||
?>
|
||||
<form action="../Admin/admin.php?p=maintenance" method="POST">
|
||||
<p><div style="text-align: center;color: red"><?php echo $error; ?></div></p>
|
||||
<table id="member" cellpadding="1" cellspacing="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Server Maintenance</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="on">Description</td>
|
||||
<td class="hab">Execute</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="hab">Start a maintenance</td>
|
||||
<td class="hab"><div style="text-align: center"><input name="startMaint" type="image" src="../img/admin/b/ok1.gif"/></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="hab">Remove a Maintenance</td>
|
||||
<td class="hab"><div style="text-align: center"><input name="removeMaint" type="image" src="../img/admin/b/ok1.gif"></div></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename maintenence.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
?>
|
||||
<table id="member" cellpadding="1" cellspacing="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Server Maintenence</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="on">Description</td>
|
||||
<td class="hab">Execute</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="hab">Close Server for Maintenece, This will ban all players (Access 2) till you can fix bugs, or a crap version of a ceasefire lol</td>
|
||||
<td class="hab"><center><a href="admin.php?p=maintenenceBan"><img src="../img/admin/b/ok1.gif"></a></center></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="hab">Bring Server Back for Maintenece, This will unban all players (By Banning Reason)</td>
|
||||
<td class="hab"><center><a href="admin.php?p=maintenenceUnban"><img src="../img/admin/b/ok1.gif"></a></center></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<form action="../GameEngine/Admin/Mods/mainteneceCleanBanData.php" method="POST">
|
||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<td class="hab">Clean Banlist Data (TRUNCATE)</td>
|
||||
<td class="hab"><center><input type="image" src="../img/admin/b/ok1.gif" value="submit"></center></td>
|
||||
</form>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename maintenenceBan.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
?>
|
||||
<form action="../GameEngine/Admin/Mods/mainteneceBan.php" method="POST">
|
||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<br />
|
||||
<table id="member" cellpadding="1" cellspacing="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Close Server (Ban Everyone)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="on">Duration</td>
|
||||
<td class="hab">Starting</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="hab"><input type="text" class="fm" name="duration" value="1"></td>
|
||||
<td class="hab"><input type="text" class="fm" name="start" value="<?php echo date('d.m.Y H:i:s', strtotime("now")); ?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Default: 1 Hour<br />Value: Hours (0.5) for 30 mins</td>
|
||||
<td>Default: Now
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="hab" colspan="2"><center><input type="text" class="fm" name="reason" value="Server Downtime"></center></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="hab" colspan="2"><center><input type="image" src="../img/admin/b/ok1.gif" value="submit"></center></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
@@ -1,91 +0,0 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename maintenenceUnban.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
$bannedUsers = $admin->search_banned();
|
||||
?>
|
||||
<form action="../GameEngine/Admin/Mods/mainteneceUnban.php" method="POST">
|
||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
|
||||
<br />
|
||||
<table id="member" cellpadding="1" cellspacing="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Open Server (Unban Players by Reason)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="on">Unban "Reason"</td>
|
||||
<td class="hab">Action</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="text" class="fm" name="unbanreason" value=""></td>
|
||||
<td class="hab" colspan="2"><center><input type="image" src="../img/admin/b/ok1.gif" value="submit"></center></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<table id="member" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="6">Bannned Players (<?php echo count($bannedUsers); ?>)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Username</b></td>
|
||||
<td><b>Start Ban / End Ban</b></td>
|
||||
<td><b>Reason</b></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if($bannedUsers)
|
||||
{
|
||||
for ($i = 0; $i <= count($bannedUsers)-1; $i++)
|
||||
{
|
||||
if($database->getUserField($bannedUsers[$i]['uid'],'username',0)=='')
|
||||
{
|
||||
|
||||
$name = $bannedUsers[$i]['name'];
|
||||
$link = "<span class=\"c b\">[".$name."]</span>";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$name = $database->getUserField($bannedUsers[$i]['uid'],'username',0);
|
||||
$link = '<a href="?p=player&uid='.$bannedUsers[$i]['uid'].'">'.$name.'<a/>';
|
||||
|
||||
}
|
||||
if($bannedUsers[$i]['end'])
|
||||
{
|
||||
$end = date("d.m.y H:i",$bannedUsers[$i]['end']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$end = '*';
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$link.'</td>
|
||||
<td ><span class="f7">'.date("d.m.y H:i",$bannedUsers[$i]['time']).' - '.$end.'</td>
|
||||
<td>'.$bannedUsers[$i]['reason'].'</td>
|
||||
<td class="on"><a href="?action=delBan&uid='.$bannedUsers[$i]['uid'].'&id='.$bannedUsers[$i]['id'].'" onClick="return del(\'unban\',\''.$name.'\')"><img src="../img/Admin/del.gif" class="del" title="cancel" alt="cancel"></img></a></td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<tr><td colspan="6" class="on">No Players are Banned</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
+3
-3
@@ -68,8 +68,8 @@ if (!empty($_GET['p'])) {
|
||||
$subpage = 'Ban/Unban Players';
|
||||
break;
|
||||
|
||||
case 'maintenence':
|
||||
$subpage = 'Server Maintenence';
|
||||
case 'maintenance':
|
||||
$subpage = 'Server Maintenance';
|
||||
break;
|
||||
|
||||
case 'cleanban':
|
||||
@@ -473,7 +473,7 @@ if (!empty($_GET['p'])) {
|
||||
<br />
|
||||
<a href="#"><b>Ban</b></a>
|
||||
<a href="?p=ban">Ban/Unban Players</a>
|
||||
<a href="?p=maintenence">Server Maintenence</a>
|
||||
<a href="?p=maintenance">Server Maintenance</a>
|
||||
<a href="?p=cleanban">Clean Banlist Data</a>
|
||||
<br />
|
||||
<a href="#"><b>Gold</b></a>
|
||||
|
||||
@@ -173,6 +173,7 @@ class Session {
|
||||
}
|
||||
|
||||
if($user && ($admin || isset($_SESSION['sessid']))) {
|
||||
$this->maintenance();
|
||||
$this->isWinner();
|
||||
|
||||
// check if this is not a support user, for who only messages and statistics are available
|
||||
@@ -193,6 +194,18 @@ class Session {
|
||||
else return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the server is under maintenance
|
||||
*
|
||||
*/
|
||||
|
||||
function maintenance(){
|
||||
if($_SESSION['ok'] == 2 && basename($_SERVER['PHP_SELF']) != 'maintenance.php'){
|
||||
header('Location: maintenance.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when there's a player who built a WW to level 100
|
||||
*
|
||||
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
include_once("GameEngine/Generator.php");
|
||||
$start_timer = $generator->pageLoadTimeStart();
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Version: 18.02.2014 ##
|
||||
## Description: When the player builds Wonder of the World ##
|
||||
## to level 100 the winner details are shown. ##
|
||||
## tells the players the game is over ##
|
||||
## Authors: aggenkeech - and a little help from Eyas95 ##
|
||||
## Page: winner.php ##
|
||||
## Fixed by: Shadow ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2013. All rights reserved. ##
|
||||
## URLs: http://travian.shadowss.ro ##
|
||||
## Source code: https://github.com/Shadowss/TravianZ/ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
use App\Utils\AccessLogger;
|
||||
|
||||
if (!function_exists('mysqli_result')) {
|
||||
function mysqli_result($res, $row, $field = 0) {
|
||||
$res->data_seek($row);
|
||||
$datarow = $res->fetch_array();
|
||||
return $datarow[$field];
|
||||
}
|
||||
}
|
||||
|
||||
include_once("GameEngine/Village.php");
|
||||
AccessLogger::logRequest();
|
||||
|
||||
if(isset($_GET['newdid'])) {
|
||||
$_SESSION['wid'] = $_GET['newdid'];
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
}
|
||||
|
||||
if($_SESSION['ok'] == 2){
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo SERVER_NAME ?> - Game Over</title>
|
||||
<link rel="shortcut icon" href="favicon.ico"/>
|
||||
<meta http-equiv="cache-control" content="max-age=0" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<meta http-equiv="expires" content="0" />
|
||||
<meta http-equiv="imagetoolbar" content="no" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<script src="mt-full.js?0faab" type="text/javascript"></script>
|
||||
<script src="unx.js?f4b7h" type="text/javascript"></script>
|
||||
<script src="new.js?0faab" type="text/javascript"></script>
|
||||
<link href="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css" />
|
||||
<?php
|
||||
if($session->gpack == null || GP_ENABLE == false)
|
||||
{
|
||||
echo "
|
||||
<link href='".GP_LOCATE."travian.css?e21d2' rel='stylesheet' type='text/css' />
|
||||
<link href='".GP_LOCATE."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "
|
||||
<link href='".$session->gpack."travian.css?e21d2' rel='stylesheet' type='text/css' />
|
||||
<link href='".$session->gpack."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">window.addEvent('domready', start);</script>
|
||||
<style type="text/css">
|
||||
.style1 {
|
||||
text-align: center;
|
||||
}
|
||||
.style2 {
|
||||
border-width: 0px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="v35 ie ie8">
|
||||
<div class="wrapper">
|
||||
<img style="filter: chroma();" src="img/x.gif" id="msfilter" alt="" />
|
||||
<div id="dynamic_header"></div>
|
||||
<?php include("Templates/header.tpl"); ?>
|
||||
<div id="mid">
|
||||
<?php include("Templates/menu.tpl"); ?>
|
||||
<div id="content" class="village2" style="font-size: 20pt;text-align: center">
|
||||
<p><b>Server is under maintenance</b></p>
|
||||
</div>
|
||||
<br /><br /><br /><br /><div id="side_info">
|
||||
<?php
|
||||
include("Templates/multivillage.tpl");
|
||||
include("Templates/quest.tpl");
|
||||
include("Templates/news.tpl");
|
||||
?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="footer-stopper"></div>
|
||||
<div class="clear"></div>
|
||||
<?php
|
||||
include("Templates/res.tpl");
|
||||
include("Templates/footer.tpl");
|
||||
?>
|
||||
<div id="stime">
|
||||
<div id="ltime">
|
||||
<div id="ltimeWrap">
|
||||
Calculated in <b><?php echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000);?></b> ms
|
||||
<br/>Server time: <span id="tp1" class="b"><?php echo date('H:i:s'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ce">
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
}else{
|
||||
header("Location: dorf1.php");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user