Enable (Disable) Alliance invitation message

+Now during the installation (or after installation in the admin panel) you can Enable (Disable) sending an in-game message to the player, if he was invited to the alliance.
+Preparing the code for Enable (Disable) "New Alliance & Embassy Mechanics"

NOTE 1: To play this version of the game, you need to reinstall the server OR you can simply add these lines of code into your file:
GameEngine/config.php

define("NEW_FUNCTIONS_ALLIANCE_INVITATION", True);
define("NEW_FUNCTIONS_EMBASSY_MECHANICS", False);

GameEngine/Admin/Mods/constant_format.tpl

define("NEW_FUNCTIONS_ALLIANCE_INVITATION", %NEW_FUNCTIONS_ALLIANCE_INVITATION%);
define("NEW_FUNCTIONS_EMBASSY_MECHANICS", %NEW_FUNCTIONS_EMBASSY_MECHANICS%);

NOTE 2: pay special attention to the fact that these are two different records !!! If the records are entered incorrectly, you will receive a non-working code!

NOTE 3: it is also necessary to follow the instructions with this change (if they were not previously executed) https://github.com/Shadowss/TravianZ/commit/11ae61c013d663304086ecfd5d845040ebf2f144
This commit is contained in:
Vladyslav
2018-06-20 19:34:05 +03:00
parent 11ae61c013
commit c1eb10b19b
13 changed files with 98 additions and 21 deletions
+25 -17
View File
@@ -179,24 +179,32 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN);
<td><b><?php echo (ERROR_REPORT=="error_reporting (0);")? "No": "Yes";?></b></td>
</tr>
</table>
<table id="member">
<thead>
<tr>
<th>New Mechanics and Functions <a href="admin.php?p=editNewFunctions"><img src="../img/admin/edit.gif" title="Edit New Mechanics and Functions"></a></th>
</tr>
</thead>
</table>
<table id="member">
<thead>
<tr>
<th>New Mechanics and Functions <a href="admin.php?p=editNewFunctions"><img src="../img/admin/edit.gif" title="Edit New Mechanics and Functions"></a></th>
</tr>
</thead>
</table>
<table id="profile">
<tr>
<td class="b"><?php echo SERV_VARIABLE ?></td>
<td class="b"><?php echo SERV_VALUE ?></td>
</tr>
<tr>
<td>Display oasis in profile <em class="tooltip">?<span class="classic">Turns on or off the display of oases of each village in the player profile</span></em></td>
<td><?php echo NEW_FUNCTIONS_OASIS ? "<b><font color='Green'>Enabled</font></b>" : "<b><font color='Red'>Disabled</font></b>"; ?></td>
</tr>
</table>
<table id="profile">
<tr>
<td class="b"><?php echo SERV_VARIABLE ?></td>
<td class="b"><?php echo SERV_VALUE ?></td>
</tr>
<tr>
<td>Display oasis in profile <em class="tooltip">?<span class="classic">Enable (Disable) the display of oases of each village in the player profile</span></em></td>
<td><?php echo NEW_FUNCTIONS_OASIS ? "<b><font color='Green'>Enabled</font></b>" : "<b><font color='Red'>Disabled</font></b>"; ?></td>
</tr>
<tr>
<td>Alliance invitation message <em class="tooltip">?<span class="classic">Enable (Disable) sending an in-game message to the player, if he was invited to the alliance</span></em></td>
<td><?php echo NEW_FUNCTIONS_ALLIANCE_INVITATION ? "<b><font color='Green'>Enabled</font></b>" : "<b><font color='Red'>Disabled</font></b>"; ?></td>
</tr>
<tr>
<td>New Alliance & Embassy Mechanics <em class="tooltip">?<span class="classic">For this setting, you can find more information on the link: <a href="https://github.com/Shadowss/TravianZ/wiki/New-Alliance-&-Embassy-Mechanics" target="_blank">https://github.com</a></span></em></td>
<td><?php echo NEW_FUNCTIONS_EMBASSY_MECHANICS ? "<b><font color='Green'>Enabled</font></b>" : "<b><font color='Red'>Disabled</font></b>"; ?></td>
</tr>
</table>
<table id="member">
<thead>
<tr>
+20 -2
View File
@@ -28,8 +28,26 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN);
<td width="50%">Display oasis in profile <em class="tooltip">?<span class="classic">Turns on or off the display of oases of each village in the player profile</span></em></td>
<td width="50%">
<select name="new_functions_oasis">
<option value="True" <?php if(NEW_FUNCTIONS_OASIS==true) echo "selected";?>>True</option>
<option value="False" <?php if(NEW_FUNCTIONS_OASIS==false) echo "selected";?>>False</option>
<option value="True" <?php if(NEW_FUNCTIONS_OASIS == true) echo "selected";?>>True</option>
<option value="False" <?php if(NEW_FUNCTIONS_OASIS == false) echo "selected";?>>False</option>
</select>
</td>
</tr>
<tr>
<td>Alliance invitation message <em class="tooltip">?<span class="classic">Enable (Disable) sending an in-game message to the player, if he was invited to the alliance</span></em></td>
<td>
<select name="new_functions_alliance_invitation">
<option value="True" <?php if(NEW_FUNCTIONS_ALLIANCE_INVITATION == true) echo "selected";?>>True</option>
<option value="False" <?php if(NEW_FUNCTIONS_ALLIANCE_INVITATION == false) echo "selected";?>>False</option>
</select>
</td>
</tr>
<tr>
<td>New Alliance & Embassy Mechanics <em class="tooltip">?<span class="classic">For this setting, you can find more information on the link: <a href="https://github.com/Shadowss/TravianZ/wiki/New-Alliance-&-Embassy-Mechanics" target="_blank">https://github.com</a></span></em></td>
<td>
<select name="new_functions_embassy_mechanics">
<option value="True" <?php if(NEW_FUNCTIONS_EMBASSY_MECHANICS == true) echo "selected";?>>True</option>
<option value="False" <?php if(NEW_FUNCTIONS_EMBASSY_MECHANICS == false) echo "selected";?>>False</option>
</select>
</td>
</tr>
+4
View File
@@ -49,6 +49,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$NEWSBOX3=(NEWSBOX3==false)? "false":"true";
$LIMIT_MAILBOX=(LIMIT_MAILBOX==false)? "false":"true";
$NEW_FUNCTIONS_OASIS = (NEW_FUNCTIONS_OASIS == false ? 'false' : 'true');
$NEW_FUNCTIONS_ALLIANCE_INVITATION = (NEW_FUNCTIONS_ALLIANCE_INVITATION == false ? 'false' : 'true');
$NEW_FUNCTIONS_EMBASSY_MECHANICS = (NEW_FUNCTIONS_EMBASSY_MECHANICS == false ? 'false' : 'true');
$text = file_get_contents("constant_format.tpl");
$text = preg_replace("'%ERRORREPORT%'", $ERRORREPORT, $text);
@@ -125,6 +127,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text);
$text = preg_replace("'%SERVER%'", SERVER, $text);
$text = preg_replace("'%NEW_FUNCTIONS_OASIS%'", $NEW_FUNCTIONS_OASIS, $text);
$text = preg_replace("'%NEW_FUNCTIONS_ALLIANCE_INVITATION%'", $NEW_FUNCTIONS_ALLIANCE_INVITATION, $text);
$text = preg_replace("'%NEW_FUNCTIONS_EMBASSY_MECHANICS%'", $NEW_FUNCTIONS_EMBASSY_MECHANICS, $text);
// PLUS settings need to be kept intact
$text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text);
+4
View File
@@ -48,6 +48,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true');
$ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true');
$NEW_FUNCTIONS_OASIS = (NEW_FUNCTIONS_OASIS == false ? 'false' : 'true');
$NEW_FUNCTIONS_ALLIANCE_INVITATION = (NEW_FUNCTIONS_ALLIANCE_INVITATION == false ? 'false' : 'true');
$NEW_FUNCTIONS_EMBASSY_MECHANICS = (NEW_FUNCTIONS_EMBASSY_MECHANICS == false ? 'false' : 'true');
$text = file_get_contents("constant_format.tpl");
$text = preg_replace("'%ERRORREPORT%'", ERROR_REPORT, $text);
@@ -122,6 +124,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text);
$text = preg_replace("'%SERVER%'", SERVER, $text);
$text = preg_replace("'%NEW_FUNCTIONS_OASIS%'", $NEW_FUNCTIONS_OASIS, $text);
$text = preg_replace("'%NEW_FUNCTIONS_ALLIANCE_INVITATION%'", $NEW_FUNCTIONS_ALLIANCE_INVITATION, $text);
$text = preg_replace("'%NEW_FUNCTIONS_EMBASSY_MECHANICS%'", $NEW_FUNCTIONS_EMBASSY_MECHANICS, $text);
// PLUS settings need to be kept intact
$text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text);
+4
View File
@@ -44,6 +44,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true');
$ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true');
$NEW_FUNCTIONS_OASIS = (NEW_FUNCTIONS_OASIS == false ? 'false' : 'true');
$NEW_FUNCTIONS_ALLIANCE_INVITATION = (NEW_FUNCTIONS_ALLIANCE_INVITATION == false ? 'false' : 'true');
$NEW_FUNCTIONS_EMBASSY_MECHANICS = (NEW_FUNCTIONS_EMBASSY_MECHANICS == false ? 'false' : 'true');
$text = file_get_contents("constant_format.tpl");
$text = preg_replace("'%ERRORREPORT%'", $ERRORREPORT, $text);
@@ -122,6 +124,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text);
$text = preg_replace("'%SERVER%'", SERVER, $text);
$text = preg_replace("'%NEW_FUNCTIONS_OASIS%'", $NEW_FUNCTIONS_OASIS, $text);
$text = preg_replace("'%NEW_FUNCTIONS_ALLIANCE_INVITATION%'", $NEW_FUNCTIONS_ALLIANCE_INVITATION, $text);
$text = preg_replace("'%NEW_FUNCTIONS_EMBASSY_MECHANICS%'", $NEW_FUNCTIONS_EMBASSY_MECHANICS, $text);
// PLUS settings need to be kept intact
$text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text);
@@ -106,6 +106,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text);
$text = preg_replace("'%SERVER%'", SERVER, $text);
$text = preg_replace("'%NEW_FUNCTIONS_OASIS%'", $_POST['new_functions_oasis'], $text);
$text = preg_replace("'%NEW_FUNCTIONS_ALLIANCE_INVITATION%'", $_POST['new_functions_alliance_invitation'], $text);
$text = preg_replace("'%NEW_FUNCTIONS_EMBASSY_MECHANICS%'", $_POST['new_functions_embassy_mechanics'], $text);
// PLUS settings need to be kept intact
$text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text);
+4 -1
View File
@@ -45,12 +45,13 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$LOG_MARKET=(LOG_MARKET==false)? "false":"true";
$LOG_ILLEGAL=(LOG_ILLEGAL==false)? "false":"true";
$LIMIT_MAILBOX=(LIMIT_MAILBOX==false)? "false":"true";
$INCLUDE_ADMIN=(INCLUDE_ADMIN==false)? "false":"true";
$SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true');
$ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true');
$NEW_FUNCTIONS_OASIS = (NEW_FUNCTIONS_OASIS == false ? 'false' : 'true');
$NEW_FUNCTIONS_ALLIANCE_INVITATION = (NEW_FUNCTIONS_ALLIANCE_INVITATION == false ? 'false' : 'true');
$NEW_FUNCTIONS_EMBASSY_MECHANICS = (NEW_FUNCTIONS_EMBASSY_MECHANICS == false ? 'false' : 'true');
$text = file_get_contents("constant_format.tpl");
$text = preg_replace("'%ERRORREPORT%'", $ERRORREPORT, $text);
@@ -129,6 +130,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text);
$text = preg_replace("'%SERVER%'", SERVER, $text);
$text = preg_replace("'%NEW_FUNCTIONS_OASIS%'", $NEW_FUNCTIONS_OASIS, $text);
$text = preg_replace("'%NEW_FUNCTIONS_ALLIANCE_INVITATION%'", $NEW_FUNCTIONS_ALLIANCE_INVITATION, $text);
$text = preg_replace("'%NEW_FUNCTIONS_EMBASSY_MECHANICS%'", $NEW_FUNCTIONS_EMBASSY_MECHANICS, $text);
// PLUS settings need to be kept intact
$text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text);
+4
View File
@@ -32,6 +32,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true');
$ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true');
$NEW_FUNCTIONS_OASIS = (NEW_FUNCTIONS_OASIS == false ? 'false' : 'true');
$NEW_FUNCTIONS_ALLIANCE_INVITATION = (NEW_FUNCTIONS_ALLIANCE_INVITATION == false ? 'false' : 'true');
$NEW_FUNCTIONS_EMBASSY_MECHANICS = (NEW_FUNCTIONS_EMBASSY_MECHANICS == false ? 'false' : 'true');
// SERVER SETTINGS - we need to keep these intact
$text = preg_replace("'%ERRORREPORT%'", ERROR_REPORT, $text);
@@ -106,6 +108,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text);
$text = preg_replace("'%SERVER%'", SERVER, $text);
$text = preg_replace("'%NEW_FUNCTIONS_OASIS%'", $NEW_FUNCTIONS_OASIS, $text);
$text = preg_replace("'%NEW_FUNCTIONS_ALLIANCE_INVITATION%'", $NEW_FUNCTIONS_ALLIANCE_INVITATION, $text);
$text = preg_replace("'%NEW_FUNCTIONS_EMBASSY_MECHANICS%'", $NEW_FUNCTIONS_EMBASSY_MECHANICS, $text);
// PLUS SETTINGS
$text = preg_replace("'%PLUS_TIME%'", $_POST['plus_time'], $text);
+4
View File
@@ -43,6 +43,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true');
$ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true');
$NEW_FUNCTIONS_OASIS = (NEW_FUNCTIONS_OASIS == false ? 'false' : 'true');
$NEW_FUNCTIONS_ALLIANCE_INVITATION = (NEW_FUNCTIONS_ALLIANCE_INVITATION == false ? 'false' : 'true');
$NEW_FUNCTIONS_EMBASSY_MECHANICS = (NEW_FUNCTIONS_EMBASSY_MECHANICS == false ? 'false' : 'true');
$text = file_get_contents("constant_format.tpl");
$text = preg_replace("'%ERRORREPORT%'", $_POST['error'], $text);
@@ -117,6 +119,8 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text);
$text = preg_replace("'%SERVER%'", SERVER, $text);
$text = preg_replace("'%NEW_FUNCTIONS_OASIS%'", $NEW_FUNCTIONS_OASIS, $text);
$text = preg_replace("'%NEW_FUNCTIONS_ALLIANCE_INVITATION%'", $NEW_FUNCTIONS_ALLIANCE_INVITATION, $text);
$text = preg_replace("'%NEW_FUNCTIONS_EMBASSY_MECHANICS%'", $NEW_FUNCTIONS_EMBASSY_MECHANICS, $text);
// PLUS settings need to be kept intact
$text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text);
+4 -1
View File
@@ -245,7 +245,9 @@ class Alliance {
// Log the notice
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a> has invited <a href="spieler.php?uid=' . $UserData['id'] . '">' . addslashes($UserData['username']) . '</a> into the alliance.');
// send invitation via in-game messages
$database->sendMessage(
if(NEW_FUNCTIONS_ALLIANCE_INVITATION == false) return;
else {
$database->sendMessage(
$UserData['id'],
4,
'Alliance invitation.',
@@ -256,6 +258,7 @@ class Alliance {
0,
0,
true);
}
}
}
+3
View File
@@ -300,6 +300,9 @@ define("ADMIN_ALLOW_INCOMING_RAIDS", %ARAIDS%);
// **** NEW MECHANICS AND FUNCTIONS **** //
/////////////////////////////////////////////////
define("NEW_FUNCTIONS_OASIS", %NEW_FUNCTIONS_OASIS%);
define("NEW_FUNCTIONS_ALLIANCE_INVITATION", %NEW_FUNCTIONS_ALLIANCE_INVITATION%);
define("NEW_FUNCTIONS_EMBASSY_MECHANICS", %NEW_FUNCTIONS_EMBASSY_MECHANICS%);
//////////////////////////////////////////
// **** DO NOT EDIT SETTINGS **** //
+2
View File
@@ -144,6 +144,8 @@ class Process {
//New Mechanics and Functions
$findReplace["%NEW_FUNCTIONS_OASIS%"] = $_POST['new_functions_oasis'];
$findReplace["%NEW_FUNCTIONS_ALLIANCE_INVITATION%"] = $_POST['new_functions_alliance_invitation'];
$findReplace["%NEW_FUNCTIONS_EMBASSY_MECHANICS%"] = $_POST['new_functions_embassy_mechanics'];
fwrite($gameConfig, str_replace(array_keys($findReplace), array_values($findReplace), $text));
+18
View File
@@ -282,6 +282,24 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
</select>
</td>
</tr>
<tr>
<td><span class="f9 c6">Alliance invitation message:</span></td>
<td>
<select name="new_functions_alliance_invitation">
<option value="true">true</option>
<option value="false" selected="selected">false</option>
</select>
</td>
</tr>
<tr>
<td><span class="f9 c6">New Alliance & Embassy Mechanics:</span></td>
<td>
<select name="new_functions_embassy_mechanics">
<option value="true">true</option>
<option value="false" selected="selected">false</option>
</select>
</td>
</tr>
</table>
</p>
<p>