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

@@ -2,7 +2,7 @@
require_once 'engine/init.php';
// Client 11 loginWebService
if($_SERVER['HTTP_USER_AGENT'] == "Mozilla/5.0" && $config['TFSVersion'] === 'TFS_10') {
if($_SERVER['HTTP_USER_AGENT'] == "Mozilla/5.0" && $config['ServerEngine'] === 'TFS_10') {
function jsonError($message, $code = 3) {
die(json_encode(array('errorCode' => $code, 'errorMessage' => $message)));
@@ -132,8 +132,8 @@ if (empty($_POST) === false) {
} else {
// Starting loging
if ($config['TFSVersion'] == 'TFS_02' || $config['TFSVersion'] == 'TFS_10') $login = user_login($username, $password);
else if ($config['TFSVersion'] == 'TFS_03') $login = user_login_03($username, $password);
if ($config['ServerEngine'] == 'TFS_02' || $config['ServerEngine'] == 'OTHIRE' || $config['ServerEngine'] == 'TFS_10') $login = user_login($username, $password);
else if ($config['ServerEngine'] == 'TFS_03') $login = user_login_03($username, $password);
else $login = false;
if ($login === false) {
$errors[] = 'Username and password combination is wrong.';
@@ -151,7 +151,7 @@ if (empty($_POST) === false) {
if ($status) {
// Regular login success, now lets check authentication token code
if ($config['TFSVersion'] == 'TFS_10' && $config['twoFactorAuthenticator']) {
if ($config['ServerEngine'] == 'TFS_10' && $config['twoFactorAuthenticator']) {
require_once("engine/function/rfc6238.php");
// Two factor authentication code / token