Compatibility with OTHire (#330)

* Preparing compatibility to OTHire

* Still working on compatibility to OTHire

* More compatibility

* More compatibility

Not tested yet

* Some fixes

- Fixed Account Creation.
- Fixed a problem that you can't load the website, that include that you can now recover your account number.

* More fixes

- Fixed character creation.
- Fixed login problem.
- Fixed displaying account number in My Account.
- Fixed displaying if you have premium days or not in My Account.

* More fixes

- Handle Kills/Deaths as TFS_03

* More fixes

- Fixed showing outfits in character profile
- Fixed displaying player houses in character profile
- Fixed displaying guilds

* Update init.php
This commit is contained in:
Rodrigo Paixão
2018-12-03 04:58:29 -02:00
committed by Stefan A. Brannfjell
parent 0d51f87c76
commit 2817010781
30 changed files with 377 additions and 198 deletions

View File

@@ -11,7 +11,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
if ($user_id !== false) {
$loadOutfits = $config['show_outfits']['characterprofile'];
if ($config['TFSVersion'] == 'TFS_10') {
if ($config['ServerEngine'] == 'TFS_10') {
if (!$loadOutfits) {
$profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin');
} else { // Load outfits
@@ -27,7 +27,10 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
if (!$loadOutfits) {
$profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex');
} else { // Load outfits
$profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons');
if ($config['ServerEngine'] !== 'OTHIRE')
$profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons');
else
$profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype');
}
}
@@ -142,9 +145,14 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
<!-- Display house start -->
<?php
if ($config['TFSVersion'] !== 'TFS_02')
if ($config['ServerEngine'] !== 'TFS_02' || $config['ServerEngine'] == 'OTHIRE')
{
$townid = ($config['TFSVersion'] === 'TFS_03') ? 'town' : 'town_id';
if ($config['ServerEngine'] == 'OTHIRE')
$townid = 'townid';
if ($config['ServerEngine'] == 'TFS_03')
$townid = 'town';
if ($config['ServerEngine'] !== 'TFS_03' && $config['ServerEngine'] !== 'OTHIRE')
$townid = 'town_id';
$houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `$townid` AS `town_id` FROM `houses` WHERE `owner` = $user_id;");
if ($houses)
@@ -180,7 +188,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
<!-- Display player status -->
<li><font class="profile_font" name="profile_font_status">Status:</font> <?php
if ($config['TFSVersion'] == 'TFS_10')
if ($config['ServerEngine'] == 'TFS_10')
{
if ($profile_data['online'])
{
@@ -276,7 +284,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
<li>
<b>Death List:</b><br>
<?php
if ($config['TFSVersion'] == 'TFS_02')
if ($config['ServerEngine'] == 'TFS_02')
{
$array = user_fetch_deathlist($user_id);
if ($array)
@@ -313,7 +321,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
echo '<b><font color="green">This player has never died.</font></b>';
}
}
else if ($config['TFSVersion'] == 'TFS_10')
else if ($config['ServerEngine'] == 'TFS_10')
{
$deaths = mysql_select_multi("SELECT
`player_id`, `time`, `level`, `killed_by`, `is_player`,
@@ -355,7 +363,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
echo '<b><font color="green">This player has never died.</font></b>';
}
}
else if ($config['TFSVersion'] == 'TFS_03')
else if ($config['ServerEngine'] == 'TFS_03' || $config['ServerEngine'] == 'OTHIRE')
{
//mysql_select_single("SELECT * FROM players WHERE name='TEST DEBUG';");
$array = user_fetch_deathlist03($user_id);