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

@@ -52,7 +52,7 @@ if (!empty($_POST['selected_character'])) {
if (user_character_account_id($char_name) === $session_user_id) {
$charid = user_character_id($char_name);
if ($charid !== false) {
if ($config['TFSVersion'] === 'TFS_10') {
if ($config['ServerEngine'] === 'TFS_10') {
if (!user_is_online_10($charid)) {
if (guild_leader_gid($charid) === false) user_delete_character_soft($charid);
else echo 'Character is leader of a guild, you must disband the guild or change leadership before deleting character.';
@@ -75,7 +75,7 @@ if (!empty($_POST['selected_character'])) {
$newname = isset($_POST['newName']) ? getValue($_POST['newName']) : '';
$player = false;
if ($config['TFSVersion'] === 'TFS_10') {
if ($config['ServerEngine'] === 'TFS_10') {
$player = mysql_select_single("SELECT `id`, `account_id` FROM `players` WHERE `name` = '$oldname'");
$player['online'] = (user_is_online_10($player['id'])) ? 1 : 0;
} else $player = mysql_select_single("SELECT `id`, `account_id`, `online` FROM `players` WHERE `name` = '$oldname'");
@@ -144,7 +144,7 @@ if (!empty($_POST['selected_character'])) {
$char_id = (int)user_character_id($char_name);
$account_id = user_character_account_id($char_name);
if ($config['TFSVersion'] == 'TFS_10') {
if ($config['ServerEngine'] == 'TFS_10') {
$chr_data['online'] = user_is_online_10($char_id) ? 1 : 0;
} else $chr_data = user_character_data($char_id, 'online');
if ($chr_data['online'] != 1) {
@@ -239,10 +239,19 @@ if ($render_page) {
?>
<div id="myaccount">
<h1>My account</h1>
<p>Welcome to your account page, <?php echo $user_data['name']; ?><br>
You have <?php echo $user_data['premdays']; ?> days remaining premium account.</p>
<p>Welcome to your account page, <?php if ($config['ServerEngine'] !== 'OTHIRE') echo $user_data['name']; else echo $user_data['id']; ?><br>
<?php if ($config['ServerEngine'] !== 'OTHIRE') {
echo 'You have ' .$user_data['premdays']. 'days remaining premium account.';
} else {
if ($user_data['premend'] != 0) {
echo 'Your premium account will last till ';
echo date("d/m/Y", $user_data['premend']);
} else {
echo 'You do not have premium account days.';
}
} ?></p>
<?php
if ($config['TFSVersion'] === 'TFS_10' && $config['twoFactorAuthenticator']) {
if ($config['ServerEngine'] === 'TFS_10' && $config['twoFactorAuthenticator']) {
$query = mysql_select_single("SELECT `secret` FROM `accounts` WHERE `id`='".(int)$session_user_id."' LIMIT 1;");
$status = ($query['secret'] === NULL) ? false : true;