Compare commits

..

12 Commits

Author SHA1 Message Date
slawkens1
956e551872 Update to 0.0.6 2017-05-06 02:08:13 +02:00
slawkens1
3270caf870 Update to version 0.0.6 2017-05-06 02:05:37 +02:00
slawkens1
4465da67e9 Fixes
* fixed support for TFS 0.2 series
* added FAQ link
2017-05-05 19:55:25 +02:00
slawkens1
187b70761c fixed https://otland.net/threads/myaac-v0-0-1.251454/page-3#post-2440424 2017-05-05 14:11:55 +02:00
Sławek
729944006e Update schema.sql 2017-05-05 07:41:52 +02:00
slawkens1
aa90a74145 Update to version 0.0.5 2017-05-05 04:08:20 +02:00
slawkens1
194d08f593 Fixes
* fixed bug with status info utf8 encoding
(https://otland.net/threads/myaac-v0-0-1.251454/page-2#post-2440259)
* fixed when ip in log_action is NULL
(https://otland.net/threads/myaac-v0-0-1.251454/page-2#post-2440357)
* added CHANGELOG
2017-05-05 04:02:01 +02:00
slawkens1
870cc8f98b Fix character loading with invalid names
Fixed characters loading with names that has been created with other AAC
2017-05-04 18:47:52 +02:00
slawkens1
8d7c694c61 * fixed in kathrine template 2017-05-04 18:35:00 +02:00
slawkens1
a93bd4a0fc Fixed some warning in PHP 7.1
Warning: Cannot assign an empty string to a string offset
* fixed Notice with tempnam()
2017-05-04 18:32:34 +02:00
slawkens1
636a54c70d Fixed https://otland.net/threads/myaac-v0-0-1.251454/page-2#post-2440320 2017-05-04 17:36:08 +02:00
slawkens1
ef9d5127a2 disabled friendly_urls by default
* as some users have reported problems with it
* fixes when $config['database_*'] is set
2017-05-04 16:57:46 +02:00
86 changed files with 793 additions and 727 deletions

46
CHANGELOG Normal file
View File

@@ -0,0 +1,46 @@
[0.0.6 - 06.05.2017]
- fixed bug while installing (https://otland.net/threads/myaac-v0-0-1.251454/page-3#post-2440543)
- fixed bug when creating character (not showing errors) (one more time)
- fixed support for TFS 0.2 series
- added FAQ link
[0.0.5 - 05.05.2017]
- fixed bug when creating character (not showing errors)
- Fixed characters loading with names that has been created with other AAC
- fixed links to shop in default template
- fixed some weird PHP 7.1 warnings/notices
- Fixed config loading with some weird comments
- fixed bug with status info utf8 encoding (https://otland.net/threads/myaac-v0-0-1.251454/page-2#post-2440259)
- fixed when ip in log_action is NULL (https://otland.net/threads/myaac-v0-0-1.251454/page-2#post-2440357)
- fixed bug when guild doesn't exist on characters page (https://otland.net/threads/myaac-v0-0-1.251454/page-2#post-2440320)
- disabled friendly_urls by default
- fixes when $config['database_*'] is set
- added CHANGELOG
[0.0.3 - 03.05.2017]
- Full support for OTHire 0.0.3
- added support for otservers that doesn't use account.name field, instead just account number will be used
- fixed encryption detection on TFS 0.3
- fixed bug when server_config table doesn't exist
- (install) moved admin account creation to new step
- fixed news comment link
- by default, the installer creates now the Admin player, for admin account
- fixed installation errors
- fixed config.lua loading with some weird comments
[0.0.2 - 02.05.2017]
- updated forum links to use friendly_urls
- some more info will be shown when cannot connect to database
- show more error infos when creating character
- fixed forum link on newses
- fixed spells loading when there's vocation name instead of id
- fixed bug when you have changed template but it doesn't exist anymore
- fixed vocations with promotion loading
- fixed support for gesior pages and templates
- added function OTS_Acount:getGroupId()
[0.0.1 - 01.05.2017]
This is first official release of MyAAC.
Features are listed here
For more information, see the release announcement on OTLand: https://otland.net/threads/myaac-v0-0-1.251454/

41
README
View File

@@ -1,41 +0,0 @@
MyAAC 0.0.1 - http://www.my-aac.org
REQUIREMENTS
=====================================
- PHP 5.1.0 or later
- MySQL database
- (optional) mod_rewrite to use friendly_urls
INSTALLATION AND CONFIGURATION
=====================================
Just decompress and untar the source (which you should have done by now,
if you're reading this), into your webserver's document root.
MyAAC needs proper permissions to handle files correctly.
If you're using apache2, then your directory needs to have owner set to: www-data, you can do it by using following command:
chown -R www-data.www-data /var/www/*
(or any other path your MyAAC installation is located at..)
--------------------------
Note: Linux only
If you're under linux use these commands to set proper permissions:
chmod 660 config.local.php
chmod 660 images/guilds
chmod 660 images/houses
chmod 660 images/screenshots
--------------------------
Visit http://your_domain/install (http://localhost/install) and follow instructions in the browser.
KNOWN PROBLEMS
=====================================
- none -
OTHER NOTES
=====================================
If you have a great idea or want contribute to the project - visit our website at http://www.my-aac.org
LICENSING
=====================================
This program and all associated files are released under the GNU Public
License, see LICENSE for details.

View File

@@ -21,13 +21,13 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
session_start(); session_start();
define('MYAAC', true); define('MYAAC', true);
define('MYAAC_VERSION', '0.0.3'); define('MYAAC_VERSION', '0.0.6');
define('TABLE_PREFIX', 'myaac_'); define('TABLE_PREFIX', 'myaac_');
define('START_TIME', microtime(true)); define('START_TIME', microtime(true));
define('MYAAC_OS', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'WINDOWS' : 'LINUX'); define('MYAAC_OS', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'WINDOWS' : 'LINUX');

View File

@@ -13,7 +13,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
@@ -28,7 +28,7 @@ $config = array(
// used for the Downloads page and some templates aswell // used for the Downloads page and some templates aswell
'client' => 1098, // 954 = client 9.54 'client' => 1098, // 954 = client 9.54
'friendly_urls' => false, // mod_rewrite is required for this, it makes links looks more elegant to eye, and also are SEO friendly (example: http://my-aac.org/guilds/Testing instead of http://my-aac.org/?subtopic=guilds&name=Testing) 'friendly_urls' => false, // mod_rewrite is required for this, it makes links looks more elegant to eye, and also are SEO friendly (example: http://my-aac.org/guilds/Testing instead of http://my-aac.org/?subtopic=guilds&name=Testing). Remember to rename .htaccess.dist to .htaccess
'gzip_output' => false, // gzip page content before sending it to the browser, uses less bandwidth but more cpu cycles 'gzip_output' => false, // gzip page content before sending it to the browser, uses less bandwidth but more cpu cycles
// gesior backward support (templates & pages) // gesior backward support (templates & pages)
@@ -59,7 +59,7 @@ $config = array(
// cache system. by default file cache is used // cache system. by default file cache is used
'cache_engine' => 'auto', // apc, eaccelerator, xcache, file, auto, or blank to disable. 'cache_engine' => 'auto', // apc, eaccelerator, xcache, file, auto, or blank to disable.
'cache_prefix' => 'myaac_', // have to be unique if running more MyAAC instances on the same server, ignored when using file cache. 'cache_prefix' => 'myaac_', // have to be unique if running more MyAAC instances on the same server
// database details (leave blank for auto detect from config.lua) // database details (leave blank for auto detect from config.lua)
'database_host' => '', 'database_host' => '',
@@ -90,8 +90,8 @@ $config = array(
'mail_address' => 'no-reply@your-server.org', // server e-mail address (from:) 'mail_address' => 'no-reply@your-server.org', // server e-mail address (from:)
'mail_admin' => 'your-address@your-server.org', // admin email address, where mails from contact form will be sent 'mail_admin' => 'your-address@your-server.org', // admin email address, where mails from contact form will be sent
'mail_signature' => array( // signature that will be included at the end of every message sent using _mail function 'mail_signature' => array( // signature that will be included at the end of every message sent using _mail function
'plain' => "--\nMy Server,\nhttp://www.myserver.com", 'plain' => ''/*'--\nMy Server,\nhttp://www.myserver.com'*/,
'html' => '<br/>My Server,\n<a href="http://www.myserver.com">myserver.com</a>' 'html' => ''/*'<br/>My Server,\n<a href="http://www.myserver.com">myserver.com</a>'*/
), ),
'smtp_enabled' => false, // send by smtp or mail function (set false if use mail function) 'smtp_enabled' => false, // send by smtp or mail function (set false if use mail function)
'smtp_host' => '', // mail host 'smtp_host' => '', // mail host

File diff suppressed because one or more lines are too long

View File

@@ -18,7 +18,7 @@ else
// detect locale // detect locale
$locale_s = get_browser_languages(); $locale_s = get_browser_languages();
if(!sizeof($locale_s)) if(!sizeof($locale_s))
$locale__ = 'en'; $locale_ = 'en';
else else
{ {
foreach($locale_s as $id => $tmp) foreach($locale_s as $id => $tmp)

View File

@@ -1,9 +1,9 @@
CREATE TABLE `myaac_account_actions` CREATE TABLE `myaac_account_actions`
( (
`account_id` INT(11) NOT NULL, `account_id` INT(11) NOT NULL,
`ip` INT(11) NOT NULL, `ip` INT(11) NOT NULL DEFAULT 0,
`date` INT(11) NOT NULL, `date` INT(11) NOT NULL DEFAULT 0,
`action` VARCHAR(255) NOT NULL, `action` VARCHAR(255) NOT NULL DEFAULT '',
KEY (`account_id`) KEY (`account_id`)
) ENGINE = MyISAM; ) ENGINE = MyISAM;

View File

@@ -213,10 +213,10 @@ if(!$error) {
if(!$error && (!isset($_SESSION['saved']))) { if(!$error && (!isset($_SESSION['saved']))) {
$content .= '$config[\'installed\'] = true;'; $content .= '$config[\'installed\'] = true;';
$content .= PHP_EOL; $content .= PHP_EOL;
if(strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) { // if(strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) {
$content .= '$config[\'friendly_urls\'] = true;'; // $content .= '$config[\'friendly_urls\'] = true;';
$content .= PHP_EOL; // $content .= PHP_EOL;
} // }
$content .= '$config[\'mail_enabled\'] = true;'; $content .= '$config[\'mail_enabled\'] = true;';
$content .= PHP_EOL; $content .= PHP_EOL;

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

File diff suppressed because one or more lines are too long

View File

@@ -1,54 +1,68 @@
<?php <?php
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
if(isset($config['lua']['sqlType'])) // tfs 0.3 if(!isset($config['database_type'][0]) || !isset($config['database_user'][0]) || !isset($config['database_password'][0]) || !isset($config['database_name'][0]))
{ {
$config['otserv_version'] = TFS_03; if(isset($config['lua']['sqlType'])) {// tfs 0.3
$config['database_type'] = $config['lua']['sqlType']; if(isset($config['lua']['mysqlHost'])) {// tfs 0.2
$config['database_host'] = $config['lua']['sqlHost']; $config['otserv_version'] = TFS_02;
$config['database_port'] = $config['lua']['sqlPort']; $config['database_type'] = 'mysql';
$config['database_user'] = $config['lua']['sqlUser']; $config['database_host'] = $config['lua']['mysqlHost'];
$config['database_password'] = $config['lua']['sqlPass']; $config['database_port'] = $config['lua']['mysqlPort'];
$config['database_name'] = $config['lua']['sqlDatabase']; $config['database_user'] = $config['lua']['mysqlUser'];
$config['database_password'] = $config['lua']['mysqlPass'];
$config['database_name'] = $config['lua']['mysqlDatabase'];
$config['database_encryption'] = $config['lua']['passwordType'];
}
else {
$config['otserv_version'] = TFS_03;
$config['database_type'] = $config['lua']['sqlType'];
$config['database_host'] = $config['lua']['sqlHost'];
$config['database_port'] = $config['lua']['sqlPort'];
$config['database_user'] = $config['lua']['sqlUser'];
$config['database_password'] = $config['lua']['sqlPass'];
$config['database_name'] = $config['lua']['sqlDatabase'];
$config['database_encryption'] = $config['lua']['encryptionType']; $config['database_encryption'] = $config['lua']['encryptionType'];
if(!isset($config['database_encryption']) || empty($config['database_encryption'])) // before 0.3.6 if(!isset($config['database_encryption']) || empty($config['database_encryption'])) // before 0.3.6
$config['database_encryption'] = $config['lua']['passwordType']; $config['database_encryption'] = $config['lua']['passwordType'];
} }
else if(isset($config['lua']['mysqlHost'])) // tfs 0.2/1.0 }
{ else if(isset($config['lua']['mysqlHost'])) // tfs 1.0
$config['otserv_version'] = TFS_02; {
$config['database_type'] = 'mysql'; $config['otserv_version'] = TFS_02;
$config['database_host'] = $config['lua']['mysqlHost']; $config['database_type'] = 'mysql';
$config['database_port'] = $config['lua']['mysqlPort']; $config['database_host'] = $config['lua']['mysqlHost'];
$config['database_user'] = $config['lua']['mysqlUser']; $config['database_port'] = $config['lua']['mysqlPort'];
$config['database_password'] = $config['lua']['mysqlPass']; $config['database_user'] = $config['lua']['mysqlUser'];
$config['database_name'] = $config['lua']['mysqlDatabase']; $config['database_password'] = $config['lua']['mysqlPass'];
$config['database_encryption'] = 'sha1'; $config['database_name'] = $config['lua']['mysqlDatabase'];
} $config['database_encryption'] = 'sha1';
else if(isset($config['lua']['database_type'])) // otserv }
{ else if(isset($config['lua']['database_type'])) // otserv
$config['otserv_version'] = OTSERV; {
$config['database_type'] = $config['lua']['database_type']; $config['otserv_version'] = OTSERV;
$config['database_host'] = $config['lua']['database_host']; $config['database_type'] = $config['lua']['database_type'];
$config['database_port'] = $config['lua']['database_port']; $config['database_host'] = $config['lua']['database_host'];
$config['database_user'] = $config['lua']['database_username']; $config['database_port'] = $config['lua']['database_port'];
$config['database_password'] = $config['lua']['database_password']; $config['database_user'] = $config['lua']['database_username'];
$config['database_name'] = $config['lua']['database_schema']; $config['database_password'] = $config['lua']['database_password'];
$config['database_encryption'] = isset($config['lua']['passwordtype']) ? $config['lua']['passwordtype'] : $config['lua']['password_type']; $config['database_name'] = $config['lua']['database_schema'];
$config['database_salt'] = isset($config['lua']['passwordsalt']) ? $config['lua']['passwordsalt'] : $config['lua']['password_salt']; $config['database_encryption'] = isset($config['lua']['passwordtype']) ? $config['lua']['passwordtype'] : $config['lua']['password_type'];
} $config['database_salt'] = isset($config['lua']['passwordsalt']) ? $config['lua']['passwordsalt'] : $config['lua']['password_salt'];
else if(isset($config['lua']['sql_host'])) // otserv 0.6.3 / 0.6.4 }
{ else if(isset($config['lua']['sql_host'])) // otserv 0.6.3 / 0.6.4
$config['otserv_version'] = OTSERV_06; {
$config['database_type'] = $config['lua']['sql_type']; $config['otserv_version'] = OTSERV_06;
$config['database_host'] = $config['lua']['sql_host']; $config['database_type'] = $config['lua']['sql_type'];
$config['database_port'] = $config['lua']['sql_port']; $config['database_host'] = $config['lua']['sql_host'];
$config['database_user'] = $config['lua']['sql_user']; $config['database_port'] = $config['lua']['sql_port'];
$config['database_password'] = $config['lua']['sql_pass']; $config['database_user'] = $config['lua']['sql_user'];
$config['database_name'] = $config['lua']['sql_db']; $config['database_password'] = $config['lua']['sql_pass'];
$config['database_encryption'] = isset($config['lua']['passwordtype']) ? $config['lua']['passwordtype'] : $config['lua']['password_type']; $config['database_name'] = $config['lua']['sql_db'];
$config['database_salt'] = isset($config['lua']['passwordsalt']) ? $config['lua']['passwordsalt'] : $config['lua']['password_salt']; $config['database_encryption'] = isset($config['lua']['passwordtype']) ? $config['lua']['passwordtype'] : $config['lua']['password_type'];
$config['database_salt'] = isset($config['lua']['passwordsalt']) ? $config['lua']['passwordsalt'] : $config['lua']['password_salt'];
}
} }
if(isset($config['lua']['useMD5Passwords']) && getBoolean($config['lua']['useMD5Passwords'])) if(isset($config['lua']['useMD5Passwords']) && getBoolean($config['lua']['useMD5Passwords']))

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
@@ -1199,7 +1199,7 @@ function load_config_lua($filename)
if(!@file_exists($config_file)) if(!@file_exists($config_file))
die('ERROR: Cannot find ' . $filename . ' file.'); die('ERROR: Cannot find ' . $filename . ' file.');
$tempFile = tempnam('/tmp', 'lua'); $tempFile = @tempnam('/tmp', 'lua');
$file = fopen($tempFile, 'w'); $file = fopen($tempFile, 'w');
if(!$file) die('Cannot load server config!'); if(!$file) die('Cannot load server config!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @author Mark Samman (Talaturen) <marksamman@gmail.com> * @author Mark Samman (Talaturen) <marksamman@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @author Mark Samman (Talaturen) <marksamman@gmail.com> * @author Mark Samman (Talaturen) <marksamman@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @author Mark Samman (Talaturen) <marksamman@gmail.com> * @author Mark Samman (Talaturen) <marksamman@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @author Mark Samman (Talaturen) <marksamman@gmail.com> * @author Mark Samman (Talaturen) <marksamman@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -756,10 +756,17 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
$this->data['banned'] = isset($ban['expires_at']); $this->data['banned'] = isset($ban['expires_at']);
$this->data['banned_time'] = $ban['expires_at']; $this->data['banned_time'] = $ban['expires_at'];
} }
else { else if(tableExist('bans')) {
$ban = $this->db->query('SELECT `active`, `expires` FROM `bans` WHERE (`type` = 3 OR `type` = 5) AND `active` = 1 AND `value` = ' . $this->data['id'] . ' AND (`expires` > ' . time() .' OR `expires` = -1) ORDER BY `expires` DESC')->fetch(); if(fieldExist('active', 'bans')) {
$this->data['banned'] = $ban['active']; $ban = $this->db->query('SELECT `active`, `expires` FROM `bans` WHERE (`type` = 3 OR `type` = 5) AND `active` = 1 AND `value` = ' . $this->data['id'] . ' AND (`expires` > ' . time() .' OR `expires` = -1) ORDER BY `expires` DESC')->fetch();
$this->data['banned_time'] = $ban['expires']; $this->data['banned'] = $ban['active'];
$this->data['banned_time'] = $ban['expires'];
}
else { // tfs 0.2
$ban = $this->db->query('SELECT `time` FROM `bans` WHERE (`type` = 3 OR `type` = 5) AND `account` = ' . $this->data['id'] . ' AND (`time` > ' . time() .' OR `time` = -1) ORDER BY `time` DESC')->fetch();
$this->data['banned'] = $ban['time'] == -1 || $ban['time'] > 0;
$this->data['banned_time'] = $ban['time'];
}
} }
} }
@@ -886,11 +893,11 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
public function logAction($action) public function logAction($action)
{ {
$ip = '127.0.0.1'; $ip = '127.0.0.1';
if(isset($_SERVER['REMOTE_ADDR']) && !empty(($_SERVER['REMOTE_ADDR']))) if(isset($_SERVER['REMOTE_ADDR']) && !empty($_SERVER['REMOTE_ADDR']))
$ip = $_SERVER['REMOTE_ADDR']; $ip = $_SERVER['REMOTE_ADDR'];
else if(isset($_SERVER['HTTP_CLIENT_IP']) && !empty(($_SERVER['HTTP_CLIENT_IP']))) else if(isset($_SERVER['HTTP_CLIENT_IP']) && !empty($_SERVER['HTTP_CLIENT_IP']))
$ip = $_SERVER['HTTP_CLIENT_IP']; $ip = $_SERVER['HTTP_CLIENT_IP'];
else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty(($_SERVER['HTTP_X_FORWARDED_FOR']))) else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']))
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
return $this->db->query('INSERT INTO ' . $this->db->tableName(TABLE_PREFIX . 'account_actions') . ' (' . $this->db->fieldName('account_id') . ', ' . $this->db->fieldName('ip') . ', ' . $this->db->fieldName('date') . ', ' . $this->db->fieldName('action') . ') VALUES (' . $this->db->quote($this->getId()).', INET_ATON(' . $this->db->quote($ip) . '), UNIX_TIMESTAMP(NOW()), ' . $this->db->quote($action).')'); return $this->db->query('INSERT INTO ' . $this->db->tableName(TABLE_PREFIX . 'account_actions') . ' (' . $this->db->fieldName('account_id') . ', ' . $this->db->fieldName('ip') . ', ' . $this->db->fieldName('date') . ', ' . $this->db->fieldName('action') . ') VALUES (' . $this->db->quote($this->getId()).', INET_ATON(' . $this->db->quote($ip) . '), UNIX_TIMESTAMP(NOW()), ' . $this->db->quote($action).')');

View File

@@ -176,7 +176,7 @@ class OTS_GuildRank extends OTS_Row_DAO implements IteratorAggregate, Countable
{ {
if( !isset($this->data['guild_id']) ) if( !isset($this->data['guild_id']) )
{ {
throw new E_OTS_NotLoaded(); return new OTS_Guild();
} }
$guild = new OTS_Guild(); $guild = new OTS_Guild();

View File

@@ -117,7 +117,12 @@ class OTS_Player extends OTS_Row_DAO
{ {
$loss = ''; $loss = '';
if(fieldExist('loss_experience', 'players')) { if(fieldExist('loss_experience', 'players')) {
$loss = ', `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`, `loss_containers`'; $loss = ', `loss_experience`, `loss_mana`, `loss_skills`';
}
$loss_items = '';
if(fieldExist('loss_items', 'players')) {
$loss_items = ', `loss_items`, `loss_containers`';
} }
$guild_info = ''; $guild_info = '';
@@ -136,7 +141,7 @@ class OTS_Player extends OTS_Row_DAO
} }
// SELECT query on database // SELECT query on database
$this->data = $this->db->query('SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`' . (fieldExist('lookaddons', 'players') ? ', `lookaddons`' : '') . ', `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull`' . $guild_info . ', `town_id`' . $loss . ', `balance`' . (fieldExist('blessings', 'players') ? ', `blessings`' : '') . (fieldExist('direction', 'players') ? ', `direction`' : '') . (fieldExist('stamina', 'players') ? ', `stamina`' : '') . (fieldExist('world_id', 'players') ? ', `world_id`' : '') . (fieldExist('online', 'players') ? ', `online`' : '') . ', `' . (fieldExist('deletion', 'players') ? 'deletion' : 'deleted') . '`' . (fieldExist('promotion', 'players') ? ', `promotion`' : '') . (fieldExist('marriage', 'players') ? ', `marriage`' : '') . ', `comment`, `created`, `hidden` FROM `players` WHERE `id` = ' . (int)$id)->fetch(); $this->data = $this->db->query('SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`' . (fieldExist('lookaddons', 'players') ? ', `lookaddons`' : '') . ', `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull`' . $guild_info . ', `town_id`' . $loss . $loss_items . ', `balance`' . (fieldExist('blessings', 'players') ? ', `blessings`' : '') . (fieldExist('direction', 'players') ? ', `direction`' : '') . (fieldExist('stamina', 'players') ? ', `stamina`' : '') . (fieldExist('world_id', 'players') ? ', `world_id`' : '') . (fieldExist('online', 'players') ? ', `online`' : '') . ', `' . (fieldExist('deletion', 'players') ? 'deletion' : 'deleted') . '`' . (fieldExist('promotion', 'players') ? ', `promotion`' : '') . (fieldExist('marriage', 'players') ? ', `marriage`' : '') . ', `comment`, `created`, `hidden` FROM `players` WHERE `id` = ' . (int)$id)->fetch();
if(!isset($this->data['guildnick']) || $this->data['guildnick']) if(!isset($this->data['guildnick']) || $this->data['guildnick'])
$this->data['guildnick'] = ''; $this->data['guildnick'] = '';
@@ -278,7 +283,12 @@ class OTS_Player extends OTS_Row_DAO
{ {
$loss = ''; $loss = '';
if(fieldExist('loss_experience', 'players')) { if(fieldExist('loss_experience', 'players')) {
$loss = ', `loss_experience` = ' . $this->data['loss_experience'] . ', `loss_mana` = ' . $this->data['loss_mana'] . ', `loss_skills` = ' . $this->data['loss_skills'] . ', `loss_items` = ' . $this->data['loss_items'] . ', `loss_containers` = ' . $this->data['loss_containers']; $loss = ', `loss_experience` = ' . $this->data['loss_experience'] . ', `loss_mana` = ' . $this->data['loss_mana'] . ', `loss_skills` = ' . $this->data['loss_skills'];
}
$loss_items = '';
if(fieldExist('loss_items', 'players')) {
$loss_items = ', `loss_items` = ' . $this->data['loss_items'] . ', `loss_containers` = ' . $this->data['loss_containers'];
} }
$guild_info = ''; $guild_info = '';
@@ -307,7 +317,7 @@ class OTS_Player extends OTS_Row_DAO
} }
// UPDATE query on database // UPDATE query on database
$this->db->query('UPDATE ' . $this->db->tableName('players') . ' SET ' . $this->db->fieldName('name') . ' = ' . $this->db->quote($this->data['name']) . ', ' . $this->db->fieldName('account_id') . ' = ' . $this->data['account_id'] . ', ' . $this->db->fieldName('group_id') . ' = ' . $this->data['group_id'] . ', ' . $this->db->fieldName('sex') . ' = ' . $this->data['sex'] . ', ' . $this->db->fieldName('vocation') . ' = ' . $this->data['vocation'] . ', ' . $this->db->fieldName('experience') . ' = ' . $this->data['experience'] . ', ' . $this->db->fieldName('level') . ' = ' . $this->data['level'] . ', ' . $this->db->fieldName('maglevel') . ' = ' . $this->data['maglevel'] . ', ' . $this->db->fieldName('health') . ' = ' . $this->data['health'] . ', ' . $this->db->fieldName('healthmax') . ' = ' . $this->data['healthmax'] . ', ' . $this->db->fieldName('mana') . ' = ' . $this->data['mana'] . ', ' . $this->db->fieldName('manamax') . ' = ' . $this->data['manamax'] . ', ' . $this->db->fieldName('manaspent') . ' = ' . $this->data['manaspent'] . ', ' . $this->db->fieldName('soul') . ' = ' . $this->data['soul'] . ', ' . $this->db->fieldName('lookbody') . ' = ' . $this->data['lookbody'] . ', ' . $this->db->fieldName('lookfeet') . ' = ' . $this->data['lookfeet'] . ', ' . $this->db->fieldName('lookhead') . ' = ' . $this->data['lookhead'] . ', ' . $this->db->fieldName('looklegs') . ' = ' . $this->data['looklegs'] . ', ' . $this->db->fieldName('looktype') . ' = ' . $this->data['looktype'] . $lookaddons . ', ' . $this->db->fieldName('posx') . ' = ' . $this->data['posx'] . ', ' . $this->db->fieldName('posy') . ' = ' . $this->data['posy'] . ', ' . $this->db->fieldName('posz') . ' = ' . $this->data['posz'] . ', ' . $this->db->fieldName('cap') . ' = ' . $this->data['cap'] . ', ' . $this->db->fieldName('lastlogin') . ' = ' . $this->data['lastlogin'] . ', ' . $this->db->fieldName('lastlogout') . ' = ' . $this->data['lastlogout'] . ', ' . $this->db->fieldName('lastip') . ' = ' . $this->data['lastip'] . ', ' . $this->db->fieldName('save') . ' = ' . (int) $this->data['save'] . ', ' . $this->db->fieldName('conditions') . ' = ' . $this->db->quote($this->data['conditions']) . ', `' . $skull_time . '` = ' . $this->data['skulltime'] . ', `' . $skull_type . '` = ' . (int) $this->data['skull'] . $guild_info . ', ' . $this->db->fieldName('town_id') . ' = ' . $this->data['town_id'] . $loss . ', ' . $this->db->fieldName('balance') . ' = ' . $this->data['balance'] . $blessings . $stamina . $direction . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']); $this->db->query('UPDATE ' . $this->db->tableName('players') . ' SET ' . $this->db->fieldName('name') . ' = ' . $this->db->quote($this->data['name']) . ', ' . $this->db->fieldName('account_id') . ' = ' . $this->data['account_id'] . ', ' . $this->db->fieldName('group_id') . ' = ' . $this->data['group_id'] . ', ' . $this->db->fieldName('sex') . ' = ' . $this->data['sex'] . ', ' . $this->db->fieldName('vocation') . ' = ' . $this->data['vocation'] . ', ' . $this->db->fieldName('experience') . ' = ' . $this->data['experience'] . ', ' . $this->db->fieldName('level') . ' = ' . $this->data['level'] . ', ' . $this->db->fieldName('maglevel') . ' = ' . $this->data['maglevel'] . ', ' . $this->db->fieldName('health') . ' = ' . $this->data['health'] . ', ' . $this->db->fieldName('healthmax') . ' = ' . $this->data['healthmax'] . ', ' . $this->db->fieldName('mana') . ' = ' . $this->data['mana'] . ', ' . $this->db->fieldName('manamax') . ' = ' . $this->data['manamax'] . ', ' . $this->db->fieldName('manaspent') . ' = ' . $this->data['manaspent'] . ', ' . $this->db->fieldName('soul') . ' = ' . $this->data['soul'] . ', ' . $this->db->fieldName('lookbody') . ' = ' . $this->data['lookbody'] . ', ' . $this->db->fieldName('lookfeet') . ' = ' . $this->data['lookfeet'] . ', ' . $this->db->fieldName('lookhead') . ' = ' . $this->data['lookhead'] . ', ' . $this->db->fieldName('looklegs') . ' = ' . $this->data['looklegs'] . ', ' . $this->db->fieldName('looktype') . ' = ' . $this->data['looktype'] . $lookaddons . ', ' . $this->db->fieldName('posx') . ' = ' . $this->data['posx'] . ', ' . $this->db->fieldName('posy') . ' = ' . $this->data['posy'] . ', ' . $this->db->fieldName('posz') . ' = ' . $this->data['posz'] . ', ' . $this->db->fieldName('cap') . ' = ' . $this->data['cap'] . ', ' . $this->db->fieldName('lastlogin') . ' = ' . $this->data['lastlogin'] . ', ' . $this->db->fieldName('lastlogout') . ' = ' . $this->data['lastlogout'] . ', ' . $this->db->fieldName('lastip') . ' = ' . $this->data['lastip'] . ', ' . $this->db->fieldName('save') . ' = ' . (int) $this->data['save'] . ', ' . $this->db->fieldName('conditions') . ' = ' . $this->db->quote($this->data['conditions']) . ', `' . $skull_time . '` = ' . $this->data['skulltime'] . ', `' . $skull_type . '` = ' . (int) $this->data['skull'] . $guild_info . ', ' . $this->db->fieldName('town_id') . ' = ' . $this->data['town_id'] . $loss . $loss_items . ', ' . $this->db->fieldName('balance') . ' = ' . $this->data['balance'] . $blessings . $stamina . $direction . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
} }
// creates new player // creates new player
else else
@@ -315,8 +325,15 @@ class OTS_Player extends OTS_Row_DAO
$loss = ''; $loss = '';
$loss_data = ''; $loss_data = '';
if(fieldExist('loss_experience', 'players')) { if(fieldExist('loss_experience', 'players')) {
$loss = ', `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`, `loss_containers`'; $loss = ', `loss_experience`, `loss_mana`, `loss_skills`';
$loss_data = ', ' . $this->data['loss_experience'] . ', ' . $this->data['loss_mana'] . ', ' . $this->data['loss_skills'] . ', ' . $this->data['loss_items'] . ', ' . $this->data['loss_containers']; $loss_data = ', ' . $this->data['loss_experience'] . ', ' . $this->data['loss_mana'] . ', ' . $this->data['loss_skills'];
}
$loss_items = '';
$loss_items_data = '';
if(fieldExist('loss_items', 'players')) {
$loss_items = ', `loss_items`, `loss_containers`';
$loss_items_data = ', ' . $this->data['loss_items'] . ', ' . $this->data['loss_containers'];
} }
$guild_info = ''; $guild_info = '';
@@ -362,7 +379,7 @@ class OTS_Player extends OTS_Row_DAO
} }
// INSERT query on database // INSERT query on database
$this->db->query('INSERT INTO ' . $this->db->tableName('players') . ' (' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('account_id') . ', ' . $this->db->fieldName('group_id') . ', ' . $this->db->fieldName('sex') . ', ' . $this->db->fieldName('vocation') . ', ' . $this->db->fieldName('experience') . ', ' . $this->db->fieldName('level') . ', ' . $this->db->fieldName('maglevel') . ', ' . $this->db->fieldName('health') . ', ' . $this->db->fieldName('healthmax') . ', ' . $this->db->fieldName('mana') . ', ' . $this->db->fieldName('manamax') . ', ' . $this->db->fieldName('manaspent') . ', ' . $this->db->fieldName('soul') . ', ' . $this->db->fieldName('lookbody') . ', ' . $this->db->fieldName('lookfeet') . ', ' . $this->db->fieldName('lookhead') . ', ' . $this->db->fieldName('looklegs') . ', ' . $this->db->fieldName('looktype') . $lookaddons . ', ' . $this->db->fieldName('posx') . ', ' . $this->db->fieldName('posy') . ', ' . $this->db->fieldName('posz') . ', ' . $this->db->fieldName('cap') . ', `lastlogin`, `lastlogout`, ' . $this->db->fieldName('lastip') . ', ' . $this->db->fieldName('save') . ', ' . $this->db->fieldName('conditions') . ', `' . $skull_time . '`, `' . $skull_type . '`' . $guild_info . ', ' . $this->db->fieldName('town_id') . $loss . ', `balance`' . $blessings . $stamina . $direction . ', ' . $this->db->fieldName('created') . $promotion . ') VALUES (' . $this->db->quote($this->data['name']) . ', ' . $this->data['account_id'] . ', ' . $this->data['group_id'] . ', ' . $this->data['sex'] . ', ' . $this->data['vocation'] . ', ' . $this->data['experience'] . ', ' . $this->data['level'] . ', ' . $this->data['maglevel'] . ', ' . $this->data['health'] . ', ' . $this->data['healthmax'] . ', ' . $this->data['mana'] . ', ' . $this->data['manamax'] . ', ' . $this->data['manaspent'] . ', ' . $this->data['soul'] . ', ' . $this->data['lookbody'] . ', ' . $this->data['lookfeet'] . ', ' . $this->data['lookhead'] . ', ' . $this->data['looklegs'] . ', ' . $this->data['looktype'] . $lookaddons_data . ', ' . $this->data['posx'] . ', ' . $this->data['posy'] . ', ' . $this->data['posz'] . ', ' . $this->data['cap'] . ', ' . $this->data['lastlogin'] . ', ' . $this->data['lastlogout'] . ', ' . $this->data['lastip'] . ', ' . (int) $this->data['save'] . ', ' . $this->db->quote($this->data['conditions']) . ', ' . $this->data['skulltime'] . ', ' . (int) $this->data['skull'] . $guild_info_data . ', ' . $this->data['town_id'] . $loss_data . ', ' . $this->data['balance'] . $blessings_data . $stamina_data . $direction_data . ', ' . time() . $promotion_data . ')'); $this->db->query('INSERT INTO ' . $this->db->tableName('players') . ' (' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('account_id') . ', ' . $this->db->fieldName('group_id') . ', ' . $this->db->fieldName('sex') . ', ' . $this->db->fieldName('vocation') . ', ' . $this->db->fieldName('experience') . ', ' . $this->db->fieldName('level') . ', ' . $this->db->fieldName('maglevel') . ', ' . $this->db->fieldName('health') . ', ' . $this->db->fieldName('healthmax') . ', ' . $this->db->fieldName('mana') . ', ' . $this->db->fieldName('manamax') . ', ' . $this->db->fieldName('manaspent') . ', ' . $this->db->fieldName('soul') . ', ' . $this->db->fieldName('lookbody') . ', ' . $this->db->fieldName('lookfeet') . ', ' . $this->db->fieldName('lookhead') . ', ' . $this->db->fieldName('looklegs') . ', ' . $this->db->fieldName('looktype') . $lookaddons . ', ' . $this->db->fieldName('posx') . ', ' . $this->db->fieldName('posy') . ', ' . $this->db->fieldName('posz') . ', ' . $this->db->fieldName('cap') . ', `lastlogin`, `lastlogout`, ' . $this->db->fieldName('lastip') . ', ' . $this->db->fieldName('save') . ', ' . $this->db->fieldName('conditions') . ', `' . $skull_time . '`, `' . $skull_type . '`' . $guild_info . ', ' . $this->db->fieldName('town_id') . $loss . $loss_items . ', `balance`' . $blessings . $stamina . $direction . ', ' . $this->db->fieldName('created') . $promotion . ') VALUES (' . $this->db->quote($this->data['name']) . ', ' . $this->data['account_id'] . ', ' . $this->data['group_id'] . ', ' . $this->data['sex'] . ', ' . $this->data['vocation'] . ', ' . $this->data['experience'] . ', ' . $this->data['level'] . ', ' . $this->data['maglevel'] . ', ' . $this->data['health'] . ', ' . $this->data['healthmax'] . ', ' . $this->data['mana'] . ', ' . $this->data['manamax'] . ', ' . $this->data['manaspent'] . ', ' . $this->data['soul'] . ', ' . $this->data['lookbody'] . ', ' . $this->data['lookfeet'] . ', ' . $this->data['lookhead'] . ', ' . $this->data['looklegs'] . ', ' . $this->data['looktype'] . $lookaddons_data . ', ' . $this->data['posx'] . ', ' . $this->data['posy'] . ', ' . $this->data['posz'] . ', ' . $this->data['cap'] . ', ' . $this->data['lastlogin'] . ', ' . $this->data['lastlogout'] . ', ' . $this->data['lastip'] . ', ' . (int) $this->data['save'] . ', ' . $this->db->quote($this->data['conditions']) . ', ' . $this->data['skulltime'] . ', ' . (int) $this->data['skull'] . $guild_info_data . ', ' . $this->data['town_id'] . $loss_data . $loss_items_data . ', ' . $this->data['balance'] . $blessings_data . $stamina_data . $direction_data . ', ' . time() . $promotion_data . ')');
// ID of new group // ID of new group
$this->data['id'] = $this->db->lastInsertId(); $this->data['id'] = $this->db->lastInsertId();
} }

View File

@@ -75,7 +75,10 @@ class OTS_ServerInfo
fwrite($socket, $packet); fwrite($socket, $packet);
// reads respond // reads respond
$data = stream_get_contents($socket); //$data = stream_get_contents($socket);
$data = '';
while (!feof($socket))
$data .= fgets($socket, 1024);
// closing connection to current server // closing connection to current server
fclose($socket); fclose($socket);
@@ -121,7 +124,9 @@ class OTS_ServerInfo
{ {
// loads respond XML // loads respond XML
$info = new OTS_InfoRespond(); $info = new OTS_InfoRespond();
$info->loadXML( $status->getBuffer() ); if(!$info->loadXML( utf8_encode($status->getBuffer())))
return false;
return $info; return $info;
} }

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
@@ -796,6 +796,8 @@ function checkName()
$newchar_vocation = isset($_POST['newcharvocation']) ? $_POST['newcharvocation'] : NULL; $newchar_vocation = isset($_POST['newcharvocation']) ? $_POST['newcharvocation'] : NULL;
$newchar_town = isset($_POST['newchartown']) ? $_POST['newchartown'] : NULL; $newchar_town = isset($_POST['newchartown']) ? $_POST['newchartown'] : NULL;
$newchar_errors = array(); $newchar_errors = array();
$newchar_created = false;
if(isset($_POST['savecharacter']) && $_POST['savecharacter'] == 1) { if(isset($_POST['savecharacter']) && $_POST['savecharacter'] == 1) {
if(empty($newchar_name)) if(empty($newchar_name))
$newchar_errors[] = 'Please enter a name for your character!'; $newchar_errors[] = 'Please enter a name for your character!';
@@ -897,7 +899,7 @@ function checkName()
} }
if(fieldExist('lookaddons', 'players')) if(fieldExist('lookaddons', 'players'))
$player->setLookAddons($char_to_copy->getLookAddons()); $player->setLookAddons($char_to_copy->getLookAddons());
$player->setTownId($newchar_town); $player->setTownId($newchar_town);
$player->setExperience($char_to_copy->getExperience()); $player->setExperience($char_to_copy->getExperience());
@@ -925,10 +927,16 @@ function checkName()
$player->setLossExperience($char_to_copy->getLossExperience()); $player->setLossExperience($char_to_copy->getLossExperience());
$player->setLossMana($char_to_copy->getLossMana()); $player->setLossMana($char_to_copy->getLossMana());
$player->setLossSkills($char_to_copy->getLossSkills()); $player->setLossSkills($char_to_copy->getLossSkills());
$player->setLossItems($char_to_copy->getLossItems());
} }
if(fieldExist('loss_items', 'players')) {
$player->setLossItems($char_to_copy->getLossItems());
$player->setLossContainerse($char_to_copy->getLossContainers());
}
$player->save(); $player->save();
$player->setCustomField("created", time()); $player->setCustomField("created", time());
$newchar_created = true;
$account_logged->logAction('Created character <b>' . $player->getName() . '</b>.'); $account_logged->logAction('Created character <b>' . $player->getName() . '</b>.');
unset($player); unset($player);
$player = $ots->createObject('Player'); $player = $ots->createObject('Player');
@@ -958,15 +966,16 @@ function checkName()
} }
} }
} }
else
{ if(count($newchar_errors) > 0) {
if(count($newchar_errors) > 0) { echo '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$template_path.'/images/content/attentionsign.gif);" /></div>';
echo '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$template_path.'/images/content/attentionsign.gif);" /></div>'; echo '<b>The Following Errors Have Occurred:</b><br/>';
echo '<b>The Following Errors Have Occurred:</b><br/>'; foreach($newchar_errors as $newchar_error)
foreach($newchar_errors as $newchar_error) echo '<li>'.$newchar_error . '</li>';
echo '<li>'.$newchar_error . '</li>'; echo '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>';
echo '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>'; }
}
if(!$newchar_created) {
echo 'Please choose a name'; echo 'Please choose a name';
if(count($config['character_samples']) > 1) if(count($config['character_samples']) > 1)
echo ', vocation'; echo ', vocation';

View File

@@ -1,27 +1,26 @@
<?php <?php
/** /**
* Changelog * CHANGELOG viewer
* *
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'MyAAC - CHANGELOG'; $title = 'MyAAC Changelog';
$data = file_get_contents(SYSTEM . 'docs/CHANGELOG'); if(!file_exists(BASE . 'CHANGELOG')) {
echo 'File CHANGELOG doesn\'t exist.';
return;
}
// replace special characters with HTML entities $changelog = file_get_contents(BASE . 'CHANGELOG');
// replace line breaks with <br /> $changelog = nl2br(htmlspecialchars($changelog));
$data = nl2br(htmlspecialchars($data));
// replace multiple spaces with single spaces
$data = preg_replace('/\s\s+/', ' ', $data);
// replace URLs with <a href...> elements // replace URLs with <a href...> elements
$data = preg_replace('/\s(\w+:\/\/)(\S+)/', ' <a href="\\1\\2" target="_blank">\\1\\2</a>', $data); $changelog = preg_replace('/\s(\w+:\/\/)(\S+)/', ' <a href="\\1\\2" target="_blank">\\1\\2</a>', $changelog);
echo '<div>' . $data . '</div>'; echo '<div>' . $changelog . '</div>';
?> ?>

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
@@ -18,7 +18,8 @@ $myaac_version = file_get_contents('http://my-aac.org/VERSION');
// compare them // compare them
if(version_compare($myaac_version, MYAAC_VERSION) <= 0) if(version_compare($myaac_version, MYAAC_VERSION) <= 0)
echo '<p class="success">MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version.</p>'; echo '<p class="success">MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version.
<br/>View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here') . '</p>';
else else
echo '<p class="warning">You\'re using outdated version.<br/> echo '<p class="warning">You\'re using outdated version.<br/>
Your version: <b>' . MYAAC_VERSION . '</b><br/> Your version: <b>' . MYAAC_VERSION . '</b><br/>

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
$title = 'Downloads'; $title = 'Downloads';

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
@@ -1026,7 +1026,7 @@ if($action == 'kickplayer') {
} }
else else
{ {
if($player->getRank()->isLoaded() && $player->getRank()->getGuild()->getName() != $guild->getName()) { if($player->getRank()->isLoaded() && $player->getRank()->getGuild()->isLoaded() && $player->getRank()->getGuild()->getName() != $guild->getName()) {
$guild_errors[] = 'Character <b>'.$name.'</b> isn\'t from your guild.'; $guild_errors[] = 'Character <b>'.$name.'</b> isn\'t from your guild.';
} }
} }

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,12 +6,16 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Houses'; $title = 'Houses';
if(!fieldExist('name', 'houses')) {
echo 'Houses list is not available on this server.';
return;
}
$rent = trim(strtolower($config['lua']['houseRentPeriod'])); $rent = trim(strtolower($config['lua']['houseRentPeriod']));
if($rent != 'yearly' && $rent != 'monthly' && $rent != 'weekly' && $rent != 'daily') if($rent != 'yearly' && $rent != 'monthly' && $rent != 'weekly' && $rent != 'daily')
$rent = 'never'; $rent = 'never';
@@ -29,7 +33,8 @@ $type = '';
{ {
$beds = array("", "one", "two", "three", "fourth", "fifth"); $beds = array("", "one", "two", "three", "fourth", "fifth");
$houseName = $_REQUEST['house']; $houseName = $_REQUEST['house'];
$house = $db->query('SELECT * FROM ' . $db->tableName('houses') . ' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($houseName)); $houseId = (check_number($_REQUEST['house']) ? $_REQUEST['house'] : -1);
$house = $db->query('SELECT * FROM ' . $db->tableName('houses') . ' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($houseName) . ' OR `id` = ' . $db->quote($houseId));
if($house->rowCount() > 0) if($house->rowCount() > 0)
{ {

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
$_GET['archive'] = true; $_GET['archive'] = true;

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -6,7 +6,7 @@
* @author Gesior <jerzyskalski@wp.pl> * @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -5,7 +5,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC * @copyright 2017 MyAAC
* @version 0.0.3 * @version 0.0.6
* @link http://my-aac.org * @link http://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');

View File

@@ -3,7 +3,7 @@ list[0] = 'news';
list[1] = 'account'; list[1] = 'account';
list[2] = 'community'; list[2] = 'community';
list[3] = 'library'; list[3] = 'library';
list[4] = 'about'; list[4] = 'shops';
function initMenu() function initMenu()
{ {

View File

@@ -9,7 +9,7 @@ function news_parse($title, $content, $date, $icon = 0, $author = '', $comments
$tmp = $template_path.'/images/letters/'.$content[0].'.gif'; $tmp = $template_path.'/images/letters/'.$content[0].'.gif';
if(file_exists($tmp)) { if(file_exists($tmp)) {
$firstLetter = '<img src="' . $tmp . '" alt="'.$content[0].'" BORDER=0 ALIGN=bottom>'; $firstLetter = '<img src="' . $tmp . '" alt="'.$content[0].'" BORDER=0 ALIGN=bottom>';
$content[0] = ''; $content = substr($content, 1);
} }
} }

View File

@@ -9,15 +9,13 @@
if(in_array(PAGE, array('news', 'newsarchive'))) if(in_array(PAGE, array('news', 'newsarchive')))
echo 'news'; echo 'news';
elseif(in_array(PAGE, array('creatures', 'spells', 'online', 'serverinfo', 'downloads', 'commands', elseif(in_array(PAGE, array('creatures', 'spells', 'online', 'serverinfo', 'downloads', 'commands',
'movies', 'screenshots', 'experiencetable'))) 'movies', 'screenshots', 'experiencetable', 'faq')))
echo 'library'; echo 'library';
elseif(in_array(PAGE, array('characters', 'guilds', 'highscores', 'wars', 'lastkills', 'houses', 'bans', elseif(in_array(PAGE, array('characters', 'guilds', 'highscores', 'wars', 'lastkills', 'houses', 'bans',
'forum', 'team'))) 'forum', 'team')))
echo 'community'; echo 'community';
elseif(in_array(PAGE, array('account', 'accountmanagement', 'createaccount', 'lostaccount', 'rules'))) elseif(in_array(PAGE, array('account', 'accountmanagement', 'createaccount', 'lostaccount', 'rules')))
echo 'account'; echo 'account';
elseif(in_array(PAGE, array('faq')))
echo 'about';
elseif(in_array(PAGE, array('points', 'gifts'))) elseif(in_array(PAGE, array('points', 'gifts')))
echo 'shops'; echo 'shops';
?>'; ?>';
@@ -40,7 +38,6 @@
<span id="account" onclick="menuSwitch('account');" class="tab">Account</span> <span id="account" onclick="menuSwitch('account');" class="tab">Account</span>
<span id="community" onclick="menuSwitch('community');" class="tab">Community</span> <span id="community" onclick="menuSwitch('community');" class="tab">Community</span>
<span id="library" onclick="menuSwitch('library');" class="tab">Library</span> <span id="library" onclick="menuSwitch('library');" class="tab">Library</span>
<span id="about" onclick="menuSwitch('about');" class="tab">About</span>
<?php <?php
if($config['gifts_system']) if($config['gifts_system'])
{ {
@@ -96,8 +93,10 @@
<a href="<?php echo $template['link_highscores']; ?>">Highscores</a> <a href="<?php echo $template['link_highscores']; ?>">Highscores</a>
<span class="separator"></span> <span class="separator"></span>
<a href="<?php echo $template['link_lastkills']; ?>">Last Deaths</a> <a href="<?php echo $template['link_lastkills']; ?>">Last Deaths</a>
<?php if(fieldExist('name', 'houses')): ?>
<span class="separator"></span> <span class="separator"></span>
<a href="<?php echo $template['link_houses']; ?>">Houses</a> <a href="<?php echo $template['link_houses']; ?>">Houses</a>
<?php endif; ?>
<span class="separator"></span> <span class="separator"></span>
<?php if($config['otserv_version'] == TFS_03): ?> <?php if($config['otserv_version'] == TFS_03): ?>
<a href="<?php echo $template['link_bans']; ?>">Bans</a> <a href="<?php echo $template['link_bans']; ?>">Bans</a>
@@ -130,14 +129,9 @@
<a href="<?php echo $template['link_screenshots']; ?>">Screenshots</a> <a href="<?php echo $template['link_screenshots']; ?>">Screenshots</a>
<span class="separator"></span> <span class="separator"></span>
<a href="<?php echo $template['link_experienceTable']; ?>">Experience Table</a> <a href="<?php echo $template['link_experienceTable']; ?>">Experience Table</a>
<span class="separator"></span>
<a href="<?php echo $template['link_faq']; ?>">FAQ</a>
</div> </div>
<div id="about-submenu">
<a href="<?php echo $template['link_faq']; ?>">FAQ</a>
<!--a href="<?php echo internalLayoutLink('about'); ?>">About us</a>
<a href="<?php echo internalLayoutLink('contact'); ?>">Contact</a-->
</div>
<?php <?php
if($config['gifts_system']) if($config['gifts_system'])
{ {
@@ -146,8 +140,8 @@
<a href="' . $template['link_points'] . '">Buy Premium Points</a> <a href="' . $template['link_points'] . '">Buy Premium Points</a>
<span class="separator"></span> <span class="separator"></span>
<a href="' . $template['link_gifts'] . '">Shop Offer</a>'; <a href="' . $template['link_gifts'] . '">Shop Offer</a>';
if($account_logged) if($logged)
echo '<span class="separator"></span><a href="?subtopic=shopsystem&action=show_history">Shop History</a>'; echo '<span class="separator"></span><a href="' . $template['link_gifts_history'] . '">Shop History</a>';
echo '</div>'; echo '</div>';
} }
?> ?>
@@ -166,7 +160,7 @@
echo ' echo '
<font color="green"><b>Server Online</b></font> &raquo; <font color="green"><b>Server Online</b></font> &raquo;
Players Online: ' . $status['players'] . ' / ' . $status['playersMax'] . ' &raquo; Players Online: ' . $status['players'] . ' / ' . $status['playersMax'] . ' &raquo;
Monsters: ' . $status['monsters'] . ' &raquo; Uptime: ' . $status['uptimeReadable'] . ''; Monsters: ' . $status['monsters'] . ' &raquo; Uptime: ' . (isset($status['uptimeReadable']) ? $status['uptimeReadable'] : 'Unknown') . '';
else else
echo '<font color="red"><b>Server Offline</b></font>'; echo '<font color="red"><b>Server Offline</b></font>';
?> ?>

View File

@@ -420,6 +420,7 @@ echo "<a href='" . $template['link_downloads'] . "'>
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> <div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
</div> </div>
</a> </a>
<?php if(fieldExist('name', 'houses')): ?>
<a href='<?php echo $template['link_houses']; ?>'> <a href='<?php echo $template['link_houses']; ?>'>
<div id='submenu_houses' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> <div id='submenu_houses' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> <div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
@@ -428,6 +429,7 @@ echo "<a href='" . $template['link_downloads'] . "'>
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> <div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
</div> </div>
</a> </a>
<?php endif; ?>
<a href='<?php echo $template['link_guilds']; ?>'> <a href='<?php echo $template['link_guilds']; ?>'>
<div id='submenu_guilds' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> <div id='submenu_guilds' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> <div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>

View File

@@ -8,7 +8,7 @@ function news_parse($title, $content, $date, $icon = 0, $author = '', $comments
$tmp = $template_path.'/images/letters/'.$content[0].'.gif'; $tmp = $template_path.'/images/letters/'.$content[0].'.gif';
if(file_exists($tmp)) { if(file_exists($tmp)) {
$firstLetter = '<img src="' . $tmp . '" alt="'.$content[0].'" BORDER=0 ALIGN=bottom>'; $firstLetter = '<img src="' . $tmp . '" alt="'.$content[0].'" BORDER=0 ALIGN=bottom>';
$content[0] = ''; $content = substr($content, 1);
} }
} }

View File

@@ -6,7 +6,7 @@
* @package MyAAC * @package MyAAC
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
* @copyright 2016 WodzAAC * @copyright 2016 WodzAAC
* @version 0.0.3 * @version 0.0.6
* @link http://myaac.info * @link http://myaac.info
*/ */