mirror of
				https://github.com/slawkens/myaac.git
				synced 2025-10-30 23:46:24 +01:00 
			
		
		
		
	Compare commits
	
		
			22 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | e719725841 | ||
|   | bb3e90110d | ||
|   | 2f0758e351 | ||
|   | 6667c8c364 | ||
|   | c13a540878 | ||
|   | 869ec035d9 | ||
|   | 9d696d31d8 | ||
|   | 8cc4caf587 | ||
|   | e1d1c7d5db | ||
|   | 320733c2c1 | ||
|   | c1809a98d1 | ||
|   | 46ed541015 | ||
|   | 29207361b7 | ||
|   | 25013ae91b | ||
|   | 5d630ba9dd | ||
|   | feadf1314d | ||
|   | 08b8a716d4 | ||
|   | cc26b5c744 | ||
|   | cb6e9a6a88 | ||
|   | 4adb0758c5 | ||
|   | 7312383f73 | ||
|   | 3c1210fefa | 
							
								
								
									
										2
									
								
								.github/workflows/phpstan.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/phpstan.yml
									
									
									
									
										vendored
									
									
								
							| @@ -14,7 +14,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         php-versions: [ '8.1', '8.2', '8.3', '8.4' ] |         php-versions: [ '8.1', '8.2', '8.3' ] | ||||||
|     steps: |     steps: | ||||||
|       - name: "Checkout" |       - name: "Checkout" | ||||||
|         uses: "actions/checkout@v4" |         uses: "actions/checkout@v4" | ||||||
|   | |||||||
| @@ -1,33 +1,5 @@ | |||||||
| # Changelog | # Changelog | ||||||
|  |  | ||||||
| ## [1.5 - 14.05.2025] |  | ||||||
|  |  | ||||||
| ### Added |  | ||||||
| * Feature/twig hooks filters (#258) |  | ||||||
| * Add latest client versions (14.00 - 15.01) (https://github.com/slawkens/myaac/commit/5367df23812c6182863353c9a39fd7fb0b743f4b) |  | ||||||
| * db variable to twig (https://github.com/slawkens/myaac/commit/5ed1aec28e146b871a75597411d12e42a067f4e6) |  | ||||||
| * New filter: HOOK_FILTER_ROUTES (https://github.com/slawkens/myaac/commit/9b75011224f385db8b27e109bfeb28e75b9d779c) |  | ||||||
| * Allow optionally separate folder for views (thanks @Scrollog for idea) (https://github.com/slawkens/myaac/commit/03e275213901a89edb0ebb8974b776a992ab391f) |  | ||||||
| * Add float & double types to the Settings (https://github.com/slawkens/myaac/commit/67ab425bb9796d9d123296e3fda542fa8f7f05ee) |  | ||||||
| * Add optional param _page_only for single-page apps etc. (https://github.com/slawkens/myaac/commit/113473f2560aab6d364c301cc14a8b5ba8f309f4) |  | ||||||
|  |  | ||||||
| ### Changed |  | ||||||
| * Change OTS_Account->getPremDays to not return -1 in case of freePremium (https://github.com/slawkens/myaac/commit/3befde2a1e4d24a011311e785f15185db57e19b8) |  | ||||||
| * Add note about highscores being updated x minutes + allow ttl 0 to disable cache (https://github.com/slawkens/myaac/commit/a161cff00329da6f970f3a70967fe8346fe92bbc) |  | ||||||
| * Better monster images (no image not found anymore) + use cache (https://github.com/slawkens/myaac/commit/73a5829974ceca3f02d7925d5cfbd5fa50b1bbd2) |  | ||||||
| * Rename server-info -> ots-info, changelog -> change-log (Due to conflict with apache2 server-info mod) (https://github.com/slawkens/myaac/commit/3949d84e5d7631f332111b6d00278bddbd0ad10a) |  | ||||||
| * Move rules page to admin panel (https://github.com/slawkens/myaac/commit/3949d84e5d7631f332111b6d00278bddbd0ad10a) |  | ||||||
|  |  | ||||||
| ### Fixed |  | ||||||
| * php 8.4 warnings |  | ||||||
| * Visitors counter not working properly on dev mode (https://github.com/slawkens/myaac/commit/da151051186c913dd0dd091aabe893649c2b9ee7) |  | ||||||
| * Fix login.php boosted creature & boss (not sure exact version, but should be 14.12 or around) (https://github.com/slawkens/myaac/commit/c48b8006319f6c3b5f082befd16785420bb98110) |  | ||||||
| * Fix installMenus when theme/template was removed from disc (https://github.com/slawkens/myaac/commit/c24c580796bccd54bf9e95b864763f4642684d55) |  | ||||||
| * Fix if user removes the menu category (https://github.com/slawkens/myaac/commit/dbea69f31478391dacfbbc02c8353c39b4245daf) |  | ||||||
|  |  | ||||||
| ### Updated: |  | ||||||
| * Update cypress from version ^13.17.0 to ^14.3.3 (https://github.com/slawkens/myaac/commit/629fd18ea166860d5898a822f44f9277da6ce43d) |  | ||||||
|  |  | ||||||
| ## [1.4 - 22.04.2025] | ## [1.4 - 22.04.2025] | ||||||
|  |  | ||||||
| ### Added | ### Added | ||||||
|   | |||||||
| @@ -9,6 +9,7 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| use MyAAC\Models\Account as AccountModel; | use MyAAC\Models\Account as AccountModel; | ||||||
|  | use MyAAC\Models\AccountAction; | ||||||
| use MyAAC\Models\Player; | use MyAAC\Models\Player; | ||||||
|  |  | ||||||
| defined('MYAAC') or die('Direct access not allowed!'); | defined('MYAAC') or die('Direct access not allowed!'); | ||||||
| @@ -466,9 +467,8 @@ else if (isset($_REQUEST['search'])) { | |||||||
| 									</thead> | 									</thead> | ||||||
| 									<tbody> | 									<tbody> | ||||||
| 										<?php | 										<?php | ||||||
| 											$accountActions = \MyAAC\Models\AccountAction::where('account_id', $account->getId())->orderByDesc('date')->get(); | 											$accountActions = AccountAction::where('account_id', $account->getId())->orderByDesc('date')->get(); | ||||||
| 											foreach ($accountActions as $i => $log): | 											foreach ($accountActions as $i => $log): | ||||||
| 												$log->ip = ($log->ip != 0 ? long2ip($log->ip) : inet_ntop($log->ipv6)); |  | ||||||
| 												?> | 												?> | ||||||
| 											<tr> | 											<tr> | ||||||
| 												<td><?php echo $i + 1; ?></td> | 												<td><?php echo $i + 1; ?></td> | ||||||
|   | |||||||
| @@ -26,8 +26,8 @@ | |||||||
| if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.'); | if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.'); | ||||||
|  |  | ||||||
| const MYAAC = true; | const MYAAC = true; | ||||||
| const MYAAC_VERSION = '1.5'; | const MYAAC_VERSION = '2.0-dev'; | ||||||
| const DATABASE_VERSION = 45; | const DATABASE_VERSION = 44; | ||||||
| const TABLE_PREFIX = 'myaac_'; | const TABLE_PREFIX = 'myaac_'; | ||||||
| define('START_TIME', microtime(true)); | define('START_TIME', microtime(true)); | ||||||
| define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX')); | define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX')); | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ describe('Check Public Pages', () => { | |||||||
|  |  | ||||||
| 	it('Go to changelog page', () => { | 	it('Go to changelog page', () => { | ||||||
| 		cy.visit({ | 		cy.visit({ | ||||||
| 			url: Cypress.env('URL') + '/change-log', | 			url: Cypress.env('URL') + '/changelog', | ||||||
| 			method: 'GET', | 			method: 'GET', | ||||||
| 		}) | 		}) | ||||||
| 	}) | 	}) | ||||||
| @@ -132,7 +132,7 @@ describe('Check Public Pages', () => { | |||||||
|  |  | ||||||
| 	it('Go to server info page', () => { | 	it('Go to server info page', () => { | ||||||
| 		cy.visit({ | 		cy.visit({ | ||||||
| 			url: Cypress.env('URL') + '/ots-info', | 			url: Cypress.env('URL') + '/server-info', | ||||||
| 			method: 'GET', | 			method: 'GET', | ||||||
| 		}) | 		}) | ||||||
| 	}) | 	}) | ||||||
|   | |||||||
| @@ -1,13 +1,13 @@ | |||||||
| SET @myaac_database_version = 45; | SET @myaac_database_version = 43; | ||||||
|  |  | ||||||
| CREATE TABLE `myaac_account_actions` | CREATE TABLE `myaac_account_actions` | ||||||
| ( | ( | ||||||
|  | 	`id` int NOT NULL AUTO_INCREMENT, | ||||||
| 	`account_id` int NOT NULL, | 	`account_id` int NOT NULL, | ||||||
| 	`ip` int unsigned NOT NULL DEFAULT 0, | 	`ip` varchar(45) NOT NULL DEFAULT '', | ||||||
| 	`ipv6` binary(16) NOT NULL DEFAULT 0, |  | ||||||
| 	`date` int NOT NULL DEFAULT 0, | 	`date` int NOT NULL DEFAULT 0, | ||||||
| 	`action` varchar(255) NOT NULL DEFAULT '', | 	`action` varchar(255) NOT NULL DEFAULT '', | ||||||
| 	KEY (`account_id`) | 	PRIMARY KEY (`id`) | ||||||
| ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8mb4; | ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8mb4; | ||||||
|  |  | ||||||
| CREATE TABLE `myaac_admin_menu` | CREATE TABLE `myaac_admin_menu` | ||||||
|   | |||||||
| @@ -79,10 +79,6 @@ $up(); | |||||||
| require_once SYSTEM . 'migrations/31.php'; | require_once SYSTEM . 'migrations/31.php'; | ||||||
| $up(); | $up(); | ||||||
|  |  | ||||||
| // rules page |  | ||||||
| require_once SYSTEM . 'migrations/45.php'; |  | ||||||
| $up(); |  | ||||||
|  |  | ||||||
| if(ModelsFAQ::count() == 0) { | if(ModelsFAQ::count() == 0) { | ||||||
| 	ModelsFAQ::create([ | 	ModelsFAQ::create([ | ||||||
| 		'question' => 'What is this?', | 		'question' => 'What is this?', | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								login.php
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								login.php
									
									
									
									
									
								
							| @@ -86,25 +86,12 @@ switch ($action) { | |||||||
| 		die(json_encode(['eventlist' => $eventlist, 'lastupdatetimestamp' => time()])); | 		die(json_encode(['eventlist' => $eventlist, 'lastupdatetimestamp' => time()])); | ||||||
|  |  | ||||||
| 	case 'boostedcreature': | 	case 'boostedcreature': | ||||||
| 		$clientVersion = (int)setting('core.client'); |  | ||||||
|  |  | ||||||
| 		// 14.00 and up |  | ||||||
| 		if ($clientVersion >= 1400) { |  | ||||||
| 			$creatureBoost = $db->query("SELECT * FROM " . $db->tableName('boosted_creature'))->fetchAll(); |  | ||||||
| 			$bossBoost     = $db->query("SELECT * FROM " . $db->tableName('boosted_boss'))->fetchAll(); |  | ||||||
| 			die(json_encode([ |  | ||||||
| 				'boostedcreature' => true, |  | ||||||
| 				'creatureraceid'  => intval($creatureBoost[0]['raceid']), |  | ||||||
| 				'bossraceid'      => intval($bossBoost[0]['raceid']) |  | ||||||
| 			])); |  | ||||||
| 		} |  | ||||||
|  |  | ||||||
| 		// lower clients |  | ||||||
| 		$boostedCreature = BoostedCreature::first(); | 		$boostedCreature = BoostedCreature::first(); | ||||||
| 		die(json_encode([ | 		die(json_encode([ | ||||||
| 			'boostedcreature' => true, | 			'boostedcreature' => true, | ||||||
| 			'raceid' => $boostedCreature->raceid | 			'raceid' => $boostedCreature->raceid | ||||||
| 		])); | 		])); | ||||||
|  | 	break; | ||||||
|  |  | ||||||
| 	case 'login': | 	case 'login': | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										169
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										169
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -14,13 +14,24 @@ | |||||||
|         "tinymce": "^7.2.0" |         "tinymce": "^7.2.0" | ||||||
|       }, |       }, | ||||||
|       "devDependencies": { |       "devDependencies": { | ||||||
|         "cypress": "^14.3.3" |         "cypress": "^13.17.0" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     "node_modules/@colors/colors": { | ||||||
|  |       "version": "1.5.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", | ||||||
|  |       "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", | ||||||
|  |       "dev": true, | ||||||
|  |       "license": "MIT", | ||||||
|  |       "optional": true, | ||||||
|  |       "engines": { | ||||||
|  |         "node": ">=0.1.90" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/@cypress/request": { |     "node_modules/@cypress/request": { | ||||||
|       "version": "3.0.8", |       "version": "3.0.7", | ||||||
|       "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.8.tgz", |       "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.7.tgz", | ||||||
|       "integrity": "sha512-h0NFgh1mJmm1nr4jCwkGHwKneVYKghUyWe6TMNrk0B9zsjAJxpg8C4/+BAcmLgCPa1vj1V8rNUaILl+zYRUWBQ==", |       "integrity": "sha512-LzxlLEMbBOPYB85uXrDqvD4MgcenjRBLIns3zyhx7vTPj/0u2eQhzXvPiGcaJrV38Q9dbkExWp6cOHPJ+EtFYg==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "Apache-2.0", |       "license": "Apache-2.0", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
| @@ -37,7 +48,7 @@ | |||||||
|         "json-stringify-safe": "~5.0.1", |         "json-stringify-safe": "~5.0.1", | ||||||
|         "mime-types": "~2.1.19", |         "mime-types": "~2.1.19", | ||||||
|         "performance-now": "^2.1.0", |         "performance-now": "^2.1.0", | ||||||
|         "qs": "6.14.0", |         "qs": "6.13.1", | ||||||
|         "safe-buffer": "^5.1.2", |         "safe-buffer": "^5.1.2", | ||||||
|         "tough-cookie": "^5.0.0", |         "tough-cookie": "^5.0.0", | ||||||
|         "tunnel-agent": "^0.6.0", |         "tunnel-agent": "^0.6.0", | ||||||
| @@ -376,9 +387,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/call-bind-apply-helpers": { |     "node_modules/call-bind-apply-helpers": { | ||||||
|       "version": "1.0.2", |       "version": "1.0.1", | ||||||
|       "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", |       "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", | ||||||
|       "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", |       "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
| @@ -390,14 +401,14 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/call-bound": { |     "node_modules/call-bound": { | ||||||
|       "version": "1.0.4", |       "version": "1.0.3", | ||||||
|       "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", |       "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", | ||||||
|       "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", |       "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "call-bind-apply-helpers": "^1.0.2", |         "call-bind-apply-helpers": "^1.0.1", | ||||||
|         "get-intrinsic": "^1.3.0" |         "get-intrinsic": "^1.2.6" | ||||||
|       }, |       }, | ||||||
|       "engines": { |       "engines": { | ||||||
|         "node": ">= 0.4" |         "node": ">= 0.4" | ||||||
| @@ -493,9 +504,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/cli-table3": { |     "node_modules/cli-table3": { | ||||||
|       "version": "0.6.1", |       "version": "0.6.5", | ||||||
|       "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.1.tgz", |       "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", | ||||||
|       "integrity": "sha512-w0q/enDHhPLq44ovMGdQeeDLvwxwavsJX7oQGYt/LrBlYsyaxyDnp6z3QzFut/6kLLKnlcUVJLrpB7KBfgG/RA==", |       "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
| @@ -505,7 +516,7 @@ | |||||||
|         "node": "10.* || >= 12.*" |         "node": "10.* || >= 12.*" | ||||||
|       }, |       }, | ||||||
|       "optionalDependencies": { |       "optionalDependencies": { | ||||||
|         "colors": "1.4.0" |         "@colors/colors": "1.5.0" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/cli-truncate": { |     "node_modules/cli-truncate": { | ||||||
| @@ -552,17 +563,6 @@ | |||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT" |       "license": "MIT" | ||||||
|     }, |     }, | ||||||
|     "node_modules/colors": { |  | ||||||
|       "version": "1.4.0", |  | ||||||
|       "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", |  | ||||||
|       "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", |  | ||||||
|       "dev": true, |  | ||||||
|       "license": "MIT", |  | ||||||
|       "optional": true, |  | ||||||
|       "engines": { |  | ||||||
|         "node": ">=0.1.90" |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     "node_modules/combined-stream": { |     "node_modules/combined-stream": { | ||||||
|       "version": "1.0.8", |       "version": "1.0.8", | ||||||
|       "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", |       "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", | ||||||
| @@ -619,14 +619,14 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/cypress": { |     "node_modules/cypress": { | ||||||
|       "version": "14.3.3", |       "version": "13.17.0", | ||||||
|       "resolved": "https://registry.npmjs.org/cypress/-/cypress-14.3.3.tgz", |       "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.17.0.tgz", | ||||||
|       "integrity": "sha512-1Rz7zc9iqLww6BysaESqUhtIuaFHS7nL3wREovAKYsNhLTfX3TbcBWHWgEz70YimH2NkSOsm4oIcJJ9HYHOlew==", |       "integrity": "sha512-5xWkaPurwkIljojFidhw8lFScyxhtiFHl/i/3zov+1Z5CmY4t9tjIdvSXfu82Y3w7wt0uR9KkucbhkVvJZLQSA==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "hasInstallScript": true, |       "hasInstallScript": true, | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "@cypress/request": "^3.0.8", |         "@cypress/request": "^3.0.6", | ||||||
|         "@cypress/xvfb": "^1.2.4", |         "@cypress/xvfb": "^1.2.4", | ||||||
|         "@types/sinonjs__fake-timers": "8.1.1", |         "@types/sinonjs__fake-timers": "8.1.1", | ||||||
|         "@types/sizzle": "^2.3.2", |         "@types/sizzle": "^2.3.2", | ||||||
| @@ -637,9 +637,9 @@ | |||||||
|         "cachedir": "^2.3.0", |         "cachedir": "^2.3.0", | ||||||
|         "chalk": "^4.1.0", |         "chalk": "^4.1.0", | ||||||
|         "check-more-types": "^2.24.0", |         "check-more-types": "^2.24.0", | ||||||
|         "ci-info": "^4.1.0", |         "ci-info": "^4.0.0", | ||||||
|         "cli-cursor": "^3.1.0", |         "cli-cursor": "^3.1.0", | ||||||
|         "cli-table3": "0.6.1", |         "cli-table3": "~0.6.1", | ||||||
|         "commander": "^6.2.1", |         "commander": "^6.2.1", | ||||||
|         "common-tags": "^1.8.0", |         "common-tags": "^1.8.0", | ||||||
|         "dayjs": "^1.10.4", |         "dayjs": "^1.10.4", | ||||||
| @@ -663,7 +663,7 @@ | |||||||
|         "process": "^0.11.10", |         "process": "^0.11.10", | ||||||
|         "proxy-from-env": "1.0.0", |         "proxy-from-env": "1.0.0", | ||||||
|         "request-progress": "^3.0.0", |         "request-progress": "^3.0.0", | ||||||
|         "semver": "^7.7.1", |         "semver": "^7.5.3", | ||||||
|         "supports-color": "^8.1.1", |         "supports-color": "^8.1.1", | ||||||
|         "tmp": "~0.2.3", |         "tmp": "~0.2.3", | ||||||
|         "tree-kill": "1.2.2", |         "tree-kill": "1.2.2", | ||||||
| @@ -674,7 +674,7 @@ | |||||||
|         "cypress": "bin/cypress" |         "cypress": "bin/cypress" | ||||||
|       }, |       }, | ||||||
|       "engines": { |       "engines": { | ||||||
|         "node": "^18.0.0 || ^20.0.0 || >=22.0.0" |         "node": "^16.0.0 || ^18.0.0 || >=20.0.0" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/cypress/node_modules/fs-extra": { |     "node_modules/cypress/node_modules/fs-extra": { | ||||||
| @@ -819,9 +819,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/es-object-atoms": { |     "node_modules/es-object-atoms": { | ||||||
|       "version": "1.1.1", |       "version": "1.0.0", | ||||||
|       "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", |       "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", | ||||||
|       "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", |       "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
| @@ -831,22 +831,6 @@ | |||||||
|         "node": ">= 0.4" |         "node": ">= 0.4" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/es-set-tostringtag": { |  | ||||||
|       "version": "2.1.0", |  | ||||||
|       "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", |  | ||||||
|       "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", |  | ||||||
|       "dev": true, |  | ||||||
|       "license": "MIT", |  | ||||||
|       "dependencies": { |  | ||||||
|         "es-errors": "^1.3.0", |  | ||||||
|         "get-intrinsic": "^1.2.6", |  | ||||||
|         "has-tostringtag": "^1.0.2", |  | ||||||
|         "hasown": "^2.0.2" |  | ||||||
|       }, |  | ||||||
|       "engines": { |  | ||||||
|         "node": ">= 0.4" |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     "node_modules/escape-string-regexp": { |     "node_modules/escape-string-regexp": { | ||||||
|       "version": "1.0.5", |       "version": "1.0.5", | ||||||
|       "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", |       "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", | ||||||
| @@ -976,15 +960,14 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/form-data": { |     "node_modules/form-data": { | ||||||
|       "version": "4.0.2", |       "version": "4.0.1", | ||||||
|       "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", |       "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", | ||||||
|       "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", |       "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "asynckit": "^0.4.0", |         "asynckit": "^0.4.0", | ||||||
|         "combined-stream": "^1.0.8", |         "combined-stream": "^1.0.8", | ||||||
|         "es-set-tostringtag": "^2.1.0", |  | ||||||
|         "mime-types": "^2.1.12" |         "mime-types": "^2.1.12" | ||||||
|       }, |       }, | ||||||
|       "engines": { |       "engines": { | ||||||
| @@ -1016,18 +999,18 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/get-intrinsic": { |     "node_modules/get-intrinsic": { | ||||||
|       "version": "1.3.0", |       "version": "1.2.7", | ||||||
|       "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", |       "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", | ||||||
|       "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", |       "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "call-bind-apply-helpers": "^1.0.2", |         "call-bind-apply-helpers": "^1.0.1", | ||||||
|         "es-define-property": "^1.0.1", |         "es-define-property": "^1.0.1", | ||||||
|         "es-errors": "^1.3.0", |         "es-errors": "^1.3.0", | ||||||
|         "es-object-atoms": "^1.1.1", |         "es-object-atoms": "^1.0.0", | ||||||
|         "function-bind": "^1.1.2", |         "function-bind": "^1.1.2", | ||||||
|         "get-proto": "^1.0.1", |         "get-proto": "^1.0.0", | ||||||
|         "gopd": "^1.2.0", |         "gopd": "^1.2.0", | ||||||
|         "has-symbols": "^1.1.0", |         "has-symbols": "^1.1.0", | ||||||
|         "hasown": "^2.0.2", |         "hasown": "^2.0.2", | ||||||
| @@ -1148,22 +1131,6 @@ | |||||||
|         "url": "https://github.com/sponsors/ljharb" |         "url": "https://github.com/sponsors/ljharb" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/has-tostringtag": { |  | ||||||
|       "version": "1.0.2", |  | ||||||
|       "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", |  | ||||||
|       "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", |  | ||||||
|       "dev": true, |  | ||||||
|       "license": "MIT", |  | ||||||
|       "dependencies": { |  | ||||||
|         "has-symbols": "^1.0.3" |  | ||||||
|       }, |  | ||||||
|       "engines": { |  | ||||||
|         "node": ">= 0.4" |  | ||||||
|       }, |  | ||||||
|       "funding": { |  | ||||||
|         "url": "https://github.com/sponsors/ljharb" |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     "node_modules/hasown": { |     "node_modules/hasown": { | ||||||
|       "version": "2.0.2", |       "version": "2.0.2", | ||||||
|       "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", |       "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", | ||||||
| @@ -1593,9 +1560,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/object-inspect": { |     "node_modules/object-inspect": { | ||||||
|       "version": "1.13.4", |       "version": "1.13.3", | ||||||
|       "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", |       "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", | ||||||
|       "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", |       "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "engines": { |       "engines": { | ||||||
| @@ -1742,13 +1709,13 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/qs": { |     "node_modules/qs": { | ||||||
|       "version": "6.14.0", |       "version": "6.13.1", | ||||||
|       "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", |       "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", | ||||||
|       "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", |       "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "BSD-3-Clause", |       "license": "BSD-3-Clause", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "side-channel": "^1.1.0" |         "side-channel": "^1.0.6" | ||||||
|       }, |       }, | ||||||
|       "engines": { |       "engines": { | ||||||
|         "node": ">=0.6" |         "node": ">=0.6" | ||||||
| @@ -1827,9 +1794,9 @@ | |||||||
|       "license": "MIT" |       "license": "MIT" | ||||||
|     }, |     }, | ||||||
|     "node_modules/semver": { |     "node_modules/semver": { | ||||||
|       "version": "7.7.1", |       "version": "7.6.3", | ||||||
|       "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", |       "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", | ||||||
|       "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", |       "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "ISC", |       "license": "ISC", | ||||||
|       "bin": { |       "bin": { | ||||||
| @@ -2064,22 +2031,22 @@ | |||||||
|       "license": "GPL-2.0-or-later" |       "license": "GPL-2.0-or-later" | ||||||
|     }, |     }, | ||||||
|     "node_modules/tldts": { |     "node_modules/tldts": { | ||||||
|       "version": "6.1.86", |       "version": "6.1.71", | ||||||
|       "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", |       "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.71.tgz", | ||||||
|       "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", |       "integrity": "sha512-LQIHmHnuzfZgZWAf2HzL83TIIrD8NhhI0DVxqo9/FdOd4ilec+NTNZOlDZf7EwrTNoutccbsHjvWHYXLAtvxjw==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "tldts-core": "^6.1.86" |         "tldts-core": "^6.1.71" | ||||||
|       }, |       }, | ||||||
|       "bin": { |       "bin": { | ||||||
|         "tldts": "bin/cli.js" |         "tldts": "bin/cli.js" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/tldts-core": { |     "node_modules/tldts-core": { | ||||||
|       "version": "6.1.86", |       "version": "6.1.71", | ||||||
|       "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", |       "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.71.tgz", | ||||||
|       "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", |       "integrity": "sha512-LRbChn2YRpic1KxY+ldL1pGXN/oVvKfCVufwfVzEQdFYNo39uF7AJa/WXdo+gYO7PTvdfkCPCed6Hkvz/kR7jg==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT" |       "license": "MIT" | ||||||
|     }, |     }, | ||||||
| @@ -2094,9 +2061,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/tough-cookie": { |     "node_modules/tough-cookie": { | ||||||
|       "version": "5.1.2", |       "version": "5.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", |       "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.0.tgz", | ||||||
|       "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", |       "integrity": "sha512-rvZUv+7MoBYTiDmFPBrhL7Ujx9Sk+q9wwm22x8c8T5IJaR+Wsyc7TNxbVxo84kZoRJZZMazowFLqpankBEQrGg==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "BSD-3-Clause", |       "license": "BSD-3-Clause", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ | |||||||
|     "postinstall": "node ./npm-post-install.js" |     "postinstall": "node ./npm-post-install.js" | ||||||
|   }, |   }, | ||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|     "cypress": "^14.3.3" |     "cypress": "^13.17.0" | ||||||
|   }, |   }, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@tinymce/tinymce-jquery": "^2.1.0", |     "@tinymce/tinymce-jquery": "^2.1.0", | ||||||
|   | |||||||
| @@ -109,12 +109,4 @@ $config['clients'] = [ | |||||||
| 	1330, | 	1330, | ||||||
| 	1332, | 	1332, | ||||||
| 	1340, | 	1340, | ||||||
|  |  | ||||||
| 	1400, |  | ||||||
| 	1405, |  | ||||||
| 	1410, |  | ||||||
| 	1411, |  | ||||||
| 	1412, |  | ||||||
| 	1500, |  | ||||||
| 	1501, |  | ||||||
| ]; | ]; | ||||||
|   | |||||||
| @@ -122,10 +122,6 @@ try { | |||||||
|  |  | ||||||
| 	$eloquentConnection = $capsule->getConnection(); | 	$eloquentConnection = $capsule->getConnection(); | ||||||
|  |  | ||||||
| 	if (isset($twig)) { |  | ||||||
| 		$twig->addGlobal('db', $db); |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| } catch (Exception $e) { | } catch (Exception $e) { | ||||||
| 	if(isset($cache) && $cache->enabled()) { | 	if(isset($cache) && $cache->enabled()) { | ||||||
| 		$cache->delete('config_lua'); | 		$cache->delete('config_lua'); | ||||||
|   | |||||||
| @@ -1115,7 +1115,7 @@ class POT | |||||||
|  * |  * | ||||||
|  * @param IOTS_FileCache $cache Cache handler (skip this parameter to reset cache handler to null). |  * @param IOTS_FileCache $cache Cache handler (skip this parameter to reset cache handler to null). | ||||||
|  */ |  */ | ||||||
|     public function setItemsCache(?IOTS_FileCache $cache = null) |     public function setItemsCache(IOTS_FileCache $cache = null) | ||||||
|     { |     { | ||||||
|         $this->itemsCache = $cache; |         $this->itemsCache = $cache; | ||||||
|     } |     } | ||||||
| @@ -1253,7 +1253,7 @@ class POT | |||||||
|  * |  * | ||||||
|  * @param IOTS_FileCache $cache Cache handler (skip this parameter to reset cache handler to null). |  * @param IOTS_FileCache $cache Cache handler (skip this parameter to reset cache handler to null). | ||||||
|  */ |  */ | ||||||
|     public function setMapCache(?IOTS_FileCache $cache = null) |     public function setMapCache(IOTS_FileCache $cache = null) | ||||||
|     { |     { | ||||||
|         $this->mapCache = $cache; |         $this->mapCache = $cache; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -12,6 +12,8 @@ | |||||||
|  * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public License, Version 3 |  * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public License, Version 3 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|  | use MyAAC\Models\AccountAction; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * OTServ account abstraction. |  * OTServ account abstraction. | ||||||
|  * |  * | ||||||
| @@ -443,6 +445,9 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable | |||||||
| 			throw new E_OTS_NotLoaded(); | 			throw new E_OTS_NotLoaded(); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		$configFreePremium = configLua('freePremium'); | ||||||
|  | 		if(isset($configFreePremium) && getBoolean($configFreePremium)) {return -1;} | ||||||
|  |  | ||||||
| 		if(isset($this->data['premium_ends_at']) || isset($this->data['premend'])) { | 		if(isset($this->data['premium_ends_at']) || isset($this->data['premend'])) { | ||||||
| 			$col = isset($this->data['premium_ends_at']) ? 'premium_ends_at' : 'premend'; | 			$col = isset($this->data['premium_ends_at']) ? 'premium_ends_at' : 'premend'; | ||||||
| 			$ret = ceil(($this->data[$col] - time()) / (24 * 60 * 60)); | 			$ret = ceil(($this->data[$col] - time()) / (24 * 60 * 60)); | ||||||
| @@ -1007,26 +1012,16 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable | |||||||
|  |  | ||||||
| 	public function logAction($action) | 	public function logAction($action) | ||||||
| 	{ | 	{ | ||||||
| 		$ip = get_browser_real_ip(); | 		AccountAction::create([ | ||||||
| 		if(!str_contains($ip, ":")) { | 			'account_id' => $this->getId(), | ||||||
| 			$ipv6 = '0'; | 			'ip' => get_browser_real_ip(), | ||||||
| 		} | 			'date' => time(), | ||||||
| 		else { | 			'action' => $action, | ||||||
| 			$ipv6 = $ip; | 		]); | ||||||
| 			$ip = ''; |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 		return $this->db->exec('INSERT INTO `' . TABLE_PREFIX . 'account_actions` (`account_id`, `ip`, `ipv6`, `date`, `action`) VALUES (' . $this->db->quote($this->getId()).', ' . ($ip == '' ? '0' : $this->db->quote(ip2long($ip))) . ', (' . ($ipv6 == '0' ? $this->db->quote('') : $this->db->quote(inet_pton($ipv6))) . '), UNIX_TIMESTAMP(NOW()), ' . $this->db->quote($action).')'); | 	public function getActionsLog($limit) { | ||||||
| 	} | 		return AccountAction::where('account_id', $this->data['id'])->orderByDesc('date')->limit($limit)->get()->toArray(); | ||||||
|  |  | ||||||
| 	public function getActionsLog($limit1, $limit2) |  | ||||||
| 	{ |  | ||||||
| 		$actions = array(); |  | ||||||
|  |  | ||||||
| 		foreach($this->db->query('SELECT `ip`, `ipv6`, `date`, `action` FROM `' . TABLE_PREFIX . 'account_actions` WHERE `account_id` = ' . $this->data['id'] . ' ORDER by `date` DESC LIMIT ' . $limit1 . ', ' . $limit2 . '')->fetchAll() as $a) |  | ||||||
| 			$actions[] = array('ip' => $a['ip'], 'ipv6' => $a['ipv6'], 'date' => $a['date'], 'action' => $a['action']); |  | ||||||
|  |  | ||||||
| 		return $actions; |  | ||||||
| 	} | 	} | ||||||
| /** | /** | ||||||
|  * Returns players iterator. |  * Returns players iterator. | ||||||
|   | |||||||
| @@ -1,20 +1,27 @@ | |||||||
| <?php | <?php | ||||||
|  | /** | ||||||
|  |  * @var OTS_DB_MySQL $db | ||||||
|  |  */ | ||||||
|  |  | ||||||
| // 2025-05-14 | // 2025-02-27 | ||||||
| // update pages links | // remove ipv6, change to ip (for both ipv4 + ipv6) as VARCHAR(45) | ||||||
| // server-info conflicts with apache2 mod | $up = function () use ($db) { | ||||||
| // Changelog conflicts with changelog files | 	$db->query("ALTER TABLE `myaac_account_actions` DROP KEY `account_id`;"); | ||||||
|  | 	$db->query("ALTER TABLE  `myaac_account_actions` ADD COLUMN `id` INT(11) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`);"); | ||||||
|  |  | ||||||
| use MyAAC\Models\Menu; | 	$db->modifyColumn(TABLE_PREFIX . 'account_actions', 'ip', "VARCHAR(45) NOT NULL DEFAULT ''"); | ||||||
| use MyAAC\Models\Pages; | 	$db->query("UPDATE `" . TABLE_PREFIX . "account_actions` SET `ip` = INET_NTOA(`ip`) WHERE `ip` != '0';"); | ||||||
|  | 	$db->query("UPDATE `" . TABLE_PREFIX . "account_actions` SET `ip` = INET6_NTOA(`ipv6`) WHERE `ip` = '0';"); | ||||||
| $up = function() { | 	$db->dropColumn(TABLE_PREFIX . 'account_actions', 'ipv6'); | ||||||
| 	Menu::where('link', 'server-info')->update(['link' => 'ots-info']); |  | ||||||
| 	Menu::where('link', 'changelog')->update(['link' => 'change-log']); |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
| $down = function() { | $down = function () use ($db) { | ||||||
| 	Menu::where('link', 'ots-info')->update(['link' => 'server-info']); | 	$db->query("ALTER TABLE `" . TABLE_PREFIX . "account_actions` DROP `id`;"); | ||||||
| 	Menu::where('link', 'change-log')->update(['link' => 'changelog']); | 	$db->query("ALTER TABLE  `" . TABLE_PREFIX . "account_actions` ADD KEY (`account_id`);"); | ||||||
| }; |  | ||||||
|  |  | ||||||
|  | 	$db->addColumn(TABLE_PREFIX . 'account_actions', 'ipv6', "BINARY(16) NOT NULL DEFAULT 0x00000000000000000000000000000000 AFTER ip"); | ||||||
|  | 	$db->query("UPDATE `" . TABLE_PREFIX . "account_actions` SET `ipv6` = INET6_ATON(ip) WHERE NOT IS_IPV4(`ip`);"); | ||||||
|  | 	$db->query("UPDATE `" . TABLE_PREFIX . "account_actions` SET `ip` = INET_ATON(`ip`) WHERE IS_IPV4(`ip`);"); | ||||||
|  | 	$db->query("UPDATE `" . TABLE_PREFIX . "account_actions` SET `ip` = 0 WHERE `ipv6` != 0x00000000000000000000000000000000;"); | ||||||
|  | 	$db->modifyColumn(TABLE_PREFIX . 'account_actions', 'ip', "INT(11) UNSIGNED NOT NULL DEFAULT 0;"); | ||||||
|  | }; | ||||||
|   | |||||||
| @@ -1,32 +0,0 @@ | |||||||
| <?php |  | ||||||
|  |  | ||||||
| // 2025-05-14 |  | ||||||
| // update pages links |  | ||||||
| // server-info conflicts with apache2 mod |  | ||||||
| // Changelog conflicts with changelog files |  | ||||||
|  |  | ||||||
| use MyAAC\Models\Pages; |  | ||||||
|  |  | ||||||
| $up = function() { |  | ||||||
| 	Pages::where('name', 'rules_on_the_page')->update(['hide' => 1]); |  | ||||||
|  |  | ||||||
| 	$rules = Pages::where('name', 'rules')->first(); |  | ||||||
| 	if (!$rules) { |  | ||||||
| 		Pages::create([ |  | ||||||
| 			'name' => 'rules', |  | ||||||
| 			'title' => 'Server Rules', |  | ||||||
| 			'body' => '<b>{{ config.lua.serverName }} Rules</b><br/>' . nl2br(file_get_contents(__DIR__ . '/30-rules.txt')), |  | ||||||
| 			'date' => time(), |  | ||||||
| 			'player_id' => 1, |  | ||||||
| 			'php' => 0, |  | ||||||
| 			'enable_tinymce' => 1, |  | ||||||
| 			'access' => 0, |  | ||||||
| 			'hide' => 0, |  | ||||||
| 		]); |  | ||||||
| 	} |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| $down = function() { |  | ||||||
| 	Pages::where('name', 'rules_on_the_page')->update(['hide' => 0]); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| @@ -85,12 +85,8 @@ if($email_new_time > 1) | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| $actions = array(); | $actions = $account_logged->getActionsLog(1000); | ||||||
| foreach($account_logged->getActionsLog(0, 1000) as $action) { |  | ||||||
| 	$actions[] = array('action' => $action['action'], 'date' => $action['date'], 'ip' => $action['ip'] != 0 ? long2ip($action['ip']) : inet_ntop($action['ipv6'])); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| $players = array(); |  | ||||||
| /** @var OTS_Players_List $account_players */ | /** @var OTS_Players_List $account_players */ | ||||||
| $account_players = $account_logged->getPlayersList(); | $account_players = $account_logged->getPlayersList(); | ||||||
| $account_players->orderBy('id'); | $account_players->orderBy('id'); | ||||||
|   | |||||||
| @@ -1,46 +0,0 @@ | |||||||
| <?php |  | ||||||
| /** |  | ||||||
|  * Changelog |  | ||||||
|  * |  | ||||||
|  * @package   MyAAC |  | ||||||
|  * @author    Slawkens <slawkens@gmail.com> |  | ||||||
|  * @copyright 2019 MyAAC |  | ||||||
|  * @link      https://my-aac.org |  | ||||||
|  */ |  | ||||||
| defined('MYAAC') or die('Direct access not allowed!'); |  | ||||||
| $title = 'Changelog'; |  | ||||||
|  |  | ||||||
| use MyAAC\Models\Changelog; |  | ||||||
|  |  | ||||||
| $_page = isset($_GET['page']) ? (int)$_GET['page'] : 0; |  | ||||||
| $limit = 30; |  | ||||||
| $offset = $_page * $limit; |  | ||||||
| $next_page = false; |  | ||||||
|  |  | ||||||
| $canEdit = hasFlag(FLAG_CONTENT_NEWS) || superAdmin(); |  | ||||||
|  |  | ||||||
| $changelogs = Changelog::isPublic()->orderByDesc('date')->limit($limit + 1)->offset($offset)->get()->toArray(); |  | ||||||
|  |  | ||||||
| $i = 0; |  | ||||||
| foreach($changelogs as $key => &$log) |  | ||||||
| { |  | ||||||
| 	if($i < $limit) { |  | ||||||
| 		$log['type'] = getChangelogType($log['type']); |  | ||||||
| 		$log['where'] = getChangelogWhere($log['where']); |  | ||||||
| 	} |  | ||||||
| 	else { |  | ||||||
| 		unset($changelogs[$key]); |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	if ($i >= $limit) |  | ||||||
| 		$next_page = true; |  | ||||||
|  |  | ||||||
| 	$i++; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| $twig->display('changelog.html.twig', array( |  | ||||||
| 	'changelogs' => $changelogs, |  | ||||||
| 	'page' => $_page, |  | ||||||
| 	'next_page' => $next_page, |  | ||||||
| 	'canEdit' => $canEdit, |  | ||||||
| )); |  | ||||||
| @@ -1,3 +1,46 @@ | |||||||
| <?php | <?php | ||||||
|  | /** | ||||||
|  |  * Changelog | ||||||
|  |  * | ||||||
|  |  * @package   MyAAC | ||||||
|  |  * @author    Slawkens <slawkens@gmail.com> | ||||||
|  |  * @copyright 2019 MyAAC | ||||||
|  |  * @link      https://my-aac.org | ||||||
|  |  */ | ||||||
|  | defined('MYAAC') or die('Direct access not allowed!'); | ||||||
|  | $title = 'Changelog'; | ||||||
|  |  | ||||||
| require 'change-log.php'; | use MyAAC\Models\Changelog; | ||||||
|  |  | ||||||
|  | $_page = isset($_GET['page']) ? (int)$_GET['page'] : 0; | ||||||
|  | $limit = 30; | ||||||
|  | $offset = $_page * $limit; | ||||||
|  | $next_page = false; | ||||||
|  |  | ||||||
|  | $canEdit = hasFlag(FLAG_CONTENT_NEWS) || superAdmin(); | ||||||
|  |  | ||||||
|  | $changelogs = Changelog::isPublic()->orderByDesc('date')->limit($limit + 1)->offset($offset)->get()->toArray(); | ||||||
|  |  | ||||||
|  | $i = 0; | ||||||
|  | foreach($changelogs as $key => &$log) | ||||||
|  | { | ||||||
|  | 	if($i < $limit) { | ||||||
|  | 		$log['type'] = getChangelogType($log['type']); | ||||||
|  | 		$log['where'] = getChangelogWhere($log['where']); | ||||||
|  | 	} | ||||||
|  | 	else { | ||||||
|  | 		unset($changelogs[$key]); | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if ($i >= $limit) | ||||||
|  | 		$next_page = true; | ||||||
|  |  | ||||||
|  | 	$i++; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | $twig->display('changelog.html.twig', array( | ||||||
|  | 	'changelogs' => $changelogs, | ||||||
|  | 	'page' => $_page, | ||||||
|  | 	'next_page' => $next_page, | ||||||
|  | 	'canEdit' => $canEdit, | ||||||
|  | )); | ||||||
|   | |||||||
| @@ -18,11 +18,8 @@ defined('MYAAC') or die('Direct access not allowed!'); | |||||||
| $title = 'Highscores'; | $title = 'Highscores'; | ||||||
|  |  | ||||||
| $settingHighscoresCountryBox = setting('core.highscores_country_box'); | $settingHighscoresCountryBox = setting('core.highscores_country_box'); | ||||||
| if(config('account_country') && $settingHighscoresCountryBox) { | if(config('account_country') && $settingHighscoresCountryBox) | ||||||
| 	require SYSTEM . 'countries.conf.php'; | 	require SYSTEM . 'countries.conf.php'; | ||||||
| } |  | ||||||
|  |  | ||||||
| $highscoresTTL = setting('core.highscores_cache_ttl'); |  | ||||||
|  |  | ||||||
| $list = urldecode($_GET['list'] ?? 'experience'); | $list = urldecode($_GET['list'] ?? 'experience'); | ||||||
| $page = $_GET['page'] ?? 1; | $page = $_GET['page'] ?? 1; | ||||||
| @@ -143,7 +140,7 @@ $needReCache = true; | |||||||
| $cacheKey = 'highscores_' . $skill . '_' . $vocation . '_' . $page . '_' . $configHighscoresPerPage; | $cacheKey = 'highscores_' . $skill . '_' . $vocation . '_' . $page . '_' . $configHighscoresPerPage; | ||||||
|  |  | ||||||
| $cache = Cache::getInstance(); | $cache = Cache::getInstance(); | ||||||
| if ($cache->enabled() && $highscoresTTL > 0) { | if ($cache->enabled()) { | ||||||
| 	$tmp = ''; | 	$tmp = ''; | ||||||
| 	if ($cache->fetch($cacheKey, $tmp)) { | 	if ($cache->fetch($cacheKey, $tmp)) { | ||||||
| 		$highscores = unserialize($tmp); | 		$highscores = unserialize($tmp); | ||||||
| @@ -217,8 +214,8 @@ if (empty($highscores)) { | |||||||
| 	})->toArray(); | 	})->toArray(); | ||||||
| } | } | ||||||
|  |  | ||||||
| if ($highscoresTTL > 0 && $cache->enabled() && $needReCache) { | if ($cache->enabled() && $needReCache) { | ||||||
| 	$cache->set($cacheKey, serialize($highscores), $highscoresTTL * 60); | 	$cache->set($cacheKey, serialize($highscores), setting('core.highscores_cache_ttl') * 60); | ||||||
| } | } | ||||||
|  |  | ||||||
| $show_link_to_next_page = false; | $show_link_to_next_page = false; | ||||||
| @@ -281,10 +278,6 @@ if(setting('core.highscores_frags')) { | |||||||
| if(setting('core.highscores_balance')) | if(setting('core.highscores_balance')) | ||||||
| 	$types['balance'] = 'Balance'; | 	$types['balance'] = 'Balance'; | ||||||
|  |  | ||||||
| if ($highscoresTTL > 0 && $cache->enabled()) { |  | ||||||
| 	echo '<small>*Note: Highscores are updated every' . ($highscoresTTL > 1 ? ' ' . $highscoresTTL : '') . ' minute' . ($highscoresTTL > 1 ? 's' : '') . '.</small><br/><br/>'; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| /** @var Twig\Environment $twig */ | /** @var Twig\Environment $twig */ | ||||||
| $twig->display('highscores.html.twig', [ | $twig->display('highscores.html.twig', [ | ||||||
| 	'highscores' => $highscores, | 	'highscores' => $highscores, | ||||||
|   | |||||||
| @@ -1,110 +0,0 @@ | |||||||
| <?php |  | ||||||
| /** |  | ||||||
|  * Server info |  | ||||||
|  * |  | ||||||
|  * @package   MyAAC |  | ||||||
|  * @author    Gesior <jerzyskalski@wp.pl> |  | ||||||
|  * @author    Slawkens <slawkens@gmail.com> |  | ||||||
|  * @author    whiteblXK |  | ||||||
|  * @copyright 2019 MyAAC |  | ||||||
|  * @link      https://my-aac.org |  | ||||||
|  */ |  | ||||||
| defined('MYAAC') or die('Direct access not allowed!'); |  | ||||||
| $title = 'Server info'; |  | ||||||
|  |  | ||||||
| if(isset($config['lua']['experience_stages'])) |  | ||||||
|     $config['lua']['experienceStages'] = $config['lua']['experience_stages']; |  | ||||||
|  |  | ||||||
| if(isset($config['lua']['min_pvp_level'])) |  | ||||||
|     $config['lua']['protectionLevel'] = $config['lua']['min_pvp_level']; |  | ||||||
|  |  | ||||||
| $rent = trim(strtolower($config['lua']['houseRentPeriod'])); |  | ||||||
| if($rent != 'yearly' && $rent != 'monthly' && $rent != 'weekly' && $rent != 'daily') |  | ||||||
|     $rent = 'never'; |  | ||||||
|  |  | ||||||
| if(isset($config['lua']['houseCleanOld'])) |  | ||||||
|     $cleanOld = (int)(eval('return ' . $config['lua']['houseCleanOld'] . ';') / (24 * 60 * 60)); |  | ||||||
|  |  | ||||||
| if(isset($config['lua']['rate_exp'])) |  | ||||||
|     $config['lua']['rateExp'] = $config['lua']['rate_exp']; |  | ||||||
| if(isset($config['lua']['rateExperience'])) |  | ||||||
|     $config['lua']['rateExp'] = $config['lua']['rateExperience']; |  | ||||||
| if(isset($config['lua']['rate_mag'])) |  | ||||||
|     $config['lua']['rateMagic'] = $config['lua']['rate_mag']; |  | ||||||
| if(isset($config['lua']['rate_skill'])) |  | ||||||
|     $config['lua']['rateSkill'] = $config['lua']['rate_skill']; |  | ||||||
| if(isset($config['lua']['rate_loot'])) |  | ||||||
|     $config['lua']['rateLoot'] = $config['lua']['rate_loot']; |  | ||||||
| if(isset($config['lua']['rate_spawn'])) |  | ||||||
|     $config['lua']['rateSpawn'] = $config['lua']['rate_spawn']; |  | ||||||
|  |  | ||||||
| $house_level = NULL; |  | ||||||
| if(isset($config['lua']['levelToBuyHouse'])) |  | ||||||
|     $house_level = $config['lua']['levelToBuyHouse']; |  | ||||||
| else if(isset($config['lua']['house_level'])) |  | ||||||
|     $house_level = $config['lua']['house_level']; |  | ||||||
|  |  | ||||||
| if(isset($config['lua']['in_fight_duration'])) |  | ||||||
|     $config['lua']['pzLocked'] = $config['lua']['in_fight_duration']; |  | ||||||
|  |  | ||||||
| $pzLocked = eval('return ' . $config['lua']['pzLocked'] . ';'); |  | ||||||
| $whiteSkullTime = isset($config['lua']['whiteSkullTime']) ? $config['lua']['whiteSkullTime'] : NULL; |  | ||||||
| if(!isset($whiteSkullTime) && isset($config['lua']['unjust_skull_duration'])) |  | ||||||
|     $whiteSkullTime = $config['lua']['unjust_skull_duration']; |  | ||||||
|  |  | ||||||
| if(isset($whiteSkullTime)) |  | ||||||
|     $whiteSkullTime = eval('return ' . $whiteSkullTime . ';'); |  | ||||||
|  |  | ||||||
| $redSkullLength = isset($config['lua']['redSkullLength']) ? $config['lua']['redSkullLength'] : NULL; |  | ||||||
| if(!isset($redSkullLength) && isset($config['lua']['red_skull_duration'])) |  | ||||||
|     $redSkullLength = $config['lua']['red_skull_duration']; |  | ||||||
|  |  | ||||||
| if(isset($redSkullLength)) |  | ||||||
|     $redSkullLength = eval('return ' . $redSkullLength . ';'); |  | ||||||
|  |  | ||||||
| $blackSkull = false; |  | ||||||
| $blackSkullLength = NULL; |  | ||||||
| if(isset($config['lua']['useBlackSkull']) && getBoolean($config['lua']['useBlackSkull'])) |  | ||||||
| { |  | ||||||
|     $blackSkullLength = $config['lua']['blackSkullLength']; |  | ||||||
|     $blackSkull = true; |  | ||||||
| } |  | ||||||
| else if(isset($config['lua']['black_skull_duration'])) { |  | ||||||
|     $blackSkullLength = eval('return ' . $config['lua']['blackSkullLength'] . ';'); |  | ||||||
|     $blackSkull = true; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| $clientVersion = NULL; |  | ||||||
| if(isset($status['online'])) |  | ||||||
|     $clientVersion = isset($status['clientVersion']) ? $status['clientVersion'] : null; |  | ||||||
|  |  | ||||||
| $twig->display('serverinfo.html.twig', array( |  | ||||||
|     'experienceStages' => isset($config['lua']['experienceStages']) && getBoolean($config['lua']['experienceStages']) ? $config['lua']['experienceStages'] : null, |  | ||||||
|     'serverIp' => str_replace('/', '', str_replace('http://', '', $config['lua']['url'])), |  | ||||||
|     'clientVersion' => $clientVersion, |  | ||||||
|     'globalSaveHour' => isset($config['lua']['globalSaveEnabled']) && getBoolean($config['lua']['globalSaveEnabled']) ? $config['lua']['globalSaveHour'] : null, |  | ||||||
|     'protectionLevel' => $config['lua']['protectionLevel'], |  | ||||||
|     'houseRent' => $rent == 'never' ? 'disabled' : $rent, |  | ||||||
|     'houseOld' => isset($cleanOld) ? $cleanOld : null, |  | ||||||
|     'rateExp' => $config['lua']['rateExp'], |  | ||||||
|     'rateExpFromPlayers' => isset($config['lua']['rateExperienceFromPlayers']) ? $config['lua']['rateExperienceFromPlayers'] : null, |  | ||||||
|     'rateMagic' => $config['lua']['rateMagic'], |  | ||||||
|     'rateSkill' => $config['lua']['rateSkill'], |  | ||||||
|     'rateLoot' => $config['lua']['rateLoot'], |  | ||||||
|     'rateSpawn' => $config['lua']['rateSpawn'], |  | ||||||
|     'houseLevel' => $house_level, |  | ||||||
|     'pzLocked' => $pzLocked, |  | ||||||
|     'whiteSkullTime' => $whiteSkullTime, |  | ||||||
|     'redSkullLength' => $redSkullLength, |  | ||||||
|     'blackSkull' => $blackSkull, |  | ||||||
|     'blackSkullLength' => $blackSkullLength, |  | ||||||
|     'dailyFragsToRedSkull' => isset($config['lua']['dailyFragsToRedSkull']) ? $config['lua']['dailyFragsToRedSkull'] : (isset($config['lua']['kills_per_day_red_skull']) ? $config['lua']['kills_per_day_red_skull'] : null), |  | ||||||
|     'weeklyFragsToRedSkull' => isset($config['lua']['weeklyFragsToRedSkull']) ? $config['lua']['weeklyFragsToRedSkull'] : (isset($config['lua']['kills_per_week_red_skull']) ? $config['lua']['kills_per_week_red_skull'] : null), |  | ||||||
|     'monthlyFragsToRedSkull' => isset($config['lua']['monthlyFragsToRedSkull']) ? $config['lua']['monthlyFragsToRedSkull'] : (isset($config['lua']['kills_per_month_red_skull']) ? $config['lua']['kills_per_month_red_skull'] : null), |  | ||||||
|     'dailyFragsToBlackSkull' => isset($config['lua']['dailyFragsToBlackSkull']) ? $config['lua']['dailyFragsToBlackSkull'] : (isset($config['lua']['kills_per_day_black_skull']) ? $config['lua']['kills_per_day_black_skull'] : null), |  | ||||||
|     'weeklyFragsToBlackSkull' => isset($config['lua']['weeklyFragsToBlackSkull']) ? $config['lua']['weeklyFragsToBlackSkull'] : (isset($config['lua']['kills_per_week_black_skull']) ? $config['lua']['kills_per_week_black_skull'] : null), |  | ||||||
|     'monthlyFragsToBlackSkull' => isset($config['lua']['monthlyFragsToBlackSkull']) ? $config['lua']['monthlyFragsToBlackSkull'] : (isset($config['lua']['kills_per_month_black_skull']) ? $config['lua']['kills_per_month_black_skull'] : null), |  | ||||||
|     'banishmentLength' => isset($config['lua']['banishment_length']) ? eval('return (' . $config['lua']['banishment_length'] . ') / (24 * 60 * 60);') : null, |  | ||||||
|     'finalBanishmentLength' => isset($config['lua']['final_banishment_length']) ? eval('return (' . $config['lua']['final_banishment_length'] . ') / (24 * 60 * 60);') : null, |  | ||||||
|     'ipBanishmentLength' => isset($config['lua']['ip_banishment_length']) ? eval('return (' . $config['lua']['ip_banishment_length'] . ') / (24 * 60 * 60);') : null, |  | ||||||
| )); |  | ||||||
							
								
								
									
										14
									
								
								system/pages/rules.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								system/pages/rules.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | |||||||
|  | <?php | ||||||
|  | /** | ||||||
|  |  * Rules | ||||||
|  |  * | ||||||
|  |  * @package   MyAAC | ||||||
|  |  * @author    Gesior <jerzyskalski@wp.pl> | ||||||
|  |  * @author    Slawkens <slawkens@gmail.com> | ||||||
|  |  * @copyright 2019 MyAAC | ||||||
|  |  * @link      https://my-aac.org | ||||||
|  |  */ | ||||||
|  | defined('MYAAC') or die('Direct access not allowed!'); | ||||||
|  | $title = 'Server Rules'; | ||||||
|  |  | ||||||
|  | $twig->display('rules.html.twig'); | ||||||
| @@ -1,3 +1,110 @@ | |||||||
| <?php | <?php | ||||||
|  | /** | ||||||
|  |  * Server info | ||||||
|  |  * | ||||||
|  |  * @package   MyAAC | ||||||
|  |  * @author    Gesior <jerzyskalski@wp.pl> | ||||||
|  |  * @author    Slawkens <slawkens@gmail.com> | ||||||
|  |  * @author    whiteblXK | ||||||
|  |  * @copyright 2019 MyAAC | ||||||
|  |  * @link      https://my-aac.org | ||||||
|  |  */ | ||||||
|  | defined('MYAAC') or die('Direct access not allowed!'); | ||||||
|  | $title = 'Server info'; | ||||||
|  |  | ||||||
| require 'ots-info.php'; | if(isset($config['lua']['experience_stages'])) | ||||||
|  |     $config['lua']['experienceStages'] = $config['lua']['experience_stages']; | ||||||
|  |  | ||||||
|  | if(isset($config['lua']['min_pvp_level'])) | ||||||
|  |     $config['lua']['protectionLevel'] = $config['lua']['min_pvp_level']; | ||||||
|  |  | ||||||
|  | $rent = trim(strtolower($config['lua']['houseRentPeriod'])); | ||||||
|  | if($rent != 'yearly' && $rent != 'monthly' && $rent != 'weekly' && $rent != 'daily') | ||||||
|  |     $rent = 'never'; | ||||||
|  |  | ||||||
|  | if(isset($config['lua']['houseCleanOld'])) | ||||||
|  |     $cleanOld = (int)(eval('return ' . $config['lua']['houseCleanOld'] . ';') / (24 * 60 * 60)); | ||||||
|  |  | ||||||
|  | if(isset($config['lua']['rate_exp'])) | ||||||
|  |     $config['lua']['rateExp'] = $config['lua']['rate_exp']; | ||||||
|  | if(isset($config['lua']['rateExperience'])) | ||||||
|  |     $config['lua']['rateExp'] = $config['lua']['rateExperience']; | ||||||
|  | if(isset($config['lua']['rate_mag'])) | ||||||
|  |     $config['lua']['rateMagic'] = $config['lua']['rate_mag']; | ||||||
|  | if(isset($config['lua']['rate_skill'])) | ||||||
|  |     $config['lua']['rateSkill'] = $config['lua']['rate_skill']; | ||||||
|  | if(isset($config['lua']['rate_loot'])) | ||||||
|  |     $config['lua']['rateLoot'] = $config['lua']['rate_loot']; | ||||||
|  | if(isset($config['lua']['rate_spawn'])) | ||||||
|  |     $config['lua']['rateSpawn'] = $config['lua']['rate_spawn']; | ||||||
|  |  | ||||||
|  | $house_level = NULL; | ||||||
|  | if(isset($config['lua']['levelToBuyHouse'])) | ||||||
|  |     $house_level = $config['lua']['levelToBuyHouse']; | ||||||
|  | else if(isset($config['lua']['house_level'])) | ||||||
|  |     $house_level = $config['lua']['house_level']; | ||||||
|  |  | ||||||
|  | if(isset($config['lua']['in_fight_duration'])) | ||||||
|  |     $config['lua']['pzLocked'] = $config['lua']['in_fight_duration']; | ||||||
|  |  | ||||||
|  | $pzLocked = eval('return ' . $config['lua']['pzLocked'] . ';'); | ||||||
|  | $whiteSkullTime = isset($config['lua']['whiteSkullTime']) ? $config['lua']['whiteSkullTime'] : NULL; | ||||||
|  | if(!isset($whiteSkullTime) && isset($config['lua']['unjust_skull_duration'])) | ||||||
|  |     $whiteSkullTime = $config['lua']['unjust_skull_duration']; | ||||||
|  |  | ||||||
|  | if(isset($whiteSkullTime)) | ||||||
|  |     $whiteSkullTime = eval('return ' . $whiteSkullTime . ';'); | ||||||
|  |  | ||||||
|  | $redSkullLength = isset($config['lua']['redSkullLength']) ? $config['lua']['redSkullLength'] : NULL; | ||||||
|  | if(!isset($redSkullLength) && isset($config['lua']['red_skull_duration'])) | ||||||
|  |     $redSkullLength = $config['lua']['red_skull_duration']; | ||||||
|  |  | ||||||
|  | if(isset($redSkullLength)) | ||||||
|  |     $redSkullLength = eval('return ' . $redSkullLength . ';'); | ||||||
|  |  | ||||||
|  | $blackSkull = false; | ||||||
|  | $blackSkullLength = NULL; | ||||||
|  | if(isset($config['lua']['useBlackSkull']) && getBoolean($config['lua']['useBlackSkull'])) | ||||||
|  | { | ||||||
|  |     $blackSkullLength = $config['lua']['blackSkullLength']; | ||||||
|  |     $blackSkull = true; | ||||||
|  | } | ||||||
|  | else if(isset($config['lua']['black_skull_duration'])) { | ||||||
|  |     $blackSkullLength = eval('return ' . $config['lua']['blackSkullLength'] . ';'); | ||||||
|  |     $blackSkull = true; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | $clientVersion = NULL; | ||||||
|  | if(isset($status['online'])) | ||||||
|  |     $clientVersion = isset($status['clientVersion']) ? $status['clientVersion'] : null; | ||||||
|  |  | ||||||
|  | $twig->display('serverinfo.html.twig', array( | ||||||
|  |     'experienceStages' => isset($config['lua']['experienceStages']) && getBoolean($config['lua']['experienceStages']) ? $config['lua']['experienceStages'] : null, | ||||||
|  |     'serverIp' => str_replace('/', '', str_replace('http://', '', $config['lua']['url'])), | ||||||
|  |     'clientVersion' => $clientVersion, | ||||||
|  |     'globalSaveHour' => isset($config['lua']['globalSaveEnabled']) && getBoolean($config['lua']['globalSaveEnabled']) ? $config['lua']['globalSaveHour'] : null, | ||||||
|  |     'protectionLevel' => $config['lua']['protectionLevel'], | ||||||
|  |     'houseRent' => $rent == 'never' ? 'disabled' : $rent, | ||||||
|  |     'houseOld' => isset($cleanOld) ? $cleanOld : null, | ||||||
|  |     'rateExp' => $config['lua']['rateExp'], | ||||||
|  |     'rateExpFromPlayers' => isset($config['lua']['rateExperienceFromPlayers']) ? $config['lua']['rateExperienceFromPlayers'] : null, | ||||||
|  |     'rateMagic' => $config['lua']['rateMagic'], | ||||||
|  |     'rateSkill' => $config['lua']['rateSkill'], | ||||||
|  |     'rateLoot' => $config['lua']['rateLoot'], | ||||||
|  |     'rateSpawn' => $config['lua']['rateSpawn'], | ||||||
|  |     'houseLevel' => $house_level, | ||||||
|  |     'pzLocked' => $pzLocked, | ||||||
|  |     'whiteSkullTime' => $whiteSkullTime, | ||||||
|  |     'redSkullLength' => $redSkullLength, | ||||||
|  |     'blackSkull' => $blackSkull, | ||||||
|  |     'blackSkullLength' => $blackSkullLength, | ||||||
|  |     'dailyFragsToRedSkull' => isset($config['lua']['dailyFragsToRedSkull']) ? $config['lua']['dailyFragsToRedSkull'] : (isset($config['lua']['kills_per_day_red_skull']) ? $config['lua']['kills_per_day_red_skull'] : null), | ||||||
|  |     'weeklyFragsToRedSkull' => isset($config['lua']['weeklyFragsToRedSkull']) ? $config['lua']['weeklyFragsToRedSkull'] : (isset($config['lua']['kills_per_week_red_skull']) ? $config['lua']['kills_per_week_red_skull'] : null), | ||||||
|  |     'monthlyFragsToRedSkull' => isset($config['lua']['monthlyFragsToRedSkull']) ? $config['lua']['monthlyFragsToRedSkull'] : (isset($config['lua']['kills_per_month_red_skull']) ? $config['lua']['kills_per_month_red_skull'] : null), | ||||||
|  |     'dailyFragsToBlackSkull' => isset($config['lua']['dailyFragsToBlackSkull']) ? $config['lua']['dailyFragsToBlackSkull'] : (isset($config['lua']['kills_per_day_black_skull']) ? $config['lua']['kills_per_day_black_skull'] : null), | ||||||
|  |     'weeklyFragsToBlackSkull' => isset($config['lua']['weeklyFragsToBlackSkull']) ? $config['lua']['weeklyFragsToBlackSkull'] : (isset($config['lua']['kills_per_week_black_skull']) ? $config['lua']['kills_per_week_black_skull'] : null), | ||||||
|  |     'monthlyFragsToBlackSkull' => isset($config['lua']['monthlyFragsToBlackSkull']) ? $config['lua']['monthlyFragsToBlackSkull'] : (isset($config['lua']['kills_per_month_black_skull']) ? $config['lua']['kills_per_month_black_skull'] : null), | ||||||
|  |     'banishmentLength' => isset($config['lua']['banishment_length']) ? eval('return (' . $config['lua']['banishment_length'] . ') / (24 * 60 * 60);') : null, | ||||||
|  |     'finalBanishmentLength' => isset($config['lua']['final_banishment_length']) ? eval('return (' . $config['lua']['final_banishment_length'] . ') / (24 * 60 * 60);') : null, | ||||||
|  |     'ipBanishmentLength' => isset($config['lua']['ip_banishment_length']) ? eval('return (' . $config['lua']['ip_banishment_length'] . ') / (24 * 60 * 60);') : null, | ||||||
|  | )); | ||||||
|   | |||||||
| @@ -1035,8 +1035,8 @@ Sent by MyAAC,<br/> | |||||||
| 		'highscores_cache_ttl' => [ | 		'highscores_cache_ttl' => [ | ||||||
| 			'name' => 'Highscores Cache TTL (in minutes)', | 			'name' => 'Highscores Cache TTL (in minutes)', | ||||||
| 			'type' => 'number', | 			'type' => 'number', | ||||||
| 			'min' => 0, | 			'min' => 1, | ||||||
| 			'desc' => 'How often to update highscores from database in minutes. Too low may slow down your website.<br/>0 to disable.', | 			'desc' => 'How often to update highscores from database in minutes (default 15 minutes). Too low may cause lags on website.', | ||||||
| 			'default' => 15, | 			'default' => 15, | ||||||
| 		], | 		], | ||||||
| 		'highscores_vocation_box' => [ | 		'highscores_vocation_box' => [ | ||||||
|   | |||||||
| @@ -43,6 +43,9 @@ class Account extends Model { | |||||||
| 			return 0; | 			return 0; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		global $config; | ||||||
|  | 		if(isset($config['lua']['freePremium']) && getBoolean($config['lua']['freePremium'])) return -1; | ||||||
|  |  | ||||||
| 		if($this->premdays == 65535){ | 		if($this->premdays == 65535){ | ||||||
| 			return 65535; | 			return 65535; | ||||||
| 		} | 		} | ||||||
|   | |||||||
| @@ -9,6 +9,6 @@ class AccountAction extends Model { | |||||||
|  |  | ||||||
| 	public $timestamps = false; | 	public $timestamps = false; | ||||||
|  |  | ||||||
| 	protected $fillable = ['account_id', 'ip', 'ipv6', 'date', 'action']; | 	protected $fillable = ['account_id', 'ip', 'date', 'action']; | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -10,6 +10,6 @@ class Visitor extends Model { | |||||||
|  |  | ||||||
| 	public $timestamps = false; | 	public $timestamps = false; | ||||||
|  |  | ||||||
| 	protected $fillable = ['ip', 'lastvisit', 'page', 'user_agent']; | 	protected $fillable = ['ip', 'lastivist', 'page', 'user_agent']; | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								system/templates/rules.html.twig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								system/templates/rules.html.twig
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | |||||||
|  | <b>{{ config.lua.serverName }} Rules</b><br/> | ||||||
|  | {{ getCustomPage('rules_on_the_page') | nl2br }} | ||||||
| @@ -4,7 +4,7 @@ return [ | |||||||
| 	MENU_CATEGORY_NEWS => [ | 	MENU_CATEGORY_NEWS => [ | ||||||
| 		'Latest News' => 'news', | 		'Latest News' => 'news', | ||||||
| 		'News Archive' => 'news/archive', | 		'News Archive' => 'news/archive', | ||||||
| 		'Changelog' => 'change-log', | 		'Changelog' => 'changelog', | ||||||
| 	], | 	], | ||||||
| 	MENU_CATEGORY_ACCOUNT => [ | 	MENU_CATEGORY_ACCOUNT => [ | ||||||
| 		'Account Management' => 'account/manage', | 		'Account Management' => 'account/manage', | ||||||
| @@ -28,7 +28,7 @@ return [ | |||||||
| 	MENU_CATEGORY_LIBRARY => [ | 	MENU_CATEGORY_LIBRARY => [ | ||||||
| 		'Monsters' => 'monsters', | 		'Monsters' => 'monsters', | ||||||
| 		'Spells' => 'spells', | 		'Spells' => 'spells', | ||||||
| 		'Server Info' => 'ots-info', | 		'Server Info' => 'server-info', | ||||||
| 		'Commands' => 'commands', | 		'Commands' => 'commands', | ||||||
| 		'Exp Stages' => 'exp-stages', | 		'Exp Stages' => 'exp-stages', | ||||||
| 		'Gallery' => 'gallery', | 		'Gallery' => 'gallery', | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ return [ | |||||||
| 	MENU_CATEGORY_NEWS => [ | 	MENU_CATEGORY_NEWS => [ | ||||||
| 		'Latest News' => 'news', | 		'Latest News' => 'news', | ||||||
| 		'News Archive' => 'news/archive', | 		'News Archive' => 'news/archive', | ||||||
| 		'Changelog' => 'change-log', | 		'Changelog' => 'changelog', | ||||||
| 	], | 	], | ||||||
| 	MENU_CATEGORY_ACCOUNT => [ | 	MENU_CATEGORY_ACCOUNT => [ | ||||||
| 		'Account Management' => 'account/manage', | 		'Account Management' => 'account/manage', | ||||||
| @@ -33,7 +33,7 @@ return [ | |||||||
| 		'Commands' => 'commands', | 		'Commands' => 'commands', | ||||||
| 		'Exp Stages' => 'exp-stages', | 		'Exp Stages' => 'exp-stages', | ||||||
| 		'Gallery' => 'gallery', | 		'Gallery' => 'gallery', | ||||||
| 		'Server Info' => 'ots-info', | 		'Server Info' => 'server-info', | ||||||
| 		'Exp Table' => 'exp-table', | 		'Exp Table' => 'exp-table', | ||||||
| 		'FAQ' => 'faq', | 		'FAQ' => 'faq', | ||||||
| 	], | 	], | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user