mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-12 22:31:02 +00:00
New Mileston + New SendWelcome Message
New Mileston + New SendWelcome Message
This commit is contained in:
@@ -1,15 +1,43 @@
|
||||
Hello %USER%,
|
||||
|
||||
Thank you for registering on our server.
|
||||
Since the %START% at %TIME% Romans, Gauls and Teutons attack each other on this game world. Right now, %PLAYERS% players in %ALLI% Alliances are fighting for supremacy. To not get lost in this devastating battle, you should look for allies even though you are <b>protected by beginner's protection for %PROTECTION% hours</b>.
|
||||
|
||||
The taskmaster will help you on your way to establishing your empire with advice, deed and resources (after a few tasks such as finding out the exact duration of your beginner's protection). You can find him on the right side of your village. After successfully completing all of his tasks you will be on your own again.
|
||||
Since the %START% at %TIME%, %TRIBES% are competing for supremacy on this game world. Right now, %PLAYERS% players in %ALLI% Alliances are fighting for dominance. To not get lost in this devastating battle, you should look for allies even though you are <b>protected by beginner's protection for %PROTECTION% hours</b>.
|
||||
|
||||
<ul style="margin-top:0;margin-bottom:0;"><li>You have to heed the <a href="rules.php">game rules</a></li><li>Information concerning troops and buildings can be found in the <a href="#" onClick="return Popup(0,0);">instructions</a></li><li>Problems? Check the <a href="http://t3.answers.travian.com" target="_blank">Travian Answers</a> first!</li><li>No solution? Try asking in the <a href="http://forum.travian.com/">Forum</a></li><li>Tried everything to no avail? Write an answer to this message to contact the Support</li></ul>
|
||||
The taskmaster will help you on your way to establishing your empire with advice, deeds and resources (after a few tasks such as finding out the exact duration of your beginner's protection). You can find him on the right side of your village. After successfully completing all of his tasks you will be on your own again.
|
||||
|
||||
<ul style="margin-top:0;margin-bottom:0;">
|
||||
<li>You have to heed the <a href="rules.php">game rules</a></li>
|
||||
<li>Information concerning troops and buildings can be found in the <a href="#" onClick="return Popup(0,0);">instructions</a></li>
|
||||
<li>Problems? Check the <a href="http://t3.answers.travianz.org" target="_blank">Travian Answers</a> first!</li>
|
||||
<li>No solution? Try asking in the <a href="https://github.com/Shadowss/TravianZ">Forum</a></li>
|
||||
<li>Tried everything to no avail? Write an answer to this message to contact the Support</li>
|
||||
</ul>
|
||||
|
||||
<b>Game World Timeline</b>
|
||||
|
||||
This game world is expected to run until approximately <b>%WORLD_END_DATE%</b>
|
||||
.
|
||||
The estimated end date is calculated dynamically from the World Wonder Construction Plan release, the time required to construct the World Wonder from level 0 to level 100 at the current server speed, and an additional <b>5 days</b> to allow for final attacks and possible World Wonder setbacks.
|
||||
|
||||
<ul style="margin-top:0;margin-bottom:0;">
|
||||
<li><b>Natars appear:</b> %NATARS_DATE%</li>
|
||||
<li><b>World Wonder villages appear:</b> %WW_VILLAGES_DATE%</li>
|
||||
<li><b>World Wonder Construction Plans appear:</b> %WW_PLANS_DATE%</li>
|
||||
<li><b>World Wonder construction time from level 0 to 100:</b> %WW_BUILD_TIME%</li>
|
||||
<li><b>Estimated World Wonder completion:</b> %WW100_DATE%</li>
|
||||
</ul>
|
||||
|
||||
<b>Natars</b>
|
||||
|
||||
After approximately <b>%NATAR_TIME%</b>, the <b>legendary tribe of the Natars</b> will enter the battlefield. Prepare your armies, strengthen your alliances and get ready for the final stage of the game.
|
||||
|
||||
<b>Active Server Features</b>
|
||||
|
||||
The following features are currently active on this game world:
|
||||
|
||||
%ACTIVE_NEW_FUNCTIONS%
|
||||
|
||||
<b>Travian game worlds run for roughly 11 months.</b>
|
||||
When you delete your account or a game world ends you can move remaining gold to another account, if applicable. The details will be explained to you in an e-mail.
|
||||
|
||||
<b>After about 9 month</b> brave battles, trading and forging confederacies, you will be given the chance to match against the <b>legendary tribe of the Natars</b> and by chance perhaps even steal their secret granting infinite power....
|
||||
|
||||
Regards, %SERVER_NAME%
|
||||
Regards, %SERVER_NAME%
|
||||
@@ -698,9 +698,72 @@ class HeroItems
|
||||
$stmt->close();
|
||||
|
||||
$this->invalidateCaches($uid);
|
||||
|
||||
/**
|
||||
* Milestone "Hero Master": primul jucator de pe server care are eroul
|
||||
* echipat cu tier 3 pe TOATE cele sase sloturi (coif, armura, mana
|
||||
* dreapta, mana stanga, incaltaminte si Warhorse - calul de tier 3).
|
||||
*
|
||||
* Verificarea se face dupa echipare, cand chiar s-a schimbat ceva.
|
||||
* recordMilestoneIfFirst() foloseste INSERT IGNORE pe o cheie unica,
|
||||
* deci al doilea jucator care ajunge acolo nu suprascrie nimic, iar
|
||||
* apelurile repetate ale aceluiasi jucator nu costa nimic.
|
||||
*/
|
||||
if ($ok) {
|
||||
$this->checkHeroMasterMilestone($uid);
|
||||
}
|
||||
|
||||
return $ok;
|
||||
}
|
||||
|
||||
/**
|
||||
* Eroul are tier 3 pe toate cele sase sloturi de echipament?
|
||||
* Slotul 7 (HSLOT_BAG) e pentru consumabile, deci nu conteaza.
|
||||
*/
|
||||
public function isFullTier3($uid)
|
||||
{
|
||||
$equipped = $this->getEquipped((int) $uid);
|
||||
|
||||
if (!is_array($equipped)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$slots = array(HSLOT_HELMET, HSLOT_BODY, HSLOT_RIGHT, HSLOT_LEFT, HSLOT_SHOES, HSLOT_HORSE);
|
||||
|
||||
foreach ($slots as $slot) {
|
||||
|
||||
if (!isset($equipped[$slot]['def']['tier'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((int) $equipped[$slot]['def']['tier'] !== 3) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Inregistreaza milestone-ul, daca e cazul. */
|
||||
private function checkHeroMasterMilestone($uid)
|
||||
{
|
||||
global $database;
|
||||
|
||||
if (!defined('NEW_FUNCTIONS_MILESTONES') || !NEW_FUNCTIONS_MILESTONES) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$database || !method_exists($database, 'recordMilestoneIfFirst')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$this->isFullTier3($uid)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$database->recordMilestoneIfFirst('hero_master', (int) $uid, 0, '');
|
||||
}
|
||||
|
||||
/** Unequip a specific owned row. Returns true on success. */
|
||||
public function unequipItem($uid, $rowId)
|
||||
{
|
||||
|
||||
@@ -2451,6 +2451,7 @@ tz_def('TZ_MILESTONE_FIRST_ALLIANCE', 'First Alliance Founded');
|
||||
tz_def('TZ_MILESTONE_FIRST_PVP_CONQUEST', 'First Village Conquered from a Player');
|
||||
tz_def('TZ_MILESTONE_FIVE_VILLAGES', 'First to Found 5 Villages');
|
||||
tz_def('TZ_MILESTONE_FOUNDED_BY', 'Founded by');
|
||||
tz_def('TZ_MILESTONE_HERO_MASTER', 'First Hero Master (full tier 3 equipment)');
|
||||
|
||||
// ===== i18n etape 2 (lot suivant) =====
|
||||
tz_def('TZ_ACCOUNT_OR_INCREASE_YOUR_RESOURCE', '-Account or increase your resource production.To do so click');
|
||||
|
||||
@@ -2457,6 +2457,7 @@ tz_def('TZ_MILESTONE_FIRST_ALLIANCE', 'Première alliance fondée');
|
||||
tz_def('TZ_MILESTONE_FIRST_PVP_CONQUEST', 'Premier village conquis à un joueur');
|
||||
tz_def('TZ_MILESTONE_FIVE_VILLAGES', 'Premier à fonder 5 villages');
|
||||
tz_def('TZ_MILESTONE_FOUNDED_BY', 'Fondé par');
|
||||
tz_def('TZ_MILESTONE_HERO_MASTER', 'Premier Maitre des Heros (equipement tier 3 complet)');
|
||||
|
||||
// ===== i18n etape 2 (lot suivant) =====
|
||||
tz_def('TZ_ACCOUNT_OR_INCREASE_YOUR_RESOURCE', '-Compte ou augmentez votre production de ressources. Pour ce faire, cliquez');
|
||||
|
||||
@@ -2698,6 +2698,7 @@ tz_def('TZ_MILESTONE_FIRST_ALLIANCE', 'Prima alianță fondată');
|
||||
tz_def('TZ_MILESTONE_FIRST_PVP_CONQUEST', 'Primul sat cucerit de la un jucător');
|
||||
tz_def('TZ_MILESTONE_FIVE_VILLAGES', 'Primul care a fondat 5 sate');
|
||||
tz_def('TZ_MILESTONE_FOUNDED_BY', 'Fondată de');
|
||||
tz_def('TZ_MILESTONE_HERO_MASTER', 'Primul Erou Maestru (echipament complet tier 3)');
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// COMPLETARE 1:1 dupa en.php - Hero T4, triburi noi, milestones, Waterworks (revizuieste traducerile)
|
||||
|
||||
+743
-35
@@ -738,44 +738,752 @@ class Message
|
||||
}
|
||||
}
|
||||
|
||||
public function sendWelcome($uid, $username)
|
||||
{
|
||||
global $database;
|
||||
$welcomemsg = file_get_contents("GameEngine/Admin/welcome.tpl");
|
||||
$welcomemsg = "[message]" . preg_replace(
|
||||
[
|
||||
"'%USER%'",
|
||||
"'%START%'",
|
||||
"'%TIME%'",
|
||||
"'%PLAYERS%'",
|
||||
"'%ALLI%'",
|
||||
"'%SERVER_NAME%'",
|
||||
"'%PROTECTION%'"
|
||||
],
|
||||
[
|
||||
$username,
|
||||
date("y.m.d", COMMENCE),
|
||||
date("H:i", COMMENCE),
|
||||
$database->countUser(),
|
||||
$database->countAlli(),
|
||||
SERVER_NAME,
|
||||
round((PROTECTION / 3600))
|
||||
],
|
||||
$welcomemsg
|
||||
) . "[/message]";
|
||||
return $database->sendMessage(
|
||||
$uid,
|
||||
1,
|
||||
WEL_TOPIC,
|
||||
addslashes($welcomemsg),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
public function sendWelcome($uid, $username){
|
||||
global $database;
|
||||
|
||||
$welcomemsg = file_get_contents("GameEngine/Admin/welcome.tpl");
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* GAME WORLD DATES
|
||||
* ================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* REAL SERVER START DATE / TIME
|
||||
* ================================================================
|
||||
*
|
||||
* START_DATE and START_TIME are the official world start values
|
||||
* configured in config.php.
|
||||
*
|
||||
* COMMENCE is not used here because it may represent a different
|
||||
* internal timestamp.
|
||||
*/
|
||||
|
||||
$worldStart = strtotime(
|
||||
START_DATE . ' ' . START_TIME
|
||||
);
|
||||
|
||||
/*
|
||||
* Natars spawn
|
||||
*
|
||||
* NATARS_SPAWN_TIME is stored in days.
|
||||
*/
|
||||
$natarsDate = $worldStart;
|
||||
|
||||
if (defined('NATARS_SPAWN_TIME')) {
|
||||
$natarsDate = $worldStart + ((int) NATARS_SPAWN_TIME * 86400);
|
||||
}
|
||||
|
||||
/*
|
||||
* World Wonder villages
|
||||
*/
|
||||
$wwVillagesDate = $worldStart;
|
||||
|
||||
if (defined('NATARS_WW_SPAWN_TIME')) {
|
||||
$wwVillagesDate = $worldStart + ((int) NATARS_WW_SPAWN_TIME * 86400);
|
||||
}
|
||||
|
||||
/*
|
||||
* World Wonder Construction Plans
|
||||
*/
|
||||
$wwPlansDate = $worldStart;
|
||||
|
||||
if (defined('NATARS_WW_BUILDING_PLAN_SPAWN_TIME')) {
|
||||
$wwPlansDate = $worldStart + (
|
||||
(int) NATARS_WW_BUILDING_PLAN_SPAWN_TIME * 86400
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* WORLD WONDER BUILD TIME
|
||||
* ================================================================
|
||||
*
|
||||
* The World Wonder is building gid 40.
|
||||
*
|
||||
* Calculate the complete construction time from level 1
|
||||
* through level 100 using the actual World Wonder times
|
||||
* from buidata.php.
|
||||
*
|
||||
* This calculation follows the same formula used by
|
||||
* getBuildingTime() for normal buildings:
|
||||
*
|
||||
* base_time
|
||||
* × (Main Building attri / 100)
|
||||
* ÷ SPEED
|
||||
*
|
||||
* The World Wonder village is considered to have
|
||||
* Main Building level 20 for this calculation.
|
||||
*/
|
||||
|
||||
$wwBuildSeconds = 0;
|
||||
|
||||
/*
|
||||
* Load building data if it is not already loaded.
|
||||
*
|
||||
* buidata.php contains:
|
||||
* $bid40 = World Wonder
|
||||
* $bid15 = Main Building
|
||||
*/
|
||||
if (!isset($bid40) || !isset($bid15)) {
|
||||
require_once("GameEngine/Data/buidata.php");
|
||||
}
|
||||
|
||||
/*
|
||||
* World Wonder construction is calculated using
|
||||
* Main Building level 20.
|
||||
*
|
||||
* This corresponds to the formula in getBuildingTime():
|
||||
*
|
||||
* $dataArray[$level]['time']
|
||||
* * ($bid15[$mainBuilding]['attri'] / 100)
|
||||
* / SPEED
|
||||
*/
|
||||
$mainBuildingLevel = 20;
|
||||
|
||||
if (
|
||||
isset($bid40) &&
|
||||
is_array($bid40) &&
|
||||
isset($bid15) &&
|
||||
is_array($bid15) &&
|
||||
isset($bid15[$mainBuildingLevel]) &&
|
||||
isset($bid15[$mainBuildingLevel]['attri'])
|
||||
) {
|
||||
|
||||
$mainBuildingModifier =
|
||||
((float) $bid15[$mainBuildingLevel]['attri']) / 100;
|
||||
|
||||
/*
|
||||
* Calculate the total construction time
|
||||
* from World Wonder level 1 to level 100.
|
||||
*/
|
||||
for ($level = 1; $level <= 100; $level++) {
|
||||
|
||||
if (
|
||||
!isset($bid40[$level]) ||
|
||||
!isset($bid40[$level]['time'])
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$baseTime = (float) $bid40[$level]['time'];
|
||||
|
||||
/*
|
||||
* Same formula as getBuildingTime():
|
||||
*
|
||||
* base time
|
||||
* × Main Building modifier
|
||||
* ÷ server speed
|
||||
*/
|
||||
$levelBuildTime = round(
|
||||
$baseTime
|
||||
* $mainBuildingModifier
|
||||
/ SPEED
|
||||
);
|
||||
|
||||
$wwBuildSeconds += $levelBuildTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* WW START DATE
|
||||
* ================================================================
|
||||
*
|
||||
* The WW cannot start before:
|
||||
*
|
||||
* 1. Natars appear
|
||||
* 2. WW villages appear
|
||||
* 3. Construction Plans appear
|
||||
*
|
||||
* Therefore use the latest of these dates.
|
||||
*/
|
||||
|
||||
$wwStartDate = max(
|
||||
$natarsDate,
|
||||
$wwVillagesDate,
|
||||
$wwPlansDate
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* WW LEVEL 100 DATE
|
||||
* ================================================================
|
||||
*/
|
||||
|
||||
$ww100Date = $wwStartDate + $wwBuildSeconds;
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* FINAL WORLD END DATE
|
||||
* ================================================================
|
||||
*
|
||||
* Add 5 additional days for:
|
||||
*
|
||||
* - final attacks
|
||||
* - WW setbacks
|
||||
* - possible destruction/downgrade of WW levels
|
||||
*
|
||||
* This is intentionally a safety margin.
|
||||
*/
|
||||
|
||||
$worldEndDate = $ww100Date + (5 * 86400);
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* DATE FORMAT
|
||||
* ================================================================
|
||||
*/
|
||||
|
||||
$formatDate = function ($timestamp) {
|
||||
return date("d.m.Y H:i", $timestamp);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* FORMAT WW BUILD TIME
|
||||
* ================================================================
|
||||
*/
|
||||
|
||||
$wwBuildTimeDays = floor($wwBuildSeconds / 86400);
|
||||
$wwBuildTimeHours = floor(
|
||||
($wwBuildSeconds % 86400) / 3600
|
||||
);
|
||||
$wwBuildTimeMinutes = floor(
|
||||
($wwBuildSeconds % 3600) / 60
|
||||
);
|
||||
|
||||
$wwBuildTimeParts = [];
|
||||
|
||||
if ($wwBuildTimeDays > 0) {
|
||||
$wwBuildTimeParts[] =
|
||||
$wwBuildTimeDays . ' ' .
|
||||
($wwBuildTimeDays == 1 ? 'day' : 'days');
|
||||
}
|
||||
|
||||
if ($wwBuildTimeHours > 0) {
|
||||
$wwBuildTimeParts[] =
|
||||
$wwBuildTimeHours . ' ' .
|
||||
($wwBuildTimeHours == 1 ? 'hour' : 'hours');
|
||||
}
|
||||
|
||||
if ($wwBuildTimeMinutes > 0) {
|
||||
$wwBuildTimeParts[] =
|
||||
$wwBuildTimeMinutes . ' ' .
|
||||
($wwBuildTimeMinutes == 1 ? 'minute' : 'minutes');
|
||||
}
|
||||
|
||||
if (empty($wwBuildTimeParts)) {
|
||||
$wwBuildTime = 'less than 1 minute';
|
||||
} else {
|
||||
$wwBuildTime = implode(', ', $wwBuildTimeParts);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* NATAR TIME
|
||||
* ================================================================
|
||||
*
|
||||
* If Natars appear after at least approximately 2 months,
|
||||
* display the elapsed time in months.
|
||||
*
|
||||
* If they appear sooner, display the exact date instead.
|
||||
*/
|
||||
|
||||
$natarSeconds = $natarsDate - $worldStart;
|
||||
|
||||
/*
|
||||
* Average month length used only for displaying
|
||||
* "approximately X months".
|
||||
*/
|
||||
$averageMonthSeconds = 30.4375 * 86400;
|
||||
|
||||
$natarMonths = $natarSeconds / $averageMonthSeconds;
|
||||
|
||||
if ($natarMonths >= 2) {
|
||||
|
||||
$roundedNatarMonths = round($natarMonths, 1);
|
||||
|
||||
/*
|
||||
* Remove unnecessary .0
|
||||
*/
|
||||
if (
|
||||
floor($roundedNatarMonths) ==
|
||||
$roundedNatarMonths
|
||||
) {
|
||||
$roundedNatarMonths = (int) $roundedNatarMonths;
|
||||
}
|
||||
|
||||
$natarTime =
|
||||
'approximately ' .
|
||||
$roundedNatarMonths . ' ' .
|
||||
($roundedNatarMonths == 1 ? 'month' : 'months');
|
||||
|
||||
} else {
|
||||
|
||||
$natarTime =
|
||||
'on ' .
|
||||
date("d.m.Y H:i", $natarsDate);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* TRIBES
|
||||
* ================================================================
|
||||
*
|
||||
* Romans, Gauls and Teutons are always available.
|
||||
*
|
||||
* Additional tribes are displayed only when their corresponding
|
||||
* NEW_FUNCTION constant is enabled.
|
||||
*/
|
||||
|
||||
$tribes = [
|
||||
'Romans',
|
||||
'Gauls',
|
||||
'Teutons'
|
||||
];
|
||||
|
||||
if (
|
||||
defined('NEW_FUNCTION_TRIBE_HUNS') &&
|
||||
NEW_FUNCTION_TRIBE_HUNS
|
||||
) {
|
||||
$tribes[] = 'Huns';
|
||||
}
|
||||
|
||||
if (
|
||||
defined('NEW_FUNCTION_TRIBE_EGIPTEANS') &&
|
||||
NEW_FUNCTION_TRIBE_EGIPTEANS
|
||||
) {
|
||||
$tribes[] = 'Egyptians';
|
||||
}
|
||||
|
||||
if (
|
||||
defined('NEW_FUNCTION_TRIBE_SPARTANS') &&
|
||||
NEW_FUNCTION_TRIBE_SPARTANS
|
||||
) {
|
||||
$tribes[] = 'Spartans';
|
||||
}
|
||||
|
||||
if (
|
||||
defined('NEW_FUNCTION_TRIBE_VIKINGS') &&
|
||||
NEW_FUNCTION_TRIBE_VIKINGS
|
||||
) {
|
||||
$tribes[] = 'Vikings';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Human-readable tribe list.
|
||||
*
|
||||
* 3 tribes:
|
||||
* Romans, Gauls and Teutons
|
||||
*
|
||||
* 4 tribes:
|
||||
* Romans, Gauls, Teutons and Huns
|
||||
*
|
||||
* 7 tribes:
|
||||
* Romans, Gauls, Teutons, Huns, Egyptians, Spartans and Vikings
|
||||
*/
|
||||
|
||||
$tribeCount = count($tribes);
|
||||
|
||||
if ($tribeCount == 1) {
|
||||
|
||||
$tribesText = $tribes[0];
|
||||
|
||||
} elseif ($tribeCount == 2) {
|
||||
|
||||
$tribesText =
|
||||
$tribes[0] . ' and ' .
|
||||
$tribes[1];
|
||||
|
||||
} else {
|
||||
|
||||
$lastTribe = array_pop($tribes);
|
||||
|
||||
$tribesText =
|
||||
implode(', ', $tribes) .
|
||||
' and ' .
|
||||
$lastTribe;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* ACTIVE NEW FUNCTIONS
|
||||
* ================================================================
|
||||
*
|
||||
* Only functions that are actually enabled are shown.
|
||||
*/
|
||||
|
||||
$activeFunctions = [];
|
||||
|
||||
/*
|
||||
* Function:
|
||||
* Oasis display
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_OASIS') &&
|
||||
NEW_FUNCTIONS_OASIS
|
||||
) {
|
||||
$activeFunctions[] = 'Enhanced Oasis Display';
|
||||
}
|
||||
|
||||
/*
|
||||
* Alliance invitations
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_ALLIANCE_INVITATION') &&
|
||||
NEW_FUNCTIONS_ALLIANCE_INVITATION
|
||||
) {
|
||||
$activeFunctions[] = 'Alliance Invitation System';
|
||||
}
|
||||
|
||||
/*
|
||||
* Alliance & Embassy mechanics
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_EMBASSY_MECHANICS') &&
|
||||
NEW_FUNCTIONS_EMBASSY_MECHANICS
|
||||
) {
|
||||
$activeFunctions[] = 'New Alliance & Embassy Mechanics';
|
||||
}
|
||||
|
||||
/*
|
||||
* Forum post notifications
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_FORUM_POST_MESSAGE') &&
|
||||
NEW_FUNCTIONS_FORUM_POST_MESSAGE
|
||||
) {
|
||||
$activeFunctions[] = 'Forum Post Notifications';
|
||||
}
|
||||
|
||||
/*
|
||||
* Tribe images
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_TRIBE_IMAGES') &&
|
||||
NEW_FUNCTIONS_TRIBE_IMAGES
|
||||
) {
|
||||
$activeFunctions[] = 'Tribe Images';
|
||||
}
|
||||
|
||||
/*
|
||||
* Multihunter images
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_MHS_IMAGES') &&
|
||||
NEW_FUNCTIONS_MHS_IMAGES
|
||||
) {
|
||||
$activeFunctions[] = 'Multihunter Images';
|
||||
}
|
||||
|
||||
/*
|
||||
* Artifact display
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_DISPLAY_ARTIFACT') &&
|
||||
NEW_FUNCTIONS_DISPLAY_ARTIFACT
|
||||
) {
|
||||
$activeFunctions[] = 'Artifact Display';
|
||||
}
|
||||
|
||||
/*
|
||||
* World Wonder display
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_DISPLAY_WONDER') &&
|
||||
NEW_FUNCTIONS_DISPLAY_WONDER
|
||||
) {
|
||||
$activeFunctions[] = 'World Wonder Display';
|
||||
}
|
||||
|
||||
/*
|
||||
* Vacation Mode
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_VACATION') &&
|
||||
NEW_FUNCTIONS_VACATION
|
||||
) {
|
||||
$activeFunctions[] = 'Vacation Mode';
|
||||
}
|
||||
|
||||
/*
|
||||
* Catapult target display
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_DISPLAY_CATAPULT_TARGET') &&
|
||||
NEW_FUNCTIONS_DISPLAY_CATAPULT_TARGET
|
||||
) {
|
||||
$activeFunctions[] = 'Catapult Target Display';
|
||||
}
|
||||
|
||||
/*
|
||||
* Nature / Natars manual
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_MANUAL_NATURENATARS') &&
|
||||
NEW_FUNCTIONS_MANUAL_NATURENATARS
|
||||
) {
|
||||
$activeFunctions[] = 'Nature & Natars Manual';
|
||||
}
|
||||
|
||||
/*
|
||||
* Direct links
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_DISPLAY_LINKS') &&
|
||||
NEW_FUNCTIONS_DISPLAY_LINKS
|
||||
) {
|
||||
$activeFunctions[] = 'Direct Links';
|
||||
}
|
||||
|
||||
/*
|
||||
* 3-year medal
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_MEDAL_3YEAR') &&
|
||||
NEW_FUNCTIONS_MEDAL_3YEAR
|
||||
) {
|
||||
$activeFunctions[] = '3-Year Veteran Medal';
|
||||
}
|
||||
|
||||
/*
|
||||
* 5-year medal
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_MEDAL_5YEAR') &&
|
||||
NEW_FUNCTIONS_MEDAL_5YEAR
|
||||
) {
|
||||
$activeFunctions[] = '5-Year Veteran Medal';
|
||||
}
|
||||
|
||||
/*
|
||||
* 10-year medal
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_MEDAL_10YEAR') &&
|
||||
NEW_FUNCTIONS_MEDAL_10YEAR
|
||||
) {
|
||||
$activeFunctions[] = '10-Year Veteran Medal';
|
||||
}
|
||||
|
||||
/*
|
||||
* Special medals
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM') &&
|
||||
NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM
|
||||
) {
|
||||
$activeFunctions[] = 'Special Medals System';
|
||||
}
|
||||
|
||||
/*
|
||||
* Server milestones
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_MILESTONES') &&
|
||||
NEW_FUNCTIONS_MILESTONES
|
||||
) {
|
||||
$activeFunctions[] = 'Server Milestones';
|
||||
}
|
||||
|
||||
/*
|
||||
* Medal reset
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_MEDAL_RESET') &&
|
||||
NEW_FUNCTIONS_MEDAL_RESET
|
||||
) {
|
||||
$activeFunctions[] = 'Medal Reset Timer';
|
||||
}
|
||||
|
||||
/*
|
||||
* T4 Hero System
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_HERO_T4') &&
|
||||
NEW_FUNCTIONS_HERO_T4
|
||||
) {
|
||||
$activeFunctions[] = 'T4 Hero System';
|
||||
}
|
||||
|
||||
/*
|
||||
* Huns
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTION_TRIBE_HUNS') &&
|
||||
NEW_FUNCTION_TRIBE_HUNS
|
||||
) {
|
||||
$activeFunctions[] = 'Huns';
|
||||
}
|
||||
|
||||
/*
|
||||
* Egyptians
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTION_TRIBE_EGIPTEANS') &&
|
||||
NEW_FUNCTION_TRIBE_EGIPTEANS
|
||||
) {
|
||||
$activeFunctions[] = 'Egyptians';
|
||||
}
|
||||
|
||||
/*
|
||||
* Spartans
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTION_TRIBE_SPARTANS') &&
|
||||
NEW_FUNCTION_TRIBE_SPARTANS
|
||||
) {
|
||||
$activeFunctions[] = 'Spartans';
|
||||
}
|
||||
|
||||
/*
|
||||
* Vikings
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTION_TRIBE_VIKINGS') &&
|
||||
NEW_FUNCTION_TRIBE_VIKINGS
|
||||
) {
|
||||
$activeFunctions[] = 'Vikings';
|
||||
}
|
||||
|
||||
/*
|
||||
* Registration Gold
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTION_REGISTRATION_GOLD') &&
|
||||
NEW_FUNCTION_REGISTRATION_GOLD
|
||||
) {
|
||||
$activeFunctions[] = 'Registration Gold Bonus';
|
||||
}
|
||||
|
||||
/*
|
||||
* Alliance Bonus
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTIONS_ALLIANCE_BONUSES') &&
|
||||
NEW_FUNCTIONS_ALLIANCE_BONUSES
|
||||
) {
|
||||
$activeFunctions[] = 'Alliance Bonus';
|
||||
}
|
||||
|
||||
/*
|
||||
* WW Image
|
||||
*/
|
||||
if (
|
||||
defined('NEW_FUNCTION_WW_IMAGE') &&
|
||||
NEW_FUNCTION_WW_IMAGE
|
||||
) {
|
||||
$activeFunctions[] = 'WW Image by Tribe';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* ACTIVE FEATURES HTML
|
||||
* ================================================================
|
||||
*/
|
||||
|
||||
if (!empty($activeFunctions)) {
|
||||
|
||||
$activeFunctionsHtml =
|
||||
'<ul style="margin-top:0;margin-bottom:0;">';
|
||||
|
||||
foreach ($activeFunctions as $feature) {
|
||||
$activeFunctionsHtml .=
|
||||
'<li>' .
|
||||
htmlspecialchars($feature, ENT_QUOTES, 'UTF-8') .
|
||||
'</li>';
|
||||
}
|
||||
|
||||
$activeFunctionsHtml .= '</ul>';
|
||||
|
||||
} else {
|
||||
|
||||
$activeFunctionsHtml =
|
||||
'<i>No additional server features are currently active.</i>';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ================================================================
|
||||
* REPLACE TEMPLATE VARIABLES
|
||||
* ================================================================
|
||||
*/
|
||||
|
||||
$welcomemsg = preg_replace(
|
||||
[
|
||||
"'%USER%'",
|
||||
"'%START%'",
|
||||
"'%TIME%'",
|
||||
"'%PLAYERS%'",
|
||||
"'%ALLI%'",
|
||||
"'%SERVER_NAME%'",
|
||||
"'%PROTECTION%'",
|
||||
"'%TRIBES%'",
|
||||
"'%WORLD_END_DATE%'",
|
||||
"'%NATARS_DATE%'",
|
||||
"'%WW_VILLAGES_DATE%'",
|
||||
"'%WW_PLANS_DATE%'",
|
||||
"'%WW_BUILD_TIME%'",
|
||||
"'%WW100_DATE%'",
|
||||
"'%NATAR_TIME%'",
|
||||
"'%ACTIVE_NEW_FUNCTIONS%'"
|
||||
],
|
||||
[
|
||||
$username,
|
||||
date("d.m.Y", $worldStart),
|
||||
date("H:i", $worldStart),
|
||||
$database->countUser(),
|
||||
$database->countAlli(),
|
||||
SERVER_NAME,
|
||||
round((PROTECTION / 3600)),
|
||||
$tribesText,
|
||||
$formatDate($worldEndDate),
|
||||
$formatDate($natarsDate),
|
||||
$formatDate($wwVillagesDate),
|
||||
$formatDate($wwPlansDate),
|
||||
$wwBuildTime,
|
||||
$formatDate($ww100Date),
|
||||
$natarTime,
|
||||
$activeFunctionsHtml
|
||||
],
|
||||
$welcomemsg
|
||||
);
|
||||
|
||||
/*
|
||||
* Add message BBCode wrapper.
|
||||
*/
|
||||
$welcomemsg = "[message]" . $welcomemsg . "[/message]";
|
||||
|
||||
/*
|
||||
* Send welcome message.
|
||||
*/
|
||||
return $database->sendMessage(
|
||||
$uid,
|
||||
1,
|
||||
WEL_TOPIC,
|
||||
addslashes($welcomemsg),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
private function wordCensor($text)
|
||||
{
|
||||
$censorarray = explode(",", CENSORED);
|
||||
|
||||
Reference in New Issue
Block a user