From 482a768128d9ab223b58d3000b8933b1245dbacd Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sat, 15 Oct 2016 03:04:43 +0200 Subject: [PATCH 01/64] Implement basic composer.json file --- composer.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 000000000..ef257c5e5 --- /dev/null +++ b/composer.json @@ -0,0 +1,12 @@ +{ + "name": "rtfmcorp/asylamba-game", + "type": "project", + "autoload": { + "psr-4": { + "Asylamba\\": "system/" + } + }, + "require": { + "php": ">=5.5.9" + } +} From f16b4cfe63ec4ceaaade199aa46cae423a5b181d Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sat, 15 Oct 2016 03:04:59 +0200 Subject: [PATCH 02/64] Ignore vendors and composer.lock --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 9769f5d71..2d29b137a 100755 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ system/config/app.config.local.php *.log *.psd + +/nbproject/ +/vendor/ +composer.lock \ No newline at end of file From fa31c0ecb8781b6aa25c51ab36b190f8c34411c1 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sat, 15 Oct 2016 03:05:18 +0200 Subject: [PATCH 03/64] Close #3: implement composer.json file --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..352f20dfc --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +## [Unreleased] +### Added +* Composer project file \ No newline at end of file From 73d4024e32d7f989bf816ccaf8d35815610aa972 Mon Sep 17 00:00:00 2001 From: Axel VENET Date: Mon, 17 Oct 2016 13:23:11 +0200 Subject: [PATCH 04/64] Implement composer.lock file --- .gitignore | 3 +-- composer.lock | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index 2d29b137a..3ff16c405 100755 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,4 @@ system/config/app.config.local.php *.psd /nbproject/ -/vendor/ -composer.lock \ No newline at end of file +/vendor/ \ No newline at end of file diff --git a/composer.lock b/composer.lock new file mode 100644 index 000000000..74b7a2047 --- /dev/null +++ b/composer.lock @@ -0,0 +1,20 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "8216345b76739124b2fac71e29e4e299", + "content-hash": "005074ec4578d858da4210e0c5528494", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.9" + }, + "platform-dev": [] +} From 10510e53a0c80aefd997bea811056ab225a8fda1 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sat, 15 Oct 2016 03:10:58 +0200 Subject: [PATCH 05/64] Implement PHPUnit configuration file --- phpunit.xml.dist | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 phpunit.xml.dist diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 000000000..6fca7c474 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,19 @@ + + + + + + + + + + + tests + + + From 54c7b494dd37f389032cee04a54871af16c4447c Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sat, 15 Oct 2016 03:11:59 +0200 Subject: [PATCH 06/64] Close #1: implement phpunit configuration file --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 352f20dfc..2c4e44e41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ ## [Unreleased] ### Added -* Composer project file \ No newline at end of file +* Composer project file +* PHPUnit configuration file From 33ddc858cf038c47ccc561519bfeb6eafc24c8a5 Mon Sep 17 00:00:00 2001 From: Axel VENET Date: Mon, 17 Oct 2016 13:58:46 +0200 Subject: [PATCH 07/64] Implement PHPUnit as a project dependency --- composer.json | 3 +- composer.lock | 1308 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 1307 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index ef257c5e5..2ff011f95 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ } }, "require": { - "php": ">=5.5.9" + "php": ">=5.5.9", + "phpunit/phpunit": "~5.6" } } diff --git a/composer.lock b/composer.lock index 74b7a2047..afda12550 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,1311 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "8216345b76739124b2fac71e29e4e299", - "content-hash": "005074ec4578d858da4210e0c5528494", - "packages": [], + "hash": "2435da5187a3336f5cc90c84a0bcbe29", + "content-hash": "0937eb1ab5aa97aad3755e31a382ea92", + "packages": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" + }, + { + "name": "myclabs/deep-copy", + "version": "1.5.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/ea74994a3dc7f8d2f65a06009348f2d63c81e61f", + "reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2016-09-16 13:37:59" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-09-30 07:12:33" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-06-10 07:14:17" + }, + { + "name": "phpspec/prophecy", + "version": "v1.6.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2016-06-07 08:13:47" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5f3f7e736d6319d5f1fc402aff8b026da26709a3", + "reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "^1.4.2", + "sebastian/code-unit-reverse-lookup": "~1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "~1.0|~2.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.4.0", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2016-07-26 14:39:29" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2015-06-21 13:08:43" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21 13:50:34" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2016-05-12 18:03:57" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2015-09-15 10:49:45" + }, + { + "name": "phpunit/phpunit", + "version": "5.6.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "60c32c5b5e79c2248001efa2560f831da11cc2d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/60c32c5b5e79c2248001efa2560f831da11cc2d7", + "reference": "60c32c5b5e79c2248001efa2560f831da11cc2d7", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "^4.0.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.2", + "sebastian/environment": "^1.3 || ^2.0", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/object-enumerator": "~1.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0|~2.0", + "symfony/yaml": "~2.1|~3.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.6.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2016-10-07 13:03:26" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "238d7a2723bce689c79eeac9c7d5e1d623bb9dc2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/238d7a2723bce689c79eeac9c7d5e1d623bb9dc2", + "reference": "238d7a2723bce689c79eeac9c7d5e1d623bb9dc2", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2016-10-09 07:01:45" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2016-02-13 06:45:14" + }, + { + "name": "sebastian/comparator", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2015-07-26 15:48:44" + }, + { + "name": "sebastian/diff", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-12-08 07:14:41" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-08-18 05:49:44" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-06-17 09:04:28" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12 03:26:01" + }, + { + "name": "sebastian/object-enumerator", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", + "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2016-01-28 13:25:10" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-11-11 19:50:13" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28 20:34:47" + }, + { + "name": "sebastian/version", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-02-04 12:56:52" + }, + { + "name": "symfony/yaml", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/368b9738d4033c8b93454cb0dbd45d305135a6d3", + "reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2016-09-25 08:27:07" + }, + { + "name": "webmozart/assert", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-08-09 15:02:57" + } + ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", From f5703a7e287f482dccd449898e8b115b528d95ed Mon Sep 17 00:00:00 2001 From: acknowledge Date: Sun, 16 Oct 2016 16:27:28 +0200 Subject: [PATCH 08/64] =?UTF-8?q?limit=20the=20max=20level=20of=20the=20te?= =?UTF-8?q?chnology=20'ing=C3=A9nierie=20du=20batiment'=20to=2020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- .../modules/promethee/resource/TechnologyResource.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 62c8e452b..798509496 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ ASYLAMBA : Expansion Stellaire ============================== -Jeu de stragégie en ligne multi-joueur. [asylamba.com](http://asylamba.com) +Jeu de stragégie en ligne multi-joueur. Visitez [asylamba.com](http://asylamba.com) pour tester le jeu. -![](http://asylamba.com/public/media/files/sources/asylambacom.png) +![logo Asylamba](http://asylamba.com/public/media/files/sources/asylambacom.png) Dépendances ----------- diff --git a/system/modules/promethee/resource/TechnologyResource.class.php b/system/modules/promethee/resource/TechnologyResource.class.php index 2dc440d6a..ae2c2e205 100755 --- a/system/modules/promethee/resource/TechnologyResource.class.php +++ b/system/modules/promethee/resource/TechnologyResource.class.php @@ -460,7 +460,7 @@ public static function getImprovementPercentage($techno, $level = -1) { 'requiredTechnosphere' => 6, 'requiredResearch' => array(0, 0, 0, 0, 0, 0, 0, 0, 4, 4), 'time' => 40800, - 'maxLevel' => 25, + 'maxLevel' => 20, 'category' => 2, 'resource' => 1150, 'credit' => 10500, From 0fcb9d271555afca8ade6dd25ab64cc49cae2160 Mon Sep 17 00:00:00 2001 From: acknowledge Date: Mon, 17 Oct 2016 13:19:44 +0200 Subject: [PATCH 09/64] update version number in the config file --- system/config/app.config.local.default.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/config/app.config.local.default.php b/system/config/app.config.local.default.php index 3cdd205fb..6c6115d08 100755 --- a/system/config/app.config.local.default.php +++ b/system/config/app.config.local.default.php @@ -31,7 +31,7 @@ # défini le sous-titre du serveur (affiché comme titre) define('APP_SUBNAME', 'Expansion Stellaire'); # numéro de version de l'app -define('APP_VERSION', '0.14'); +define('APP_VERSION', '1.4.0'); # créateurs du projet define('APP_CREATOR', 'Gil Clavien, Jacky Casas, Noé Zufferey'); # défini la description du serveur (affichée dans la page) From 43662e25e070e762d3230cc72d8351a5f9edaac9 Mon Sep 17 00:00:00 2001 From: acknowledge Date: Wed, 19 Oct 2016 23:59:47 +0200 Subject: [PATCH 10/64] add README and CONTRIBUTING in english --- CONTRIBUTING.en.md | 45 +++++++++++++++++++++++++++ CONTRIBUTING.md | 2 +- README.en.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 ++- 4 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 CONTRIBUTING.en.md create mode 100644 README.en.md diff --git a/CONTRIBUTING.en.md b/CONTRIBUTING.en.md new file mode 100644 index 000000000..f9d4d57d6 --- /dev/null +++ b/CONTRIBUTING.en.md @@ -0,0 +1,45 @@ +Guide for the contributor +========================= + +You can contribute in two different ways : + +- Open an issue : If you find something wrong or something that can be done better, just open an [*issue*](https://github.com/rtfmcorp/asylamba-game/issues) and describe as good as you can the problem. +- Propose a PR : If you want to resolve something, you can do it, just follow the precedure down below. + + +What type of problem can I solve ? +---------------------------------- + +You can search for an issue you want to solve. In this case, please comment the issue so that we know you're working on it. If there's no issues you can create it. + +Here are the things you can do : + +- correct orthograph or typing errors +- make refactoring, optimizations +- work on the interface (make it responsive for example) +- create documentation +- optimize the installation process + +If you want to add or modify game features, it's likely that the PR will be rejected. If you want to do it, please start a discussion with the dev team first, we'll talk together about what you want to do (open a topic in Asylamba's forum). + + +How to contribute ? +------------------- + +First you need to fork the repo. Then you can work on your version of the game and make commits. When it's done you can submit a pull request on the *dev* branch of the main repo. + +The main branch is *master*, the *dev* branch is used for development. We'll not accept PRs on the *master* branch. + +*Hint : Make a branch on your fork to do modifications so that you can work on another issue while waiting for the approval/rejection of your PR. Don't forget that all the commits you do on the same branch after the PR will be added to the PR.* + +An official guide for the contributions is available [here](https://guides.github.com/activities/contributing-to-open-source/#contributing). If you have any question, don't hesitate to contact us by mail, Asylamba or Discord. + + +Good practices +-------------- + +- respect the code conventions (spacing, new lines, tabs, naming) +- the code must be in english (variables names, ...) +- the comments are in english or french +- the commits names must be clear (in french or english) +- a commit modifies/improves one thing, it must be clear and concise diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a86807ecf..d35cda3bf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,7 @@ Voici les différentes choses que vous pouvez faire : - corriger des fautes d'orthographe ou fautes de frappe - faire du refactoring, optimisation -- optimiser l'interface (reponse design par exemple) +- optimiser l'interface (reponsive design par exemple) - créer de la documentation (dans ce cas, il serait mieux de discuter en premier lieu de la technique utilisée, ainsi d'autres personnes pourront vous aider, et vous aurez plus de chance que ça soit accepté) En ce qui concerne l'ajout ou la modification de fonctionnalités, il est fort probable que ça soit refusé. Si vous souhaitez vous lancer là-dedans, il faut en discuter au préalable avec l'équipe de développement, directement sur le forum du jeu ou sur le serveur Discord d'Asylamba. Cela permettra de ne pas sortir de la ligne directrice. diff --git a/README.en.md b/README.en.md new file mode 100644 index 000000000..fb76516b0 --- /dev/null +++ b/README.en.md @@ -0,0 +1,77 @@ +ASYLAMBA : Expansion Stellaire +============================== + +Multiplayer online strategy game. Visit [asylamba.com](http://asylamba.com) to try the game. It's only in French for the moment. + +![Asylamba logo](http://asylamba.com/public/media/files/sources/asylambacom.png) + +Read this file in other languages : [Français](README.md), [English](README.en.md) + +Dependencies +------------ + +- Apache 2.4.7 +- PHP 5.5.9 +- MySQL 5.5.49 + + +Installation +------------ + +Procedure for a local install : + +- copy the file `index.default.php` and name it `index.php`, modify the `PUBLICR` constant with your own path +- copy the file `system/config/app.config.local.default.php` and name it `app.config.local.php`, modify the `APP_ROOT` constant and some others if needed (connection to database, and so on.) +- create a database (the name must be the same as the `DEFAULT_SQL_DTB` constant from the last point file) + +From there, you can access an interface that permits to create all the SQL tables of the DB : `http://localhost/[votre chemin]/script`. To do the install, click on the first button : "deploy.dbinstall". + +If no errors are displayed, you can go to `http://localhost/[votre chemin]/buffer` and create your first players. This interface allows you to connect to each and every player created. + +Three scripts are available to update the game on a daily basis, it the ones under the title "Tâches Cron" (cron tasks). You can either launch them by hand or call the related URLs with crons. + + +Structure of the project +------------------------ + +The game was developed without any framework for performance and specific needs reasons. There are not many dependencies at that time. We can notice the use of jQuery and LESS for CSS compilation. The rest is in pure HTML/CSS/JavaScript/PHP. + +The project contains mainly two folders : + +- `public/` : for images, CSS, JavaScript and logs +- `system/` : for views and game core + +The `system/` folder contains a lot of sub-folders. It's pretty easy to guess what's inside for most of them. However the `system/modules` folder requires some explanations. It contains the main classes of the game that are grouped by modules. Each one of these modules is called with a greek god name. The list with explanations is just down there. + + +| Module | Goal | +|-----------|----------| +| Ares | the war (commanders, fights, fleets) | +| Artemis | the spy | +| Athena | the orbital base (orbital base, buildings, commercial shippings, recycling, transactions) | +| Atlas | the rankings (faction, player) | +| Demeter | the factions (elections, law, forums) | +| Gaia | the galaxy (sectors, solar systems, planets) | +| Hermes | the communication (message, notification) | +| Promethee | the technology (research, technologies) | +| Zeus | the joueur (tutorial, bonus management, credit sendings) | + + +Contribute +---------- + +If you want to contribute to the project, it's possible ! Thanks to read the [instructions](CONTRIBUTING.en.md) before starting. + + +Contributors +------------ + +* [abdelaz3r](https://github.com/abdelaz3r) +* [acknowledge](https://github.com/acknowledge) +* [N03](https://github.com/N03) + + +License +------- + +[WIP] \ No newline at end of file diff --git a/README.md b/README.md index 798509496..2276a35de 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Jeu de stragégie en ligne multi-joueur. Visitez [asylamba.com](http://asylamba. ![logo Asylamba](http://asylamba.com/public/media/files/sources/asylambacom.png) +For the english version, follow this link : [English version](README.en.md) + Dépendances ----------- @@ -18,7 +20,7 @@ Installation Procédure pour une installation locale : -- copier `index.default.php` et le renommer en `index.php`, y modifier la constante PUBLICR avec votre chemin +- copier `index.default.php` et le renommer en `index.php`, y modifier la constante `PUBLICR` avec votre chemin - copier `system/config/app.config.local.default.php` et le renommer `app.config.local.php`, y modifier la constante `APP_ROOT` et d'autres infos (connexion à la base de données, etc.) - créer une base de données (nom correspondant à la constante `DEFAULT_SQL_DTB` du fichier du point précédent) From 48c10cf824a2172b839af76a04d91dd12e3cc198 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sun, 23 Oct 2016 00:16:49 +0200 Subject: [PATCH 11/64] Refactor core classes architecture --- system/Classes/Container/Alert.php | 70 ++++++ system/Classes/Container/ArrayList.php | 66 ++++++ system/Classes/Container/Cookie.php | 51 +++++ system/Classes/Container/EventList.php | 106 +++++++++ system/Classes/Container/History.php | 41 ++++ system/Classes/Container/Params.php | 57 +++++ system/Classes/Container/Session.php | 111 +++++++++ system/Classes/Container/StackList.php | 103 +++++++++ .../Database/Database.php} | 27 ++- .../Database/DatabaseAdmin.php} | 23 +- .../Library/Benchmark.php} | 11 +- .../Library/Benchtime.php} | 10 +- .../Bug.class.php => Classes/Library/Bug.php} | 19 +- .../Library/Chronos.php} | 11 +- .../Library/DataAnalysis.php} | 5 +- .../Library/Format.php} | 13 +- .../Library/Game.php} | 39 ++-- .../Library/Parser.php} | 15 +- .../Library/Security.php} | 9 +- .../Library/Utils.php} | 35 +-- .../API.class.php => Classes/Worker/API.php} | 12 +- .../ASM.class.php => Classes/Worker/ASM.php} | 50 ++++- .../CTC.class.php => Classes/Worker/CTC.php} | 17 +- .../CTR.class.php => Classes/Worker/CTR.php} | 34 ++- system/Classes/Worker/Manager.php | 211 ++++++++++++++++++ system/Classes/Worker/ManagerSession.php | 54 +++++ system/classes/container/Alert.class.php | 46 ---- system/classes/container/ArrayList.class.php | 49 ---- system/classes/container/Cookie.class.php | 43 ---- system/classes/container/EventList.class.php | 86 ------- system/classes/container/History.class.php | 27 --- system/classes/container/Params.class.php | 41 ---- system/classes/container/Session.class.php | 88 -------- system/classes/container/StackList.class.php | 74 ------ system/classes/loader.php | 37 --- system/classes/worker/Manager.class.php | 206 ----------------- .../classes/worker/ManagerSession.class.php | 20 -- 37 files changed, 1094 insertions(+), 823 deletions(-) create mode 100644 system/Classes/Container/Alert.php create mode 100644 system/Classes/Container/ArrayList.php create mode 100644 system/Classes/Container/Cookie.php create mode 100644 system/Classes/Container/EventList.php create mode 100644 system/Classes/Container/History.php create mode 100644 system/Classes/Container/Params.php create mode 100644 system/Classes/Container/Session.php create mode 100644 system/Classes/Container/StackList.php rename system/{classes/db/DataBase.class.php => Classes/Database/Database.php} (77%) mode change 100755 => 100644 rename system/{classes/db/DataBaseAdmin.class.php => Classes/Database/DatabaseAdmin.php} (81%) mode change 100755 => 100644 rename system/{classes/lib/Benchmark.class.php => Classes/Library/Benchmark.php} (87%) mode change 100755 => 100644 rename system/{classes/lib/Benchtime.class.php => Classes/Library/Benchtime.php} (93%) mode change 100755 => 100644 rename system/{classes/lib/Bug.class.php => Classes/Library/Bug.php} (94%) mode change 100755 => 100644 rename system/{classes/lib/Chronos.class.php => Classes/Library/Chronos.php} (97%) mode change 100755 => 100644 rename system/{classes/lib/DataAnalysis.class.php => Classes/Library/DataAnalysis.php} (83%) rename system/{classes/lib/Format.class.php => Classes/Library/Format.php} (95%) mode change 100755 => 100644 rename system/{classes/lib/Game.class.php => Classes/Library/Game.php} (96%) mode change 100755 => 100644 rename system/{classes/lib/Parser.class.php => Classes/Library/Parser.php} (97%) mode change 100755 => 100644 rename system/{classes/lib/Security.class.php => Classes/Library/Security.php} (91%) mode change 100755 => 100644 rename system/{classes/lib/Utils.class.php => Classes/Library/Utils.php} (92%) mode change 100755 => 100644 rename system/{classes/worker/API.class.php => Classes/Worker/API.php} (95%) mode change 100755 => 100644 rename system/{classes/worker/ASM.class.php => Classes/Worker/ASM.php} (69%) mode change 100755 => 100644 rename system/{classes/worker/CTC.class.php => Classes/Worker/CTC.php} (93%) mode change 100755 => 100644 rename system/{classes/worker/CTR.class.php => Classes/Worker/CTR.php} (93%) mode change 100755 => 100644 create mode 100644 system/Classes/Worker/Manager.php create mode 100644 system/Classes/Worker/ManagerSession.php delete mode 100755 system/classes/container/Alert.class.php delete mode 100755 system/classes/container/ArrayList.class.php delete mode 100755 system/classes/container/Cookie.class.php delete mode 100755 system/classes/container/EventList.class.php delete mode 100755 system/classes/container/History.class.php delete mode 100755 system/classes/container/Params.class.php delete mode 100755 system/classes/container/Session.class.php delete mode 100755 system/classes/container/StackList.class.php delete mode 100755 system/classes/loader.php delete mode 100755 system/classes/worker/Manager.class.php delete mode 100755 system/classes/worker/ManagerSession.class.php diff --git a/system/Classes/Container/Alert.php b/system/Classes/Container/Alert.php new file mode 100644 index 000000000..ece68ee12 --- /dev/null +++ b/system/Classes/Container/Alert.php @@ -0,0 +1,70 @@ +alerts[] = array($message, $type); + return $this->size() - 1; + } + + public function clear() { + $this->alerts = array(); + } + + /** + * @return int + */ + public function size() { + return count($this->alerts); + } + + /** + * @param int $position + * @return array|boolean + */ + public function get($position) { + if (isset($this->alerts[$position])) { + return $this->alerts[$position]; + } + return false; + } + + /** + * @param string $tag + * @param string $type + * @return string + */ + public function getAlerts($tag, $type = ALERT_DEFAULT) { + $format = ''; + foreach ($this->alerts as $k) { + if ($type != ALERT_DEFAULT AND $type = $k[1]) { + $format .= '<' . $tag . ' class="alert_' . $k[1] . '">' . $k[0] . ''; + } + } + return $format; + } + + /** + * @param string $path + * @param boolean $date + * @param array $supp + */ + public function logAlerts($path, $date = TRUE, $supp = array()) { + # TODO + } + + public function readUrl() { + if (isset($_GET['say'])) { + $this->alerts[] = array($_GET['say'], ALERT_URL_INFO); + } + } +} \ No newline at end of file diff --git a/system/Classes/Container/ArrayList.php b/system/Classes/Container/ArrayList.php new file mode 100644 index 000000000..2293d7a30 --- /dev/null +++ b/system/Classes/Container/ArrayList.php @@ -0,0 +1,66 @@ +elements); + } + + /** + * @param string $key + * @return mixed + */ + public function get($key) { + if (isset($this->elements[$key])) { + return $this->elements[$key]; + } + return null; + } + + /** + * @param string $key + * @return boolean + */ + public function exist($key) { + return isset($this->elements[$key]); + } + + /** + * @param string $key + * @param mixed $value + * @return boolean + */ + public function equal($key, $value) { + return (($this->exist($key) && $this->get($key) == $value)); + } + + /** + * @param string $key + * @param mixed $value + */ + public function add($key, $value) { + $this->elements[$key] = $value; + } + + /** + * @param string $key + * @return boolean + */ + public function remove($key) { + if (isset($this->elements[$key])) { + unset($this->elements[$key]); + } + return false; + } + + public function clear() { + $this->elements = array(); + } +} \ No newline at end of file diff --git a/system/Classes/Container/Cookie.php b/system/Classes/Container/Cookie.php new file mode 100644 index 000000000..8ce23c2bd --- /dev/null +++ b/system/Classes/Container/Cookie.php @@ -0,0 +1,51 @@ +name = APP_NAME . '_' . SERVER_SESS; + $this->init(); + } + + /** + * @param string $key + * @param mixed $value + */ + public function add($key, $value) { + $this->elements[$key] = $value; + $this->rewrite(); + } + + /** + * @param string $key + * @return boolean + */ + public function remove($key) { + if (!isset($this->elements[$key])) { + return false; + } + unset($this->elements[$key]); + $this->rewrite(); + } + + public function clear() { + $this->elements = array(); + $this->rewrite(); + } + + public function rewrite() { + setcookie($this->name, serialize($this->elements), time() + 3000000, '/'); + } + + public function init() { + if (isset($_COOKIE[$this->name])) { + $this->elements = unserialize($_COOKIE[$this->name]); + } + } +} \ No newline at end of file diff --git a/system/Classes/Container/EventList.php b/system/Classes/Container/EventList.php new file mode 100644 index 000000000..d3c363488 --- /dev/null +++ b/system/Classes/Container/EventList.php @@ -0,0 +1,106 @@ +events); + } + + /** + * @param int $index + * @return ArrayList + */ + public function get($index = 0) { + if (isset($this->events[$index])) { + return $this->events[$index]; + } + return null; + } + + /** + * @param string $date + * @return \Asylamba\Classes\Container\StackList + */ + public function getPastEvents($date) { + $past = new StackList(); + foreach($this->events AS $e) { + if ($e->get('date') <= $date) { + $past->append($e); + } + } + return $past; + } + + /** + * @param string $date + */ + public function clearPastEvents($date) { + $size = $this->size() - 1; + for ($i = $size; $i >= 0; $i--) { + if ($this->events[$i]->get('date') <= $date) { + $this->remove($i); + $i--; + } + } + } + + /** + * @param string $date + * @param string $eventType + * @param string $eventId + * @param string $eventInfo + */ + public function add($date, $eventType, $eventId, $eventInfo = NULL) { + $event = new ArrayList(); + $event->add('date', $date); + $event->add('eventType', $eventType); + $event->add('eventId', $eventId); + $event->add('eventInfo', $eventInfo); + + $index = 0; + $found = FALSE; + foreach($this->events AS $e) { + if ($e->get('date') > $date) { + $found = TRUE; + break; + } + $index++; + } + if ($found) { + $begin = array_slice($this->events, 0, $index); + $begin[] = $event; + $end = array_slice($this->events, $index); + $this->events = array_merge($begin, $end); + } else { + $this->events[] = $event; + } + } + + /** + * @param int $index + * @return boolean + */ + public function remove($index) { + if ($index < 0) { + $index = count($this->events) + $index; + } + if (!isset($this->events[$index])) { + return false; + } + $begin = array_slice($this->events, 0, $index); + $end = array_slice($this->events, $index+1); + $this->events = array_merge($begin, $end); + } + + public function clear() { + $this->events = array(); + } +} \ No newline at end of file diff --git a/system/Classes/Container/History.php b/system/Classes/Container/History.php new file mode 100644 index 000000000..0a9e8dd6e --- /dev/null +++ b/system/Classes/Container/History.php @@ -0,0 +1,41 @@ +events, $path); + if (count($this->events) > self::MAX_SIZE) { + $this->events = array_slice($this->events, 0, self::MAX_SIZE); + } + } + + /** + * @return string + */ + public function getCurrentPath() { + return $this->events[0]; + } + + /** + * @param int $larger + * @return string + */ + public function getPastPath($larger = 0) { + if (isset($this->events[$larger])) { + return $this->events[$larger]; + } + } + + public function clear() { + $this->events = array(); + } +} \ No newline at end of file diff --git a/system/Classes/Container/Params.php b/system/Classes/Container/Params.php new file mode 100644 index 000000000..f93abbea5 --- /dev/null +++ b/system/Classes/Container/Params.php @@ -0,0 +1,57 @@ + TRUE, + self::SHOW_MAP_MINIMAP => TRUE, + self::SHOW_MAP_RC => FALSE, + self::SHOW_MAP_ANTISPY => TRUE, + self::SHOW_MAP_FLEETOUT => TRUE, + self::SHOW_MAP_FLEETIN => TRUE, + self::SHOW_ATTACK_REPORT=> TRUE, + self::SHOW_REBEL_REPORT => TRUE, + self::REDIRECT_CHAT => FALSE, + ]; + + /** + * @param string $params + * @return boolean + */ + public static function check($params) { + return CTR::$cookie->exist('p' . $params) + ? (bool)CTR::$cookie->get('p' . $params) + : self::$params[$params]; + } + + /** + * @param string $params + * @param mixed $value + */ + public static function update($params, $value) { + if (in_array($params, self::$params)) { + CTR::$cookie->add('p' . $params, $value); + } + } + + /** + * @return array + */ + public static function getParams() { + return self::$params; + } +} diff --git a/system/Classes/Container/Session.php b/system/Classes/Container/Session.php new file mode 100644 index 000000000..53cfd91fa --- /dev/null +++ b/system/Classes/Container/Session.php @@ -0,0 +1,111 @@ +elements = NULL; + } + + public function clear() { + $this->remove('playerInfo', new ArrayList()); + $this->remove('playerBase', new ArrayList()); + $this->remove('playerEvent', new ArrayList()); + } + + ## + + public function initPlayerInfo() { + $this->add('playerInfo', new ArrayList()); + } + + public function initPlayerBase() { + $a = new ArrayList(); + $a->add('ob', new StackList()); + $a->add('ms', new StackList()); + + $this->add('playerBase', $a); + } + + public function initPlayerEvent() { + $this->add('playerEvent', new EventList()); + } + + public function initLastUpdate() { + $l = new ArrayList(); + $l->add('game', Utils::now()); + $l->add('event', Utils::now()); + + $this->add('lastUpdate', $l); + } + + public function initPlayerBonus() { + $this->add('playerBonus', new StackList()); + } + + ## + /** + * @param string $key + * @param int $id + * @param string $name + * @param string $sector + * @param string $system + * @param string $img + * @param string $type + * @return boolean + */ + public function addBase($key, $id, $name, $sector, $system, $img, $type) { + if ($this->exist('playerBase')) { + if ($key != 'ob' && $key != 'ms') { + return false; + } + $a = new ArrayList(); + + $a->add('id', $id); + $a->add('name', $name); + $a->add('sector', $sector); + $a->add('system', $system); + $a->add('img', $img); + $a->add('type', $type); + + $this->get('playerBase')->get($key)->append($a); + } + } + + /** + * @param string $key + * @param int $id + */ + public function removeBase($key, $id) { + if ($this->exist('playerBase')) { + $size = $this->get('playerBase')->get($key)->size(); + for ($i = 0; $i < $size; $i++) { + if ($this->get('playerBase')->get($key)->get($i)->get('id') == $id) { + $this->get('playerBase')->get($key)->remove($i); + } + } + } + } + + /** + * @param int $id + * @return boolean + */ + public function baseExist($id) { + $obSize = $this->get('playerBase')->get('ob')->size(); + for ($i = 0; $i < $obSize; $i++) { + if ($id == $this->get('playerBase')->get('ob')->get($i)->get('id')) { + return TRUE; + } + } + $msSize = $this->get('playerBase')->get('ms')->size(); + for ($i = 0; $i < $msSize; $i++) { + if ($id == $this->get('playerBase')->get('ms')->get($i)->get('id')) { + return TRUE; + } + } + return FALSE; + } +} \ No newline at end of file diff --git a/system/Classes/Container/StackList.php b/system/Classes/Container/StackList.php new file mode 100644 index 000000000..6a833de49 --- /dev/null +++ b/system/Classes/Container/StackList.php @@ -0,0 +1,103 @@ +elements); + } + + /** + * @param int $index + * @return mixed + */ + public function get($index = 0) { + if (isset($this->elements[$index])) { + return $this->elements[$index]; + } + return NULL; + } + + /** + * @param int $index + * @return boolean + */ + public function exist($index) { + return (isset($this->elements[$index])); + } + + /** + * @param string $key + * @param mixed $value + */ + public function add($key, $value) { + $this->elements[$key] = $value; + } + + /** + * @param string $key + * @param mixed $value + */ + public function increase($key, $value) { + $this->elements[$key] = + (isset($this->elements[$key])) + ? $this->elements[$key] + $value + : $value + ; + } + + /** + * @param string $key + * @param mixed $value + */ + public function insert($key, $value) { + if (count($this->elements) < $key) { + $this->elements[$key] = $value; + } else { + // décalage des tous les index qui suivent + $begin = array_slice($this->elements, 0, $key); + $begin[] = $value; + $end = array_slice($this->elements, $key); + $this->elements = array_merge($begin, $end); + } + } + + /** + * @param mixed $element + */ + public function append($value) { + $this->elements[] = $value; + } + + /** + * @param mixed $value + */ + public function prepend($value) { + array_unshift($this->elements, $value); + } + + /** + * @param int $index + */ + public function remove($index) { + if ($index < 0) { + $index = count($this->elements) + $index; + } + if (!isset($this->elements[$index])) { + return false; + } + $begin = array_slice($this->elements, 0, $index); + $end = array_slice($this->elements, $index+1); + $this->elements = array_merge($begin, $end); + } + + public function clear() { + $this->elements = array(); + } +} diff --git a/system/classes/db/DataBase.class.php b/system/Classes/Database/Database.php old mode 100755 new mode 100644 similarity index 77% rename from system/classes/db/DataBase.class.php rename to system/Classes/Database/Database.php index e06aa3d06..fd8936368 --- a/system/classes/db/DataBase.class.php +++ b/system/Classes/Database/Database.php @@ -1,10 +1,13 @@ PDOInstance = new PDO( - 'mysql:dbname=' . DEFAULT_SQL_DTB . ';host=' . DEFAULT_SQL_HOST . ';charset=utf8', - DEFAULT_SQL_USER, - DEFAULT_SQL_PASS, + $this->PDOInstance = new \PDO( + 'mysql:dbname=' . DEFAULT_SQL_DTB . ';host=' . DEFAULT_SQL_HOST . ';charset=utf8', + DEFAULT_SQL_USER, + DEFAULT_SQL_PASS, $pdoOptions ); - } catch (PDOException $e) { + } catch (\PDOException $e) { echo 'Erreur de connection à la base de donnée : ' . $e->getMessage(); exit(); } @@ -31,12 +34,12 @@ private function __construct() { public static function getInstance() { if (is_null(self::$instance)) { - self::$instance = new DataBase(); + self::$instance = new Database(); self::$nbrOfInstance++; } return self::$instance; } - + public function query($query) { self::$nbrOfQuery++; return $this->PDOInstance->query($query); @@ -54,4 +57,4 @@ public function lastInsertId() { public function quote($query) { return $this->PDOInstance->quote($query); } -} \ No newline at end of file +} diff --git a/system/classes/db/DataBaseAdmin.class.php b/system/Classes/Database/DatabaseAdmin.php old mode 100755 new mode 100644 similarity index 81% rename from system/classes/db/DataBaseAdmin.class.php rename to system/Classes/Database/DatabaseAdmin.php index 613f16564..76210d511 --- a/system/classes/db/DataBaseAdmin.class.php +++ b/system/Classes/Database/DatabaseAdmin.php @@ -1,10 +1,13 @@ PDOInstance = new PDO( - 'mysql:dbname=' . ADMIN_SQL_DTB . ';host=' . ADMIN_SQL_HOST . ';charset=utf8', - ADMIN_SQL_USER, - ADMIN_SQL_PASS, + $this->PDOInstance = new \PDO( + 'mysql:dbname=' . ADMIN_SQL_DTB . ';host=' . ADMIN_SQL_HOST . ';charset=utf8', + ADMIN_SQL_USER, + ADMIN_SQL_PASS, $pdoOptions ); - } catch (PDOException $e) { + } catch (\PDOException $e) { echo 'Erreur de connection à la base de donnée : ' . $e->getMessage(); exit(); } @@ -37,7 +40,7 @@ public static function getInstance() { return self::$instance; } - + public function query($query) { self::$nbrOfQuery++; return $this->PDOInstance->query($query); @@ -55,4 +58,4 @@ public function lastInsertId() { public function quote($query) { return $this->PDOInstance->quote($query); } -} \ No newline at end of file +} diff --git a/system/classes/lib/Benchmark.class.php b/system/Classes/Library/Benchmark.php old mode 100755 new mode 100644 similarity index 87% rename from system/classes/lib/Benchmark.class.php rename to system/Classes/Library/Benchmark.php index f77070c8e..18f59ff2f --- a/system/classes/lib/Benchmark.class.php +++ b/system/Classes/Library/Benchmark.php @@ -9,6 +9,8 @@ * @version 0.1 **/ +namespace Asylamba\Classes\Library; + class Benchmark { protected $bTime = 0; protected $eTime = 0; @@ -48,7 +50,7 @@ public function start() { $this->bTime = $this->getMicrotime(); $this->running = TRUE; } else { - throw new Exception('Benchmark object is currently running', 1); + throw new \Exception('Benchmark object is currently running', 1); } } @@ -58,7 +60,7 @@ public function end() { $this->rTime = $this->eTime - $this->bTime; $this->running = FALSE; } else { - throw new Exception('Benchmark object is not running', 1); + throw new \Exception('Benchmark object is not running', 1); } } @@ -83,12 +85,12 @@ protected function formatTime($mode, $precision) { break; case 'h' : $formatTime = $this->rTime / 360; break; - default : throw new Exception('Unknow return time format', 1); + default : throw new \Exception('Unknow return time format', 1); break; } if ($precision < -10 OR $precision > 10) { - throw new Exception('Out of range time precision', 1); + throw new \Exception('Out of range time precision', 1); } $formatTime = round($formatTime, $precision); @@ -100,4 +102,3 @@ public static function getMicrotime() { return ((float)$usec + (float)$sec); } } -?> \ No newline at end of file diff --git a/system/classes/lib/Benchtime.class.php b/system/Classes/Library/Benchtime.php old mode 100755 new mode 100644 similarity index 93% rename from system/classes/lib/Benchtime.class.php rename to system/Classes/Library/Benchtime.php index 73b3c4ec9..ea793d689 --- a/system/classes/lib/Benchtime.class.php +++ b/system/Classes/Library/Benchtime.php @@ -8,6 +8,8 @@ # @author Gil Clavien # @version 0.2 +namespace Asylamba\Classes\Library; + class Benchtime { # time storage protected $name; @@ -64,16 +66,16 @@ public function getResult($mode = FALSE) { } elseif ($mode == self::PHP) { $ret = $interval; } - + return $ret; } protected function transform() { $interval = array(); - for ($i = 1; $i < count($this->time); $i++) { + for ($i = 1; $i < count($this->time); $i++) { $interval[] = array( - 'name' => $this->time[$i]['name'], + 'name' => $this->time[$i]['name'], 'time' => $this->time[$i]['time'] - $this->time[$i - 1]['time'] ); } @@ -86,4 +88,4 @@ protected function getMicrotime() { return ((float)$usec + (float)$sec); } } -?> \ No newline at end of file +?> diff --git a/system/classes/lib/Bug.class.php b/system/Classes/Library/Bug.php old mode 100755 new mode 100644 similarity index 94% rename from system/classes/lib/Bug.class.php rename to system/Classes/Library/Bug.php index b4de1b398..5b2a776b7 --- a/system/classes/lib/Bug.class.php +++ b/system/Classes/Library/Bug.php @@ -1,7 +1,10 @@ '; } } - + // DONNE LE TEMPS ACTUEL EN MICROSECONDE - + private static $benchTime = 0; - + public static function benchTime() { list($usec, $sec) = explode(' ', microtime()); $ret = ((float)$usec + (float)$sec); - + if (self::$benchTime == 0) { self::$benchTime = $ret; } else { self::$benchTime = $ret - self::$benchTime; } } - + public static function benchReturn($mode = '') { $ret = self::$benchTime; self::$benchTime = 0; - + if ($mode == 'ms') { return floor($ret * 1000) . 'ms'; } elseif ($mode == 'se') { @@ -43,4 +46,4 @@ public static function benchReturn($mode = '') { public static function writeLog($target, $content) { file_put_contents($target, $content . "\n\r", FILE_APPEND); } -} \ No newline at end of file +} diff --git a/system/classes/lib/Chronos.class.php b/system/Classes/Library/Chronos.php old mode 100755 new mode 100644 similarity index 97% rename from system/classes/lib/Chronos.class.php rename to system/Classes/Library/Chronos.php index 88216c26e..ea7e00140 --- a/system/classes/lib/Chronos.class.php +++ b/system/Classes/Library/Chronos.php @@ -1,4 +1,7 @@ la date est collée à la relève précédente */ public static function transform($date, $reference = FALSE, $collapse = FALSE) { - $date = new DateTime($date); + $date = new \DateTime($date); $releve = self::getRel($date->format('Y-m-d H:i:s')); $segment = floor($releve / Chronos::CO_SEG); @@ -109,4 +112,4 @@ public static function secondToFormat($seconds, $format = 'large') { return trim($return, ', '); } -} \ No newline at end of file +} diff --git a/system/classes/lib/DataAnalysis.class.php b/system/Classes/Library/DataAnalysis.php similarity index 83% rename from system/classes/lib/DataAnalysis.class.php rename to system/Classes/Library/DataAnalysis.php index 1e822ad2b..9c0205c6c 100644 --- a/system/classes/lib/DataAnalysis.class.php +++ b/system/Classes/Library/DataAnalysis.php @@ -1,4 +1,7 @@ nombre qui définit ou non le pluriel * arg : $return * * : str => retourne la chaine (ou s si non spécifié) si number est supérieur à 1 - * arg : + * arg : */ public static function addPlural($number, $return = '', $expression = '') { if ($number > 1) { @@ -122,11 +127,11 @@ public static function paddingNumber($number, $size) { $digits = strlen((string) $number); if ($digits < $size) { - for ($i = 0; $i < $size - $digits; $i++) { + for ($i = 0; $i < $size - $digits; $i++) { $number = '0' . $number; } } return $number; } -} \ No newline at end of file +} diff --git a/system/classes/lib/Game.class.php b/system/Classes/Library/Game.php old mode 100755 new mode 100644 similarity index 96% rename from system/classes/lib/Game.class.php rename to system/Classes/Library/Game.php index f11bec5f0..e59f9175c --- a/system/classes/lib/Game.class.php +++ b/system/Classes/Library/Game.php @@ -1,4 +1,17 @@ get(PlayerBonus::SHIP_SPEED) / 100)) : 0; return Commander::FLEETSPEED + $b; } public static function getMaxTravelDistance($bonus) { - include_once ARES; - return Commander::DISTANCEMAX; } @@ -88,15 +97,11 @@ public static function getTimeTravel($systemFrom, $positionFrom, $xFrom, $yFrom, } public static function getTimeTravelInSystem($startPosition, $destinationPosition) { - include_once ARES; - $distance = abs($startPosition - $destinationPosition); return round((Commander::COEFFMOVEINSYSTEM * $distance) * ((40 - $distance) / 50) + 180); } public static function getTimeTravelOutOfSystem($bonus, $startX, $startY, $destinationX, $destinationY) { - include_once ARES; - $distance = self::getDistance($startX, $destinationX, $startY, $destinationY); $time = Commander::COEFFMOVEOUTOFSYSTEM; $time += round((Commander::COEFFMOVEINTERSYSTEM * $distance) / self::getFleetSpeed($bonus)); @@ -137,7 +142,7 @@ public static function getAntiSpyRadius($investment, $mode = ANTISPY_DISPLAY_MOD public static function antiSpyArea($startPlace, $destinationPlace, $arrivalDate) { # dans le même système if ($startPlace->getRSystem() == $destinationPlace->getRSystem()) { - return ANTISPY_LITTLE_CIRCLE; + return ANTISPY_LITTLE_CIRCLE; } else { $duration = self::getTimeToTravel($startPlace, $destinationPlace); @@ -151,7 +156,7 @@ public static function antiSpyArea($startPlace, $destinationPlace, $arrivalDate) if ($antiSpyRadius >= $distanceRemaining) { if ($distanceRemaining < $antiSpyRadius / 3) { - return ANTISPY_LITTLE_CIRCLE; + return ANTISPY_LITTLE_CIRCLE; } elseif ($distanceRemaining < $antiSpyRadius / 3 * 2) { return ANTISPY_MIDDLE_CIRCLE; } else { @@ -194,7 +199,7 @@ public static function getAntiSpyEntryTime($startPlace, $destinationPlace, $arri $ratio = ($antiSpyRadius / 3) / $distanceRemaining; $sec = $ratio * $secRemaining; $newDate2 = Utils::addSecondsToDate($arrivalDate, -$sec); - + return array(TRUE, $newDate1, $newDate2); } else { $ratio = $antiSpyRadius / $distanceRemaining; @@ -208,7 +213,7 @@ public static function getAntiSpyEntryTime($startPlace, $destinationPlace, $arri $ratio = ($antiSpyRadius / 3) / $distanceRemaining; $sec = $ratio * $secRemaining; $newDate3 = Utils::addSecondsToDate($arrivalDate, -$sec); - + return array($newDate1, $newDate2, $newDate3); } } @@ -217,7 +222,7 @@ public static function getAntiSpyEntryTime($startPlace, $destinationPlace, $arri public static function getCommercialShipQuantityNeeded($transactionType, $quantity, $identifier = 0) { include_once ATHENA; switch ($transactionType) { - case Transaction::TYP_RESOURCE : + case Transaction::TYP_RESOURCE : # 1000 ressources => 1 commercialShip $needed = ceil($quantity / 1000); break; @@ -402,7 +407,7 @@ public static function getTypeOfSpy($success, $antiSpy) { } public static function getImprovementFromScientificCoef($coef) { - # transform scientific coefficient of a place + # transform scientific coefficient of a place # into improvement coefficient for the technosphere if ($coef < 10) { return 0; @@ -416,12 +421,12 @@ public static function getImprovementFromScientificCoef($coef) { public static function getFleetCost($ships, $affected = TRUE) { include_once ATHENA; $cost = 0; - for ($i = 0; $i < ShipResource::SHIP_QUANTITY; $i++) { + for ($i = 0; $i < ShipResource::SHIP_QUANTITY; $i++) { $cost += ShipResource::getInfo($i, 'cost') * $ships[$i]; } if (!$affected) { $cost *= ShipResource::COST_REDUCTION; - } + } return ceil($cost); } -} \ No newline at end of file +} diff --git a/system/classes/lib/Parser.class.php b/system/Classes/Library/Parser.php old mode 100755 new mode 100644 similarity index 97% rename from system/classes/lib/Parser.class.php rename to system/Classes/Library/Parser.php index 2720ebcb8..0d1a55c0b --- a/system/classes/lib/Parser.class.php +++ b/system/Classes/Library/Parser.php @@ -1,4 +1,9 @@ getCurrentSession(); @@ -108,7 +113,7 @@ function($m) { protected function parsePlace($string) { return preg_replace_callback( - '#\[\#(.+)\]#isU', + '#\[\#(.+)\]#isU', function($m) { include_once GAIA; $S_PLM1 = ASM::$plm->getCurrentSession(); @@ -128,7 +133,7 @@ function($m) { } ASM::$plm->changeSession($S_PLM1); - }, + }, $string ); } @@ -143,4 +148,4 @@ protected function parseTag($string) { protected function parseBigTag($string) { return $string; } -} \ No newline at end of file +} diff --git a/system/classes/lib/Security.class.php b/system/Classes/Library/Security.php old mode 100755 new mode 100644 similarity index 91% rename from system/classes/lib/Security.class.php rename to system/Classes/Library/Security.php index 09d6be6c5..cbe78d4ef --- a/system/classes/lib/Security.class.php +++ b/system/Classes/Library/Security.php @@ -1,4 +1,7 @@ add(DateInterval::createFromDateString('1 hour')); - + $cursor->add(\DateInterval::createFromDateString('1 hour')); + if ($cursor->getTimestamp() <= $tail->getTimestamp()) { $dates[] = $cursor->format('Y-m-d H:i:s'); } else { @@ -88,7 +93,7 @@ public static function intervalDates($date1, $date2, $precision = 'h') { $nextDay = floor($seconds / 86400) * 86400; $fullDay = date('Y-m-d H:i:s', $nextDay); - for ($i = 0; $i < $daysInterval; $i++) { + for ($i = 0; $i < $daysInterval; $i++) { # add date to array $dates[] = $fullDay; # compute next date @@ -149,7 +154,7 @@ public static function check($string, $mode = '') { } return $string; } - + public static function arrayToWhere($array, $prefix = '') { if (!empty($array)) { $i = 0; $return = ''; @@ -162,7 +167,7 @@ public static function arrayToWhere($array, $prefix = '') { } if (is_array($v)) { $return .= ' ('; - for ($j = 0; $j < count($v); $j++) { + for ($j = 0; $j < count($v); $j++) { if ($j == 0) { $return .= $prefix . $k . ' = ?'; } else { @@ -178,7 +183,7 @@ public static function arrayToWhere($array, $prefix = '') { return $return; } } - + public static function arrayToOrder($array, $prefix = '') { if (!empty($array)) { $return = 'ORDER BY'; @@ -193,7 +198,7 @@ public static function arrayToOrder($array, $prefix = '') { return $return; } } - + public static function arrayToLimit($array) { if (empty($array)) { return ''; @@ -228,4 +233,4 @@ public static function shuffle(&$array) { $array = $new; return true; } -} \ No newline at end of file +} diff --git a/system/classes/worker/API.class.php b/system/Classes/Worker/API.php old mode 100755 new mode 100644 similarity index 95% rename from system/classes/worker/API.class.php rename to system/Classes/Worker/API.php index 8aad0b7af..cb4f55a13 --- a/system/classes/worker/API.class.php +++ b/system/Classes/Worker/API.php @@ -1,8 +1,16 @@ query = $this->path . 'api/s-' . $this->server . '/a-' . Security::crypt('a-' . $api . '/' . $targ, $this->key); - + curl_setopt($ch, CURLOPT_URL, $this->query); curl_setopt($ch, CURLOPT_RETURNTRANSFER , TRUE); $answer = curl_exec($ch); @@ -131,4 +139,4 @@ public function getPlayerStatement($bindkey) { return $this->query('getplayerstatement', array('bindkey' => $bindkey)); } } -?> \ No newline at end of file +?> diff --git a/system/classes/worker/ASM.class.php b/system/Classes/Worker/ASM.php old mode 100755 new mode 100644 similarity index 69% rename from system/classes/worker/ASM.class.php rename to system/Classes/Worker/ASM.php index 941cde015..d77c9fc73 --- a/system/classes/worker/ASM.class.php +++ b/system/Classes/Worker/ASM.php @@ -1,4 +1,52 @@ save(); } } -} \ No newline at end of file +} diff --git a/system/classes/worker/CTC.class.php b/system/Classes/Worker/CTC.php old mode 100755 new mode 100644 similarity index 93% rename from system/classes/worker/CTC.class.php rename to system/Classes/Worker/CTC.php index a480cdb0e..256349d4f --- a/system/classes/worker/CTC.class.php +++ b/system/Classes/Worker/CTC.php @@ -1,4 +1,10 @@ 0) { $beforeUsort = count(self::$events); - + self::$events = CTC::insertion(self::$events); $afterUsort = count(self::$events); @@ -41,7 +47,7 @@ public static function applyContext($token) { $j++; self::$currentDate = $event['date']; call_user_func_array(array($event['object'], $event['method']), $event['args']); - + $logt .= '> [' . $event['date'] . '] ' . get_class($event['object']) . '(' . $event['object']->getId() . ')::' . $event['method'] . "\n"; } @@ -55,7 +61,7 @@ public static function applyContext($token) { $logt .= "> \n"; $logt .= "\n"; - + $path = 'public/log/ctc/' . date('Y') . '-' . date('m') . '-' . date('d') . '.log'; Bug::writeLog($path, $logt); } @@ -68,11 +74,11 @@ public static function applyContext($token) { public static function add($date, $object, $method, $args = array()) { if (!self::$running) { - throw new Exception('CTC isn\'t running actually', 1); + throw new \Exception('CTC isn\'t running actually', 1); } else { self::$add++; $event = array( - 'timest' => strtotime($date), + 'timest' => strtotime($date), 'date' => $date, 'object' => $object, 'method' => $method, @@ -128,4 +134,3 @@ public static function get() { return self::$events; } } -?> \ No newline at end of file diff --git a/system/classes/worker/CTR.class.php b/system/Classes/Worker/CTR.php old mode 100755 new mode 100644 similarity index 93% rename from system/classes/worker/CTR.class.php rename to system/Classes/Worker/CTR.php index 2362796dd..c49e32cf1 --- a/system/classes/worker/CTR.class.php +++ b/system/Classes/Worker/CTR.php @@ -1,4 +1,20 @@ array('admin', 'Administration'), '404' => array('notfound', '404'), - + 'action' => array('action', 'Action'), 'ajax' => array('ajax', 'Ajax'), 'inscription' => array('inscription', 'Inscription'), @@ -95,7 +111,7 @@ public static function init() { self::$post->add($k, $v); } self::parseRoute(); - + # initialise les données de message d'erreur if (isset($_SESSION[SERVER_SESS]['alert'])) { self::$alert = unserialize($_SESSION[SERVER_SESS]['alert']); @@ -139,8 +155,9 @@ private static function parseRoute() { self::$history->add($newURI); } + $nbParams = count($requestURI); # remplir les paramètres depuis le routing - for ($i = 1; $i < count($requestURI); $i++) { + for ($i = 1; $i < $nbParams; ++$i) { $params = explode('-', $requestURI[$i]); if (count($params) == 2) { self::$get->add($params[0], $params[1]); @@ -205,7 +222,7 @@ public static function getInclude() { include TEMPLATE . self::$data->get('screenmode') . '/stepbar.php'; include INSCRIPTION . 'content.php'; - + include TEMPLATE . self::$data->get('screenmode') . '/btmbar.php'; include TEMPLATE . self::$data->get('screenmode') . '/alert.php'; include TEMPLATE . self::$data->get('screenmode') . '/close.php'; @@ -214,12 +231,12 @@ public static function getInclude() { include EVENT . 'loadEvent.php'; include EVENT . 'executeEvent.php'; include EVENT . 'updateGame.php'; - + include TEMPLATE . self::$data->get('screenmode') . '/open.php'; include TEMPLATE . self::$data->get('screenmode') . '/navbar.php'; - + include PAGES . self::$data->get('screenmode') . '/' . self::$page . '.php'; - + include TEMPLATE . self::$data->get('screenmode') . '/toolbar.php'; include TEMPLATE . self::$data->get('screenmode') . '/alert.php'; include TEMPLATE . self::$data->get('screenmode') . '/close.php'; @@ -233,7 +250,7 @@ public static function getStat() { $ctn = "### " . date('H:i:s') . " ###\r"; $ctn .= "# path : " . $_SERVER['REQUEST_URI'] . "\r"; $ctn .= "# time : " . self::$benchmark->getTime('mls', 0) . "ms\r"; - $ctn .= "# query : " . DataBase::getNbrOfQuery() . "\r"; + $ctn .= "# query : " . Database::getNbrOfQuery() . "\r"; Bug::writeLog($path, $ctn); } @@ -270,4 +287,3 @@ public static function save() { } } } -?> \ No newline at end of file diff --git a/system/Classes/Worker/Manager.php b/system/Classes/Worker/Manager.php new file mode 100644 index 000000000..5242c3799 --- /dev/null +++ b/system/Classes/Worker/Manager.php @@ -0,0 +1,211 @@ +newSession(); + } + + public function newSession($uMode = ASM_UMODE) { + $this->statSessions++; + $this->statChangeSessions++; + + if (count($this->sessions) == 0) { + $session = new ManagerSession('_1', $this->managerType, ASM_UMODE); + } else { + $session = new ManagerSession('_' . (count($this->sessions) + 1), $this->managerType, $uMode); + } + + $this->currentSession = $session; + $this->sessions[] = $session; + + $this->objects[$session->getId()] = array(); + $this->origin[$session->getId()] = array(); + + return $session; + } + + public function changeSession(ManagerSession $session) { + $this->statChangeSessions++; + + if (in_array($session, $this->sessions) AND $session->getType() == $this->managerType) { + $this->currentSession = $session; + return TRUE; + } else { + return FALSE; + } + } + + public function getCurrentSession() { return $this->currentSession; } + public function getFirstSession() { return $this->sessions[0]; } + + // OBJECT MANAGER CORE + protected $objects = array(); + protected $origin = array(); + + public function get($i = 0) { + if (isset($this->objects[$this->currentSession->getId()][$i])) { + return $this->objects[$this->currentSession->getId()][$i]; + } else { + return FALSE; + } + } + + public function getById($id) { + foreach ($this->objects[$this->currentSession->getId()] AS $o) { + if ($o->getId() == $id) { + return $o; + } + } + return FALSE; + } + + public function getAll() { + return $this->objects[$this->currentSession->getId()]; + } + + public function size() { + return count($this->objects[$this->currentSession->getId()]); + } + + protected function _ObjectExist($object) { + foreach ($this->sessions AS $s) { + foreach ($this->origin[$s->getId()] as $k => $o) { + if ($o->getId() == $object->getId()) { + if ($s->getId() == $this->currentSession->getId()) { + return TRUE; + } else { + return $this->objects[$s->getId()][$k]; + } + } + } + } + return FALSE; + } + + protected function _Add($object) { + $element = $this->_ObjectExist($object); + + if ($element === FALSE) { + $this->statObject++; + $this->statRealObject++; + + $this->objects[$this->currentSession->getId()][] = $object; + $this->origin[$this->currentSession->getId()][] = clone($object); + return $object; + } elseif ($element === TRUE) { + $currentIdSession = $this->currentSession->getId(); + foreach ($this->origin[$currentIdSession] as $k => $o) { + if ($o == $object) { + return $this->objects[$currentIdSession][$k]; + } + } + return FALSE; + } else { + $this->statObject++; + $this->statReferenceObject++; + + $this->objects[$this->currentSession->getId()][] = $element; + $this->origin[$this->currentSession->getId()][] = $element; + return $element; + } + } + + protected function _Remove($id) { + foreach ($this->sessions as $session) { + foreach ($this->objects[$session->getId()] AS $k => $o) { + if ($o->getId() == $id) { + unset($this->objects[$session->getId()][$k]); + unset($this->origin[$session->getId()][$k]); + } + } + $this->objects[$session->getId()] = array_values($this->objects[$session->getId()]); + $this->origin[$session->getId()] = array_values($this->origin[$session->getId()]); + } + return NULL; + } + + public function _Save() { + if (!empty($this->objects)) { + return []; + } + $savingList = array(); + foreach ($this->sessions AS $s) { + foreach ($this->objects[$s->getId()] AS $k => $o) { + if ($this->objects[$s->getId()][$k] != $this->origin[$s->getId()][$k]) { + $savingList[] = $o; + } + } + } + $this->statSavingObject = count($savingList); + return $savingList; + } + + public function _EmptyCurrentSession() { + $currentSessionId = $this->currentSession->getId(); + foreach ($this->objects[$currentSessionId] as $k => $o) { + # code... + unset($this->objects[$currentSessionId][$k]); + unset($this->origin[$currentSessionId][$k]); + } + } + + // DEBUG & STATISTIC MANAGER CORE + protected $statObject = 0; + protected $statRealObject = 0; + protected $statReferenceObject = 0; + protected $statSavingObject = 0; + + protected $statSessions = 0; + protected $statChangeSessions = 0; + + public function saveStat($path) { + $ret = 'objet ' . $this->managerType . '
'; + $ret .= 'object : ' . $this->statObject . '
'; + $ret .= 'real object : ' . $this->statRealObject . '
'; + $ret .= 'ref object : ' . $this->statReferenceObject . '
'; + $ret .= 'saving object : ' . $this->statSavingObject . '
'; + + $ret .= 'sessions : ' . $this->statSessions . '
'; + $ret .= 'change sessions : ' . $this->statChangeSessions . '
'; + $ret .= '-----------------------------------------------------
'; + Bug::writeLog($path, $ret); + } + + public function showStat() { + $ret = 'objet ' . $this->managerType . '
'; + $ret .= 'object : ' . $this->statObject . '
'; + $ret .= 'real object : ' . $this->statRealObject . '
'; + $ret .= 'ref object : ' . $this->statReferenceObject . '
'; + $ret .= 'saving object : ' . $this->statSavingObject . '
'; + + $ret .= 'sessions : ' . $this->statSessions . '
'; + $ret .= 'change sessions : ' . $this->statChangeSessions . '
'; + $ret .= '-----------------------------------------------------
'; + echo $ret; + } + + public function show($flag = 1) { + if ($flag == 1) { + var_dump($this->objects); + } elseif ($flag == 2) { + var_dump($this->origin); + } else { + var_dump($this->objects); + var_dump($this->origin); + } + for ($i = 0; $i < 200; $i++) { + echo '-'; + } + } +} diff --git a/system/Classes/Worker/ManagerSession.php b/system/Classes/Worker/ManagerSession.php new file mode 100644 index 000000000..fe353d477 --- /dev/null +++ b/system/Classes/Worker/ManagerSession.php @@ -0,0 +1,54 @@ +id = $id; + $this->type = $type; + $this->uMode = $uMode; + } + + /** + * @return int + */ + public function getId() { + return $this->id; + } + + /** + * @return string + */ + public function getType() { + return $this->type; + } + + /** + * @return string + */ + public function getUMode() { + return $this->uMode; + } + + /** + * @return string + */ + public function toString() { + return + 'id = ' . $this->id . ', type = ' . $this->type . + ', uMode = ' . $this->uMode . ' ' + ; + } +} diff --git a/system/classes/container/Alert.class.php b/system/classes/container/Alert.class.php deleted file mode 100755 index fe1cd23c6..000000000 --- a/system/classes/container/Alert.class.php +++ /dev/null @@ -1,46 +0,0 @@ -alerts[] = array($message, $type); - return $this->size() - 1; - } - - public function clear() { - $this->alerts = array(); - } - - public function size() { - return count($this->alerts); - } - - public function get($position) { - if (isset($this->alerts[$position])) { - return $this->alerts[$position]; - } else { - return FALSE; - } - } - - public function getAlerts($tag, $type = ALERT_DEFAULT) { - $format = ''; - foreach ($this->alerts as $k) { - if ($type != ALERT_DEFAULT AND $type = $k[1]) { - $format .= '<' . $tag . ' class="alert_' . $k[1] . '">' . $k[0] . ''; - } - } - return $format; - } - - public function logAlerts($path, $date = TRUE, $supp = array()) { - # TODO - } - - public function readUrl() { - if (isset($_GET['say'])) { - $this->alerts[] = array($_GET['say'], ALERT_URL_INFO); - } - } -} -?> \ No newline at end of file diff --git a/system/classes/container/ArrayList.class.php b/system/classes/container/ArrayList.class.php deleted file mode 100755 index 4f7a086ad..000000000 --- a/system/classes/container/ArrayList.class.php +++ /dev/null @@ -1,49 +0,0 @@ -elements); - } - - public function get($key) { - if (isset($this->elements[$key])) { - return $this->elements[$key]; - } else { - return NULL; - } - } - - public function exist($key) { - if (isset($this->elements[$key])) { - return TRUE; - } else { - return FALSE; - } - } - - public function equal($key, $value) { - if ($this->exist($key) && $this->get($key) == $value) { - return TRUE; - } else { - return FALSE; - } - } - - public function add($key, $value) { - $this->elements[$key] = $value; - } - - public function remove($key) { - if (isset($this->elements[$key])) { - unset($this->elements[$key]); - } else { - return FALSE; - } - } - - public function clear() { - $this->elements = array(); - } -} -?> \ No newline at end of file diff --git a/system/classes/container/Cookie.class.php b/system/classes/container/Cookie.class.php deleted file mode 100755 index 1f6279161..000000000 --- a/system/classes/container/Cookie.class.php +++ /dev/null @@ -1,43 +0,0 @@ -name = APP_NAME . '_' . SERVER_SESS; - $this->init(); - } - - public function add($key, $value) { - $this->elements[$key] = $value; - $this->rewrite(); - } - - public function remove($key) { - if (isset($this->elements[$key])) { - unset($this->elements[$key]); - } else { - return FALSE; - } - $this->rewrite(); - } - - public function clear() { - $this->elements = array(); - $this->rewrite(); - } - - public function rewrite() { - setcookie($this->name, serialize($this->elements), time() + 3000000, '/'); - } - - public function init() { - if (isset($_COOKIE[$this->name])) { - $this->elements = unserialize($_COOKIE[$this->name]); - } - } -} -?> \ No newline at end of file diff --git a/system/classes/container/EventList.class.php b/system/classes/container/EventList.class.php deleted file mode 100755 index 7778169a5..000000000 --- a/system/classes/container/EventList.class.php +++ /dev/null @@ -1,86 +0,0 @@ -events); - } - - public function get($index = 0) { - if (isset($this->events[$index])) { - return $this->events[$index]; - } else { - return NULL; - } - } - - public function getPastEvents($date) { - $past = new StackList(); - foreach($this->events AS $e) { - if ($e->get('date') <= $date) { - $past->append($e); - } - } - return $past; - } - - public function clearPastEvents($date) { - $size = $this->size() - 1; - for ($i = $size; $i >= 0; $i--) { - if ($this->events[$i]->get('date') <= $date) { - $this->remove($i); - $i--; - } - } - } - - public function add($date, $eventType, $eventId, $eventInfo = NULL) { - $event = new ArrayList(); - $event->add('date', $date); - $event->add('eventType', $eventType); - $event->add('eventId', $eventId); - $event->add('eventInfo', $eventInfo); - - $index = 0; - if (self::size() == 0) { - $this->events[$index] = $event; - } else { - $found = FALSE; - foreach($this->events AS $e) { - if ($e->get('date') > $date) { - $found = TRUE; - break; - } - $index++; - } - if ($found) { - $begin = array_slice($this->events, 0, $index); - $begin[] = $event; - $end = array_slice($this->events, $index); - $this->events = array_merge($begin, $end); - } else { - $this->events[self::size()] = $event; - } - } - } - - public function remove($index) { - if ($index < 0) { - $index = count($this->events) + $index; - } - if (isset($this->events[$index])) { - $begin = array_slice($this->events, 0, $index); - $end = array_slice($this->events, $index+1); - $this->events = array_merge($begin, $end); - } else { - return FALSE; - } - } - - public function clear() { - $this->events = array(); - } -} -?> \ No newline at end of file diff --git a/system/classes/container/History.class.php b/system/classes/container/History.class.php deleted file mode 100755 index ae3bb7a9a..000000000 --- a/system/classes/container/History.class.php +++ /dev/null @@ -1,27 +0,0 @@ -events, $path); - if (count($this->events) > self::MAX_SIZE) { - $this->events = array_slice($this->events, 0, self::MAX_SIZE); - } - } - - public function getCurrentPath() { - return $this->events[0]; - } - - public function getPastPath($larger = 0) { - if (isset($this->events[$larger])) { - return $this->events[$larger]; - } - } - - public function clear() { - $this->events = array(); - } -} -?> \ No newline at end of file diff --git a/system/classes/container/Params.class.php b/system/classes/container/Params.class.php deleted file mode 100755 index 04b410f06..000000000 --- a/system/classes/container/Params.class.php +++ /dev/null @@ -1,41 +0,0 @@ - TRUE, - self::SHOW_MAP_MINIMAP => TRUE, - self::SHOW_MAP_RC => FALSE, - self::SHOW_MAP_ANTISPY => TRUE, - self::SHOW_MAP_FLEETOUT => TRUE, - self::SHOW_MAP_FLEETIN => TRUE, - self::SHOW_ATTACK_REPORT=> TRUE, - self::SHOW_REBEL_REPORT => TRUE, - self::REDIRECT_CHAT => FALSE, - ]; - - public static function check($params) { - return CTR::$cookie->exist('p' . $params) - ? (bool)CTR::$cookie->get('p' . $params) - : self::$params[$params]; - } - - public static function update($params, $value) { - if (in_array($params, self::$params)) { - CTR::$cookie->add('p' . $params, $value); - } - } - - public static function getParams() { - return self::$params; - } -} -?> \ No newline at end of file diff --git a/system/classes/container/Session.class.php b/system/classes/container/Session.class.php deleted file mode 100755 index 7c43b87e1..000000000 --- a/system/classes/container/Session.class.php +++ /dev/null @@ -1,88 +0,0 @@ -elements = NULL; - } - - public function clear() { - $this->remove('playerInfo', new ArrayList()); - $this->remove('playerBase', new ArrayList()); - $this->remove('playerEvent', new ArrayList()); - } - - ## - - public function initPlayerInfo() { - $this->add('playerInfo', new ArrayList()); - } - - public function initPlayerBase() { - $a = new ArrayList(); - $a->add('ob', new StackList()); - $a->add('ms', new StackList()); - - $this->add('playerBase', $a); - } - - public function initPlayerEvent() { - $this->add('playerEvent', new EventList()); - } - - public function initLastUpdate() { - $l = new ArrayList(); - $l->add('game', Utils::now()); - $l->add('event', Utils::now()); - - $this->add('lastUpdate', $l); - } - - public function initPlayerBonus() { - $this->add('playerBonus', new StackList()); - } - - ## - - public function addBase($key, $id, $name, $sector, $system, $img, $type) { - if ($this->exist('playerBase')) { - if ($key == 'ob' || $key == 'ms') { - $a = new ArrayList(); - - $a->add('id', $id); - $a->add('name', $name); - $a->add('sector', $sector); - $a->add('system', $system); - $a->add('img', $img); - $a->add('type', $type); - - $this->get('playerBase')->get($key)->append($a); - } else { - return FALSE; - } - } - } - - public function removeBase($key, $id) { - if ($this->exist('playerBase')) { - for ($i = 0; $i < $this->get('playerBase')->get($key)->size(); $i++) { - if ($this->get('playerBase')->get($key)->get($i)->get('id') == $id) { - $this->get('playerBase')->get($key)->remove($i); - } - } - } - } - - public function baseExist($id) { - for ($i = 0; $i < $this->get('playerBase')->get('ob')->size(); $i++) { - if ($id == $this->get('playerBase')->get('ob')->get($i)->get('id')) { - return TRUE; - } - } - for ($i = 0; $i < $this->get('playerBase')->get('ms')->size(); $i++) { - if ($id == $this->get('playerBase')->get('ms')->get($i)->get('id')) { - return TRUE; - } - } - return FALSE; - } -} -?> \ No newline at end of file diff --git a/system/classes/container/StackList.class.php b/system/classes/container/StackList.class.php deleted file mode 100755 index 6655138ba..000000000 --- a/system/classes/container/StackList.class.php +++ /dev/null @@ -1,74 +0,0 @@ -elements); - } - - public function get($index = 0) { - if (isset($this->elements[$index])) { - return $this->elements[$index]; - } else { - return NULL; - } - } - - public function exist($index) { - if (isset($this->elements[$index])) { - return TRUE; - } else { - return FALSE; - } - } - - public function add($key, $value) { - $this->elements[$key] = $value; - } - - public function increase($key, $value) { - if (isset($this->elements[$key])) { - $this->elements[$key] = $this->elements[$key] + $value; - } else { - $this->elements[$key] = $value; - } - } - - public function insert($key, $value) { - if (count($this->elements) < $key) { - $this->elements[$key] = $value; - } else { - // décalage des tous les index qui suivent - $begin = array_slice($this->elements, 0, $key); - $begin[] = $value; - $end = array_slice($this->elements, $key); - $this->elements = array_merge($begin, $end); - } - } - - public function append($value) { - $this->elements[] = $value; - } - - public function prepend($value) { - array_unshift($this->elements, $value); - } - - public function remove($index) { - if ($index < 0) { - $index = count($this->elements) + $index; - } - if (isset($this->elements[$index])) { - $begin = array_slice($this->elements, 0, $index); - $end = array_slice($this->elements, $index+1); - $this->elements = array_merge($begin, $end); - } else { - return FALSE; - } - } - - public function clear() { - $this->elements = array(); - } -} -?> \ No newline at end of file diff --git a/system/classes/loader.php b/system/classes/loader.php deleted file mode 100755 index d6a115f19..000000000 --- a/system/classes/loader.php +++ /dev/null @@ -1,37 +0,0 @@ - \ No newline at end of file diff --git a/system/classes/worker/Manager.class.php b/system/classes/worker/Manager.class.php deleted file mode 100755 index 71ca2c4f2..000000000 --- a/system/classes/worker/Manager.class.php +++ /dev/null @@ -1,206 +0,0 @@ -newSession(); - } - - public function newSession($uMode = ASM_UMODE) { - $this->statSessions++; - $this->statChangeSessions++; - - if (count($this->sessions) == 0) { - $session = new ManagerSession('_1', $this->managerType, ASM_UMODE); - } else { - $session = new ManagerSession('_' . (count($this->sessions) + 1), $this->managerType, $uMode); - } - - $this->currentSession = $session; - $this->sessions[] = $session; - - $this->objects[$session->getId()] = array(); - $this->origin[$session->getId()] = array(); - - return $session; - } - - public function changeSession(ManagerSession $session) { - $this->statChangeSessions++; - - if (in_array($session, $this->sessions) AND $session->getType() == $this->managerType) { - $this->currentSession = $session; - return TRUE; - } else { - return FALSE; - } - } - - public function getCurrentSession() { return $this->currentSession; } - public function getFirstSession() { return $this->sessions[0]; } - - // OBJECT MANAGER CORE - protected $objects = array(); - protected $origin = array(); - - public function get($i = 0) { - if (isset($this->objects[$this->currentSession->getId()][$i])) { - return $this->objects[$this->currentSession->getId()][$i]; - } else { - return FALSE; - } - } - - public function getById($id) { - foreach ($this->objects[$this->currentSession->getId()] AS $o) { - if ($o->getId() == $id) { - return $o; - } - } - return FALSE; - } - - public function getAll() { - return $this->objects[$this->currentSession->getId()]; - } - - public function size() { - return count($this->objects[$this->currentSession->getId()]); - } - - protected function _ObjectExist($object) { - foreach ($this->sessions AS $s) { - foreach ($this->origin[$s->getId()] as $k => $o) { - if ($o->getId() == $object->getId()) { - if ($s->getId() == $this->currentSession->getId()) { - return TRUE; - } else { - return $this->objects[$s->getId()][$k]; - } - } - } - } - return FALSE; - } - - protected function _Add($object) { - $element = $this->_ObjectExist($object); - - if ($element === FALSE) { - $this->statObject++; - $this->statRealObject++; - - $this->objects[$this->currentSession->getId()][] = $object; - $this->origin[$this->currentSession->getId()][] = clone($object); - return $object; - } elseif ($element === TRUE) { - $currentIdSession = $this->currentSession->getId(); - foreach ($this->origin[$currentIdSession] as $k => $o) { - if ($o == $object) { - return $this->objects[$currentIdSession][$k]; - } - } - return FALSE; - } else { - $this->statObject++; - $this->statReferenceObject++; - - $this->objects[$this->currentSession->getId()][] = $element; - $this->origin[$this->currentSession->getId()][] = $element; - return $element; - } - } - - protected function _Remove($id) { - foreach ($this->sessions as $session) { - foreach ($this->objects[$session->getId()] AS $k => $o) { - if ($o->getId() == $id) { - unset($this->objects[$session->getId()][$k]); - unset($this->origin[$session->getId()][$k]); - } - } - - $this->objects[$session->getId()] = array_values($this->objects[$session->getId()]); - $this->origin[$session->getId()] = array_values($this->origin[$session->getId()]); - - } - - return NULL; - } - - public function _Save() { - $savingList = array(); - if (!empty($this->objects)) { - foreach ($this->sessions AS $s) { - foreach ($this->objects[$s->getId()] AS $k => $o) { - if ($this->objects[$s->getId()][$k] != $this->origin[$s->getId()][$k]) { - $savingList[] = $o; - } - } - } $this->statSavingObject = count($savingList); - } - return $savingList; - } - - public function _EmptyCurrentSession() { - $currentSessionId = $this->currentSession->getId(); - foreach ($this->objects[$currentSessionId] as $k => $o) { - # code... - unset($this->objects[$currentSessionId][$k]); - unset($this->origin[$currentSessionId][$k]); - } - } - - // DEBUG & STATISTIC MANAGER CORE - protected $statObject = 0; - protected $statRealObject = 0; - protected $statReferenceObject = 0; - protected $statSavingObject = 0; - - protected $statSessions = 0; - protected $statChangeSessions = 0; - - public function saveStat($path) { - $ret = 'objet ' . $this->managerType . '
'; - $ret .= 'object : ' . $this->statObject . '
'; - $ret .= 'real object : ' . $this->statRealObject . '
'; - $ret .= 'ref object : ' . $this->statReferenceObject . '
'; - $ret .= 'saving object : ' . $this->statSavingObject . '
'; - - $ret .= 'sessions : ' . $this->statSessions . '
'; - $ret .= 'change sessions : ' . $this->statChangeSessions . '
'; - $ret .= '-----------------------------------------------------
'; - Bug::writeLog($path, $ret); - } - - public function showStat() { - $ret = 'objet ' . $this->managerType . '
'; - $ret .= 'object : ' . $this->statObject . '
'; - $ret .= 'real object : ' . $this->statRealObject . '
'; - $ret .= 'ref object : ' . $this->statReferenceObject . '
'; - $ret .= 'saving object : ' . $this->statSavingObject . '
'; - - $ret .= 'sessions : ' . $this->statSessions . '
'; - $ret .= 'change sessions : ' . $this->statChangeSessions . '
'; - $ret .= '-----------------------------------------------------
'; - echo $ret; - } - - public function show($flag = 1) { - if ($flag == 1) { - var_dump($this->objects); - } elseif ($flag == 2) { - var_dump($this->origin); - } else { - var_dump($this->objects); - var_dump($this->origin); - } - for ($i = 0; $i < 200; $i++) { - echo '-'; - } - } -} -?> \ No newline at end of file diff --git a/system/classes/worker/ManagerSession.class.php b/system/classes/worker/ManagerSession.class.php deleted file mode 100755 index 07ff5d841..000000000 --- a/system/classes/worker/ManagerSession.class.php +++ /dev/null @@ -1,20 +0,0 @@ -id = $id; - $this->type = $type; - $this->uMode = $uMode; - } - - public function getId() { return $this->id; } - public function getType() { return $this->type; } - public function getUMode() { return $this->uMode; } - - public function toString() { return 'id = ' . $this->id . ', type = ' . $this->type . - ', uMode = ' . $this->uMode . ' ';} -} -?> \ No newline at end of file From 07cce868c07d71f24d3748b8ebcd948bff43dd2b Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sun, 23 Oct 2016 00:18:36 +0200 Subject: [PATCH 12/64] Refactor Ares module architecture --- .../Ares/FightController.php} | 8 +- .../Modules/Ares/Manager/CommanderManager.php | 342 +++++++++++++++++ .../Ares/Manager/LittleReportManager.php} | 17 +- .../Ares/Manager/ReportManager.php} | 20 +- .../Ares/Model/Commander.php} | 16 +- .../Ares/Model/LiveReport.php} | 2 + .../Ares/Model/Report.php} | 4 + .../Ares/Model/Ship.php} | 5 + .../Ares/Model/Squadron.php} | 360 +++++++++--------- .../Ares/Resource}/CommanderResources.php | 5 +- .../ares => Modules/Ares}/main.conf.php | 0 system/Modules/Ares/main.php | 5 + .../ares/class/CommanderManager.class.php | 334 ---------------- system/modules/ares/main.php | 20 - 14 files changed, 590 insertions(+), 548 deletions(-) rename system/{modules/ares/class/FightController.class.php => Modules/Ares/FightController.php} (98%) mode change 100755 => 100644 create mode 100644 system/Modules/Ares/Manager/CommanderManager.php rename system/{modules/ares/class/LittleReportManager.class.php => Modules/Ares/Manager/LittleReportManager.php} (93%) mode change 100755 => 100644 rename system/{modules/ares/class/ReportManager.class.php => Modules/Ares/Manager/ReportManager.php} (96%) mode change 100755 => 100644 rename system/{modules/ares/class/Commander.class.php => Modules/Ares/Model/Commander.php} (98%) mode change 100755 => 100644 rename system/{modules/ares/class/LiveReport.class.php => Modules/Ares/Model/LiveReport.php} (97%) mode change 100755 => 100644 rename system/{modules/ares/class/Report.class.php => Modules/Ares/Model/Report.php} (98%) mode change 100755 => 100644 rename system/{modules/ares/class/Ship.class.php => Modules/Ares/Model/Ship.php} (96%) mode change 100755 => 100644 rename system/{modules/ares/class/Squadron.class.php => Modules/Ares/Model/Squadron.php} (96%) mode change 100755 => 100644 rename system/{modules/ares/resource => Modules/Ares/Resource}/CommanderResources.php (96%) rename system/{modules/ares => Modules/Ares}/main.conf.php (100%) create mode 100755 system/Modules/Ares/main.php delete mode 100755 system/modules/ares/class/CommanderManager.class.php delete mode 100755 system/modules/ares/main.php diff --git a/system/modules/ares/class/FightController.class.php b/system/Modules/Ares/FightController.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/ares/class/FightController.class.php rename to system/Modules/Ares/FightController.php index 95c933361..5815bf4c5 --- a/system/modules/ares/class/FightController.class.php +++ b/system/Modules/Ares/FightController.php @@ -9,6 +9,11 @@ * @package Arès * @update 14.02.14 */ +namespace Asylamba\Modules\Ares; + +use Asylamba\Modules\Ares\Model\LiveReport; +use Asylamba\Classes\Library\DataAnalysis; +use Asylamba\Modules\Athena\Resource\ShipResource; class FightController { private $isAFight = FALSE; @@ -365,5 +370,4 @@ public function startFight($commanderA, $playerA, $commanderD, $playerD = NULL) } return array($commanderA, $commanderD); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/Modules/Ares/Manager/CommanderManager.php b/system/Modules/Ares/Manager/CommanderManager.php new file mode 100644 index 000000000..38eb56340 --- /dev/null +++ b/system/Modules/Ares/Manager/CommanderManager.php @@ -0,0 +1,342 @@ +prepare('SELECT c.*, + o.iSchool, o.name AS oName, + p.name AS pName, + p.rColor AS pColor, + pd.population AS destinationPlacePop, + ps.population AS startPlacePop, + dp.name AS dpName, + sp.name AS spName, + sq.id AS sqId, + sq.ship0 AS sqShip0, + sq.ship1 AS sqShip1, + sq.ship2 AS sqShip2, + sq.ship3 AS sqShip3, + sq.ship4 AS sqShip4, + sq.ship5 AS sqShip5, + sq.ship6 AS sqShip6, + sq.ship7 AS sqShip7, + sq.ship8 AS sqShip8, + sq.ship9 AS sqShip9, + sq.ship10 AS sqShip10, + sq.ship11 AS sqShip11, + sq.dCreation AS sqDCreation, + sq.DLastModification AS sqDLastModification + FROM commander AS c + LEFT JOIN orbitalBase AS o + ON o.rPlace = c.rBase + LEFT JOIN player AS p + ON p.id = c.rPlayer + LEFT JOIN orbitalBase AS dp + ON dp.rPlace = c.rDestinationPlace + LEFT JOIN place AS pd + ON pd.id = c.rDestinationPlace + LEFT JOIN orbitalBase AS sp + ON sp.rPlace = c.rStartPlace + LEFT JOIN place AS ps + ON ps.id = c.rStartPlace + LEFT JOIN squadron AS sq + ON sq.rCommander = c.id + ' . $formatWhere .' + ' . $formatOrder .' + ' . $formatLimit + ); + + foreach($where AS $v) { + if (is_array($v)) { + foreach ($v as $p) { + $valuesArray[] = $p; + } + } else { + $valuesArray[] = $v; + } + } + + if (empty($valuesArray)) { + $qr->execute(); + } else { + $qr->execute($valuesArray); + } + + $awCommanders = $qr->fetchAll(); + $qr->closeCursor(); + + if (count($awCommanders) > 0) { + for ($i = 0; $i < count($awCommanders); $i++) { + if ($i == 0 || $awCommanders[$i]['id'] != $awCommanders[$i - 1]['id']) { + $commander = new Commander(); + + $commander->id = $awCommanders[$i]['id']; + $commander->name = $awCommanders[$i]['name']; + $commander->avatar = $awCommanders[$i]['avatar']; + $commander->rPlayer = $awCommanders[$i]['rPlayer']; + $commander->playerName = $awCommanders[$i]['pName']; + $commander->playerColor = $awCommanders[$i]['pColor']; + $commander->rBase = $awCommanders[$i]['rBase']; + $commander->comment = $awCommanders[$i]['comment']; + $commander->sexe = $awCommanders[$i]['sexe']; + $commander->age = $awCommanders[$i]['age']; + $commander->level = $awCommanders[$i]['level']; + $commander->experience = $awCommanders[$i]['experience']; + $commander->uCommander = $awCommanders[$i]['uCommander']; + $commander->palmares = $awCommanders[$i]['palmares']; + $commander->statement = $awCommanders[$i]['statement']; + $commander->line = $awCommanders[$i]['line']; + $commander->dCreation = $awCommanders[$i]['dCreation']; + $commander->dAffectation = $awCommanders[$i]['dAffectation']; + $commander->dDeath = $awCommanders[$i]['dDeath']; + $commander->oBName = $awCommanders[$i]['oName']; + + $commander->dStart = $awCommanders[$i]['dStart']; + $commander->dArrival = $awCommanders[$i]['dArrival']; + $commander->resources = $awCommanders[$i]['resources']; + $commander->travelType = $awCommanders[$i]['travelType']; + $commander->travelLength = $awCommanders[$i]['travelLength']; + $commander->rStartPlace = $awCommanders[$i]['rStartPlace']; + $commander->rDestinationPlace = $awCommanders[$i]['rDestinationPlace']; + + $commander->startPlaceName = ($awCommanders[$i]['spName'] == '') ? 'planète rebelle' : $awCommanders[$i]['spName']; + $commander->destinationPlaceName = ($awCommanders[$i]['dpName'] == '') ? 'planète rebelle' : $awCommanders[$i]['dpName']; + $commander->destinationPlacePop = $awCommanders[$i]['destinationPlacePop']; + $commander->startPlacePop = $awCommanders[$i]['startPlacePop']; + } + + $commander->squadronsIds[] = $awCommanders[$i]['sqId']; + + $commander->armyInBegin[] = array( + $awCommanders[$i]['sqShip0'], + $awCommanders[$i]['sqShip1'], + $awCommanders[$i]['sqShip2'], + $awCommanders[$i]['sqShip3'], + $awCommanders[$i]['sqShip4'], + $awCommanders[$i]['sqShip5'], + $awCommanders[$i]['sqShip6'], + $awCommanders[$i]['sqShip7'], + $awCommanders[$i]['sqShip8'], + $awCommanders[$i]['sqShip9'], + $awCommanders[$i]['sqShip10'], + $awCommanders[$i]['sqShip11'], + $awCommanders[$i]['sqDCreation'], + $awCommanders[$i]['sqDLastModification']); + + if ($i == count($awCommanders) - 1 || $awCommanders[$i]['id'] != $awCommanders[$i + 1]['id']) { + $currentCommander = $this->_Add($commander); + + if ($this->currentSession->getUMode()) { + $currentCommander->uCommander(); + } + } + } + } + } + + public function emptySession() { + # empty the session, for player rankings + $this->_EmptyCurrentSession(); + $this->newSession(FALSE); + } + + //inscrit un nouveau commandant en bdd + public function add($newCommander) { + $db = Database::getInstance(); + $qr = 'INSERT INTO commander + SET + name = ?, + avatar = ?, + rPlayer = ?, + rBase = ?, + sexe = ?, + age = ?, + level = ?, + experience = ?, + uCommander = ?, + statement = ?, + dCreation = ?'; + $qr = $db->prepare($qr); + $aw = $qr->execute(array( + $newCommander->name, + $newCommander->avatar, + $newCommander->rPlayer, + $newCommander->rBase, + $newCommander->sexe, + $newCommander->age, + $newCommander->level, + $newCommander->experience, + Utils::now(), + $newCommander->statement, + $newCommander->dCreation, + )); + $newCommander->setId($db->lastInsertId()); + + $nbrSquadrons = $newCommander->getLevel(); + $maxId = $db->lastInsertId(); + $qr2 = 'INSERT INTO + squadron(rCommander, dCreation) + VALUES(?, NOW())'; + $qr2 = $db->prepare($qr2); + + for ($i = 0; $i < $nbrSquadrons; $i++) { + $aw2 = $qr2->execute(array($maxId)); + } + + $lastSquadronId = $db->lastInsertId(); + for ($i = 0; $i < count($newCommander->getArmy()); $i++) { + $newCommander->getSquadron[$i]->setId($lastSquadronId); + $lastSquadronId--; + } + + $this->_Add($newCommander); + } + + //réécrit la base de donnée (à l'issue d'un combat par exemple) + public function save() { + $commanders = $this->_Save(); + foreach ($commanders AS $k => $commander) { + $db = Database::getInstance(); + $qr = 'UPDATE commander + SET + name = ?, + avatar = ?, + rPlayer = ?, + rBase = ?, + comment = ?, + sexe = ?, + age = ?, + level = ?, + experience = ?, + uCommander = ?, + palmares = ?, + statement = ?, + `line` = ?, + dStart = ?, + dArrival = ?, + resources = ?, + travelType = ?, + travelLength = ?, + rStartPlace = ?, + rDestinationPlace = ?, + dCreation = ?, + dAffectation = ?, + dDeath = ? + + WHERE id = ?'; + + $qr = $db->prepare($qr); + //uper les commandants + $qr->execute(array( + $commander->name, + $commander->avatar, + $commander->rPlayer, + $commander->rBase, + $commander->comment, + $commander->sexe, + $commander->age, + $commander->level, + $commander->experience, + $commander->uCommander, + $commander->palmares, + $commander->statement, + $commander->line, + $commander->dStart, + $commander->dArrival, + $commander->resources, + $commander->travelType, + $commander->travelLength, + $commander->rStartPlace, + $commander->rDestinationPlace, + $commander->dCreation, + $commander->dAffectation, + $commander->dDeath, + $commander->id)); + + $qr = 'UPDATE squadron SET + rCommander = ?, + ship0 = ?, + ship1 = ?, + ship2 = ?, + ship3 = ?, + ship4 = ?, + ship5 = ?, + ship6 = ?, + ship7 = ?, + ship8 = ?, + ship9 = ?, + ship10 = ?, + ship11 = ?, + DLAstModification = NOW() + WHERE id = ?'; + + $qr = $db->prepare($qr); + $army = $commander->getArmy(); + + foreach ($army AS $squadron) { + //uper les escadrilles + $qr->execute(array( + $squadron->getRCommander(), + $squadron->getNbrShipByType(0), + $squadron->getNbrShipByType(1), + $squadron->getNbrShipByType(2), + $squadron->getNbrShipByType(3), + $squadron->getNbrShipByType(4), + $squadron->getNbrShipByType(5), + $squadron->getNbrShipByType(6), + $squadron->getNbrShipByType(7), + $squadron->getNbrShipByType(8), + $squadron->getNbrShipByType(9), + $squadron->getNbrShipByType(10), + $squadron->getNbrShipByType(11), + $squadron->getId() + )); + } + if ($commander->getLevel() > $commander->getSizeArmy()) { + //on créé une nouvelle squadron avec rCommander correspondant + $nbrSquadronToCreate = $commander->getLevel() - $commander->getSizeArmy(); + $qr = 'INSERT INTO + squadron (rCommander, dCreation) + VALUES (' . $commander->getId() . ', NOW())'; + $i = 1; + while ($i < $nbrSquadronToCreate) { + $qr .= ',(' . $commander->getId() . ', NOW())'; + $i++; + } + $qr = $db->prepare($qr); + $qr->execute(); + } + } + $this->isUpdate = TRUE; + } + + public function setCommander($commander) { + $this->objects['' . $commander->getId() .''] = $commander; + } +} diff --git a/system/modules/ares/class/LittleReportManager.class.php b/system/Modules/Ares/Manager/LittleReportManager.php old mode 100755 new mode 100644 similarity index 93% rename from system/modules/ares/class/LittleReportManager.class.php rename to system/Modules/Ares/Manager/LittleReportManager.php index 5aab23a37..350bb6055 --- a/system/modules/ares/class/LittleReportManager.class.php +++ b/system/Modules/Ares/Manager/LittleReportManager.php @@ -10,6 +10,14 @@ * @update 12.07.13 */ +namespace Asylamba\Modules\Ares\Manager; + +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\Manager; + +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Ares\Model\Report; + class LittleReportManager extends Manager { protected $managerType ='_LittleReport'; @@ -18,7 +26,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT r.*, p1.rColor AS colorA, p2.rColor AS colorD, @@ -55,7 +63,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function loadByRequest($request, $params) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT r.*, p1.rColor AS colorA, p2.rColor AS colorD, @@ -121,7 +129,7 @@ protected function fill($qr) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $reports = $this->_Save(); foreach ($reports as $report) { @@ -185,5 +193,4 @@ public function save() { ); } } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/ares/class/ReportManager.class.php b/system/Modules/Ares/Manager/ReportManager.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/ares/class/ReportManager.class.php rename to system/Modules/Ares/Manager/ReportManager.php index 4b44b9cc2..e427cb3bc --- a/system/modules/ares/class/ReportManager.class.php +++ b/system/Modules/Ares/Manager/ReportManager.php @@ -10,6 +10,15 @@ * @update 12.07.13 */ +namespace Asylamba\Modules\Ares\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; + +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Ares\Model\Report; + class ReportManager extends Manager { protected $managerType ='_Report'; @@ -18,7 +27,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT r.*, sq.id AS sqId, sq.position AS sqPosition, @@ -136,7 +145,7 @@ public function loadOnlyReport($where = array(), $order = array(), $limit = arra $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT r.* FROM report AS r ' . $formatWhere .' @@ -204,7 +213,7 @@ public function loadOnlyReport($where = array(), $order = array(), $limit = arra } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $reports = $this->_Save(); foreach ($reports as $report) { @@ -286,7 +295,7 @@ public function emptySession() { } public function add($newReport) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO report SET rPlayerAttacker = ?, @@ -377,5 +386,4 @@ public function add($newReport) { $this->_Add($newReport); return $newReport->id; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/ares/class/Commander.class.php b/system/Modules/Ares/Model/Commander.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/ares/class/Commander.class.php rename to system/Modules/Ares/Model/Commander.php index af7ef8dbe..989fec091 --- a/system/modules/ares/class/Commander.class.php +++ b/system/Modules/Ares/Model/Commander.php @@ -10,6 +10,19 @@ * @update 13.02.14_ */ +namespace Asylamba\Modules\Ares\Model; + +use Asylamba\Modules\Athena\Resource\ShipResource; + +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Container\ArrayList; + +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTC; + +use Asylamba\Modules\Zeus\Model\PlayerBonus; + class Commander { const COEFFSCHOOL = 100; const COEFFEARNEDEXP = 50; @@ -543,5 +556,4 @@ public function uCommander() { CTC::applyContext($token); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/ares/class/LiveReport.class.php b/system/Modules/Ares/Model/LiveReport.php old mode 100755 new mode 100644 similarity index 97% rename from system/modules/ares/class/LiveReport.class.php rename to system/Modules/Ares/Model/LiveReport.php index 7543cf5ad..db8dfdd34 --- a/system/modules/ares/class/LiveReport.class.php +++ b/system/Modules/Ares/Model/LiveReport.php @@ -10,6 +10,8 @@ * @update 01.06.14 */ +namespace Asylamba\Modules\Ares\Model; + class LiveReport { public static $squadrons = array(); public static $halfround = 0; diff --git a/system/modules/ares/class/Report.class.php b/system/Modules/Ares/Model/Report.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/ares/class/Report.class.php rename to system/Modules/Ares/Model/Report.php index 8f7ae84d8..f010992c8 --- a/system/modules/ares/class/Report.class.php +++ b/system/Modules/Ares/Model/Report.php @@ -19,6 +19,10 @@ nbr victoires */ +namespace Asylamba\Modules\Ares\Model; + +use Asylamba\Modules\Athena\Resource\ShipResource; + class Report { const STANDARD = 0; const ARCHIVED = 1; diff --git a/system/modules/ares/class/Ship.class.php b/system/Modules/Ares/Model/Ship.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/ares/class/Ship.class.php rename to system/Modules/Ares/Model/Ship.php index 405f73845..86b3fda1a --- a/system/modules/ares/class/Ship.class.php +++ b/system/Modules/Ares/Model/Ship.php @@ -12,6 +12,11 @@ include_once ATHENA; +namespace Asylamba\Modules\Ares\Model; + +use Asylamba\Modules\Athena\Resource\ShipResource; +use Asylamba\Modules\Zeus\Model\PlayerBonus; + class Ship { public $id = 0; diff --git a/system/modules/ares/class/Squadron.class.php b/system/Modules/Ares/Model/Squadron.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/ares/class/Squadron.class.php rename to system/Modules/Ares/Model/Squadron.php index 79149fbc9..628f20e07 --- a/system/modules/ares/class/Squadron.class.php +++ b/system/Modules/Ares/Model/Squadron.php @@ -1,177 +1,183 @@ -id; } - public function getLineCoord() { return $this->lineCoord; } - public function getNbrShips() { return $this->nbrShips; } - public function getRCommander() { return $this->rCommander; } - public function getPosition() { return $this->position; } - public function getSquadron() { return $this->squadron; } - public function getArrayOfShips() { return $this->arrayOfShips; } - public function getDLastModification() { return $this->dLAstModification; } - - public function getShip($key) { return $this->squadron[$key]; } - public function getNbrShipByType($i) { return $this->arrayOfShips[$i]; } - - public function getPev() { - $pev = 0; - foreach ($this->squadron AS $ship) { - $pev += $ship->getPev(); - } - return $pev; - } - - private function getPv() { - $pv = 0; - foreach ($this->squadron as $ship) { - $pv += $ship->getLife(); - } - return $pv; - } - - private function howManyLostPv($squadron1, $squadron2) { - $lostPv = abs($squadron1->getPv() - $squadron2->getPv()); - return $lostPv; - } - - public function setId($id) { $this->id = $id; } - - public function isEmpty() { - if ($this->getPev() == 0) { - return TRUE; - } else { - return FALSE; - } - } - - public function setRelId($id) { $this->relId = $id; } - - public function __construct($vector, $id, $lineCoord, $position, $rCommander, $isAttacker = NULL) { - for($i = 0; $i < 12; $i++) { - $this->arrayOfShips[] = $vector[$i]; - } - - $this->dLastModification = $vector[12]; - $this->lineCoord = $lineCoord; - $this->id = $id; - $this->rCommander = $rCommander; - $this->position = $position; - - for($i = 0; $i < 12; $i++) { - for ($j = 0; $j < $vector[$i]; $j++) { - $this->squadron[] = new Ship($i, $isAttacker); - $this->squadron[$this->nbrShips]->affectId($this->nbrShips); - $this->nbrShips++; - } - } - } - - public function updateShip($shipNbrName, $nbr) { - $this->arrayOfShips[$shipNbrName] += $nbr; - } - - public function emptySquadron() { - for ($i = 0; $i < 12; $i++) { - $this->arrayOfShips[$i] = 0; - } - } - - # méthodes de combat - public function engage($enemyCommander, $position, $idCommander, $nameCommander, $thisCommander) { - $this->relId = $this->chooseEnemy($enemyCommander); - if ($this->relId !== NULL) { - - $thisSquadronBefore = $this; - $enemySquadron = $enemyCommander->getSquadron($this->relId); - - LiveReport::$littleRound++; - $this->fight($enemyCommander->getSquadron($this->relId)); - LiveReport::$squadrons[] = array(0, $this->position, 0, LiveReport::$littleRound, $this->rCommander, $this->arrayOfShips[0], $this->arrayOfShips[1], $this->arrayOfShips[2], $this->arrayOfShips[3], $this->arrayOfShips[4], $this->arrayOfShips[5], $this->arrayOfShips[6], $this->arrayOfShips[7], $this->arrayOfShips[8], $this->arrayOfShips[9], $this->arrayOfShips[10], $this->arrayOfShips[11]); - LiveReport::$squadrons[] = array(0, $enemySquadron->position, 0, LiveReport::$littleRound, $enemySquadron->rCommander, $enemySquadron->arrayOfShips[0], $enemySquadron->arrayOfShips[1], $enemySquadron->arrayOfShips[2], $enemySquadron->arrayOfShips[3], $enemySquadron->arrayOfShips[4], $enemySquadron->arrayOfShips[5], $enemySquadron->arrayOfShips[6], $enemySquadron->arrayOfShips[7], $enemySquadron->arrayOfShips[8], $enemySquadron->arrayOfShips[9], $enemySquadron->arrayOfShips[10], $enemySquadron->arrayOfShips[11]); - - $enemyCommander->getSquadron($this->relId)->setRelId($this->position); - $enemyCommander->getSquadron($this->relId)->fight($thisCommander->getSquadron($this->position)); - } - return $enemyCommander; - } - - private function chooseEnemy($enemyCommander) { - $nbrShipsInLine = 0; - foreach ($enemyCommander->getArmy() as $enemySquadron) { - if ($enemySquadron->getLineCoord() * 3 <= FightController::getCurrentLine()) { - $nbrShipsInLine += $enemySquadron->getNbrShips(); - } - } - if ($nbrShipsInLine == 0) { - return NULL; - } elseif ($this->relId != NULL AND $enemyCommander->getSquadron($this->relId)->getNbrShips() > 0) { - return $this->relId; - } else { - $aleaNbr = rand(0, count($enemyCommander->squadronsIds) - 1); - for($i = 0; $i < $enemyCommander->getLevel(); $i++) { - if ($enemyCommander->getSquadron($aleaNbr)->getLineCoord() * 3 <= FightController::getCurrentLine() AND $enemyCommander->getSquadron($aleaNbr)->getNbrShips() > 0) { - break; - } else { - if ($aleaNbr == count($enemyCommander->squadronsIds) - 1) { - $aleaNbr = 0; - } else { - $aleaNbr++; - } - } - } - return $aleaNbr; - } - } - - public function fight($enemySquadron) { - foreach ($this->squadron as $ship) { - if ($enemySquadron->getNbrShips() == 0) { - break; - } - $enemySquadron = $ship->engage($enemySquadron); - } - } - - public function destructShip($key) { - $this->deleteOffset($this->squadron[$key]->getNbrName()); - - $this->squadron[$key] = NULL; - $newSquadron = array(); - foreach ($this->squadron as $offset) { - if ($offset != NULL) { - $newSquadron[] = $offset; - } - } - $this->squadron = $newSquadron; - } - - private function deleteOffset($i) { - $this->arrayOfShips[$i]--; - $this->nbrShips--; - } -} -?> \ No newline at end of file +id; } + public function getLineCoord() { return $this->lineCoord; } + public function getNbrShips() { return $this->nbrShips; } + public function getRCommander() { return $this->rCommander; } + public function getPosition() { return $this->position; } + public function getSquadron() { return $this->squadron; } + public function getArrayOfShips() { return $this->arrayOfShips; } + public function getDLastModification() { return $this->dLAstModification; } + + public function getShip($key) { return $this->squadron[$key]; } + public function getNbrShipByType($i) { return $this->arrayOfShips[$i]; } + + public function getPev() { + $pev = 0; + foreach ($this->squadron AS $ship) { + $pev += $ship->getPev(); + } + return $pev; + } + + private function getPv() { + $pv = 0; + foreach ($this->squadron as $ship) { + $pv += $ship->getLife(); + } + return $pv; + } + + private function howManyLostPv($squadron1, $squadron2) { + $lostPv = abs($squadron1->getPv() - $squadron2->getPv()); + return $lostPv; + } + + public function setId($id) { $this->id = $id; } + + public function isEmpty() { + if ($this->getPev() == 0) { + return TRUE; + } else { + return FALSE; + } + } + + public function setRelId($id) { $this->relId = $id; } + + public function __construct($vector, $id, $lineCoord, $position, $rCommander, $isAttacker = NULL) { + for($i = 0; $i < 12; $i++) { + $this->arrayOfShips[] = $vector[$i]; + } + + $this->dLastModification = $vector[12]; + $this->lineCoord = $lineCoord; + $this->id = $id; + $this->rCommander = $rCommander; + $this->position = $position; + + for($i = 0; $i < 12; $i++) { + for ($j = 0; $j < $vector[$i]; $j++) { + $this->squadron[] = new Ship($i, $isAttacker); + $this->squadron[$this->nbrShips]->affectId($this->nbrShips); + $this->nbrShips++; + } + } + } + + public function updateShip($shipNbrName, $nbr) { + $this->arrayOfShips[$shipNbrName] += $nbr; + } + + public function emptySquadron() { + for ($i = 0; $i < 12; $i++) { + $this->arrayOfShips[$i] = 0; + } + } + + # méthodes de combat + public function engage($enemyCommander, $position, $idCommander, $nameCommander, $thisCommander) { + $this->relId = $this->chooseEnemy($enemyCommander); + if ($this->relId !== NULL) { + + $thisSquadronBefore = $this; + $enemySquadron = $enemyCommander->getSquadron($this->relId); + + LiveReport::$littleRound++; + $this->fight($enemyCommander->getSquadron($this->relId)); + LiveReport::$squadrons[] = array(0, $this->position, 0, LiveReport::$littleRound, $this->rCommander, $this->arrayOfShips[0], $this->arrayOfShips[1], $this->arrayOfShips[2], $this->arrayOfShips[3], $this->arrayOfShips[4], $this->arrayOfShips[5], $this->arrayOfShips[6], $this->arrayOfShips[7], $this->arrayOfShips[8], $this->arrayOfShips[9], $this->arrayOfShips[10], $this->arrayOfShips[11]); + LiveReport::$squadrons[] = array(0, $enemySquadron->position, 0, LiveReport::$littleRound, $enemySquadron->rCommander, $enemySquadron->arrayOfShips[0], $enemySquadron->arrayOfShips[1], $enemySquadron->arrayOfShips[2], $enemySquadron->arrayOfShips[3], $enemySquadron->arrayOfShips[4], $enemySquadron->arrayOfShips[5], $enemySquadron->arrayOfShips[6], $enemySquadron->arrayOfShips[7], $enemySquadron->arrayOfShips[8], $enemySquadron->arrayOfShips[9], $enemySquadron->arrayOfShips[10], $enemySquadron->arrayOfShips[11]); + + $enemyCommander->getSquadron($this->relId)->setRelId($this->position); + $enemyCommander->getSquadron($this->relId)->fight($thisCommander->getSquadron($this->position)); + } + return $enemyCommander; + } + + private function chooseEnemy($enemyCommander) { + $nbrShipsInLine = 0; + foreach ($enemyCommander->getArmy() as $enemySquadron) { + if ($enemySquadron->getLineCoord() * 3 <= FightController::getCurrentLine()) { + $nbrShipsInLine += $enemySquadron->getNbrShips(); + } + } + if ($nbrShipsInLine == 0) { + return NULL; + } elseif ($this->relId != NULL AND $enemyCommander->getSquadron($this->relId)->getNbrShips() > 0) { + return $this->relId; + } else { + $aleaNbr = rand(0, count($enemyCommander->squadronsIds) - 1); + for($i = 0; $i < $enemyCommander->getLevel(); $i++) { + if ($enemyCommander->getSquadron($aleaNbr)->getLineCoord() * 3 <= FightController::getCurrentLine() AND $enemyCommander->getSquadron($aleaNbr)->getNbrShips() > 0) { + break; + } else { + if ($aleaNbr == count($enemyCommander->squadronsIds) - 1) { + $aleaNbr = 0; + } else { + $aleaNbr++; + } + } + } + return $aleaNbr; + } + } + + public function fight($enemySquadron) { + foreach ($this->squadron as $ship) { + if ($enemySquadron->getNbrShips() == 0) { + break; + } + $enemySquadron = $ship->engage($enemySquadron); + } + } + + public function destructShip($key) { + $this->deleteOffset($this->squadron[$key]->getNbrName()); + + $this->squadron[$key] = NULL; + $newSquadron = array(); + foreach ($this->squadron as $offset) { + if ($offset != NULL) { + $newSquadron[] = $offset; + } + } + $this->squadron = $newSquadron; + } + + private function deleteOffset($i) { + $this->arrayOfShips[$i]--; + $this->nbrShips--; + } +} \ No newline at end of file diff --git a/system/modules/ares/resource/CommanderResources.php b/system/Modules/Ares/Resource/CommanderResources.php similarity index 96% rename from system/modules/ares/resource/CommanderResources.php rename to system/Modules/Ares/Resource/CommanderResources.php index b5aaec74a..a264c417c 100755 --- a/system/modules/ares/resource/CommanderResources.php +++ b/system/Modules/Ares/Resource/CommanderResources.php @@ -10,6 +10,8 @@ * @update 04.03.2014 */ +namespace Asylamba\Modules\Ares\Resource; + class CommanderResources { private static $commanders = array( array( @@ -89,5 +91,4 @@ public static function getInfo($level, $info) { public static function size() { return count(self::$commanders); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/ares/main.conf.php b/system/Modules/Ares/main.conf.php similarity index 100% rename from system/modules/ares/main.conf.php rename to system/Modules/Ares/main.conf.php diff --git a/system/Modules/Ares/main.php b/system/Modules/Ares/main.php new file mode 100755 index 000000000..c183e69c3 --- /dev/null +++ b/system/Modules/Ares/main.php @@ -0,0 +1,5 @@ +prepare('SELECT c.*, - o.iSchool, o.name AS oName, - p.name AS pName, - p.rColor AS pColor, - pd.population AS destinationPlacePop, - ps.population AS startPlacePop, - dp.name AS dpName, - sp.name AS spName, - sq.id AS sqId, - sq.ship0 AS sqShip0, - sq.ship1 AS sqShip1, - sq.ship2 AS sqShip2, - sq.ship3 AS sqShip3, - sq.ship4 AS sqShip4, - sq.ship5 AS sqShip5, - sq.ship6 AS sqShip6, - sq.ship7 AS sqShip7, - sq.ship8 AS sqShip8, - sq.ship9 AS sqShip9, - sq.ship10 AS sqShip10, - sq.ship11 AS sqShip11, - sq.dCreation AS sqDCreation, - sq.DLastModification AS sqDLastModification - FROM commander AS c - LEFT JOIN orbitalBase AS o - ON o.rPlace = c.rBase - LEFT JOIN player AS p - ON p.id = c.rPlayer - LEFT JOIN orbitalBase AS dp - ON dp.rPlace = c.rDestinationPlace - LEFT JOIN place AS pd - ON pd.id = c.rDestinationPlace - LEFT JOIN orbitalBase AS sp - ON sp.rPlace = c.rStartPlace - LEFT JOIN place AS ps - ON ps.id = c.rStartPlace - LEFT JOIN squadron AS sq - ON sq.rCommander = c.id - ' . $formatWhere .' - ' . $formatOrder .' - ' . $formatLimit - ); - - foreach($where AS $v) { - if (is_array($v)) { - foreach ($v as $p) { - $valuesArray[] = $p; - } - } else { - $valuesArray[] = $v; - } - } - - if (empty($valuesArray)) { - $qr->execute(); - } else { - $qr->execute($valuesArray); - } - - $awCommanders = $qr->fetchAll(); - $qr->closeCursor(); - - if (count($awCommanders) > 0) { - for ($i = 0; $i < count($awCommanders); $i++) { - if ($i == 0 || $awCommanders[$i]['id'] != $awCommanders[$i - 1]['id']) { - $commander = new Commander(); - - $commander->id = $awCommanders[$i]['id']; - $commander->name = $awCommanders[$i]['name']; - $commander->avatar = $awCommanders[$i]['avatar']; - $commander->rPlayer = $awCommanders[$i]['rPlayer']; - $commander->playerName = $awCommanders[$i]['pName']; - $commander->playerColor = $awCommanders[$i]['pColor']; - $commander->rBase = $awCommanders[$i]['rBase']; - $commander->comment = $awCommanders[$i]['comment']; - $commander->sexe = $awCommanders[$i]['sexe']; - $commander->age = $awCommanders[$i]['age']; - $commander->level = $awCommanders[$i]['level']; - $commander->experience = $awCommanders[$i]['experience']; - $commander->uCommander = $awCommanders[$i]['uCommander']; - $commander->palmares = $awCommanders[$i]['palmares']; - $commander->statement = $awCommanders[$i]['statement']; - $commander->line = $awCommanders[$i]['line']; - $commander->dCreation = $awCommanders[$i]['dCreation']; - $commander->dAffectation = $awCommanders[$i]['dAffectation']; - $commander->dDeath = $awCommanders[$i]['dDeath']; - $commander->oBName = $awCommanders[$i]['oName']; - - $commander->dStart = $awCommanders[$i]['dStart']; - $commander->dArrival = $awCommanders[$i]['dArrival']; - $commander->resources = $awCommanders[$i]['resources']; - $commander->travelType = $awCommanders[$i]['travelType']; - $commander->travelLength = $awCommanders[$i]['travelLength']; - $commander->rStartPlace = $awCommanders[$i]['rStartPlace']; - $commander->rDestinationPlace = $awCommanders[$i]['rDestinationPlace']; - - $commander->startPlaceName = ($awCommanders[$i]['spName'] == '') ? 'planète rebelle' : $awCommanders[$i]['spName']; - $commander->destinationPlaceName = ($awCommanders[$i]['dpName'] == '') ? 'planète rebelle' : $awCommanders[$i]['dpName']; - $commander->destinationPlacePop = $awCommanders[$i]['destinationPlacePop']; - $commander->startPlacePop = $awCommanders[$i]['startPlacePop']; - } - - $commander->squadronsIds[] = $awCommanders[$i]['sqId']; - - $commander->armyInBegin[] = array( - $awCommanders[$i]['sqShip0'], - $awCommanders[$i]['sqShip1'], - $awCommanders[$i]['sqShip2'], - $awCommanders[$i]['sqShip3'], - $awCommanders[$i]['sqShip4'], - $awCommanders[$i]['sqShip5'], - $awCommanders[$i]['sqShip6'], - $awCommanders[$i]['sqShip7'], - $awCommanders[$i]['sqShip8'], - $awCommanders[$i]['sqShip9'], - $awCommanders[$i]['sqShip10'], - $awCommanders[$i]['sqShip11'], - $awCommanders[$i]['sqDCreation'], - $awCommanders[$i]['sqDLastModification']); - - if ($i == count($awCommanders) - 1 || $awCommanders[$i]['id'] != $awCommanders[$i + 1]['id']) { - $currentCommander = $this->_Add($commander); - - if ($this->currentSession->getUMode()) { - $currentCommander->uCommander(); - } - } - } - } - } - - public function emptySession() { - # empty the session, for player rankings - $this->_EmptyCurrentSession(); - $this->newSession(FALSE); - } - - //inscrit un nouveau commandant en bdd - public function add($newCommander) { - $db = DataBase::getInstance(); - $qr = 'INSERT INTO commander - SET - name = ?, - avatar = ?, - rPlayer = ?, - rBase = ?, - sexe = ?, - age = ?, - level = ?, - experience = ?, - uCommander = ?, - statement = ?, - dCreation = ?'; - $qr = $db->prepare($qr); - $aw = $qr->execute(array( - $newCommander->name, - $newCommander->avatar, - $newCommander->rPlayer, - $newCommander->rBase, - $newCommander->sexe, - $newCommander->age, - $newCommander->level, - $newCommander->experience, - Utils::now(), - $newCommander->statement, - $newCommander->dCreation, - )); - $newCommander->setId($db->lastInsertId()); - - $nbrSquadrons = $newCommander->getLevel(); - $maxId = $db->lastInsertId(); - $qr2 = 'INSERT INTO - squadron(rCommander, dCreation) - VALUES(?, NOW())'; - $qr2 = $db->prepare($qr2); - - for ($i = 0; $i < $nbrSquadrons; $i++) { - $aw2 = $qr2->execute(array($maxId)); - } - - $lastSquadronId = $db->lastInsertId(); - for ($i = 0; $i < count($newCommander->getArmy()); $i++) { - $newCommander->getSquadron[$i]->setId($lastSquadronId); - $lastSquadronId--; - } - - $this->_Add($newCommander); - } - - //réécrit la base de donnée (à l'issue d'un combat par exemple) - public function save() { - $commanders = $this->_Save(); - foreach ($commanders AS $k => $commander) { - $db = DataBase::getInstance(); - $qr = 'UPDATE commander - SET - name = ?, - avatar = ?, - rPlayer = ?, - rBase = ?, - comment = ?, - sexe = ?, - age = ?, - level = ?, - experience = ?, - uCommander = ?, - palmares = ?, - statement = ?, - `line` = ?, - dStart = ?, - dArrival = ?, - resources = ?, - travelType = ?, - travelLength = ?, - rStartPlace = ?, - rDestinationPlace = ?, - dCreation = ?, - dAffectation = ?, - dDeath = ? - - WHERE id = ?'; - - $qr = $db->prepare($qr); - //uper les commandants - $qr->execute(array( - $commander->name, - $commander->avatar, - $commander->rPlayer, - $commander->rBase, - $commander->comment, - $commander->sexe, - $commander->age, - $commander->level, - $commander->experience, - $commander->uCommander, - $commander->palmares, - $commander->statement, - $commander->line, - $commander->dStart, - $commander->dArrival, - $commander->resources, - $commander->travelType, - $commander->travelLength, - $commander->rStartPlace, - $commander->rDestinationPlace, - $commander->dCreation, - $commander->dAffectation, - $commander->dDeath, - $commander->id)); - - $qr = 'UPDATE squadron SET - rCommander = ?, - ship0 = ?, - ship1 = ?, - ship2 = ?, - ship3 = ?, - ship4 = ?, - ship5 = ?, - ship6 = ?, - ship7 = ?, - ship8 = ?, - ship9 = ?, - ship10 = ?, - ship11 = ?, - DLAstModification = NOW() - WHERE id = ?'; - - $qr = $db->prepare($qr); - $army = $commander->getArmy(); - - foreach ($army AS $squadron) { - //uper les escadrilles - $qr->execute(array( - $squadron->getRCommander(), - $squadron->getNbrShipByType(0), - $squadron->getNbrShipByType(1), - $squadron->getNbrShipByType(2), - $squadron->getNbrShipByType(3), - $squadron->getNbrShipByType(4), - $squadron->getNbrShipByType(5), - $squadron->getNbrShipByType(6), - $squadron->getNbrShipByType(7), - $squadron->getNbrShipByType(8), - $squadron->getNbrShipByType(9), - $squadron->getNbrShipByType(10), - $squadron->getNbrShipByType(11), - $squadron->getId() - )); - } - if ($commander->getLevel() > $commander->getSizeArmy()) { - //on créé une nouvelle squadron avec rCommander correspondant - $nbrSquadronToCreate = $commander->getLevel() - $commander->getSizeArmy(); - $qr = 'INSERT INTO - squadron (rCommander, dCreation) - VALUES (' . $commander->getId() . ', NOW())'; - $i = 1; - while ($i < $nbrSquadronToCreate) { - $qr .= ',(' . $commander->getId() . ', NOW())'; - $i++; - } - $qr = $db->prepare($qr); - $qr->execute(); - } - } - $this->isUpdate = TRUE; - } - - public function setCommander($commander) { - $this->objects['' . $commander->getId() .''] = $commander; - } -} diff --git a/system/modules/ares/main.php b/system/modules/ares/main.php deleted file mode 100755 index c7303df4e..000000000 --- a/system/modules/ares/main.php +++ /dev/null @@ -1,20 +0,0 @@ - \ No newline at end of file From 1501c87ccb531351ad132472c9bca09b68047d86 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sun, 23 Oct 2016 00:19:47 +0200 Subject: [PATCH 13/64] Refactor Artemis module architecture --- .../Artemis/Manager}/SpyReportManager.php | 21 ++++++++++++------- .../Artemis/Model}/SpyReport.php | 2 ++ system/Modules/Artemis/main.php | 3 +++ system/modules/artemis/main.php | 8 ------- 4 files changed, 19 insertions(+), 15 deletions(-) rename system/{modules/artemis/class => Modules/Artemis/Manager}/SpyReportManager.php (92%) mode change 100755 => 100644 rename system/{modules/artemis/class => Modules/Artemis/Model}/SpyReport.php (96%) mode change 100755 => 100644 create mode 100755 system/Modules/Artemis/main.php delete mode 100755 system/modules/artemis/main.php diff --git a/system/modules/artemis/class/SpyReportManager.php b/system/Modules/Artemis/Manager/SpyReportManager.php old mode 100755 new mode 100644 similarity index 92% rename from system/modules/artemis/class/SpyReportManager.php rename to system/Modules/Artemis/Manager/SpyReportManager.php index 72c05ac04..276c09b5a --- a/system/modules/artemis/class/SpyReportManager.php +++ b/system/Modules/Artemis/Manager/SpyReportManager.php @@ -10,6 +10,14 @@ * @version 26.03.14 **/ +namespace Asylamba\Modules\Artemis\Manager; + +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Artemis\Model\SpyReport; + class SpyReportManager extends Manager { protected $managerType = '_SpyReport'; @@ -18,7 +26,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT sr.*, p.typeOfPlace AS typeOfPlace, p.position AS position, @@ -95,7 +103,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function add(SpyReport $sr) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO spyReport(rPlayer, price, rPlace, placeColor, typeOfBase, typeOfOrbitalBase, placeName, points, rEnemy, enemyName, enemyAvatar, enemyLevel, resources, shipsInStorage, antiSpyInvest, commercialRouteIncome, commanders, success, type, dSpying) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); @@ -131,7 +139,7 @@ public function save() { $reports = $this->_Save(); foreach ($reports AS $sr) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE spyReport SET id = ?, rPlayer = ?, @@ -183,7 +191,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM spyReport WHERE id = ?'); $qr->execute(array($id)); @@ -192,7 +200,7 @@ public function deleteById($id) { } public function deleteByRPlayer($rPlayer) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM spyReport WHERE rPlayer = ?'); $qr->execute(array($rPlayer)); @@ -207,5 +215,4 @@ public function deleteByRPlayer($rPlayer) { return $nbrDeleted; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/artemis/class/SpyReport.php b/system/Modules/Artemis/Model/SpyReport.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/artemis/class/SpyReport.php rename to system/Modules/Artemis/Model/SpyReport.php index 744f70a74..358026e7e --- a/system/modules/artemis/class/SpyReport.php +++ b/system/Modules/Artemis/Model/SpyReport.php @@ -10,6 +10,8 @@ * @update 26.03.14 */ +namespace Asylamba\Modules\Artemis\Model; + class SpyReport { # constants const TYP_NOT_CAUGHT = 0; diff --git a/system/Modules/Artemis/main.php b/system/Modules/Artemis/main.php new file mode 100755 index 000000000..3d3ae1fd2 --- /dev/null +++ b/system/Modules/Artemis/main.php @@ -0,0 +1,3 @@ + Date: Sun, 23 Oct 2016 00:23:22 +0200 Subject: [PATCH 14/64] Refactor Athena module architecture --- .../Athena/Manager/BuildingQueueManager.php} | 17 +++++--- .../Manager/CommercialRouteManager.php} | 20 ++++++---- .../Manager/CommercialShippingManager.php} | 17 +++++--- .../Athena/Manager/CommercialTaxManager.php} | 16 +++++--- .../Athena/Manager/OrbitalBaseManager.php} | 27 +++++++++---- .../Athena/Manager/RecyclingLogManager.php} | 20 ++++++---- .../Manager/RecyclingMissionManager.php} | 18 ++++++--- .../Athena/Manager/ShipQueueManager.php} | 19 ++++++--- .../Athena/Manager/TransactionManager.php} | 21 ++++++---- .../Athena/Model/BuildingQueue.php} | 4 +- .../Athena/Model/CommercialRoute.php} | 4 +- .../Athena/Model/CommercialShipping.php} | 10 +++++ .../Athena/Model/CommercialTax.php} | 1 + .../Athena/Model/OrbitalBase.php} | 16 ++++++++ .../Athena/Model/RecyclingLog.php} | 2 + .../Athena/Model/RecyclingMission.php} | 1 + .../Athena/Model/ShipQueue.php} | 4 +- .../Athena/Model/Transaction.php} | 10 +++++ .../Athena/Resource/OrbitalBaseResource.php} | 9 +++++ .../Athena/Resource/SchoolClassResource.php} | 7 +++- .../Athena/Resource/ShipResource.php} | 13 ++++++- .../athena => Modules/Athena}/main.conf.php | 0 system/Modules/Athena/main.php | 5 +++ system/modules/athena/main.php | 39 ------------------- 24 files changed, 193 insertions(+), 107 deletions(-) rename system/{modules/athena/class/BuildingQueueManager.class.php => Modules/Athena/Manager/BuildingQueueManager.php} (86%) mode change 100755 => 100644 rename system/{modules/athena/class/CommercialRouteManager.class.php => Modules/Athena/Manager/CommercialRouteManager.php} (93%) mode change 100755 => 100644 rename system/{modules/athena/class/CommercialShippingManager.class.php => Modules/Athena/Manager/CommercialShippingManager.php} (92%) mode change 100755 => 100644 rename system/{modules/athena/class/CommercialTaxManager.class.php => Modules/Athena/Manager/CommercialTaxManager.php} (85%) mode change 100755 => 100644 rename system/{modules/athena/class/OrbitalBaseManager.class.php => Modules/Athena/Manager/OrbitalBaseManager.php} (97%) mode change 100755 => 100644 rename system/{modules/athena/class/RecyclingLogManager.class.php => Modules/Athena/Manager/RecyclingLogManager.php} (89%) mode change 100755 => 100644 rename system/{modules/athena/class/RecyclingMissionManager.class.php => Modules/Athena/Manager/RecyclingMissionManager.php} (90%) mode change 100755 => 100644 rename system/{modules/athena/class/ShipQueueManager.class.php => Modules/Athena/Manager/ShipQueueManager.php} (86%) mode change 100755 => 100644 rename system/{modules/athena/class/TransactionManager.class.php => Modules/Athena/Manager/TransactionManager.php} (92%) mode change 100755 => 100644 rename system/{modules/athena/class/BuildingQueue.class.php => Modules/Athena/Model/BuildingQueue.php} (88%) mode change 100755 => 100644 rename system/{modules/athena/class/CommercialRoute.class.php => Modules/Athena/Model/CommercialRoute.php} (98%) mode change 100755 => 100644 rename system/{modules/athena/class/CommercialShipping.class.php => Modules/Athena/Model/CommercialShipping.php} (96%) mode change 100755 => 100644 rename system/{modules/athena/class/CommercialTax.class.php => Modules/Athena/Model/CommercialTax.php} (88%) mode change 100755 => 100644 rename system/{modules/athena/class/OrbitalBase.class.php => Modules/Athena/Model/OrbitalBase.php} (98%) mode change 100755 => 100644 rename system/{modules/athena/class/RecyclingLog.class.php => Modules/Athena/Model/RecyclingLog.php} (92%) mode change 100755 => 100644 rename system/{modules/athena/class/RecyclingMission.class.php => Modules/Athena/Model/RecyclingMission.php} (95%) mode change 100755 => 100644 rename system/{modules/athena/class/ShipQueue.class.php => Modules/Athena/Model/ShipQueue.php} (89%) mode change 100755 => 100644 rename system/{modules/athena/class/Transaction.class.php => Modules/Athena/Model/Transaction.php} (96%) mode change 100755 => 100644 rename system/{modules/athena/resource/OrbitalBaseResource.class.php => Modules/Athena/Resource/OrbitalBaseResource.php} (99%) mode change 100755 => 100644 rename system/{modules/athena/resource/SchoolClassResource.class.php => Modules/Athena/Resource/SchoolClassResource.php} (92%) mode change 100755 => 100644 rename system/{modules/athena/resource/ShipResource.class.php => Modules/Athena/Resource/ShipResource.php} (98%) mode change 100755 => 100644 rename system/{modules/athena => Modules/Athena}/main.conf.php (100%) create mode 100755 system/Modules/Athena/main.php delete mode 100755 system/modules/athena/main.php diff --git a/system/modules/athena/class/BuildingQueueManager.class.php b/system/Modules/Athena/Manager/BuildingQueueManager.php old mode 100755 new mode 100644 similarity index 86% rename from system/modules/athena/class/BuildingQueueManager.class.php rename to system/Modules/Athena/Manager/BuildingQueueManager.php index 4f3d998de..ec252f447 --- a/system/modules/athena/class/BuildingQueueManager.class.php +++ b/system/Modules/Athena/Manager/BuildingQueueManager.php @@ -9,6 +9,12 @@ * @package Athena * @update 10.02.14 */ +namespace Asylamba\Modules\Athena\Manager; + +use Asylamba\Classes\Worker\Manager; +use \Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Athena\Model\BuildingQueue; class BuildingQueueManager extends Manager { protected $managerType = '_BuildingQueue'; @@ -18,7 +24,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM orbitalBaseBuildingQueue ' . $formatWhere . ' @@ -57,7 +63,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function add(BuildingQueue $bq) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO orbitalBaseBuildingQueue(rOrbitalBase, buildingNumber, targetLevel, dStart, dEnd) VALUES(?, ?, ?, ?, ?)'); @@ -76,7 +82,7 @@ public function add(BuildingQueue $bq) { public function save() { $buildingQueues = $this->_Save(); foreach ($buildingQueues AS $bq) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE orbitalBaseBuildingQueue SET id = ?, rOrbitalBase = ?, @@ -98,7 +104,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM orbitalBaseBuildingQueue WHERE id = ?'); $qr->execute(array($id)); @@ -107,5 +113,4 @@ public function deleteById($id) { return TRUE; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/CommercialRouteManager.class.php b/system/Modules/Athena/Manager/CommercialRouteManager.php old mode 100755 new mode 100644 similarity index 93% rename from system/modules/athena/class/CommercialRouteManager.class.php rename to system/Modules/Athena/Manager/CommercialRouteManager.php index 0420ccfa9..47061e6f3 --- a/system/modules/athena/class/CommercialRouteManager.class.php +++ b/system/Modules/Athena/Manager/CommercialRouteManager.php @@ -9,6 +9,13 @@ * @package Athena * @update 20.05.13 */ +namespace Asylamba\Modules\Athena\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Athena\CommercialRoute; +use Asylamba\Modules\Demeter\Model\Color; class CommercialRouteManager extends Manager { protected $managerType = '_CommercialRoute'; @@ -19,7 +26,7 @@ public function load($where, $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT cr.id AS id, cr.rOrbitalBase AS rOrbitalBase, @@ -125,7 +132,7 @@ public function emptySession() { } public function add(CommercialRoute $cr) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO commercialRoute(rOrbitalBase, rOrbitalBaseLinked, imageLink, distance, price, income, dProposition, dCreation, statement) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)'); @@ -148,7 +155,7 @@ public function add(CommercialRoute $cr) { public function save() { $routes = $this->_Save(); foreach ($routes AS $k => $cr) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE commercialRoute SET id = ?, rOrbitalBase = ?, @@ -179,7 +186,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM commercialRoute WHERE id = ?'); $qr->execute(array($id)); @@ -193,7 +200,7 @@ public static function freezeRoute($color1, $color2) { if (!($color1->colorLink[$color2->id] == Color::ENEMY || $color2->colorLink[$color1->id] == Color::ENEMY)) { $freeze = FALSE; } - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare( 'UPDATE commercialRoute AS cr LEFT JOIN orbitalBase AS ob1 @@ -217,5 +224,4 @@ public static function freezeRoute($color1, $color2) { $qr->execute(array(CRM_ACTIVE, $color1->id, $color2->id, $color2->id, $color1->id, CRM_STANDBY)); } } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/CommercialShippingManager.class.php b/system/Modules/Athena/Manager/CommercialShippingManager.php old mode 100755 new mode 100644 similarity index 92% rename from system/modules/athena/class/CommercialShippingManager.class.php rename to system/Modules/Athena/Manager/CommercialShippingManager.php index 2e50c9552..2de28f39f --- a/system/modules/athena/class/CommercialShippingManager.class.php +++ b/system/Modules/Athena/Manager/CommercialShippingManager.php @@ -9,6 +9,12 @@ * @package Athena * @version 19.11.13 **/ +namespace Asylamba\Modules\Athena\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Athena\Model\CommercialShipping; class CommercialShippingManager extends Manager { protected $managerType = '_CommercialShipping'; @@ -18,7 +24,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT cs.*, p1.rSystem AS rSystem1, p1.position AS position1, s1.xPosition AS xSystem1, s1.yPosition AS ySystem1, p2.rSystem AS rSystem2, p2.position AS position2, s2.xPosition AS xSystem2, s2.yPosition AS ySystem2, @@ -98,7 +104,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function add(CommercialShipping $cs) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO commercialShipping(rPlayer, rBase, rBaseDestination, rTransaction, resourceTransported, shipQuantity, dDeparture, dArrival, statement) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)'); @@ -123,7 +129,7 @@ public function save() { $commercialShippings = $this->_Save(); foreach ($commercialShippings AS $cs) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE commercialShipping SET id = ?, rPlayer = ?, @@ -153,7 +159,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM commercialShipping WHERE id = ?'); $qr->execute(array($id)); @@ -161,5 +167,4 @@ public function deleteById($id) { return TRUE; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/CommercialTaxManager.class.php b/system/Modules/Athena/Manager/CommercialTaxManager.php old mode 100755 new mode 100644 similarity index 85% rename from system/modules/athena/class/CommercialTaxManager.class.php rename to system/Modules/Athena/Manager/CommercialTaxManager.php index b723bbf44..7e23a33e1 --- a/system/modules/athena/class/CommercialTaxManager.class.php +++ b/system/Modules/Athena/Manager/CommercialTaxManager.php @@ -9,6 +9,13 @@ * @package Athena * @version 05.03.14 **/ +namespace Asylamba\Modules\Athena\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Athena\Model\CommercialTax; class CommercialTaxManager extends Manager { protected $managerType = '_CommercialTax'; @@ -18,7 +25,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM commercialTax ' . $formatWhere . ' @@ -56,7 +63,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function add(CommercialTax $ct) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO commercialTax(faction, relatedFaction, exportTax, importTax) VALUES(?, ?, ?, ?)'); @@ -76,7 +83,7 @@ public function save() { $commercialTaxes = $this->_Save(); foreach ($commercialTaxes AS $t) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE commercialTax SET id = ?, faction = ?, @@ -94,5 +101,4 @@ public function save() { )); } } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/OrbitalBaseManager.class.php b/system/Modules/Athena/Manager/OrbitalBaseManager.php old mode 100755 new mode 100644 similarity index 97% rename from system/modules/athena/class/OrbitalBaseManager.class.php rename to system/Modules/Athena/Manager/OrbitalBaseManager.php index c50dca0a5..4db1109d4 --- a/system/modules/athena/class/OrbitalBaseManager.class.php +++ b/system/Modules/Athena/Manager/OrbitalBaseManager.php @@ -1,6 +1,4 @@ prepare('SELECT ob.*, p.position AS position, @@ -89,7 +101,7 @@ public function search($search, $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT ob.*, p.position AS position, @@ -319,7 +331,7 @@ public function add(OrbitalBase $b) { include_once GAIA; GalaxyColorManager::apply(); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO orbitalBase(rPlace, rPlayer, name, typeOfBase, levelGenerator, levelRefinery, levelDock1, levelDock2, levelDock3, levelTechnosphere, levelCommercialPlateforme, levelStorage, levelRecycling, levelSpatioport, points, iSchool, iAntiSpy, antiSpyAverage, @@ -381,7 +393,7 @@ public function add(OrbitalBase $b) { public function save() { $bases = $this->_Save(); foreach ($bases AS $k => $b) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE orbitalBase SET rPlace = ?, rPlayer = ?, name = ?, typeOfBase = ?, levelGenerator = ?, levelRefinery = ?, levelDock1 = ?, levelDock2 = ?, levelDock3 = ?, levelTechnosphere = ?, levelCommercialPlateforme = ?, levelStorage = ?, levelRecycling = ?, levelSpatioport = ?, points = ?, iSchool = ?, iAntiSpy = ?, antiSpyAverage = ?, @@ -524,5 +536,4 @@ public function changeOwnerById($id, $base, $newOwner, $routeSession, $recycling CTR::$alert->add('dans changeOwnerById de OrbitalBaseManager', ALERT_BUG_ERROR); } } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/RecyclingLogManager.class.php b/system/Modules/Athena/Manager/RecyclingLogManager.php old mode 100755 new mode 100644 similarity index 89% rename from system/modules/athena/class/RecyclingLogManager.class.php rename to system/Modules/Athena/Manager/RecyclingLogManager.php index fd8b764ab..ea5061aaf --- a/system/modules/athena/class/RecyclingLogManager.class.php +++ b/system/Modules/Athena/Manager/RecyclingLogManager.php @@ -9,6 +9,13 @@ * @package Zeus * @version 09.02.15 **/ +namespace Asylamba\Modules\Athena\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Athena\Model\RecyclingLog; class RecyclingLogManager extends Manager { protected $managerType = '_RecyclingLog'; @@ -18,7 +25,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT rl.* FROM recyclingLog AS rl ' . $formatWhere . ' @@ -72,7 +79,7 @@ protected function fill($qr) { } public function add(RecyclingLog $rl) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO recyclingLog(rRecycling, resources, credits, ship0, ship1, ship2, ship3, ship4, ship5, ship6, ship7, ship8, ship9, ship10, ship11, dLog) @@ -105,7 +112,7 @@ public function save() { $recyclingLogs = $this->_Save(); foreach ($recyclingLogs AS $rl) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE recyclingLog SET id = ?, rRecycling = ?, @@ -149,7 +156,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM recyclingLog WHERE id = ?'); $qr->execute(array($id)); @@ -159,7 +166,7 @@ public function deleteById($id) { } public function deleteAllFromMission($missionId) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT id FROM recyclingLog WHERE rRecycling = ?'); $qr->execute(array($missionId)); @@ -169,5 +176,4 @@ public function deleteAllFromMission($missionId) { return TRUE; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/RecyclingMissionManager.class.php b/system/Modules/Athena/Manager/RecyclingMissionManager.php old mode 100755 new mode 100644 similarity index 90% rename from system/modules/athena/class/RecyclingMissionManager.class.php rename to system/Modules/Athena/Manager/RecyclingMissionManager.php index 3a8c4660f..ae328fddb --- a/system/modules/athena/class/RecyclingMissionManager.class.php +++ b/system/Modules/Athena/Manager/RecyclingMissionManager.php @@ -9,6 +9,13 @@ * @package Zeus * @version 09.02.15 **/ +namespace Asylamba\Modules\Athena\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Athena\Model\RecyclingMission; class RecyclingMissionManager extends Manager { protected $managerType = '_RecyclingMission'; @@ -18,7 +25,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT rm.*, p.typeOfPlace AS typeOfPlace, p.position AS position, @@ -90,7 +97,7 @@ protected function fill($qr) { } public function add(RecyclingMission $rm) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO recyclingMission(rBase, rTarget, cycleTime, recyclerQuantity, addToNextMission, uRecycling, statement) VALUES(?, ?, ?, ?, ?, ?, ?)'); @@ -113,7 +120,7 @@ public function save() { $recyclingMissions = $this->_Save(); foreach ($recyclingMissions AS $rm) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE recyclingMission SET id = ?, rBase = ?, @@ -139,7 +146,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM recyclingMission WHERE id = ?'); $qr->execute(array($id)); @@ -147,5 +154,4 @@ public function deleteById($id) { return TRUE; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/ShipQueueManager.class.php b/system/Modules/Athena/Manager/ShipQueueManager.php old mode 100755 new mode 100644 similarity index 86% rename from system/modules/athena/class/ShipQueueManager.class.php rename to system/Modules/Athena/Manager/ShipQueueManager.php index 1288df90a..cc0f20d67 --- a/system/modules/athena/class/ShipQueueManager.class.php +++ b/system/Modules/Athena/Manager/ShipQueueManager.php @@ -10,6 +10,14 @@ * @update 10.02.14 */ +namespace Asylamba\Modules\Athena\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Athena\Model\ShipQueue; + class ShipQueueManager extends Manager { protected $managerType = '_ShipQueue'; @@ -18,7 +26,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM orbitalBaseShipQueue ' . $formatWhere . ' @@ -58,7 +66,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function add(ShipQueue $sq) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO orbitalBaseShipQueue(rOrbitalBase, dockType, shipNumber, quantity, dStart, dEnd) VALUES(?, ?, ?, ?, ?, ?)'); @@ -78,7 +86,7 @@ public function add(ShipQueue $sq) { public function save() { $shipQueues = $this->_Save(); foreach ($shipQueues AS $k => $sq) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE orbitalBaseShipQueue SET id = ?, rOrbitalBase = ?, @@ -102,7 +110,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM orbitalBaseShipQueue WHERE id = ?'); $qr->execute(array($id)); @@ -111,5 +119,4 @@ public function deleteById($id) { return TRUE; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/TransactionManager.class.php b/system/Modules/Athena/Manager/TransactionManager.php old mode 100755 new mode 100644 similarity index 92% rename from system/modules/athena/class/TransactionManager.class.php rename to system/Modules/Athena/Manager/TransactionManager.php index 408387976..704113711 --- a/system/modules/athena/class/TransactionManager.class.php +++ b/system/Modules/Athena/Manager/TransactionManager.php @@ -10,6 +10,14 @@ * @version 19.11.13 **/ +namespace Asylamba\Modules\Athena\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Athena\Model\Transaction; + class TransactionManager extends Manager { protected $managerType = '_Transaction'; @@ -18,7 +26,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT t.*, play.name AS playerName, play.rColor AS playerColor, @@ -105,7 +113,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function getExchangeRate($transactionType) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT currentRate FROM transaction WHERE type = ? AND statement = ? @@ -118,7 +126,7 @@ public function getExchangeRate($transactionType) { } public function add(Transaction $t) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO transaction(rPlayer, rPlace, type, quantity, identifier, price, commercialShipQuantity, statement, dPublication, dValidation, currentRate) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); @@ -145,7 +153,7 @@ public function save() { $transactions = $this->_Save(); foreach ($transactions AS $t) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE transaction SET id = ?, rPlayer = ?, @@ -179,7 +187,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM transaction WHERE id = ?'); $qr->execute(array($id)); @@ -187,5 +195,4 @@ public function deleteById($id) { return TRUE; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/BuildingQueue.class.php b/system/Modules/Athena/Model/BuildingQueue.php old mode 100755 new mode 100644 similarity index 88% rename from system/modules/athena/class/BuildingQueue.class.php rename to system/Modules/Athena/Model/BuildingQueue.php index 72a9f3af4..10ba3eb87 --- a/system/modules/athena/class/BuildingQueue.class.php +++ b/system/Modules/Athena/Model/BuildingQueue.php @@ -9,6 +9,7 @@ * @package Athena * @update 10.02.14 */ +namespace Asylamba\Modules\Athena\Model; class BuildingQueue { // ATTRIBUTES @@ -22,5 +23,4 @@ class BuildingQueue { public function getId() { return $this->id; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/CommercialRoute.class.php b/system/Modules/Athena/Model/CommercialRoute.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/athena/class/CommercialRoute.class.php rename to system/Modules/Athena/Model/CommercialRoute.php index 0b9875518..ee11e612e --- a/system/modules/athena/class/CommercialRoute.class.php +++ b/system/Modules/Athena/Model/CommercialRoute.php @@ -9,6 +9,7 @@ * @package Athena * @update 20.05.13 */ +namespace Asylamba\Modules\Athena; class CommercialRoute { @@ -93,5 +94,4 @@ public function setPlayerId2($var) { $this->playerId2 = $var; } public function setPlayerName2($var) { $this->playerName2 = $var; } public function setAvatar2($var) { $this->avatar2 = $var; } public function setPopulation2($var) { $this->population2 = $var; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/CommercialShipping.class.php b/system/Modules/Athena/Model/CommercialShipping.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/athena/class/CommercialShipping.class.php rename to system/Modules/Athena/Model/CommercialShipping.php index 2c00fdc44..b8bd6f2dd --- a/system/modules/athena/class/CommercialShipping.class.php +++ b/system/Modules/Athena/Model/CommercialShipping.php @@ -9,6 +9,16 @@ * @package Athena * @update 13.11.13 */ +namespace Asylamba\Modules\Athena\Model; + +use Asylamba\Modules\Hermes\Model\Notification; +use Asylamba\Modules\Athena\Resource\ShipResource; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Modules\Ares\Model\Commander; +use Asylamba\Modules\Ares\Resource\CommanderResources; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Utils; class CommercialShipping { # statement diff --git a/system/modules/athena/class/CommercialTax.class.php b/system/Modules/Athena/Model/CommercialTax.php old mode 100755 new mode 100644 similarity index 88% rename from system/modules/athena/class/CommercialTax.class.php rename to system/Modules/Athena/Model/CommercialTax.php index b34906c43..d23d9c222 --- a/system/modules/athena/class/CommercialTax.class.php +++ b/system/Modules/Athena/Model/CommercialTax.php @@ -9,6 +9,7 @@ * @package Athena * @update 05.03.14 */ +namespace Asylamba\Modules\Athena\Model; class CommercialTax { diff --git a/system/modules/athena/class/OrbitalBase.class.php b/system/Modules/Athena/Model/OrbitalBase.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/athena/class/OrbitalBase.class.php rename to system/Modules/Athena/Model/OrbitalBase.php index c3f77a827..9137bc5fc --- a/system/modules/athena/class/OrbitalBase.class.php +++ b/system/Modules/Athena/Model/OrbitalBase.php @@ -9,6 +9,22 @@ * @package Athena * @update 02.01.14 */ +namespace Asylamba\Modules\Athena\Model; + +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\CTC; +use Asylamba\Classes\Worker\ASM; + +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Library\Game; + +use Asylamba\Modules\Zeus\Model\PlayerBonus; +use Asylamba\Modules\Hermes\Model\Notification; +use Asylamba\Modules\Promethee\Model\Technology; + +use Asylamba\Modules\Athena\Resource\ShipResource; +use Asylamba\Modules\Promethee\Resource\TechnologyResource; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; class OrbitalBase { # type of base diff --git a/system/modules/athena/class/RecyclingLog.class.php b/system/Modules/Athena/Model/RecyclingLog.php old mode 100755 new mode 100644 similarity index 92% rename from system/modules/athena/class/RecyclingLog.class.php rename to system/Modules/Athena/Model/RecyclingLog.php index 5b47f4b09..8dfe58db7 --- a/system/modules/athena/class/RecyclingLog.class.php +++ b/system/Modules/Athena/Model/RecyclingLog.php @@ -10,6 +10,8 @@ * @update 09.02.15 */ +namespace Asylamba\Modules\Athena\Model; + class RecyclingLog { public $id = 0; diff --git a/system/modules/athena/class/RecyclingMission.class.php b/system/Modules/Athena/Model/RecyclingMission.php old mode 100755 new mode 100644 similarity index 95% rename from system/modules/athena/class/RecyclingMission.class.php rename to system/Modules/Athena/Model/RecyclingMission.php index 752c032e2..c8428ad14 --- a/system/modules/athena/class/RecyclingMission.class.php +++ b/system/Modules/Athena/Model/RecyclingMission.php @@ -9,6 +9,7 @@ * @package Zeus * @update 09.02.15 */ +namespace Asylamba\Modules\Athena\Model; class RecyclingMission { diff --git a/system/modules/athena/class/ShipQueue.class.php b/system/Modules/Athena/Model/ShipQueue.php old mode 100755 new mode 100644 similarity index 89% rename from system/modules/athena/class/ShipQueue.class.php rename to system/Modules/Athena/Model/ShipQueue.php index 435574153..06167f238 --- a/system/modules/athena/class/ShipQueue.class.php +++ b/system/Modules/Athena/Model/ShipQueue.php @@ -9,6 +9,7 @@ * @package Athena * @update 10.02.14 */ +namespace Asylamba\Modules\Athena\Model; class ShipQueue { // ATTRIBUTES @@ -23,5 +24,4 @@ class ShipQueue { public function getId() { return $this->id; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/class/Transaction.class.php b/system/Modules/Athena/Model/Transaction.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/athena/class/Transaction.class.php rename to system/Modules/Athena/Model/Transaction.php index c84eea431..f9b03237a --- a/system/modules/athena/class/Transaction.class.php +++ b/system/Modules/Athena/Model/Transaction.php @@ -9,6 +9,16 @@ * @package Athena * @update 19.11.13 */ +namespace Asylamba\Modules\Athena\Model; + +use Asylamba\Classes\Library\Game; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Chronos; +use Asylamba\Classes\Library\Format; + +use Asylamba\Modules\Demeter\Resource\ColorResource; +use Asylamba\Modules\Ares\Resource\CommanderResources; +use Asylamba\Modules\Athena\Resource\ShipResource; class Transaction { # statement diff --git a/system/modules/athena/resource/OrbitalBaseResource.class.php b/system/Modules/Athena/Resource/OrbitalBaseResource.php old mode 100755 new mode 100644 similarity index 99% rename from system/modules/athena/resource/OrbitalBaseResource.class.php rename to system/Modules/Athena/Resource/OrbitalBaseResource.php index f572339c5..a2df424f6 --- a/system/modules/athena/resource/OrbitalBaseResource.class.php +++ b/system/Modules/Athena/Resource/OrbitalBaseResource.php @@ -1,4 +1,13 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/resource/ShipResource.class.php b/system/Modules/Athena/Resource/ShipResource.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/athena/resource/ShipResource.class.php rename to system/Modules/Athena/Resource/ShipResource.php index 21c075b32..8522e8ce6 --- a/system/modules/athena/resource/ShipResource.class.php +++ b/system/Modules/Athena/Resource/ShipResource.php @@ -1,5 +1,15 @@ 'Le Phénix est le type prédominant de croiseur de la galaxie de l’Œil. Conçu par le vieil Empire pour mettre un terme à la rébellion des périodes de troubles, il est le vaisseau de combat le plus massif du chantier de ligne. En effet, sa construction nécessite énormément de matériel et de main-d’œuvre. De plus, le Phénix est piloté par un équipage de plus de 300 personnes.

Cet appareil, très gros, est difficile à manœuvrer dans les combats de mêlée. Cependant il est d’une efficacité redoutable en dernière ligne de vos escadrilles.' ), ); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/athena/main.conf.php b/system/Modules/Athena/main.conf.php similarity index 100% rename from system/modules/athena/main.conf.php rename to system/Modules/Athena/main.conf.php diff --git a/system/Modules/Athena/main.php b/system/Modules/Athena/main.php new file mode 100755 index 000000000..add6b576f --- /dev/null +++ b/system/Modules/Athena/main.php @@ -0,0 +1,5 @@ + \ No newline at end of file From 485c6339b11d9169b85ff9fb811b5276784f0a9c Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sun, 23 Oct 2016 00:24:49 +0200 Subject: [PATCH 15/64] Refactor Atlas module architecture --- .../Atlas/Manager}/FactionRankingManager.php | 17 +++++++++------ .../Atlas/Manager}/PlayerRankingManager.php | 21 ++++++++++++------- .../Atlas/Model}/FactionRanking.php | 5 +++++ .../Atlas/Model}/PlayerRanking.php | 7 ++++++- system/Modules/Atlas/main.php | 3 +++ system/modules/atlas/main.php | 10 --------- 6 files changed, 38 insertions(+), 25 deletions(-) rename system/{modules/atlas/class => Modules/Atlas/Manager}/FactionRankingManager.php (93%) mode change 100755 => 100644 rename system/{modules/atlas/class => Modules/Atlas/Manager}/PlayerRankingManager.php (94%) mode change 100755 => 100644 rename system/{modules/atlas/class => Modules/Atlas/Model}/FactionRanking.php (93%) mode change 100755 => 100644 rename system/{modules/atlas/class => Modules/Atlas/Model}/PlayerRanking.php (96%) mode change 100755 => 100644 create mode 100755 system/Modules/Atlas/main.php delete mode 100755 system/modules/atlas/main.php diff --git a/system/modules/atlas/class/FactionRankingManager.php b/system/Modules/Atlas/Manager/FactionRankingManager.php old mode 100755 new mode 100644 similarity index 93% rename from system/modules/atlas/class/FactionRankingManager.php rename to system/Modules/Atlas/Manager/FactionRankingManager.php index 0c3937533..2279cedea --- a/system/modules/atlas/class/FactionRankingManager.php +++ b/system/Modules/Atlas/Manager/FactionRankingManager.php @@ -9,12 +9,18 @@ * @package Atlas * @version 04.06.14 **/ +namespace Asylamba\Modules\Atlas\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Atlas\Model\FactionRanking; class FactionRankingManager extends Manager { protected $managerType = '_FactionRanking'; public function loadLastContext($where = array(), $order = array(), $limit = array()) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM ranking WHERE faction = 1 ORDER BY dRanking DESC LIMIT 1'); $qr->execute(); $aw = $qr->fetch(); @@ -75,7 +81,7 @@ public function loadLastContext($where = array(), $order = array(), $limit = arr } public function loadByRequest($request, $args = array()) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM factionRanking AS fr ' . $request @@ -108,7 +114,7 @@ public function loadByRequest($request, $args = array()) { } public function add(FactionRanking $fr) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO factionRanking(rRanking, rFaction, points, pointsPosition, pointsVariation, newPoints, general, generalPosition, generalVariation, wealth, wealthPosition, wealthVariation, territorial, territorialPosition, territorialVariation) @@ -140,7 +146,7 @@ public function save() { $rankings = $this->_Save(); foreach ($rankings AS $fr) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE factionRanking SET id = ?, rRanking = ?, @@ -180,5 +186,4 @@ public function save() { )); } } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/atlas/class/PlayerRankingManager.php b/system/Modules/Atlas/Manager/PlayerRankingManager.php old mode 100755 new mode 100644 similarity index 94% rename from system/modules/atlas/class/PlayerRankingManager.php rename to system/Modules/Atlas/Manager/PlayerRankingManager.php index 5be637014..ebd7e8c2b --- a/system/modules/atlas/class/PlayerRankingManager.php +++ b/system/Modules/Atlas/Manager/PlayerRankingManager.php @@ -9,12 +9,18 @@ * @package Atlas * @version 04.06.14 **/ +namespace Asylamba\Modules\Atlas\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Atlas\Model\PlayerRanking; class PlayerRankingManager extends Manager { protected $managerType = '_PlayerRanking'; public function loadLastContext($where = array(), $order = array(), $limit = array()) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM ranking WHERE player = 1 ORDER BY dRanking DESC LIMIT 1'); $qr->execute(); $aw = $qr->fetch(); @@ -27,7 +33,7 @@ public function loadLastContext($where = array(), $order = array(), $limit = arr $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT pl.*, p.rColor AS color, p.name AS name, @@ -58,7 +64,7 @@ public function loadLastContext($where = array(), $order = array(), $limit = arr } while($aw = $qr->fetch()) { - $pl = new playerRanking(); + $pl = new PlayerRanking(); $pl->id = $aw['id']; $pl->rRanking = $aw['rRanking']; @@ -99,7 +105,7 @@ public function loadByRequest($request) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare($request); while($aw = $qr->fetch()) { @@ -140,7 +146,7 @@ public function loadByRequest($request) { } public function add(playerRanking $pl) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO playerRanking(rRanking, rPlayer, general, generalPosition, generalVariation, @@ -186,7 +192,7 @@ public function save() { $rankings = $this->_Save(); foreach ($rankings AS $pl) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE playerRanking SET id = ?, rRanking = ?, @@ -242,5 +248,4 @@ public function save() { )); } } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/atlas/class/FactionRanking.php b/system/Modules/Atlas/Model/FactionRanking.php old mode 100755 new mode 100644 similarity index 93% rename from system/modules/atlas/class/FactionRanking.php rename to system/Modules/Atlas/Model/FactionRanking.php index 5e39eeb6a..e92a30bb9 --- a/system/modules/atlas/class/FactionRanking.php +++ b/system/Modules/Atlas/Model/FactionRanking.php @@ -9,6 +9,11 @@ * @package Atlas * @update 04.06.14 */ +namespace Asylamba\Modules\Atlas\Model; + +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Demeter\Resource\ColorResource; class FactionRanking { diff --git a/system/modules/atlas/class/PlayerRanking.php b/system/Modules/Atlas/Model/PlayerRanking.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/atlas/class/PlayerRanking.php rename to system/Modules/Atlas/Model/PlayerRanking.php index a84ed592d..3f6df7ae8 --- a/system/modules/atlas/class/PlayerRanking.php +++ b/system/Modules/Atlas/Model/PlayerRanking.php @@ -9,7 +9,12 @@ * @package Atlas * @update 04.06.14 */ -include_once DEMETER; + +namespace Asylamba\Modules\Atlas\Model; + +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Demeter\Resource\ColorResource; class PlayerRanking { # set number of player before you (remove 1) in rank view diff --git a/system/Modules/Atlas/main.php b/system/Modules/Atlas/main.php new file mode 100755 index 000000000..acb1ea89e --- /dev/null +++ b/system/Modules/Atlas/main.php @@ -0,0 +1,3 @@ + Date: Sun, 23 Oct 2016 00:25:30 +0200 Subject: [PATCH 16/64] Refactor Demeter module architecture --- .../Demeter/Manager/ColorManager.php} | 17 +++++++--- .../Manager/Election/CandidateManager.php} | 15 ++++++--- .../Manager/Election/ElectionManager.php} | 16 +++++++--- .../Demeter/Manager/Election/VoteManager.php} | 14 +++++--- .../Manager/Forum/FactionNewsManager.php} | 16 +++++++--- .../Manager/Forum/ForumMessageManager.php} | 14 +++++--- .../Manager/Forum/ForumTopicManager.php} | 14 +++++--- .../Demeter/Manager/Law/LawManager.php} | 14 +++++--- .../Demeter/Manager/Law/VoteLawManager.php} | 14 +++++--- .../Demeter/Model/Color.php} | 32 +++++++++++++------ .../Demeter/Model/Election/Candidate.php} | 1 + .../Demeter/Model/Election/Election.php} | 1 + .../Demeter/Model/Election/Vote.php} | 1 + .../Demeter/Model/Forum/FactionNews.php} | 3 ++ .../Demeter/Model/Forum/ForumMessage.php} | 3 ++ .../Demeter/Model/Forum/ForumTopic.php} | 8 +++-- .../Demeter/Model/Law/Law.php} | 3 ++ .../Demeter/Model/Law/VoteLaw.php} | 1 + .../Demeter/Resource/ColorResource.php} | 3 ++ .../Demeter/Resource}/ForumResources.php | 1 + .../Demeter/Resource}/LawResources.php | 1 + system/Modules/Demeter/main.php | 3 ++ system/modules/demeter/main.php | 30 ----------------- 23 files changed, 145 insertions(+), 80 deletions(-) rename system/{modules/demeter/class/ColorManager.class.php => Modules/Demeter/Manager/ColorManager.php} (94%) mode change 100755 => 100644 rename system/{modules/demeter/class/election/CandidateManager.class.php => Modules/Demeter/Manager/Election/CandidateManager.php} (90%) mode change 100755 => 100644 rename system/{modules/demeter/class/election/ElectionManager.class.php => Modules/Demeter/Manager/Election/ElectionManager.php} (82%) mode change 100755 => 100644 rename system/{modules/demeter/class/election/VoteManager.class.php => Modules/Demeter/Manager/Election/VoteManager.php} (85%) mode change 100755 => 100644 rename system/{modules/demeter/class/forum/FactionNewsManager.class.php => Modules/Demeter/Manager/Forum/FactionNewsManager.php} (86%) mode change 100755 => 100644 rename system/{modules/demeter/class/forum/ForumMessageManager.class.php => Modules/Demeter/Manager/Forum/ForumMessageManager.php} (89%) mode change 100755 => 100644 rename system/{modules/demeter/class/forum/ForumTopicManager.class.php => Modules/Demeter/Manager/Forum/ForumTopicManager.php} (89%) mode change 100755 => 100644 rename system/{modules/demeter/class/law/LawManager.class.php => Modules/Demeter/Manager/Law/LawManager.php} (88%) mode change 100755 => 100644 rename system/{modules/demeter/class/law/VoteLawManager.class.php => Modules/Demeter/Manager/Law/VoteLawManager.php} (85%) mode change 100755 => 100644 rename system/{modules/demeter/class/Color.class.php => Modules/Demeter/Model/Color.php} (96%) mode change 100755 => 100644 rename system/{modules/demeter/class/election/Candidate.class.php => Modules/Demeter/Model/Election/Candidate.php} (91%) mode change 100755 => 100644 rename system/{modules/demeter/class/election/Election.class.php => Modules/Demeter/Model/Election/Election.php} (84%) mode change 100755 => 100644 rename system/{modules/demeter/class/election/Vote.class.php => Modules/Demeter/Model/Election/Vote.php} (86%) mode change 100755 => 100644 rename system/{modules/demeter/class/forum/FactionNews.class.php => Modules/Demeter/Model/Forum/FactionNews.php} (87%) mode change 100755 => 100644 rename system/{modules/demeter/class/forum/ForumMessage.class.php => Modules/Demeter/Model/Forum/ForumMessage.php} (91%) mode change 100755 => 100644 rename system/{modules/demeter/class/forum/ForumTopic.class.php => Modules/Demeter/Model/Forum/ForumTopic.php} (84%) mode change 100755 => 100644 rename system/{modules/demeter/class/law/Law.class.php => Modules/Demeter/Model/Law/Law.php} (94%) mode change 100755 => 100644 rename system/{modules/demeter/class/law/VoteLaw.class.php => Modules/Demeter/Model/Law/VoteLaw.php} (87%) mode change 100755 => 100644 rename system/{modules/demeter/resource/ColorResource.class.php => Modules/Demeter/Resource/ColorResource.php} (99%) mode change 100755 => 100644 rename system/{modules/demeter/resource => Modules/Demeter/Resource}/ForumResources.php (98%) rename system/{modules/demeter/resource => Modules/Demeter/Resource}/LawResources.php (99%) create mode 100755 system/Modules/Demeter/main.php delete mode 100755 system/modules/demeter/main.php diff --git a/system/modules/demeter/class/ColorManager.class.php b/system/Modules/Demeter/Manager/ColorManager.php old mode 100755 new mode 100644 similarity index 94% rename from system/modules/demeter/class/ColorManager.class.php rename to system/Modules/Demeter/Manager/ColorManager.php index 442335a36..8427089c6 --- a/system/modules/demeter/class/ColorManager.class.php +++ b/system/Modules/Demeter/Manager/ColorManager.php @@ -10,6 +10,15 @@ * @update 26.11.13 */ +namespace Asylamba\Modules\Demeter\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Demeter\Model\Color; +use Asylamba\Modules\Demeter\Resource\ColorResource; +use Asylamba\Classes\Worker\ASM; + class ColorManager extends Manager { protected $managerType ='_Color'; @@ -18,7 +27,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT c.* FROM color AS c ' . $formatWhere .' @@ -119,7 +128,7 @@ public function save() { $colors = $this->_Save(); foreach ($colors AS $color) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE color SET alive = ?, @@ -166,7 +175,7 @@ public function save() { } public function add($newColor) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO color SET @@ -211,7 +220,7 @@ public function add($newColor) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM color WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/demeter/class/election/CandidateManager.class.php b/system/Modules/Demeter/Manager/Election/CandidateManager.php old mode 100755 new mode 100644 similarity index 90% rename from system/modules/demeter/class/election/CandidateManager.class.php rename to system/Modules/Demeter/Manager/Election/CandidateManager.php index e52656f3f..2b1fd9ad5 --- a/system/modules/demeter/class/election/CandidateManager.class.php +++ b/system/Modules/Demeter/Manager/Election/CandidateManager.php @@ -9,6 +9,13 @@ * @package Demeter * @update 06.10.13 */ +namespace Asylamba\Modules\Demeter\Manager\Election; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; + +use Asylamba\Modules\Demeter\Model\Election\Candidate; class CandidateManager extends Manager { protected $managerType ='_Candidate'; @@ -18,7 +25,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT c.*, p.name AS pName, p.avatar AS pAvatar, @@ -75,7 +82,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $candidates = $this->_Save(); @@ -105,7 +112,7 @@ public function save() { } public function add($newCandidate) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO candidate SET @@ -137,7 +144,7 @@ public function add($newCandidate) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM candidate WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/demeter/class/election/ElectionManager.class.php b/system/Modules/Demeter/Manager/Election/ElectionManager.php old mode 100755 new mode 100644 similarity index 82% rename from system/modules/demeter/class/election/ElectionManager.class.php rename to system/Modules/Demeter/Manager/Election/ElectionManager.php index 017136b4b..895f80638 --- a/system/modules/demeter/class/election/ElectionManager.class.php +++ b/system/Modules/Demeter/Manager/Election/ElectionManager.php @@ -9,6 +9,12 @@ * @package Demeter * @update 06.10.13 */ +namespace Asylamba\Modules\Demeter\Manager\Election; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Demeter\Model\Election\Election; class ElectionManager extends Manager { protected $managerType ='_Election'; @@ -18,7 +24,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT e.* FROM election AS e ' . $formatWhere .' @@ -57,7 +63,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $elections = $this->_Save(); @@ -76,7 +82,7 @@ public function save() { } public function add($newElection) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO election SET @@ -85,7 +91,7 @@ public function add($newElection) { $aw = $qr->execute(array( $newElection->rColor, - $newElection->dElection + $newElection->dElection->format('Y-m-d H:i:s') )); $newElection->id = $db->lastInsertId(); @@ -96,7 +102,7 @@ public function add($newElection) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM election WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/demeter/class/election/VoteManager.class.php b/system/Modules/Demeter/Manager/Election/VoteManager.php old mode 100755 new mode 100644 similarity index 85% rename from system/modules/demeter/class/election/VoteManager.class.php rename to system/Modules/Demeter/Manager/Election/VoteManager.php index 6e6b00d8c..04cc71df5 --- a/system/modules/demeter/class/election/VoteManager.class.php +++ b/system/Modules/Demeter/Manager/Election/VoteManager.php @@ -9,6 +9,12 @@ * @package Demeter * @update 06.10.13 */ +namespace Asylamba\Modules\Demeter\Manager\Election; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Demeter\Model\Election\Vote; class VoteManager extends Manager { protected $managerType ='_Vote'; @@ -18,7 +24,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT v.* FROM vote AS v ' . $formatWhere .' @@ -59,7 +65,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $votes = $this->_Save(); @@ -81,7 +87,7 @@ public function save() { } public function add($newVote) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO vote SET @@ -105,7 +111,7 @@ public function add($newVote) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM vote WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/demeter/class/forum/FactionNewsManager.class.php b/system/Modules/Demeter/Manager/Forum/FactionNewsManager.php old mode 100755 new mode 100644 similarity index 86% rename from system/modules/demeter/class/forum/FactionNewsManager.class.php rename to system/Modules/Demeter/Manager/Forum/FactionNewsManager.php index 2504eb7e6..3e765453d --- a/system/modules/demeter/class/forum/FactionNewsManager.class.php +++ b/system/Modules/Demeter/Manager/Forum/FactionNewsManager.php @@ -9,6 +9,12 @@ * @package Demeter * @update 09.01.15 */ +namespace Asylamba\Modules\Demeter\Manager\Forum; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Demeter\Model\Forum\FactionNews; class FactionNewsManager extends Manager { protected $managerType ='_factionNews'; @@ -18,7 +24,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT n.* FROM factionNews AS n ' . $formatWhere .' @@ -46,7 +52,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $qr->closeCursor(); foreach($aw AS $awNews) { - $news = new factionNews(); + $news = new FactionNews(); $news->id = $awNews['id']; $news->rFaction = $awNews['rFaction']; $news->title = $awNews['title']; @@ -61,7 +67,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $newsArray = $this->_Save(); @@ -94,7 +100,7 @@ public function save() { } public function add($news) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO factionNews SET @@ -123,7 +129,7 @@ public function add($news) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM factionNews WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/demeter/class/forum/ForumMessageManager.class.php b/system/Modules/Demeter/Manager/Forum/ForumMessageManager.php old mode 100755 new mode 100644 similarity index 89% rename from system/modules/demeter/class/forum/ForumMessageManager.class.php rename to system/Modules/Demeter/Manager/Forum/ForumMessageManager.php index e1b03b617..d7bb7b5a4 --- a/system/modules/demeter/class/forum/ForumMessageManager.class.php +++ b/system/Modules/Demeter/Manager/Forum/ForumMessageManager.php @@ -9,6 +9,12 @@ * @package Demeter * @update 06.10.13 */ +namespace Asylamba\Modules\Demeter\Manager\Forum; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Demeter\Model\Forum\ForumMessage; class ForumMessageManager extends Manager { protected $managerType ='_ForumMessage'; @@ -18,7 +24,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT m.*, p.name AS playerName, p.rColor AS playerColor, @@ -72,7 +78,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $messages = $this->_Save(); @@ -102,7 +108,7 @@ public function save() { } public function add($newMessage) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO forumMessage SET @@ -127,7 +133,7 @@ public function add($newMessage) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM forumMessage WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/demeter/class/forum/ForumTopicManager.class.php b/system/Modules/Demeter/Manager/Forum/ForumTopicManager.php old mode 100755 new mode 100644 similarity index 89% rename from system/modules/demeter/class/forum/ForumTopicManager.class.php rename to system/Modules/Demeter/Manager/Forum/ForumTopicManager.php index 60b3cda55..3ca57167b --- a/system/modules/demeter/class/forum/ForumTopicManager.class.php +++ b/system/Modules/Demeter/Manager/Forum/ForumTopicManager.php @@ -9,6 +9,12 @@ * @package Demeter * @update 06.10.13 */ +namespace Asylamba\Modules\Demeter\Manager\Forum; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Demeter\Model\Forum\ForumTopic; class ForumTopicManager extends Manager { protected $managerType ='_ForumTopic'; @@ -18,7 +24,7 @@ public function load($where = array(), $order = array(), $limit = array(), $play $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT t.*, (SELECT lv.dView FROM forumLastView AS lv WHERE rTopic = t.id AND rPlayer = ?) AS lastView, COUNT(m.id) AS nbMessage @@ -72,7 +78,7 @@ public function load($where = array(), $order = array(), $limit = array(), $play } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $topics = $this->_Save(); foreach ($topics AS $topic) { @@ -104,7 +110,7 @@ public function save() { } public function add($newTopic) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO forumTopic SET @@ -138,7 +144,7 @@ public function add($newTopic) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM forumTopic WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/demeter/class/law/LawManager.class.php b/system/Modules/Demeter/Manager/Law/LawManager.php old mode 100755 new mode 100644 similarity index 88% rename from system/modules/demeter/class/law/LawManager.class.php rename to system/Modules/Demeter/Manager/Law/LawManager.php index 59e904538..2d1f609d5 --- a/system/modules/demeter/class/law/LawManager.class.php +++ b/system/Modules/Demeter/Manager/Law/LawManager.php @@ -9,6 +9,12 @@ * @package Demeter * @update 29.09.14 */ +namespace Asylamba\Modules\Demeter\Manager\Law; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Demeter\Model\Law\Law; class LawManager extends Manager { protected $managerType ='_Law'; @@ -18,7 +24,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT l.*, (SELECT COUNT(v.id) FROM voteLaw AS v WHERE rLaw = l.id AND vote = 1) AS forVote, (SELECT COUNT(v.id) FROM voteLaw AS v WHERE rLaw = l.id AND vote = 0) AS againstVote @@ -67,7 +73,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $laws = $this->_Save(); @@ -95,7 +101,7 @@ public function save() { } public function add($newLaw) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO law SET @@ -125,7 +131,7 @@ public function add($newLaw) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM law WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/demeter/class/law/VoteLawManager.class.php b/system/Modules/Demeter/Manager/Law/VoteLawManager.php old mode 100755 new mode 100644 similarity index 85% rename from system/modules/demeter/class/law/VoteLawManager.class.php rename to system/Modules/Demeter/Manager/Law/VoteLawManager.php index 1af88682a..88a0ec5f6 --- a/system/modules/demeter/class/law/VoteLawManager.class.php +++ b/system/Modules/Demeter/Manager/Law/VoteLawManager.php @@ -9,6 +9,12 @@ * @package Demeter * @update 29.09.14 */ +namespace Asylamba\Modules\Demeter\Manager\Law; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Demeter\Model\Law\VoteLaw; class VoteLawManager extends Manager { protected $managerType ='_VoteLaw'; @@ -18,7 +24,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT v.* FROM voteLaw AS v ' . $formatWhere .' @@ -59,7 +65,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $voteLaws = $this->_Save(); @@ -84,7 +90,7 @@ public function save() { } public function add($newVoteLaw) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO voteLaw SET rLaw = ?, @@ -107,7 +113,7 @@ public function add($newVoteLaw) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM voteLaw WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/demeter/class/Color.class.php b/system/Modules/Demeter/Model/Color.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/demeter/class/Color.class.php rename to system/Modules/Demeter/Model/Color.php index e921df014..f52b3f0e1 --- a/system/modules/demeter/class/Color.class.php +++ b/system/Modules/Demeter/Model/Color.php @@ -9,8 +9,18 @@ * @package Demeter * @update 06.10.13 */ -include_once ZEUS; -include_once ATHENA; + +namespace Asylamba\Modules\Demeter\Model; + +use Asylamba\Classes\Library\Parser; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTC; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Hermes\Model\Notification; +use Asylamba\Modules\Demeter\Model\Election\Election; +use Asylamba\Modules\Hermes\Model\ConversationUser; +use Asylamba\Modules\Demeter\Resource\LawResources; +use Asylamba\Modules\Demeter\Model\Law\Law; class Color { # Regime @@ -378,7 +388,9 @@ public function uCampaign($token_pam) { ASM::$elm->newSession(); $election = new Election(); $election->rColor = $this->id; - + // @WARNING : DEFAULT VALUE + $election->dElection = new \DateTime(); + /*$date = new DateTime($this->dLastElection); $date->modify('+' . $this->mandateDuration + self::ELECTIONTIME + self::CAMPAIGNTIME . ' second'); $election->dElection = $date->format('Y-m-d H:i:s');*/ @@ -666,7 +678,7 @@ public function uMethod() { $token_pam = ASM::$pam->getCurrentSession(); ASM::$pam->changeSession($_PAM); - $date = new DateTime($this->dLastElection); + $date = new \DateTime($this->dLastElection); $date->modify('+' . $this->mandateDuration . ' second'); $date = $date->format('Y-m-d H:i:s'); @@ -674,7 +686,7 @@ public function uMethod() { } } elseif ($this->electionStatement == self::CAMPAIGN) { if (Utils::interval($this->dLastElection, Utils::now(), 's') > $this->mandateDuration + self::CAMPAIGNTIME) { - $date = new DateTime($this->dLastElection); + $date = new \DateTime($this->dLastElection); $date->modify('+' . $this->mandateDuration . ' second'); $date = $date->format('Y-m-d H:i:s'); @@ -682,7 +694,7 @@ public function uMethod() { } } else { if (Utils::interval($this->dLastElection, Utils::now(), 's') > $this->mandateDuration + self::ELECTIONTIME + self::CAMPAIGNTIME) { - $date = new DateTime($this->dLastElection); + $date = new \DateTime($this->dLastElection); $date->modify('+' . $this->mandateDuration + self::ELECTIONTIME + self::CAMPAIGNTIME . ' second'); $date = $date->format('Y-m-d H:i:s'); @@ -704,7 +716,7 @@ public function uMethod() { $token_pam = ASM::$pam->getCurrentSession(); ASM::$pam->changeSession($_PAM); - $date = new DateTime($this->dLastElection); + $date = new \DateTime($this->dLastElection); $date->modify('+' . $this->mandateDuration . ' second'); $date = $date->format('Y-m-d H:i:s'); @@ -712,7 +724,7 @@ public function uMethod() { } } elseif ($this->electionStatement == self::ELECTION) { if (Utils::interval($this->dLastElection, Utils::now(), 's') > self::PUTSCHTIME) { - $date = new DateTime($this->dLastElection); + $date = new \DateTime($this->dLastElection); $date->modify('+' . $this->mandateDuration + self::ELECTIONTIME + self::CAMPAIGNTIME . ' second'); $date = $date->format('Y-m-d H:i:s'); @@ -742,7 +754,7 @@ public function uMethod() { $token_pam = ASM::$pam->getCurrentSession(); ASM::$pam->changeSession($_PAM); - $date = new DateTime($this->dLastElection); + $date = new \DateTime($this->dLastElection); $date->modify('+' . $this->mandateDuration . ' second'); $date = $date->format('Y-m-d H:i:s'); @@ -750,7 +762,7 @@ public function uMethod() { } } else { if (Utils::interval($this->dLastElection, Utils::now(), 's') > $this->mandateDuration + self::CAMPAIGNTIME) { - $date = new DateTime($this->dLastElection); + $date = new \DateTime($this->dLastElection); $date->modify('+' . $this->mandateDuration + self::ELECTIONTIME + self::CAMPAIGNTIME . ' second'); $date = $date->format('Y-m-d H:i:s'); diff --git a/system/modules/demeter/class/election/Candidate.class.php b/system/Modules/Demeter/Model/Election/Candidate.php old mode 100755 new mode 100644 similarity index 91% rename from system/modules/demeter/class/election/Candidate.class.php rename to system/Modules/Demeter/Model/Election/Candidate.php index 6b8dbe084..aa7644179 --- a/system/modules/demeter/class/election/Candidate.class.php +++ b/system/Modules/Demeter/Model/Election/Candidate.php @@ -9,6 +9,7 @@ * @package Demeter * @update 06.10.13 */ +namespace Asylamba\Modules\Demeter\Model\Election; class Candidate { public $id = 0; diff --git a/system/modules/demeter/class/election/Election.class.php b/system/Modules/Demeter/Model/Election/Election.php old mode 100755 new mode 100644 similarity index 84% rename from system/modules/demeter/class/election/Election.class.php rename to system/Modules/Demeter/Model/Election/Election.php index 6819a7780..edf621fb4 --- a/system/modules/demeter/class/election/Election.class.php +++ b/system/Modules/Demeter/Model/Election/Election.php @@ -9,6 +9,7 @@ * @package Demeter * @update 06.10.13 */ +namespace Asylamba\Modules\Demeter\Model\Election; class Election { public $id = 0; diff --git a/system/modules/demeter/class/election/Vote.class.php b/system/Modules/Demeter/Model/Election/Vote.php old mode 100755 new mode 100644 similarity index 86% rename from system/modules/demeter/class/election/Vote.class.php rename to system/Modules/Demeter/Model/Election/Vote.php index 0deab63e0..e2c0f2b5a --- a/system/modules/demeter/class/election/Vote.class.php +++ b/system/Modules/Demeter/Model/Election/Vote.php @@ -9,6 +9,7 @@ * @package Demeter * @update 06.10.13 */ +namespace Asylamba\Modules\Demeter\Model\Election; class Vote { public $id = 0; diff --git a/system/modules/demeter/class/forum/FactionNews.class.php b/system/Modules/Demeter/Model/Forum/FactionNews.php old mode 100755 new mode 100644 similarity index 87% rename from system/modules/demeter/class/forum/FactionNews.class.php rename to system/Modules/Demeter/Model/Forum/FactionNews.php index ab81e7814..b33f67f20 --- a/system/modules/demeter/class/forum/FactionNews.class.php +++ b/system/Modules/Demeter/Model/Forum/FactionNews.php @@ -9,6 +9,9 @@ * @package Demeter * @update 09.01.15 */ +namespace Asylamba\Modules\Demeter\Model\Forum; + +use Asylamba\Classes\Library\Parser; class FactionNews { const STANDARD = 0; diff --git a/system/modules/demeter/class/forum/ForumMessage.class.php b/system/Modules/Demeter/Model/Forum/ForumMessage.php old mode 100755 new mode 100644 similarity index 91% rename from system/modules/demeter/class/forum/ForumMessage.class.php rename to system/Modules/Demeter/Model/Forum/ForumMessage.php index 7893048a6..cf265ed0c --- a/system/modules/demeter/class/forum/ForumMessage.class.php +++ b/system/Modules/Demeter/Model/Forum/ForumMessage.php @@ -9,6 +9,9 @@ * @package Demeter * @update 06.10.13 */ +namespace Asylamba\Modules\Demeter\Model\Forum; + +use Asylamba\Classes\Library\Parser; class ForumMessage { const PUBLISHED = 1; diff --git a/system/modules/demeter/class/forum/ForumTopic.class.php b/system/Modules/Demeter/Model/Forum/ForumTopic.php old mode 100755 new mode 100644 similarity index 84% rename from system/modules/demeter/class/forum/ForumTopic.class.php rename to system/Modules/Demeter/Model/Forum/ForumTopic.php index 2eab9cfb3..f776a78f1 --- a/system/modules/demeter/class/forum/ForumTopic.class.php +++ b/system/Modules/Demeter/Model/Forum/ForumTopic.php @@ -9,6 +9,10 @@ * @package Demeter * @update 06.10.13 */ +namespace Asylamba\Modules\Demeter\Model\Forum; + +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; class ForumTopic { public $id = 0; @@ -31,7 +35,7 @@ public function getId() { return $this->id; } public function updateLastView($playerId) { if ($this->lastView == NULL) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO forumLastView SET @@ -45,7 +49,7 @@ public function updateLastView($playerId) { ) ); } else { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE forumLastView SET diff --git a/system/modules/demeter/class/law/Law.class.php b/system/Modules/Demeter/Model/Law/Law.php old mode 100755 new mode 100644 similarity index 94% rename from system/modules/demeter/class/law/Law.class.php rename to system/Modules/Demeter/Model/Law/Law.php index 7c494a571..dd997686a --- a/system/modules/demeter/class/law/Law.class.php +++ b/system/Modules/Demeter/Model/Law/Law.php @@ -9,6 +9,9 @@ * @package Demeter * @update 29.09.14 */ +namespace Asylamba\Modules\Demeter\Model\Law; + +use Asylamba\Classes\Worker\ASM; class Law { const VOTATION = 0; diff --git a/system/modules/demeter/class/law/VoteLaw.class.php b/system/Modules/Demeter/Model/Law/VoteLaw.php old mode 100755 new mode 100644 similarity index 87% rename from system/modules/demeter/class/law/VoteLaw.class.php rename to system/Modules/Demeter/Model/Law/VoteLaw.php index 75ce11f46..6f2839c8a --- a/system/modules/demeter/class/law/VoteLaw.class.php +++ b/system/Modules/Demeter/Model/Law/VoteLaw.php @@ -9,6 +9,7 @@ * @package Demeter * @update 29.09.14 */ +namespace Asylamba\Modules\Demeter\Model\Law; class VoteLaw { public $id = 0; diff --git a/system/modules/demeter/resource/ColorResource.class.php b/system/Modules/Demeter/Resource/ColorResource.php old mode 100755 new mode 100644 similarity index 99% rename from system/modules/demeter/resource/ColorResource.class.php rename to system/Modules/Demeter/Resource/ColorResource.php index 384376335..b4752699d --- a/system/modules/demeter/resource/ColorResource.class.php +++ b/system/Modules/Demeter/Resource/ColorResource.php @@ -1,4 +1,7 @@ = 10 < 20 = pour le gouvernement d'une fac, >= 20 pour les chefs de toutes les factions Class ForumResources { diff --git a/system/modules/demeter/resource/LawResources.php b/system/Modules/Demeter/Resource/LawResources.php similarity index 99% rename from system/modules/demeter/resource/LawResources.php rename to system/Modules/Demeter/Resource/LawResources.php index 14b7e4481..4feafd16a 100755 --- a/system/modules/demeter/resource/LawResources.php +++ b/system/Modules/Demeter/Resource/LawResources.php @@ -9,6 +9,7 @@ * @package Demeter * @update 29.09.14 */ +namespace Asylamba\Modules\Demeter\Resource; #id des forums : < 10 = pour tous les gens d'une faction, >= 10 < 20 = pour le gouvernement d'une fac, >= 20 pour les chefs de toutes les factions Class LawResources { diff --git a/system/Modules/Demeter/main.php b/system/Modules/Demeter/main.php new file mode 100755 index 000000000..e7cb30c77 --- /dev/null +++ b/system/Modules/Demeter/main.php @@ -0,0 +1,3 @@ + Date: Sun, 23 Oct 2016 00:26:12 +0200 Subject: [PATCH 17/64] Refactor Gaia module architecture --- .../Gaia/Helper/ActionHelper.php} | 17 ++++++++-- .../Gaia/Helper/GalaxyGenerator.php} | 22 +++++++++--- .../Gaia/Manager/GalaxyColorManager.php} | 13 ++++--- .../Gaia/Manager/PlaceManager.php} | 22 +++++++----- .../Gaia/Manager/SectorManager.php} | 12 +++++-- .../Gaia/Manager/SystemManager.php} | 11 ++++-- .../Gaia/Model/Place.php} | 18 ++++++++++ .../Gaia/Model/PointLocation.php} | 3 ++ .../Gaia/Model/Sector.php} | 1 + .../Gaia/Model/System.php} | 1 + .../Gaia/Resource/PlaceResource.php} | 6 ++-- .../Gaia/Resource/SquadronResource.php} | 8 +++-- .../Gaia/Resource/SystemResource.php} | 6 ++-- .../gaia => Modules/Gaia}/main.conf.php | 0 system/Modules/Gaia/main.php | 15 ++++++++ system/modules/gaia/main.php | 34 ------------------- 16 files changed, 125 insertions(+), 64 deletions(-) rename system/{modules/gaia/class/ActionHelper.class.php => Modules/Gaia/Helper/ActionHelper.php} (98%) mode change 100755 => 100644 rename system/{modules/gaia/class/GalaxyGenerator.class.php => Modules/Gaia/Helper/GalaxyGenerator.php} (96%) mode change 100755 => 100644 rename system/{modules/gaia/class/GalaxyColorManager.class.php => Modules/Gaia/Manager/GalaxyColorManager.php} (94%) mode change 100755 => 100644 rename system/{modules/gaia/class/PlaceManager.class.php => Modules/Gaia/Manager/PlaceManager.php} (93%) mode change 100755 => 100644 rename system/{modules/gaia/class/SectorManager.class.php => Modules/Gaia/Manager/SectorManager.php} (92%) mode change 100755 => 100644 rename system/{modules/gaia/class/SystemManager.class.php => Modules/Gaia/Manager/SystemManager.php} (84%) mode change 100755 => 100644 rename system/{modules/gaia/class/Place.class.php => Modules/Gaia/Model/Place.php} (98%) mode change 100755 => 100644 rename system/{modules/gaia/class/PointLocation.class.php => Modules/Gaia/Model/PointLocation.php} (98%) mode change 100755 => 100644 rename system/{modules/gaia/class/Sector.class.php => Modules/Gaia/Model/Sector.php} (98%) mode change 100755 => 100644 rename system/{modules/gaia/class/System.class.php => Modules/Gaia/Model/System.php} (89%) mode change 100755 => 100644 rename system/{modules/gaia/resource/PlaceResource.res.php => Modules/Gaia/Resource/PlaceResource.php} (98%) mode change 100755 => 100644 rename system/{modules/gaia/resource/SquadronResource.res.php => Modules/Gaia/Resource/SquadronResource.php} (98%) mode change 100755 => 100644 rename system/{modules/gaia/resource/SystemResource.res.php => Modules/Gaia/Resource/SystemResource.php} (92%) mode change 100755 => 100644 rename system/{modules/gaia => Modules/Gaia}/main.conf.php (100%) create mode 100755 system/Modules/Gaia/main.php delete mode 100755 system/modules/gaia/main.php diff --git a/system/modules/gaia/class/ActionHelper.class.php b/system/Modules/Gaia/Helper/ActionHelper.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/gaia/class/ActionHelper.class.php rename to system/Modules/Gaia/Helper/ActionHelper.php index 26dea2223..765bcac1e --- a/system/modules/gaia/class/ActionHelper.class.php +++ b/system/Modules/Gaia/Helper/ActionHelper.php @@ -1,4 +1,18 @@ '; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/gaia/class/GalaxyGenerator.class.php b/system/Modules/Gaia/Helper/GalaxyGenerator.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/gaia/class/GalaxyGenerator.class.php rename to system/Modules/Gaia/Helper/GalaxyGenerator.php index 043974203..bb00a9c70 --- a/system/modules/gaia/class/GalaxyGenerator.class.php +++ b/system/Modules/Gaia/Helper/GalaxyGenerator.php @@ -1,4 +1,17 @@ query('SET FOREIGN_KEY_CHECKS = 0;'); @@ -49,7 +62,7 @@ public static function clear() { } public static function save() { - $db = DataBaseAdmin::getInstance(); + $db = DatabaseAdmin::getInstance(); # clean up database self::clear(); @@ -405,7 +418,7 @@ public static function associateSystemToSector() { } private static function getStatisticsSector() { - $db = DataBaseAdmin::getInstance(); + $db = DatabaseAdmin::getInstance(); foreach (self::$listSector as $sector) { $id = $sector[0]; @@ -524,5 +537,4 @@ private static function getNbOfPlace($systemType) { private static function getTypeOfPlace($systemType) { return self::getProportion(GalaxyConfiguration::$systems[$systemType - 1]['placesPropotion'], rand(1, 100)); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/gaia/class/GalaxyColorManager.class.php b/system/Modules/Gaia/Manager/GalaxyColorManager.php old mode 100755 new mode 100644 similarity index 94% rename from system/modules/gaia/class/GalaxyColorManager.class.php rename to system/Modules/Gaia/Manager/GalaxyColorManager.php index 3c6d2f1c8..6afe7f5d6 --- a/system/modules/gaia/class/GalaxyColorManager.class.php +++ b/system/Modules/Gaia/Manager/GalaxyColorManager.php @@ -1,5 +1,10 @@ system as $k => $v) { if ($v['hasChanged'] == TRUE) { $qr = $db->prepare('UPDATE system SET rColor = ? WHERE id = ?'); @@ -64,7 +69,7 @@ public function saveSystem() { } public function loadSector() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->query('SELECT id, rColor, prime FROM sector ORDER BY id'); while ($aw = $qr->fetch()) { $this->sector[$aw['id']] = array( @@ -76,7 +81,7 @@ public function loadSector() { } public function saveSector() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); foreach ($this->sector as $k => $v) { if ($v['hasChanged'] == TRUE) { $qr = $db->prepare('UPDATE sector SET rColor = ?, prime = ? WHERE id = ?'); diff --git a/system/modules/gaia/class/PlaceManager.class.php b/system/Modules/Gaia/Manager/PlaceManager.php old mode 100755 new mode 100644 similarity index 93% rename from system/modules/gaia/class/PlaceManager.class.php rename to system/Modules/Gaia/Manager/PlaceManager.php index 1da39b760..70036fecd --- a/system/modules/gaia/class/PlaceManager.class.php +++ b/system/Modules/Gaia/Manager/PlaceManager.php @@ -9,8 +9,15 @@ * @package Gaia * @update 20.05.13 */ +namespace Asylamba\Modules\Gaia\Manager; -include_once ARES; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Gaia\Model\Place; class PlaceManager extends Manager { protected $managerType = '_Place'; @@ -22,7 +29,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order, 'p.'); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT p.*, s.rSector AS rSector, s.xPosition AS xPosition, @@ -81,7 +88,7 @@ public function search($search, $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT p.*, s.rSector AS rSector, s.xPosition AS xPosition, @@ -193,7 +200,7 @@ protected function fill($qr) { } public static function add(Place $p) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO place(rPlayer, rSystem, typeOfPlace, position, population, coefResources, coefHistory, resources, danger, maxDanger, uPlace) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); @@ -220,7 +227,7 @@ public function save() { $places = $this->_Save(); foreach ($places AS $p) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE place SET id = ?, @@ -255,12 +262,11 @@ public function save() { } public static function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM place WHERE id = ?'); $qr->execute(array($id)); $this->_Remove($id); return TRUE; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/gaia/class/SectorManager.class.php b/system/Modules/Gaia/Manager/SectorManager.php old mode 100755 new mode 100644 similarity index 92% rename from system/modules/gaia/class/SectorManager.class.php rename to system/Modules/Gaia/Manager/SectorManager.php index 723a22ed2..63355e0fa --- a/system/modules/gaia/class/SectorManager.class.php +++ b/system/Modules/Gaia/Manager/SectorManager.php @@ -9,6 +9,12 @@ * @package Gaia * @update 20.05.13 */ +namespace Asylamba\Modules\Gaia\Manager; + +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Worker\Manager; +use Asylamba\Modules\Gaia\Model\Sector; class SectorManager extends Manager { protected $managerType = '_Sector'; @@ -39,7 +45,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM sector ' . $formatWhere . ' @@ -93,7 +99,7 @@ public function loadByOr($module, $list = array()) { foreach ($list as $v) { $query .= $module . ' = ? OR '; } $query = trim($query, 'OR '); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT DISTINCT(se.id), se.* @@ -139,7 +145,7 @@ public function loadByOr($module, $list = array()) { public function save() { $sectors = $this->_Save(); foreach ($sectors AS $s) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE sector SET rSurrender = ?, diff --git a/system/modules/gaia/class/SystemManager.class.php b/system/Modules/Gaia/Manager/SystemManager.php old mode 100755 new mode 100644 similarity index 84% rename from system/modules/gaia/class/SystemManager.class.php rename to system/Modules/Gaia/Manager/SystemManager.php index 4c8fbfc70..f6a5b3337 --- a/system/modules/gaia/class/SystemManager.class.php +++ b/system/Modules/Gaia/Manager/SystemManager.php @@ -9,6 +9,13 @@ * @package Gaia * @update 09.07.13 */ +namespace Asylamba\Modules\Gaia\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; + +use Asylamba\Modules\Gaia\Model\System; class SystemManager extends Manager { protected $managerType = '_System'; @@ -18,7 +25,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT s.* FROM system AS s ' . $formatWhere .' @@ -62,7 +69,7 @@ public function save() { $systems = $this->_Save(); foreach ($systems AS $s) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE system SET rColor = ? WHERE id = ?'); diff --git a/system/modules/gaia/class/Place.class.php b/system/Modules/Gaia/Model/Place.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/gaia/class/Place.class.php rename to system/Modules/Gaia/Model/Place.php index 5b421d382..5d5443bcf --- a/system/modules/gaia/class/Place.class.php +++ b/system/Modules/Gaia/Model/Place.php @@ -8,6 +8,24 @@ * @package Gaia * @update 21.04.13 */ +namespace Asylamba\Modules\Gaia\Model; + +use Asylamba\Modules\Ares\FightController; +use Asylamba\Classes\Worker\CTC; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Game; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Library\Format; + +use Asylamba\Modules\Zeus\Model\PlayerBonus; +use Asylamba\Modules\Ares\Model\Commander; +use Asylamba\Modules\Athena\Model\OrbitalBase; +use Asylamba\Modules\Ares\Model\LiveReport; +use Asylamba\Modules\Ares\Model\Report; +use Asylamba\Modules\Hermes\Model\Notification; + +use Asylamba\Modules\Gaia\Resource\SquadronResource; class Place { # CONSTANTS diff --git a/system/modules/gaia/class/PointLocation.class.php b/system/Modules/Gaia/Model/PointLocation.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/gaia/class/PointLocation.class.php rename to system/Modules/Gaia/Model/PointLocation.php index e49e4573b..83577e399 --- a/system/modules/gaia/class/PointLocation.class.php +++ b/system/Modules/Gaia/Model/PointLocation.php @@ -1,4 +1,7 @@ array(1, 3) ) ); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/gaia/resource/SquadronResource.res.php b/system/Modules/Gaia/Resource/SquadronResource.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/gaia/resource/SquadronResource.res.php rename to system/Modules/Gaia/Resource/SquadronResource.php index 64cf0ea03..03b68516c --- a/system/modules/gaia/resource/SquadronResource.res.php +++ b/system/Modules/Gaia/Resource/SquadronResource.php @@ -1,4 +1,9 @@ = self::size()) { @@ -102,5 +107,4 @@ public static function size() { # extrèmement fort officier (lvl 20) array(20, 20, array(2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)) ); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/gaia/resource/SystemResource.res.php b/system/Modules/Gaia/Resource/SystemResource.php old mode 100755 new mode 100644 similarity index 92% rename from system/modules/gaia/resource/SystemResource.res.php rename to system/Modules/Gaia/Resource/SystemResource.php index 4be48c66f..5d004555e --- a/system/modules/gaia/resource/SystemResource.res.php +++ b/system/Modules/Gaia/Resource/SystemResource.php @@ -1,4 +1,7 @@ 'Naine Rouge', ) ); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/gaia/main.conf.php b/system/Modules/Gaia/main.conf.php similarity index 100% rename from system/modules/gaia/main.conf.php rename to system/Modules/Gaia/main.conf.php diff --git a/system/Modules/Gaia/main.php b/system/Modules/Gaia/main.php new file mode 100755 index 000000000..6ed96e8be --- /dev/null +++ b/system/Modules/Gaia/main.php @@ -0,0 +1,15 @@ + quart supérieur droit de la carte, 2 ponts +#include_once SYSTEMR . 'config/galaxies/GalaxyConfiguration.v2.php'; +# s8 - révolution cardanienne --> bandeau +include_once SYSTEMR . 'config/galaxies/GalaxyConfiguration.v3.php'; +# s9 - empire contre-attaque --> quart de carte, 2 ponts +#include_once SYSTEMR . 'config/galaxies/GalaxyConfiguration.v4.php'; +# s10 - chute des archontes --> carte entière, 7 ponts +#include_once SYSTEMR . 'config/galaxies/GalaxyConfiguration.v1.php'; + +\Asylamba\Classes\Worker\ASM::runGaia(); \ No newline at end of file diff --git a/system/modules/gaia/main.php b/system/modules/gaia/main.php deleted file mode 100755 index e4c1348b8..000000000 --- a/system/modules/gaia/main.php +++ /dev/null @@ -1,34 +0,0 @@ - quart supérieur droit de la carte, 2 ponts -#include_once SYSTEMR . 'config/galaxies/GalaxyConfiguration.v2.php'; -# s8 - révolution cardanienne --> bandeau -include_once SYSTEMR . 'config/galaxies/GalaxyConfiguration.v3.php'; -# s9 - empire contre-attaque --> quart de carte, 2 ponts -#include_once SYSTEMR . 'config/galaxies/GalaxyConfiguration.v4.php'; -# s10 - chute des archontes --> carte entière, 7 ponts -#include_once SYSTEMR . 'config/galaxies/GalaxyConfiguration.v1.php'; - -include_once 'class/GalaxyGenerator.class.php'; -include_once 'class/PointLocation.class.php'; -include_once 'class/SectorManager.class.php'; -include_once 'class/Sector.class.php'; -include_once 'class/Place.class.php'; -include_once 'class/PlaceManager.class.php'; -include_once 'class/System.class.php'; -include_once 'class/SystemManager.class.php'; - -include_once 'class/ActionHelper.class.php'; - -ASM::runGaia(); -?> \ No newline at end of file From 5a368ed6bec5040865318fa4094bee5d72f0db68 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sun, 23 Oct 2016 00:26:41 +0200 Subject: [PATCH 18/64] Refactor Hermes module architecture --- .../Hermes/Manager}/ConversationManager.php | 18 +++++++++++++---- .../Manager}/ConversationMessageManager.php | 17 ++++++++++++---- .../Manager}/ConversationUserManager.php | 16 +++++++++++---- .../Hermes/Manager/NotificationManager.php} | 18 +++++++++++------ .../Hermes/Manager/RoadMapManager.php} | 15 ++++++++++---- .../Hermes/Model}/Conversation.php | 3 +++ .../Hermes/Model}/ConversationMessage.php | 3 +++ .../Hermes/Model}/ConversationUser.php | 3 +++ .../Hermes/Model/Notification.php} | 8 ++++++-- .../Hermes/Model/RoadMap.php} | 7 +++++-- .../hermes => Modules/Hermes}/main.conf.php | 0 system/Modules/Hermes/main.php | 5 +++++ system/modules/hermes/main.php | 20 ------------------- 13 files changed, 87 insertions(+), 46 deletions(-) rename system/{modules/hermes/class => Modules/Hermes/Manager}/ConversationManager.php (87%) rename system/{modules/hermes/class => Modules/Hermes/Manager}/ConversationMessageManager.php (88%) rename system/{modules/hermes/class => Modules/Hermes/Manager}/ConversationUserManager.php (88%) rename system/{modules/hermes/class/NotificationManager.class.php => Modules/Hermes/Manager/NotificationManager.php} (87%) mode change 100755 => 100644 rename system/{modules/hermes/class/RoadMapManager.class.php => Modules/Hermes/Manager/RoadMapManager.php} (86%) mode change 100755 => 100644 rename system/{modules/hermes/class => Modules/Hermes/Model}/Conversation.php (91%) rename system/{modules/hermes/class => Modules/Hermes/Model}/ConversationMessage.php (91%) rename system/{modules/hermes/class => Modules/Hermes/Model}/ConversationUser.php (94%) rename system/{modules/hermes/class/Notification.class.php => Modules/Hermes/Model/Notification.php} (95%) mode change 100755 => 100644 rename system/{modules/hermes/class/RoadMap.class.php => Modules/Hermes/Model/RoadMap.php} (91%) mode change 100755 => 100644 rename system/{modules/hermes => Modules/Hermes}/main.conf.php (100%) create mode 100755 system/Modules/Hermes/main.php delete mode 100755 system/modules/hermes/main.php diff --git a/system/modules/hermes/class/ConversationManager.php b/system/Modules/Hermes/Manager/ConversationManager.php similarity index 87% rename from system/modules/hermes/class/ConversationManager.php rename to system/Modules/Hermes/Manager/ConversationManager.php index 556f6e4e7..bbe5c479c 100644 --- a/system/modules/hermes/class/ConversationManager.php +++ b/system/Modules/Hermes/Manager/ConversationManager.php @@ -1,9 +1,19 @@ prepare('SELECT c.* FROM conversation AS c LEFT JOIN conversationUser AS cu @@ -66,7 +76,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $convs = $this->_Save(); @@ -92,7 +102,7 @@ public function save() { } public function add($conv) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO conversation SET title = ?, @@ -117,7 +127,7 @@ public function add($conv) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM conversation WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/hermes/class/ConversationMessageManager.php b/system/Modules/Hermes/Manager/ConversationMessageManager.php similarity index 88% rename from system/modules/hermes/class/ConversationMessageManager.php rename to system/Modules/Hermes/Manager/ConversationMessageManager.php index ac6323621..4d239be88 100644 --- a/system/modules/hermes/class/ConversationMessageManager.php +++ b/system/Modules/Hermes/Manager/ConversationMessageManager.php @@ -1,4 +1,13 @@ prepare('SELECT c.*, p.rColor AS playerColor, p.name AS playerName, @@ -61,7 +70,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $messages = $this->_Save(); @@ -89,7 +98,7 @@ public function save() { } public function add($message) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO conversationMessage SET rConversation = ?, @@ -116,7 +125,7 @@ public function add($message) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM conversationMessage WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/hermes/class/ConversationUserManager.php b/system/Modules/Hermes/Manager/ConversationUserManager.php similarity index 88% rename from system/modules/hermes/class/ConversationUserManager.php rename to system/Modules/Hermes/Manager/ConversationUserManager.php index 842697b39..381794a92 100644 --- a/system/modules/hermes/class/ConversationUserManager.php +++ b/system/Modules/Hermes/Manager/ConversationUserManager.php @@ -1,9 +1,17 @@ prepare('SELECT c.*, p.id AS playerId, p.rColor AS playerColor, @@ -57,7 +65,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function save() { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $userConvs = $this->_Save(); foreach ($userConvs AS $userConv) { @@ -82,7 +90,7 @@ public function save() { } public function add($userConv) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO conversationUser SET rConversation = ?, @@ -107,7 +115,7 @@ public function add($userConv) { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM conversationUser WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/hermes/class/NotificationManager.class.php b/system/Modules/Hermes/Manager/NotificationManager.php old mode 100755 new mode 100644 similarity index 87% rename from system/modules/hermes/class/NotificationManager.class.php rename to system/Modules/Hermes/Manager/NotificationManager.php index 1e08b87cb..031b51e0a --- a/system/modules/hermes/class/NotificationManager.class.php +++ b/system/Modules/Hermes/Manager/NotificationManager.php @@ -9,6 +9,12 @@ * @package Hermes * @update 20.05.13 */ +namespace Asylamba\Modules\Hermes\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Hermes\Model\Notification; class NotificationManager extends Manager { protected $managerType = '_Notification'; @@ -18,7 +24,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM notification ' . $formatWhere . ' @@ -58,7 +64,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function add(Notification $n) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO notification(rPlayer, title, content, dSending, readed, archived) VALUES(?, ?, ?, ?, ?, ?)'); @@ -80,7 +86,7 @@ public function save() { $notifications = $this->_Save(); foreach ($notifications AS $n) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE notification SET id = ?, rPlayer = ?, @@ -104,7 +110,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM notification WHERE id = ?'); $qr->execute(array($id)); @@ -113,7 +119,7 @@ public function deleteById($id) { } public function deleteByRPlayer($rPlayer) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM notification WHERE rPlayer = ? AND archived = 0'); $qr->execute(array($rPlayer)); @@ -131,7 +137,7 @@ public function deleteByRPlayer($rPlayer) { public static function countAll($where = array()) { $formatWhere = Utils::arrayToWhere($where); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT COUNT(id) AS nbr FROM notification diff --git a/system/modules/hermes/class/RoadMapManager.class.php b/system/Modules/Hermes/Manager/RoadMapManager.php old mode 100755 new mode 100644 similarity index 86% rename from system/modules/hermes/class/RoadMapManager.class.php rename to system/Modules/Hermes/Manager/RoadMapManager.php index b0dd0833e..782b950e0 --- a/system/modules/hermes/class/RoadMapManager.class.php +++ b/system/Modules/Hermes/Manager/RoadMapManager.php @@ -9,6 +9,13 @@ * @package Hermes * @update 21.12.13 */ +namespace Asylamba\Modules\Hermes\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Hermes\Model\RoadMap; class RoadMapManager extends Manager { protected $managerType = '_RoadMap'; @@ -18,7 +25,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT r.*, p.name AS name, @@ -67,7 +74,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function add(RoadMap $rm) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO roadMap(rPlayer, oContent, pContent, statement, dCreation) VALUES(?, ?, ?, ?, ?)'); @@ -88,7 +95,7 @@ public function save() { $roadmap = $this->_Save(); foreach ($roadmap AS $rm) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE roadMap SET rPlayer = ?, oContent = ?, @@ -108,7 +115,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM roadMap WHERE id = ?'); $qr->execute(array($id)); diff --git a/system/modules/hermes/class/Conversation.php b/system/Modules/Hermes/Model/Conversation.php similarity index 91% rename from system/modules/hermes/class/Conversation.php rename to system/Modules/Hermes/Model/Conversation.php index 9bff46fda..d69102035 100644 --- a/system/modules/hermes/class/Conversation.php +++ b/system/Modules/Hermes/Model/Conversation.php @@ -1,4 +1,7 @@ add('La notification peut être archivée ou non-archivée, il n\' a pas d\'autres possibilités !'); } } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/hermes/class/RoadMap.class.php b/system/Modules/Hermes/Model/RoadMap.php old mode 100755 new mode 100644 similarity index 91% rename from system/modules/hermes/class/RoadMap.class.php rename to system/Modules/Hermes/Model/RoadMap.php index 96095a383..04a91f74a --- a/system/modules/hermes/class/RoadMap.class.php +++ b/system/Modules/Hermes/Model/RoadMap.php @@ -10,6 +10,10 @@ * @update 21.10.13 */ +namespace Asylamba\Modules\Hermes\Model; + +use Asylamba\Classes\Library\Parser; + class RoadMap { // ATTRIBUTES public $id = 0; @@ -44,5 +48,4 @@ public function setContent($content) { public function hide() { $this->statement = 0; } public function show() { $this->statement = 1; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/hermes/main.conf.php b/system/Modules/Hermes/main.conf.php similarity index 100% rename from system/modules/hermes/main.conf.php rename to system/Modules/Hermes/main.conf.php diff --git a/system/Modules/Hermes/main.php b/system/Modules/Hermes/main.php new file mode 100755 index 000000000..e048f7163 --- /dev/null +++ b/system/Modules/Hermes/main.php @@ -0,0 +1,5 @@ + \ No newline at end of file From 8e13b7c0e9c18cd3a36173721de1221dfaa96ac5 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sun, 23 Oct 2016 00:27:11 +0200 Subject: [PATCH 19/64] Refactor Promethee module architecture --- .../Promethee/Manager/ResearchManager.php} | 16 +++++++++++----- .../Manager/TechnologyQueueManager.php} | 17 +++++++++++------ .../Promethee/Model/Research.php} | 11 +++++++++-- .../Promethee/Model/Technology.php} | 17 +++++++++++------ .../Promethee/Model/TechnologyQueue.php} | 4 ++-- .../Promethee/Resource/ResearchResource.php} | 8 ++++++-- .../Promethee/Resource/TechnologyResource.php} | 11 +++++++++++ .../Promethee}/main.conf.php | 0 system/Modules/Promethee/main.php | 5 +++++ system/modules/promethee/main.php | 17 ----------------- 10 files changed, 66 insertions(+), 40 deletions(-) rename system/{modules/promethee/class/ResearchManager.class.php => Modules/Promethee/Manager/ResearchManager.php} (92%) mode change 100755 => 100644 rename system/{modules/promethee/class/TechnologyQueueManager.class.php => Modules/Promethee/Manager/TechnologyQueueManager.php} (86%) mode change 100755 => 100644 rename system/{modules/promethee/class/Research.class.php => Modules/Promethee/Model/Research.php} (96%) mode change 100755 => 100644 rename system/{modules/promethee/class/Technology.class.php => Modules/Promethee/Model/Technology.php} (96%) mode change 100755 => 100644 rename system/{modules/promethee/class/TechnologyQueue.class.php => Modules/Promethee/Model/TechnologyQueue.php} (88%) mode change 100755 => 100644 rename system/{modules/promethee/resource/ResearchResource.class.php => Modules/Promethee/Resource/ResearchResource.php} (98%) mode change 100755 => 100644 rename system/{modules/promethee/resource/TechnologyResource.class.php => Modules/Promethee/Resource/TechnologyResource.php} (99%) mode change 100755 => 100644 rename system/{modules/promethee => Modules/Promethee}/main.conf.php (100%) create mode 100755 system/Modules/Promethee/main.php delete mode 100755 system/modules/promethee/main.php diff --git a/system/modules/promethee/class/ResearchManager.class.php b/system/Modules/Promethee/Manager/ResearchManager.php old mode 100755 new mode 100644 similarity index 92% rename from system/modules/promethee/class/ResearchManager.class.php rename to system/Modules/Promethee/Manager/ResearchManager.php index feb808c3a..c8b47bc5e --- a/system/modules/promethee/class/ResearchManager.class.php +++ b/system/Modules/Promethee/Manager/ResearchManager.php @@ -10,6 +10,13 @@ * @update 20.05.13 */ +namespace Asylamba\Modules\Promethee\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Promethee\Model\Research; + class ResearchManager extends Manager { protected $managerType = '_Research'; @@ -18,7 +25,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM research ' . $formatWhere . ' @@ -70,7 +77,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function add(Research $res) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO research(rPlayer, mathLevel, physLevel, chemLevel, bioLevel, mediLevel, econoLevel, psychoLevel, networkLevel, algoLevel, statLevel, naturalTech, lifeTech, socialTech, informaticTech, naturalToPay, lifeToPay, socialToPay, informaticToPay) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); @@ -103,7 +110,7 @@ public function save() { $researches = $this->_Save(); foreach ($researches AS $k => $res) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE research SET rPlayer = ?, mathLevel = ?, @@ -161,5 +168,4 @@ public static function deleteByRPlayer($rPlayer) { $_SESSION[SERVERSESS]['alert'][] = array($e->getMessage(), $e->getCode()); } }*/ -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/promethee/class/TechnologyQueueManager.class.php b/system/Modules/Promethee/Manager/TechnologyQueueManager.php old mode 100755 new mode 100644 similarity index 86% rename from system/modules/promethee/class/TechnologyQueueManager.class.php rename to system/Modules/Promethee/Manager/TechnologyQueueManager.php index 264545402..ea482fc36 --- a/system/modules/promethee/class/TechnologyQueueManager.class.php +++ b/system/Modules/Promethee/Manager/TechnologyQueueManager.php @@ -8,6 +8,12 @@ * @package Prométhée * @update 10.02.14 */ +namespace Asylamba\Modules\Promethee\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Promethee\Model\TechnologyQueue; class TechnologyQueueManager extends Manager { protected $managerType = '_TechnologyQueue'; @@ -17,7 +23,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM technologyQueue ' . $formatWhere . ' @@ -57,7 +63,7 @@ public function load($where = array(), $order = array(), $limit = array()) { } public function add(TechnologyQueue $t) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO technologyQueue(rPlayer, rPlace, technology, targetLevel, dStart, dEnd) VALUES(?, ?, ?, ?, ?, ?)'); @@ -76,7 +82,7 @@ public function add(TechnologyQueue $t) { public function save() { $technologyQueues = $this->_Save(); foreach ($technologyQueues AS $k => $t) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE technologyQueue SET id = ?, rPlayer = ?, @@ -100,7 +106,7 @@ public function save() { } public function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM technologyQueue WHERE id = ?'); $qr->execute(array($id)); @@ -108,5 +114,4 @@ public function deleteById($id) { return TRUE; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/promethee/class/Research.class.php b/system/Modules/Promethee/Model/Research.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/promethee/class/Research.class.php rename to system/Modules/Promethee/Model/Research.php index 53b6a554e..64f3c4217 --- a/system/modules/promethee/class/Research.class.php +++ b/system/Modules/Promethee/Model/Research.php @@ -9,6 +9,14 @@ * @package Prométhée * @update 19.04.13 */ +namespace Asylamba\Modules\Promethee\Model; + +use Asylamba\Modules\Promethee\Resource\ResearchResource; +use Asylamba\Classes\Container\StackList; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Modules\Hermes\Model\Notification; +use Asylamba\Modules\Demeter\Resource\ColorResource; class Research { // ATTRIBUTES @@ -275,5 +283,4 @@ public function update($player, $naturalInvest, $lifeInvest, $socialInvest, $inf } while ($informaticInvest > 0); ASM::$pam->changeSession($S_PAM); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/promethee/class/Technology.class.php b/system/Modules/Promethee/Model/Technology.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/promethee/class/Technology.class.php rename to system/Modules/Promethee/Model/Technology.php index 7986f9a4f..d870c7d25 --- a/system/modules/promethee/class/Technology.class.php +++ b/system/Modules/Promethee/Model/Technology.php @@ -9,6 +9,12 @@ * @package Prométhée * @update 04.06.13 */ +namespace Asylamba\Modules\Promethee\Model; + +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Promethee\Resource\TechnologyResource; +use Asylamba\Modules\Zeus\Model\PlayerBonus; class Technology { // ATTRIBUTES @@ -128,7 +134,7 @@ class Technology { public function __construct($rPlayer) { $this->rPlayer = $rPlayer; - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM technology WHERE rPlayer = ?'); @@ -270,7 +276,7 @@ public function setTechnology($id, $value, $load = FALSE) { // ajouter une entr } public static function addTech($rPlayer, $technology, $level) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO technology(rPlayer, technology, level) VALUES(?, ?, ?)'); @@ -282,7 +288,7 @@ public static function addTech($rPlayer, $technology, $level) { } public function updateTech($technology, $level) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE technology SET level = ? WHERE rPlayer = ? AND technology = ?'); @@ -298,10 +304,9 @@ public function delete($techno) { } public static function deleteByRPlayer($rPlayer, $techno) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM technology WHERE rPlayer = ? and technology = ?'); $qr->execute(array($rPlayer, $techno)); return TRUE; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/promethee/class/TechnologyQueue.class.php b/system/Modules/Promethee/Model/TechnologyQueue.php old mode 100755 new mode 100644 similarity index 88% rename from system/modules/promethee/class/TechnologyQueue.class.php rename to system/Modules/Promethee/Model/TechnologyQueue.php index 4131a7da7..3075743e2 --- a/system/modules/promethee/class/TechnologyQueue.class.php +++ b/system/Modules/Promethee/Model/TechnologyQueue.php @@ -9,6 +9,7 @@ * @package Prométhée * @update 10.02.14 */ +namespace Asylamba\Modules\Promethee\Model; class TechnologyQueue { // ATTRIBUTES @@ -23,5 +24,4 @@ class TechnologyQueue { public function getId() { return $this->id; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/promethee/resource/ResearchResource.class.php b/system/Modules/Promethee/Resource/ResearchResource.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/promethee/resource/ResearchResource.class.php rename to system/Modules/Promethee/Resource/ResearchResource.php index 4374a2332..a91ed9074 --- a/system/modules/promethee/resource/ResearchResource.class.php +++ b/system/Modules/Promethee/Resource/ResearchResource.php @@ -1,4 +1,9 @@ 'statistics' ) ); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/promethee/resource/TechnologyResource.class.php b/system/Modules/Promethee/Resource/TechnologyResource.php old mode 100755 new mode 100644 similarity index 99% rename from system/modules/promethee/resource/TechnologyResource.class.php rename to system/Modules/Promethee/Resource/TechnologyResource.php index ae2c2e205..219a5674d --- a/system/modules/promethee/resource/TechnologyResource.class.php +++ b/system/Modules/Promethee/Resource/TechnologyResource.php @@ -1,4 +1,15 @@ From 771a6993bd1675b323fcf7333c89d3e32891951d Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Sun, 23 Oct 2016 00:27:47 +0200 Subject: [PATCH 20/64] Refactor Zeus module architecture --- .../Zeus/Helper/CheckName.php} | 6 ++-- .../Zeus/Helper/PlayerHelper.php} | 7 ++++- .../Zeus/Helper/TutorialHelper.php} | 9 ++++-- .../Manager/CreditTransactionManager.php} | 18 +++++++---- .../Zeus/Manager/PlayerManager.php} | 30 ++++++++++++++----- .../Zeus/Model/CreditTransaction.php} | 4 +++ .../Zeus/Model/Player.php} | 17 +++++++++++ .../Zeus/Model/PlayerBonus.php} | 18 ++++++++--- .../Zeus/Resource/TutorialResource.php} | 4 +-- .../zeus => Modules/Zeus}/main.conf.php | 0 system/Modules/Zeus/main.php | 5 ++++ system/modules/zeus/main.php | 18 ----------- 12 files changed, 93 insertions(+), 43 deletions(-) rename system/{modules/zeus/class/CheckName.class.php => Modules/Zeus/Helper/CheckName.php} (98%) mode change 100755 => 100644 rename system/{modules/zeus/class/PlayerHelper.class.php => Modules/Zeus/Helper/PlayerHelper.php} (82%) mode change 100755 => 100644 rename system/{modules/zeus/class/TutorialHelper.class.php => Modules/Zeus/Helper/TutorialHelper.php} (94%) mode change 100755 => 100644 rename system/{modules/zeus/class/CreditTransactionManager.class.php => Modules/Zeus/Manager/CreditTransactionManager.php} (89%) mode change 100755 => 100644 rename system/{modules/zeus/class/PlayerManager.class.php => Modules/Zeus/Manager/PlayerManager.php} (94%) mode change 100755 => 100644 rename system/{modules/zeus/class/CreditTransaction.class.php => Modules/Zeus/Model/CreditTransaction.php} (94%) mode change 100755 => 100644 rename system/{modules/zeus/class/Player.class.php => Modules/Zeus/Model/Player.php} (97%) mode change 100755 => 100644 rename system/{modules/zeus/class/PlayerBonus.class.php => Modules/Zeus/Model/PlayerBonus.php} (96%) mode change 100755 => 100644 rename system/{modules/zeus/resource/TutorialResource.class.php => Modules/Zeus/Resource/TutorialResource.php} (99%) mode change 100755 => 100644 rename system/{modules/zeus => Modules/Zeus}/main.conf.php (100%) create mode 100755 system/Modules/Zeus/main.php delete mode 100755 system/modules/zeus/main.php diff --git a/system/modules/zeus/class/CheckName.class.php b/system/Modules/Zeus/Helper/CheckName.php old mode 100755 new mode 100644 similarity index 98% rename from system/modules/zeus/class/CheckName.class.php rename to system/Modules/Zeus/Helper/CheckName.php index 84d45d634..d90c423dc --- a/system/modules/zeus/class/CheckName.class.php +++ b/system/Modules/Zeus/Helper/CheckName.php @@ -1,4 +1,7 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/zeus/class/PlayerHelper.class.php b/system/Modules/Zeus/Helper/PlayerHelper.php old mode 100755 new mode 100644 similarity index 82% rename from system/modules/zeus/class/PlayerHelper.class.php rename to system/Modules/Zeus/Helper/PlayerHelper.php index ad36a8c0d..57054ef58 --- a/system/modules/zeus/class/PlayerHelper.class.php +++ b/system/Modules/Zeus/Helper/PlayerHelper.php @@ -1,7 +1,12 @@ prepare('SELECT ob.rPlace, ob.name, sy.rSector FROM orbitalBase AS ob diff --git a/system/modules/zeus/class/TutorialHelper.class.php b/system/Modules/Zeus/Helper/TutorialHelper.php old mode 100755 new mode 100644 similarity index 94% rename from system/modules/zeus/class/TutorialHelper.class.php rename to system/Modules/Zeus/Helper/TutorialHelper.php index c771bdb34..e0a70d93a --- a/system/modules/zeus/class/TutorialHelper.class.php +++ b/system/Modules/Zeus/Helper/TutorialHelper.php @@ -9,6 +9,12 @@ * @package Zeus * @update 25.04.14 */ +namespace Asylamba\Modules\Zeus\Helper; + +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; + +use Asylamba\Modules\Promethee\Model\Technology; class TutorialHelper { public static function checkTutorial() { @@ -113,5 +119,4 @@ public static function isNextTechnoStepAlreadyDone($playerId, $technoId, $level return $nextStepAlreadyDone; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/zeus/class/CreditTransactionManager.class.php b/system/Modules/Zeus/Manager/CreditTransactionManager.php old mode 100755 new mode 100644 similarity index 89% rename from system/modules/zeus/class/CreditTransactionManager.class.php rename to system/Modules/Zeus/Manager/CreditTransactionManager.php index 5935ee96e..e3f0b42e6 --- a/system/modules/zeus/class/CreditTransactionManager.class.php +++ b/system/Modules/Zeus/Manager/CreditTransactionManager.php @@ -9,6 +9,13 @@ * @package Zeus * @version 09.02.15 **/ +namespace Asylamba\Modules\Zeus\Manager; + +use Asylamba\Classes\Worker\Manager; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; + +use Asylamba\Modules\Zeus\Model\CreditTransaction; class CreditTransactionManager extends Manager { protected $managerType = '_CreditTransaction'; @@ -18,7 +25,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT ct.*, p1.name AS receiverName, p1.avatar AS receiverAvatar, @@ -84,7 +91,7 @@ protected function fill($qr) { } public function add(CreditTransaction $ct) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO creditTransaction(rSender, type, rReceiver, amount, dTransaction, comment) VALUES(?, ?, ?, ?, ?, ?)'); @@ -106,7 +113,7 @@ public function save() { $cts = $this->_Save(); foreach ($cts AS $ct) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE creditTransaction SET id = ?, rSender = ?, @@ -130,7 +137,7 @@ public function save() { } public static function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM creditTransaction WHERE id = ?'); $qr->execute(array($id)); @@ -138,5 +145,4 @@ public static function deleteById($id) { return TRUE; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/zeus/class/PlayerManager.class.php b/system/Modules/Zeus/Manager/PlayerManager.php old mode 100755 new mode 100644 similarity index 94% rename from system/modules/zeus/class/PlayerManager.class.php rename to system/Modules/Zeus/Manager/PlayerManager.php index ba73428ec..050717c72 --- a/system/modules/zeus/class/PlayerManager.class.php +++ b/system/Modules/Zeus/Manager/PlayerManager.php @@ -9,6 +9,21 @@ * @package Zeus * @version 20.05.13 **/ +namespace Asylamba\Modules\Zeus\Manager; + +use Asylamba\Classes\Worker\Manager; + +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Worker\API; +use Asylamba\Classes\Worker\ASM; + +use Asylamba\Modules\Zeus\Model\Player; +use Asylamba\Modules\Promethee\Model\Technology; +use Asylamba\Modules\Athena\Model\OrbitalBase; +use Asylamba\Modules\Hermes\Model\Notification; + +use Asylamba\Modules\Gaia\Manager\GalaxyColorManager; class PlayerManager extends Manager { protected $managerType = '_Player'; @@ -18,7 +33,7 @@ public function load($where = array(), $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT p.* FROM player AS p ' . $formatWhere . ' @@ -76,7 +91,7 @@ public function search($search, $order = array(), $limit = array()) { $formatOrder = Utils::arrayToOrder($order); $formatLimit = Utils::arrayToLimit($limit); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT p.* FROM player AS p WHERE LOWER(name) LIKE LOWER(?) @@ -131,7 +146,7 @@ protected function fill($qr) { } public function add(Player $p) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO player(bind, rColor, name, sex, description, avatar, status, rGodfather, credit, uPlayer, experience, factionPoint, level, victory, defeat, stepTutorial, stepDone, iUniversity, partNaturalSciences, partLifeSciences, partSocialPoliticalSciences, partInformaticEngineering, dInscription, dLastConnection, dLastActivity, premium, statement) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); @@ -174,7 +189,7 @@ public function save() { $players = $this->_Save(); foreach ($players AS $p) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('UPDATE player SET id = ?, bind = ?, @@ -240,7 +255,7 @@ public function save() { } public static function deleteById($id) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM player WHERE id = ?'); $qr->execute(array($id)); @@ -406,7 +421,7 @@ public function reborn($player) { public static function count($where = array()) { $formatWhere = Utils::arrayToWhere($where); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT COUNT(id) AS nbr FROM player ' . $formatWhere); $valuesArray = array(); @@ -425,5 +440,4 @@ public static function count($where = array()) { return $aw['nbr']; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/zeus/class/CreditTransaction.class.php b/system/Modules/Zeus/Model/CreditTransaction.php old mode 100755 new mode 100644 similarity index 94% rename from system/modules/zeus/class/CreditTransaction.class.php rename to system/Modules/Zeus/Model/CreditTransaction.php index b1bb89c8f..02a911560 --- a/system/modules/zeus/class/CreditTransaction.class.php +++ b/system/Modules/Zeus/Model/CreditTransaction.php @@ -10,6 +10,10 @@ * @update 09.02.15 */ +namespace Asylamba\Modules\Zeus\Model; + +use Asylamba\Modules\Demeter\Resource\ColorResource; + class CreditTransaction { const TYP_PLAYER = 0; diff --git a/system/modules/zeus/class/Player.class.php b/system/Modules/Zeus/Model/Player.php old mode 100755 new mode 100644 similarity index 97% rename from system/modules/zeus/class/Player.class.php rename to system/Modules/Zeus/Model/Player.php index 23acbc9b3..1c2d3cc96 --- a/system/modules/zeus/class/Player.class.php +++ b/system/Modules/Zeus/Model/Player.php @@ -10,6 +10,23 @@ * @update 20.05.13 */ +namespace Asylamba\Modules\Zeus\Model; + +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\CTC; +use Asylamba\Classes\Worker\ASM; + +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Library\Game; + +use Asylamba\Modules\Ares\Model\Commander; +use Asylamba\Modules\Athena\Model\Transaction; +use Asylamba\Modules\Zeus\Model\PlayerBonus; +use Asylamba\Modules\Hermes\Model\Notification; +use Asylamba\Classes\Container\ArrayList; + +use Asylamba\Modules\Athena\Resource\ShipResource; + class Player { public $id = 0; public $bind = 0; diff --git a/system/modules/zeus/class/PlayerBonus.class.php b/system/Modules/Zeus/Model/PlayerBonus.php old mode 100755 new mode 100644 similarity index 96% rename from system/modules/zeus/class/PlayerBonus.class.php rename to system/Modules/Zeus/Model/PlayerBonus.php index 18ca4a5e6..273e70fbb --- a/system/modules/zeus/class/PlayerBonus.class.php +++ b/system/Modules/Zeus/Model/PlayerBonus.php @@ -10,8 +10,19 @@ * @update 18.07.13 */ -include_once PROMETHEE; -include_once ZEUS; +namespace Asylamba\Modules\Zeus\Model; + +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; + +use Asylamba\Classes\Container\StackList; + +use Asylamba\Modules\Promethee\Model\Technology; +use Asylamba\Modules\Demeter\Model\Law\Law; + +use Asylamba\Modules\Demeter\Resource\ColorResource; +use Asylamba\Modules\Promethee\Resource\TechnologyResource; +use Asylamba\Modules\Demeter\Resource\LawResources; class PlayerBonus { // ATTRIBUTES @@ -323,5 +334,4 @@ public function updateTechnoBonus($techno, $level) { CTR::$data->get('playerBonus')->add($bonusId, $totalBonus); } } -} -?> +} \ No newline at end of file diff --git a/system/modules/zeus/resource/TutorialResource.class.php b/system/Modules/Zeus/Resource/TutorialResource.php old mode 100755 new mode 100644 similarity index 99% rename from system/modules/zeus/resource/TutorialResource.class.php rename to system/Modules/Zeus/Resource/TutorialResource.php index 0292f0d03..bbfb60ef1 --- a/system/modules/zeus/resource/TutorialResource.class.php +++ b/system/Modules/Zeus/Resource/TutorialResource.php @@ -9,6 +9,7 @@ * @package Zeus * @update 25.04.14 */ +namespace Asylamba\Modules\Zeus\Resource; class TutorialResource { @@ -419,5 +420,4 @@ public static function getInfo($id, $info) { 'resourceReward' => 0, 'shipReward' => array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) ); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/modules/zeus/main.conf.php b/system/Modules/Zeus/main.conf.php similarity index 100% rename from system/modules/zeus/main.conf.php rename to system/Modules/Zeus/main.conf.php diff --git a/system/Modules/Zeus/main.php b/system/Modules/Zeus/main.php new file mode 100755 index 000000000..b53049668 --- /dev/null +++ b/system/Modules/Zeus/main.php @@ -0,0 +1,5 @@ + \ No newline at end of file From 0053cb32487aebe6555098a895ef3db20f05d122 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:22:32 +0200 Subject: [PATCH 21/64] Implement namespaces usage in templates --- system/views/templates/desktop/alert.php | 7 ++++--- system/views/templates/desktop/btmbar.php | 1 - system/views/templates/desktop/close.php | 3 ++- system/views/templates/desktop/navbar.php | 19 ++++++++++++------- system/views/templates/desktop/open.php | 4 +++- system/views/templates/desktop/stepbar.php | 6 ++++-- system/views/templates/desktop/toolbar.php | 16 ++++++++++++---- system/views/templates/notfound.php | 1 - 8 files changed, 37 insertions(+), 20 deletions(-) diff --git a/system/views/templates/desktop/alert.php b/system/views/templates/desktop/alert.php index 7bd875e03..85b7a48d1 100755 --- a/system/views/templates/desktop/alert.php +++ b/system/views/templates/desktop/alert.php @@ -1,4 +1,7 @@ '; # affichage @@ -22,6 +25,4 @@ echo ''; CTR::$alert->clear(); -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/views/templates/desktop/btmbar.php b/system/views/templates/desktop/btmbar.php index a86280915..07898d58f 100755 --- a/system/views/templates/desktop/btmbar.php +++ b/system/views/templates/desktop/btmbar.php @@ -1,4 +1,3 @@ '; echo ''; -?> \ No newline at end of file diff --git a/system/views/templates/desktop/close.php b/system/views/templates/desktop/close.php index 748513dcc..4926e39f4 100755 --- a/system/views/templates/desktop/close.php +++ b/system/views/templates/desktop/close.php @@ -1,5 +1,6 @@ getCurrentSession(); ASM::$ntm->newSession(); ASM::$ntm->load(array('rPlayer' => CTR::$data->get('playerId'), 'readed' => 0), array('dSending', 'DESC')); # load message -$db = DataBase::getInstance(); +$db = Database::getInstance(); $qr = $db->prepare('SELECT COUNT(c.id) AS count FROM `conversation` AS c LEFT JOIN `conversationUser` AS u diff --git a/system/views/templates/desktop/open.php b/system/views/templates/desktop/open.php index 1c38b5037..613b4cc03 100755 --- a/system/views/templates/desktop/open.php +++ b/system/views/templates/desktop/open.php @@ -1,4 +1,7 @@ get('step') == 1 || !CTR::$get->exist('step'))) { $color = 'color0'; } elseif (CTR::getPage() == 'inscription') { @@ -66,4 +69,3 @@ } echo '>'; -?> diff --git a/system/views/templates/desktop/stepbar.php b/system/views/templates/desktop/stepbar.php index 8c01412c1..8a3515ba5 100755 --- a/system/views/templates/desktop/stepbar.php +++ b/system/views/templates/desktop/stepbar.php @@ -1,4 +1,7 @@ '; echo '
'; $isActive = (!in_array(CTR::$get->get('step'), array(2, 3))) ? 'class="active"' : ''; @@ -24,5 +27,4 @@ echo '
'; echo ''; -echo '
'; -?> \ No newline at end of file +echo '
'; \ No newline at end of file diff --git a/system/views/templates/desktop/toolbar.php b/system/views/templates/desktop/toolbar.php index 46535f590..735f433aa 100755 --- a/system/views/templates/desktop/toolbar.php +++ b/system/views/templates/desktop/toolbar.php @@ -1,7 +1,16 @@ getCurrentSession(); ASM::$obm->newSession(); @@ -343,4 +352,3 @@ echo '
'; ASM::$obm->changeSession($S_OBM1); -?> \ No newline at end of file diff --git a/system/views/templates/notfound.php b/system/views/templates/notfound.php index 999c512fe..ebea60700 100755 --- a/system/views/templates/notfound.php +++ b/system/views/templates/notfound.php @@ -23,4 +23,3 @@ echo 'où peut-être au blog'; echo '
'; echo ''; -?> \ No newline at end of file From a6a9cee9b6046eeb2765e7b887f0c8e23c853515 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:22:48 +0200 Subject: [PATCH 22/64] Implement namespaces usage in pages --- system/views/pages/ajax/buildingPanel.php | 8 +++--- .../pages/ajax/conversation/conversation.php | 6 +++-- .../views/pages/ajax/conversation/message.php | 8 +++--- system/views/pages/ajax/loadSystem.php | 6 ++--- system/views/pages/ajax/morerank.php | 7 ++--- system/views/pages/ajax/shipPanel.php | 8 ++++-- system/views/pages/ajax/technoPanel.php | 8 ++++-- system/views/pages/ajax/wsw/place.php | 1 - system/views/pages/ajax/wsw/player.php | 1 - .../pages/desktop/adminElement/subnav.php | 6 +++-- system/views/pages/desktop/bases.php | 11 ++++---- .../pages/desktop/basesElement/subnav.php | 5 +++- .../pages/desktop/defaultElement/movers.php | 1 - .../pages/desktop/defaultElement/subnav.php | 1 - system/views/pages/desktop/embassy.php | 9 ------- .../pages/desktop/embassyElement/subnav.php | 4 ++- system/views/pages/desktop/faction.php | 6 ----- .../pages/desktop/factionElement/subnav.php | 5 +++- system/views/pages/desktop/financial.php | 5 ---- .../pages/desktop/financialElement/subnav.php | 4 ++- system/views/pages/desktop/fleet.php | 26 +++++-------------- .../pages/desktop/fleetElement/subnav.php | 4 ++- system/views/pages/desktop/map.php | 11 ++++---- .../pages/desktop/mapElement/actionbox.php | 15 ++++++++--- .../pages/desktop/mapElement/commanders.php | 8 ++++-- .../desktop/mapElement/component/actBull.php | 13 +++++++++- .../pages/desktop/mapElement/content.php | 7 ++++- .../pages/desktop/mapElement/coordbox.php | 1 - .../desktop/mapElement/layer/attacks.php | 9 ++++--- .../desktop/mapElement/layer/background.php | 1 - .../mapElement/layer/commercialroutes.php | 9 +++++-- .../mapElement/layer/fleetmovements.php | 10 ++++--- .../desktop/mapElement/layer/map-info.php | 3 +++ .../desktop/mapElement/layer/ownbase.php | 7 ++++- .../desktop/mapElement/layer/sectors.php | 4 ++- .../pages/desktop/mapElement/layer/spying.php | 7 ++++- .../desktop/mapElement/layer/systems.php | 10 +++++-- .../views/pages/desktop/mapElement/movers.php | 1 - .../views/pages/desktop/mapElement/option.php | 4 ++- system/views/pages/desktop/message.php | 6 +---- system/views/pages/desktop/profil.php | 10 +++---- .../pages/desktop/profilElement/subnav.php | 4 ++- system/views/pages/desktop/rank.php | 3 --- .../pages/desktop/rankElement/subnav.php | 4 ++- system/views/pages/desktop/technology.php | 4 --- .../desktop/technologyElement/subnav.php | 4 ++- 46 files changed, 170 insertions(+), 125 deletions(-) diff --git a/system/views/pages/ajax/buildingPanel.php b/system/views/pages/ajax/buildingPanel.php index 7b65090ba..2ae2246b5 100755 --- a/system/views/pages/ajax/buildingPanel.php +++ b/system/views/pages/ajax/buildingPanel.php @@ -1,6 +1,10 @@ '; # generate the footnotes - include_once GAIA; $quantityArray = array_count_values($footnoteArray); echo '

'; foreach ($quantityArray as $footnote => $quantity) { @@ -150,4 +153,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/ajax/conversation/conversation.php b/system/views/pages/ajax/conversation/conversation.php index e693496d5..9592753a5 100644 --- a/system/views/pages/ajax/conversation/conversation.php +++ b/system/views/pages/ajax/conversation/conversation.php @@ -1,6 +1,8 @@ equal('mode', ConversationUser::CS_ARCHIVED) diff --git a/system/views/pages/ajax/conversation/message.php b/system/views/pages/ajax/conversation/message.php index 2261bcf92..f1e49423c 100644 --- a/system/views/pages/ajax/conversation/message.php +++ b/system/views/pages/ajax/conversation/message.php @@ -1,7 +1,9 @@ exist('page') ? CTR::$get->get('page') diff --git a/system/views/pages/ajax/loadSystem.php b/system/views/pages/ajax/loadSystem.php index 63a1f6722..f5feb5628 100755 --- a/system/views/pages/ajax/loadSystem.php +++ b/system/views/pages/ajax/loadSystem.php @@ -1,6 +1,7 @@ exist('systemid')) { $systemId = CTR::$get->get('systemid'); @@ -35,4 +36,3 @@ } ASM::$sys->changeSession($S_SYS1); -?> \ No newline at end of file diff --git a/system/views/pages/ajax/morerank.php b/system/views/pages/ajax/morerank.php index 54710465f..fb964f657 100755 --- a/system/views/pages/ajax/morerank.php +++ b/system/views/pages/ajax/morerank.php @@ -1,6 +1,8 @@ \ No newline at end of file diff --git a/system/views/pages/ajax/shipPanel.php b/system/views/pages/ajax/shipPanel.php index 753e6a371..c38187de8 100755 --- a/system/views/pages/ajax/shipPanel.php +++ b/system/views/pages/ajax/shipPanel.php @@ -1,5 +1,10 @@ get('ship'); @@ -128,4 +133,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/ajax/technoPanel.php b/system/views/pages/ajax/technoPanel.php index 550b65aea..58857a86a 100755 --- a/system/views/pages/ajax/technoPanel.php +++ b/system/views/pages/ajax/technoPanel.php @@ -1,5 +1,10 @@ get('techno'); if (TechnologyResource::isATechnology($tech) AND !TechnologyResource::isATechnologyNotDisplayed($tech)) { @@ -45,4 +50,3 @@ # component include COMPONENT . 'tech/infoTech.php'; } -?> \ No newline at end of file diff --git a/system/views/pages/ajax/wsw/place.php b/system/views/pages/ajax/wsw/place.php index 703075d1a..5d04ecabb 100755 --- a/system/views/pages/ajax/wsw/place.php +++ b/system/views/pages/ajax/wsw/place.php @@ -13,4 +13,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/ajax/wsw/player.php b/system/views/pages/ajax/wsw/player.php index f3c9db46d..cd0f15624 100755 --- a/system/views/pages/ajax/wsw/player.php +++ b/system/views/pages/ajax/wsw/player.php @@ -11,4 +11,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/adminElement/subnav.php b/system/views/pages/desktop/adminElement/subnav.php index a1bf82c75..77a3bf22e 100755 --- a/system/views/pages/desktop/adminElement/subnav.php +++ b/system/views/pages/desktop/adminElement/subnav.php @@ -1,4 +1,7 @@ '; echo ''; echo '

'; @@ -23,5 +26,4 @@ echo ''; echo ''; echo '
'; -echo ''; -?> \ No newline at end of file +echo ''; \ No newline at end of file diff --git a/system/views/pages/desktop/bases.php b/system/views/pages/desktop/bases.php index fbe9d506b..cfe3c9ddd 100755 --- a/system/views/pages/desktop/bases.php +++ b/system/views/pages/desktop/bases.php @@ -1,6 +1,11 @@ getCurrentSession(); ASM::$obm->newSession(); @@ -20,8 +25,6 @@ # obNav component if (!CTR::$get->exist('view') OR CTR::$get->get('view') == 'main') { - include_once ARES; - $ob_obSituation = $base; $commanders_obSituation = array(); @@ -92,8 +95,6 @@ ASM::$rlm->changeSession($S_RLM1); ASM::$rem->changeSession($S_REM1); } elseif (CTR::$get->get('view') == 'spatioport' && $base->levelSpatioport > 0) { - include_once DEMETER; - $ob_spatioport = $base; include COMPONENT . 'bases/ob/spatioport.php'; } elseif (CTR::$get->get('view') == 'school') { diff --git a/system/views/pages/desktop/basesElement/subnav.php b/system/views/pages/desktop/basesElement/subnav.php index b964a47f8..9c85aedae 100755 --- a/system/views/pages/desktop/basesElement/subnav.php +++ b/system/views/pages/desktop/basesElement/subnav.php @@ -1,4 +1,8 @@ '; echo ''; echo '
'; @@ -141,4 +145,3 @@ echo '
'; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/defaultElement/movers.php b/system/views/pages/desktop/defaultElement/movers.php index 6d9e1fd45..13dd484f5 100755 --- a/system/views/pages/desktop/defaultElement/movers.php +++ b/system/views/pages/desktop/defaultElement/movers.php @@ -3,4 +3,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/defaultElement/subnav.php b/system/views/pages/desktop/defaultElement/subnav.php index bae81e73b..fba5b5ac8 100755 --- a/system/views/pages/desktop/defaultElement/subnav.php +++ b/system/views/pages/desktop/defaultElement/subnav.php @@ -3,4 +3,3 @@ echo '
'; echo '
'; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/embassy.php b/system/views/pages/desktop/embassy.php index b6a3da54e..9de337879 100755 --- a/system/views/pages/desktop/embassy.php +++ b/system/views/pages/desktop/embassy.php @@ -11,11 +11,6 @@ include COMPONENT . 'publicity.php'; if (CTR::$get->exist('player')) { - # inclusion des modules - include_once ZEUS; - include_once ATHENA; - include_once HERMES; - $player = CTR::$get->exist('player') ? CTR::$get->get('player') : CTR::$data->get('playerId'); @@ -70,10 +65,6 @@ ASM::$clm->changeSession($S_COL_1); if (in_array($color, $factions)) { - # load module - include_once DEMETER; - include_once ZEUS; - # load data $S_COL_1 = ASM::$clm->getCurrentSession(); ASM::$clm->newSession(); diff --git a/system/views/pages/desktop/embassyElement/subnav.php b/system/views/pages/desktop/embassyElement/subnav.php index 7c9dcd192..676a7ea5a 100644 --- a/system/views/pages/desktop/embassyElement/subnav.php +++ b/system/views/pages/desktop/embassyElement/subnav.php @@ -1,4 +1,7 @@ '; echo ''; echo '
'; @@ -24,4 +27,3 @@ echo '
'; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/faction.php b/system/views/pages/desktop/faction.php index 1d4ec98bc..fe9931664 100755 --- a/system/views/pages/desktop/faction.php +++ b/system/views/pages/desktop/faction.php @@ -1,7 +1,4 @@ get('playerInfo')->get('color'); @@ -27,8 +24,6 @@ include COMPONENT . 'publicity.php'; if (!CTR::$get->exist('view') OR CTR::$get->get('view') == 'overview') { - include_once ZEUS; - $S_FNM_OW = ASM::$fnm->getCurrentSession(); $TOKEN_NEWS = ASM::$fnm->newSession(); @@ -508,7 +503,6 @@ ASM::$pam->changeSession($S_PAM_1); } } elseif (CTR::$get->get('view') == 'player') { - include_once ZEUS; $S_PAM1 = ASM::$pam->getCurrentSession(); $PAM_LAST_TOKEN = ASM::$pam->newSession(FALSE); diff --git a/system/views/pages/desktop/factionElement/subnav.php b/system/views/pages/desktop/factionElement/subnav.php index 67f9978c1..9db5937bb 100755 --- a/system/views/pages/desktop/factionElement/subnav.php +++ b/system/views/pages/desktop/factionElement/subnav.php @@ -1,4 +1,8 @@ '; echo ''; echo '
'; @@ -80,4 +84,3 @@ echo '
'; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/financial.php b/system/views/pages/desktop/financial.php index 52d33747a..748e2076a 100755 --- a/system/views/pages/desktop/financial.php +++ b/system/views/pages/desktop/financial.php @@ -11,11 +11,6 @@ include COMPONENT . 'publicity.php'; if (!CTR::$get->exist('view') OR CTR::$get->get('view') == 'invest') { - # inclusion des modules - include_once ATHENA; - include_once ZEUS; - include_once ARES; - # loading des objets $S_PAM_FIN = ASM::$pam->getCurrentSession(); ASM::$pam->newSession(); diff --git a/system/views/pages/desktop/financialElement/subnav.php b/system/views/pages/desktop/financialElement/subnav.php index a92b5b890..a2a4f1f53 100755 --- a/system/views/pages/desktop/financialElement/subnav.php +++ b/system/views/pages/desktop/financialElement/subnav.php @@ -1,4 +1,7 @@ '; echo ''; echo '
'; @@ -24,4 +27,3 @@ echo '
'; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/fleet.php b/system/views/pages/desktop/fleet.php index 5deda08c3..6d7ab5e54 100755 --- a/system/views/pages/desktop/fleet.php +++ b/system/views/pages/desktop/fleet.php @@ -1,4 +1,11 @@ '; @@ -11,8 +18,6 @@ include COMPONENT . 'publicity.php'; if (!CTR::$get->exist('view') OR CTR::$get->get('view') == 'movement' OR CTR::$get->get('view') == 'main') { - # inclusion des modules - include_once ARES; $S_COM_UKN = ASM::$com->getCurrentSession(); # set d'orbitale base @@ -79,7 +84,6 @@ )); if (ASM::$com->size() == 1) { - include_once ATHENA; $S_OBM_DOCK = ASM::$obm->getCurrentSession(); ASM::$obm->newSession(); ASM::$obm->load(array('rPlace' => ASM::$com->get()->getRBase())); @@ -103,8 +107,6 @@ ASM::$com->changeSession($S_COM_UKN); } elseif (CTR::$get->get('view') == 'overview') { - # inclusion des modules - include_once ARES; $S_COM_UKN = ASM::$com->getCurrentSession(); $S_OBM_UKN = ASM::$obm->getCurrentSession(); @@ -151,9 +153,6 @@ ASM::$obm->changeSession($S_OBM_UKN); ASM::$com->changeSession($S_COM_UKN); } elseif (CTR::$get->get('view') == 'spyreport') { - # inclusion des modules - include_once ARTEMIS; - # loading des objets $S_SRM1 = ASM::$srm->getCurrentSession(); ASM::$srm->newSession(); @@ -176,8 +175,6 @@ } if (ASM::$srm->size() == 1) { - include_once GAIA; - $spyreport = ASM::$srm->get(0); $S_PLM_SPY = ASM::$plm->getCurrentSession(); @@ -200,9 +197,6 @@ ASM::$srm->changeSession($S_SRM1); } elseif (CTR::$get->get('view') == 'archive') { - # inclusion des modules - include_once ARES; - # loading des objets $S_LRM1 = ASM::$lrm->getCurrentSession(); ASM::$lrm->newSession(); @@ -244,8 +238,6 @@ ASM::$rpm->load(array('r.id' => CTR::$get->get('report'))); if (ASM::$rpm->size() == 1 && (ASM::$rpm->get()->rPlayerAttacker == CTR::$data->get('playerId') || ASM::$rpm->get()->rPlayerDefender == CTR::$data->get('playerId'))) { - include_once ZEUS; - $S_PAM1 = ASM::$pam->getCurrentSession(); ASM::$pam->newSession(); ASM::$pam->load(array('id' => array(ASM::$rpm->get()->rPlayerAttacker, ASM::$rpm->get()->rPlayerDefender))); @@ -272,9 +264,6 @@ ASM::$lrm->changeSession($S_LRM1); } elseif (CTR::$get->get('view') == 'memorial') { - # inclusion des modules - include_once ARES; - # loading des objets $S_COM1 = ASM::$com->getCurrentSession(); ASM::$com->newSession(); @@ -308,4 +297,3 @@ } echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/fleetElement/subnav.php b/system/views/pages/desktop/fleetElement/subnav.php index 158bd6a14..85018838a 100755 --- a/system/views/pages/desktop/fleetElement/subnav.php +++ b/system/views/pages/desktop/fleetElement/subnav.php @@ -1,4 +1,7 @@ '; echo ''; echo '
'; @@ -54,4 +57,3 @@ echo '
'; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/map.php b/system/views/pages/desktop/map.php index 8d8ff6cf9..38d49dea5 100755 --- a/system/views/pages/desktop/map.php +++ b/system/views/pages/desktop/map.php @@ -1,13 +1,13 @@ load(); -# bases loading -include_once ATHENA; $S_OBM_MAP = ASM::$obm->getCurrentSession(); ASM::$obm->newSession(); ASM::$obm->load(array('rPlayer' => CTR::$data->get('playerId'))); @@ -114,4 +114,3 @@ echo ''; ASM::$obm->changeSession($S_OBM_MAP); -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/actionbox.php b/system/views/pages/desktop/mapElement/actionbox.php index 4d80fc89a..b3ee0fa12 100755 --- a/system/views/pages/desktop/mapElement/actionbox.php +++ b/system/views/pages/desktop/mapElement/actionbox.php @@ -1,7 +1,15 @@ exist('relatedplace')) { $S_OBM2 = ASM::$obm->getCurrentSession(); @@ -40,7 +48,6 @@ ASM::$lrm->newSession(); ASM::$lrm->load(array('rPlayerAttacker' => CTR::$data->get('playerId'), 'r.rPlace' => $placesId), array('r.dFight', 'DESC'), array(0, 30)); - include_once ARTEMIS; $S_SRM_MAP = ASM::$srm->getCurrentSession(); ASM::$srm->newSession(); ASM::$srm->load(array('rPlayer' => CTR::$data->get('playerId'), 'rPlace' => $placesId), array('dSpying', 'DESC'), array(0, 30)); diff --git a/system/views/pages/desktop/mapElement/commanders.php b/system/views/pages/desktop/mapElement/commanders.php index 78130bd1a..15e50c8e4 100755 --- a/system/views/pages/desktop/mapElement/commanders.php +++ b/system/views/pages/desktop/mapElement/commanders.php @@ -1,5 +1,10 @@ getCurrentSession(); ASM::$com->newSession(); @@ -62,4 +67,3 @@ echo ''; ASM::$com->changeSession($S_COM_MAP_COM); -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/component/actBull.php b/system/views/pages/desktop/mapElement/component/actBull.php index ab9491aaa..7461261ba 100755 --- a/system/views/pages/desktop/mapElement/component/actBull.php +++ b/system/views/pages/desktop/mapElement/component/actBull.php @@ -1,4 +1,16 @@ '; echo '
'; @@ -312,4 +324,3 @@ } echo '
'; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/content.php b/system/views/pages/desktop/mapElement/content.php index 957bc5982..d009aa0d1 100755 --- a/system/views/pages/desktop/mapElement/content.php +++ b/system/views/pages/desktop/mapElement/content.php @@ -1,4 +1,10 @@ '; echo '
'; @@ -27,4 +33,3 @@ echo '
'; echo '
'; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/coordbox.php b/system/views/pages/desktop/mapElement/coordbox.php index af01a34be..cf4c5a482 100755 --- a/system/views/pages/desktop/mapElement/coordbox.php +++ b/system/views/pages/desktop/mapElement/coordbox.php @@ -1,3 +1,2 @@ '; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/layer/attacks.php b/system/views/pages/desktop/mapElement/layer/attacks.php index 55f5e55c7..82168db37 100755 --- a/system/views/pages/desktop/mapElement/layer/attacks.php +++ b/system/views/pages/desktop/mapElement/layer/attacks.php @@ -1,6 +1,10 @@ changeSession($S_PLM_MAPLAYER); ASM::$com->changeSession($S_COM_ATT); -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/layer/background.php b/system/views/pages/desktop/mapElement/layer/background.php index 04ffe40e5..c2b8fcf21 100755 --- a/system/views/pages/desktop/mapElement/layer/background.php +++ b/system/views/pages/desktop/mapElement/layer/background.php @@ -1,3 +1,2 @@ '; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/layer/commercialroutes.php b/system/views/pages/desktop/mapElement/layer/commercialroutes.php index b1e59bf27..618d16c1d 100755 --- a/system/views/pages/desktop/mapElement/layer/commercialroutes.php +++ b/system/views/pages/desktop/mapElement/layer/commercialroutes.php @@ -1,5 +1,11 @@ query('SELECT sy1.xPosition AS sy1x, sy1.yPosition AS sy1y, @@ -32,4 +38,3 @@ } echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/layer/fleetmovements.php b/system/views/pages/desktop/mapElement/layer/fleetmovements.php index 4723f7d7b..b96b98e86 100755 --- a/system/views/pages/desktop/mapElement/layer/fleetmovements.php +++ b/system/views/pages/desktop/mapElement/layer/fleetmovements.php @@ -1,6 +1,11 @@ getCurrentSession(); ASM::$com->newSession(); @@ -41,4 +46,3 @@ ASM::$plm->changeSession($S_PLM_MAPLAYER); ASM::$com->changeSession($S_COM_MAPLAYER); -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/layer/map-info.php b/system/views/pages/desktop/mapElement/layer/map-info.php index 866363c7c..2f4b61970 100755 --- a/system/views/pages/desktop/mapElement/layer/map-info.php +++ b/system/views/pages/desktop/mapElement/layer/map-info.php @@ -1,4 +1,7 @@ '; echo '

Légende

'; diff --git a/system/views/pages/desktop/mapElement/layer/ownbase.php b/system/views/pages/desktop/mapElement/layer/ownbase.php index 673db40c2..ce2bb315b 100755 --- a/system/views/pages/desktop/mapElement/layer/ownbase.php +++ b/system/views/pages/desktop/mapElement/layer/ownbase.php @@ -1,4 +1,10 @@ '; echo ''; for ($i = 0; $i < ASM::$obm->size(); $i++) { @@ -18,4 +24,3 @@ } echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/layer/sectors.php b/system/views/pages/desktop/mapElement/layer/sectors.php index cf053aa16..97df78e78 100755 --- a/system/views/pages/desktop/mapElement/layer/sectors.php +++ b/system/views/pages/desktop/mapElement/layer/sectors.php @@ -1,4 +1,7 @@ '; echo ''; for ($i = 0; $i < $sm->size(); $i++) { @@ -11,4 +14,3 @@ } echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/layer/spying.php b/system/views/pages/desktop/mapElement/layer/spying.php index 2854b67d6..5b9e104d8 100755 --- a/system/views/pages/desktop/mapElement/layer/spying.php +++ b/system/views/pages/desktop/mapElement/layer/spying.php @@ -1,4 +1,10 @@ '; echo ''; for ($i = 0; $i < ASM::$obm->size(); $i++) { @@ -12,4 +18,3 @@ } echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/layer/systems.php b/system/views/pages/desktop/mapElement/layer/systems.php index 21d787a84..c20eb6ed5 100755 --- a/system/views/pages/desktop/mapElement/layer/systems.php +++ b/system/views/pages/desktop/mapElement/layer/systems.php @@ -1,6 +1,13 @@ '; - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT * FROM system'); $qr->execute(); $aw = $qr->fetchAll(); @@ -46,4 +53,3 @@ } echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/movers.php b/system/views/pages/desktop/mapElement/movers.php index e95212358..df552bb91 100755 --- a/system/views/pages/desktop/mapElement/movers.php +++ b/system/views/pages/desktop/mapElement/movers.php @@ -3,4 +3,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/mapElement/option.php b/system/views/pages/desktop/mapElement/option.php index 5552ffea2..9ecb20ebd 100755 --- a/system/views/pages/desktop/mapElement/option.php +++ b/system/views/pages/desktop/mapElement/option.php @@ -1,4 +1,7 @@ '; echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/message.php b/system/views/pages/desktop/message.php index 088a78d53..fca94c546 100755 --- a/system/views/pages/desktop/message.php +++ b/system/views/pages/desktop/message.php @@ -9,11 +9,7 @@ # contenu spécifique echo '
'; include COMPONENT . 'publicity.php'; - - # inclusion des modules - include_once HERMES; - - # liste des conv's + # liste des conv's $display = CTR::$get->equal('mode', ConversationUser::CS_ARCHIVED) ? ConversationUser::CS_ARCHIVED : ConversationUser::CS_DISPLAY; diff --git a/system/views/pages/desktop/profil.php b/system/views/pages/desktop/profil.php index eb25585a9..8ac6e0a61 100755 --- a/system/views/pages/desktop/profil.php +++ b/system/views/pages/desktop/profil.php @@ -1,4 +1,8 @@ equal('mode', 'splash')) { echo '
'; echo ''; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/rank.php b/system/views/pages/desktop/rank.php index 4752ce54c..c9eab3505 100755 --- a/system/views/pages/desktop/rank.php +++ b/system/views/pages/desktop/rank.php @@ -10,9 +10,6 @@ echo '
'; include COMPONENT . 'publicity.php'; - include_once ATLAS; - include_once DEMETER; - if (!CTR::$get->exist('view') OR CTR::$get->get('view') == 'player') { $S_PRM1 = ASM::$prm->getCurrentSession(); diff --git a/system/views/pages/desktop/rankElement/subnav.php b/system/views/pages/desktop/rankElement/subnav.php index 7db57c533..6d76b3c74 100755 --- a/system/views/pages/desktop/rankElement/subnav.php +++ b/system/views/pages/desktop/rankElement/subnav.php @@ -1,4 +1,7 @@ '; echo ''; echo '
'; @@ -24,4 +27,3 @@ echo '
'; echo ''; echo '
'; -?> \ No newline at end of file diff --git a/system/views/pages/desktop/technology.php b/system/views/pages/desktop/technology.php index 57a94d0fd..0b1288d65 100755 --- a/system/views/pages/desktop/technology.php +++ b/system/views/pages/desktop/technology.php @@ -10,10 +10,6 @@ # contenu spécifique echo '
'; include COMPONENT . 'publicity.php'; - - # inclusion des modules - include_once ZEUS; - # loading des objets $S_PAM_TECH = ASM::$pam->getCurrentSession(); ASM::$pam->newSession(); diff --git a/system/views/pages/desktop/technologyElement/subnav.php b/system/views/pages/desktop/technologyElement/subnav.php index 293e4b2ad..0ac160993 100755 --- a/system/views/pages/desktop/technologyElement/subnav.php +++ b/system/views/pages/desktop/technologyElement/subnav.php @@ -1,4 +1,7 @@ '; echo ''; echo '
'; @@ -24,4 +27,3 @@ echo '
'; echo ''; echo '
'; -?> \ No newline at end of file From 198fb9e896f9a6873d685411e29d493e55dee3bf Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:23:02 +0200 Subject: [PATCH 23/64] Implement namespaces usage in components --- .../admin/bugtracker/mainBugtracker.php | 1 + .../admin/message/newOfficialMessage.php | 2 +- .../views/components/admin/roadmap/addEntry.php | 4 ++-- system/views/components/bases/fastView.php | 14 +++++++++++++- system/views/components/bases/ob/base-type.php | 6 ++++++ system/views/components/bases/ob/comPlat.php | 3 +++ .../views/components/bases/ob/complat/market.php | 10 ++++++++-- .../components/bases/ob/complat/resource.php | 4 +++- .../views/components/bases/ob/complat/sell.php | 10 ++++++++-- .../components/bases/ob/complat/transaction.php | 7 ++++++- system/views/components/bases/ob/dock1.php | 12 +++++++++++- system/views/components/bases/ob/dock2.php | 13 +++++++++++-- system/views/components/bases/ob/generator.php | 11 ++++++++++- system/views/components/bases/ob/leavebase.php | 5 +++++ system/views/components/bases/ob/recycling.php | 8 +++++++- system/views/components/bases/ob/refinery.php | 7 ++++++- system/views/components/bases/ob/school.php | 13 +++++++++---- system/views/components/bases/ob/situation.php | 7 ++++++- system/views/components/bases/ob/spatioport.php | 12 +++++++++++- system/views/components/bases/ob/storage.php | 6 +++++- .../views/components/bases/ob/technosphere.php | 16 +++++++++++++--- system/views/components/conversation/create.php | 6 ++++++ system/views/components/conversation/list.php | 6 ++++++ system/views/components/conversation/manage.php | 6 ++++++ .../views/components/conversation/messages.php | 9 +++++++++ system/views/components/embassy/diary/bases.php | 1 - .../views/components/embassy/diary/rolplay.php | 4 +++- system/views/components/embassy/diary/search.php | 5 ++++- system/views/components/embassy/faction/flag.php | 4 +++- .../components/embassy/faction/government.php | 5 +++++ system/views/components/embassy/faction/nav.php | 3 +++ .../components/faction/data/diplomacy/about.php | 5 ++++- .../components/faction/data/diplomacy/main.php | 5 ++++- .../faction/data/financial/donations.php | 7 ++++++- .../faction/data/financial/sectors-tax.php | 4 ++-- .../components/faction/data/financial/stats.php | 5 +++-- .../views/components/faction/data/law/list.php | 5 +++-- system/views/components/faction/data/nav.php | 3 +++ .../components/faction/data/tactical/map.php | 4 ++++ .../components/faction/data/tactical/sectors.php | 8 ++++++-- .../components/faction/data/tactical/targets.php | 4 ++++ .../components/faction/data/trade/rc-stats.php | 8 ++++++-- .../components/faction/data/trade/tax-in.php | 5 +++-- .../components/faction/data/trade/tax-out.php | 7 ++++--- .../components/faction/data/war/incoming.php | 6 +++--- .../views/components/faction/data/war/levels.php | 5 +++-- .../faction/data/war/reports-attack.php | 6 +++--- .../faction/data/war/reports-defend.php | 6 +++--- .../views/components/faction/data/war/stats.php | 10 +++++++--- .../views/components/faction/overview/stat.php | 1 - .../components/financial/fleetFeesFinancial.php | 3 +++ .../components/financial/generalFinancial.php | 4 +++- .../components/financial/impositionFinancial.php | 4 ++++ .../components/financial/investFinancial.php | 3 +++ .../components/financial/last-receive-credit.php | 4 ++++ .../components/financial/last-send-credit.php | 4 ++++ .../components/financial/msFeesFinancial.php | 4 +++- .../components/financial/routeFinancial.php | 4 ++++ .../components/financial/send-credit-faction.php | 3 +++ .../components/financial/send-credit-player.php | 3 +++ .../components/financial/shipFeesFinancial.php | 5 +++++ .../components/financial/taxOutFinancial.php | 4 ++++ .../views/components/fleet/commanderDetail.php | 5 +++++ system/views/components/fleet/commanderFleet.php | 3 +++ system/views/components/fleet/list-report.php | 6 +++++- system/views/components/fleet/listFleet.php | 9 +++++++++ system/views/components/fleet/listSpy.php | 5 ++++- system/views/components/fleet/manage-report.php | 2 ++ system/views/components/fleet/overview.php | 5 +++++ system/views/components/fleet/report.php | 5 +++++ system/views/components/fleet/spyReport.php | 7 ++++++- system/views/components/notif/archived.php | 5 ++++- system/views/components/notif/last.php | 5 ++++- system/views/components/params/chat.php | 4 ++++ system/views/components/params/display.php | 4 ++++ system/views/components/params/general.php | 2 +- .../components/player/playerRoleplayProfil.php | 6 +++++- .../components/player/playerTechnicalProfil.php | 3 ++- system/views/components/rank/faction/front.php | 3 +++ system/views/components/rank/faction/general.php | 2 ++ .../components/rank/faction/info-victory.php | 3 +++ system/views/components/rank/faction/points.php | 3 +++ .../components/rank/faction/territorial.php | 2 ++ system/views/components/rank/faction/wealth.php | 2 ++ system/views/components/rank/player/armies.php | 2 ++ system/views/components/rank/player/butcher.php | 2 ++ system/views/components/rank/player/fight.php | 2 ++ system/views/components/rank/player/front.php | 4 ++-- system/views/components/rank/player/general.php | 2 ++ .../views/components/rank/player/resources.php | 2 ++ system/views/components/rank/player/stats.php | 3 +++ system/views/components/rank/player/trader.php | 2 ++ system/views/components/rank/player/xp.php | 2 ++ .../views/components/sponsorship/list-godson.php | 3 +++ .../views/components/sponsorship/send-mail.php | 4 ++++ system/views/components/tech/infoTech.php | 5 ++++- system/views/components/tech/university.php | 7 +++++-- 97 files changed, 422 insertions(+), 78 deletions(-) diff --git a/system/views/components/admin/bugtracker/mainBugtracker.php b/system/views/components/admin/bugtracker/mainBugtracker.php index 30fd41463..fbb6ca6ea 100755 --- a/system/views/components/admin/bugtracker/mainBugtracker.php +++ b/system/views/components/admin/bugtracker/mainBugtracker.php @@ -10,6 +10,7 @@ # int archivedBugQuantity # string listName +use Asylamba\Classes\Library\Format; echo '
'; echo '
'; diff --git a/system/views/components/admin/message/newOfficialMessage.php b/system/views/components/admin/message/newOfficialMessage.php index ce48f1503..626c9b5fa 100755 --- a/system/views/components/admin/message/newOfficialMessage.php +++ b/system/views/components/admin/message/newOfficialMessage.php @@ -7,7 +7,7 @@ # require # NULL -include_once ZEUS; +use Asylamba\Classes\Library\Format; echo '
'; echo '
'; diff --git a/system/views/components/admin/roadmap/addEntry.php b/system/views/components/admin/roadmap/addEntry.php index cd63158a8..fcf7c04b5 100755 --- a/system/views/components/admin/roadmap/addEntry.php +++ b/system/views/components/admin/roadmap/addEntry.php @@ -7,6 +7,7 @@ # require # NULL +use Asylamba\Classes\Library\Format; echo '
'; echo '
'; @@ -22,5 +23,4 @@ echo ''; echo '
'; echo '
'; -echo '
'; -?> \ No newline at end of file +echo '
'; \ No newline at end of file diff --git a/system/views/components/bases/fastView.php b/system/views/components/bases/fastView.php index ec98cc047..422a23887 100644 --- a/system/views/components/bases/fastView.php +++ b/system/views/components/bases/fastView.php @@ -10,6 +10,19 @@ # (bool) fastView_profil # calcul + +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Library\Chronos; +use Asylamba\Modules\Athena\Resource\ShipResource; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; +use Asylamba\Classes\Library\Game; +use Asylamba\Modules\Gaia\Resource\PlaceResource; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Promethee\Resource\TechnologyResource; +use Asylamba\Modules\Zeus\Model\PlayerBonus; + if ($ob_fastView->getLevelSpatioport() > 0) { $S_CRM_OFV = ASM::$crm->getCurrentSession(); ASM::$crm->changeSession($ob_fastView->routeManager); @@ -311,4 +324,3 @@ echo '
'; echo '
'; echo '
'; -?> \ No newline at end of file diff --git a/system/views/components/bases/ob/base-type.php b/system/views/components/bases/ob/base-type.php index 434ab6b24..b47f7b773 100644 --- a/system/views/components/bases/ob/base-type.php +++ b/system/views/components/bases/ob/base-type.php @@ -1,4 +1,10 @@ '; echo '
'; echo ''; diff --git a/system/views/components/bases/ob/complat/market.php b/system/views/components/bases/ob/complat/market.php index ca552653c..8af7fd1d6 100755 --- a/system/views/components/bases/ob/complat/market.php +++ b/system/views/components/bases/ob/complat/market.php @@ -1,4 +1,11 @@ getCurrentSession(); $S_CSM1 = ASM::$csm->getCurrentSession(); ASM::$csm->changeSession($ob_compPlat->shippingManager); @@ -141,5 +148,4 @@ ASM::$trm->changeSession($S_TRM1); ASM::$csm->changeSession($S_CSM1); -ASM::$ctm->changeSession($S_CTM1); -?> \ No newline at end of file +ASM::$ctm->changeSession($S_CTM1); \ No newline at end of file diff --git a/system/views/components/bases/ob/complat/resource.php b/system/views/components/bases/ob/complat/resource.php index 0b327cb32..5a932f20a 100755 --- a/system/views/components/bases/ob/complat/resource.php +++ b/system/views/components/bases/ob/complat/resource.php @@ -1,5 +1,7 @@ '; echo '
'; diff --git a/system/views/components/bases/ob/complat/sell.php b/system/views/components/bases/ob/complat/sell.php index ec79c31b2..50a762dc1 100755 --- a/system/views/components/bases/ob/complat/sell.php +++ b/system/views/components/bases/ob/complat/sell.php @@ -1,5 +1,12 @@ getCurrentSession(); @@ -192,4 +199,3 @@ echo '
'; ASM::$trm->changeSession($S_TRM1); -?> \ No newline at end of file diff --git a/system/views/components/bases/ob/complat/transaction.php b/system/views/components/bases/ob/complat/transaction.php index 7891d09ab..bbfa69f0d 100755 --- a/system/views/components/bases/ob/complat/transaction.php +++ b/system/views/components/bases/ob/complat/transaction.php @@ -1,5 +1,10 @@ getCurrentSession(); $S_CTM1 = ASM::$ctm->getCurrentSession(); diff --git a/system/views/components/bases/ob/dock1.php b/system/views/components/bases/ob/dock1.php index 534aae395..041bdfd2f 100755 --- a/system/views/components/bases/ob/dock1.php +++ b/system/views/components/bases/ob/dock1.php @@ -8,6 +8,17 @@ # {orbitalBase} ob_dock1 # work + +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Promethee\Model\Technology; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; +use Asylamba\Modules\Athena\Resource\ShipResource; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Library\Chronos; +use Asylamba\Modules\Zeus\Model\PlayerBonus; + $S_SQM1 = ASM::$sqm->getCurrentSession(); ASM::$sqm->changeSession($ob_dock1->dock1Manager); $s = array('', '', '', '', '', ''); @@ -272,4 +283,3 @@ echo '
'; ASM::$sqm->changeSession($S_SQM1); -?> \ No newline at end of file diff --git a/system/views/components/bases/ob/dock2.php b/system/views/components/bases/ob/dock2.php index f92bd450e..9689ce914 100755 --- a/system/views/components/bases/ob/dock2.php +++ b/system/views/components/bases/ob/dock2.php @@ -8,7 +8,17 @@ # {orbitalBase} ob_dock2 # work -include_once DEMETER; + +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Promethee\Model\Technology; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; +use Asylamba\Modules\Athena\Resource\ShipResource; +use Asylamba\Modules\Demeter\Resource\ColorResource; +use Asylamba\Modules\Zeus\Model\PlayerBonus; +use Asylamba\Classes\Library\Chronos; + $S_SQM1 = ASM::$sqm->getCurrentSession(); ASM::$sqm->changeSession($ob_dock2->dock2Manager); $s = array('', '', '', '', '', ''); @@ -289,4 +299,3 @@ echo '
'; ASM::$sqm->changeSession($S_SQM1); -?> \ No newline at end of file diff --git a/system/views/components/bases/ob/generator.php b/system/views/components/bases/ob/generator.php index 813e0f499..3bb832659 100755 --- a/system/views/components/bases/ob/generator.php +++ b/system/views/components/bases/ob/generator.php @@ -8,6 +8,16 @@ # {orbitalBase} ob_generator # work + +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Library\Chronos; +use Asylamba\Modules\Promethee\Model\Technology; +use Asylamba\Modules\Zeus\Model\PlayerBonus; +use Asylamba\Classes\Library\Utils; + $q = ''; $b = array('', '', '', '', '', '', '', '', '', ''); $realSizeQueue = 0; @@ -203,4 +213,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/bases/ob/leavebase.php b/system/views/components/bases/ob/leavebase.php index c965d22ee..ae6fb35c8 100755 --- a/system/views/components/bases/ob/leavebase.php +++ b/system/views/components/bases/ob/leavebase.php @@ -8,6 +8,11 @@ # {orbitalBase} ob_obSituation # [{commander}] commanders_obSituation +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Library\Chronos; +use Asylamba\Modules\Athena\Model\OrbitalBase; +use Asylamba\Modules\Ares\Model\Commander; + $onMission = FALSE; foreach ($commanders_obSituation as $commander) { if (in_array($commander->statement, [Commander::MOVING])) { diff --git a/system/views/components/bases/ob/recycling.php b/system/views/components/bases/ob/recycling.php index 6e61ea5b5..b9dc7acae 100755 --- a/system/views/components/bases/ob/recycling.php +++ b/system/views/components/bases/ob/recycling.php @@ -9,6 +9,13 @@ # {RecyclingMission session} recyclingSession # {RecyclingLog session} missionLogSessions +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Library\Chronos; +use Asylamba\Modules\Athena\Model\RecyclingMission; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; + $S_REM2 = ASM::$rem->getCurrentSession(); ASM::$rem->changeSession($recyclingSession); @@ -191,4 +198,3 @@ ASM::$rlm->changeSession($S_RLM2); ASM::$rem->changeSession($S_REM2); -?> \ No newline at end of file diff --git a/system/views/components/bases/ob/refinery.php b/system/views/components/bases/ob/refinery.php index 0c2768373..27248bf60 100755 --- a/system/views/components/bases/ob/refinery.php +++ b/system/views/components/bases/ob/refinery.php @@ -7,6 +7,12 @@ # require # {orbitalBase} ob_refinery +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; +use Asylamba\Classes\Library\Game; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Modules\Zeus\Model\PlayerBonus; + echo '
'; echo '
'; echo ''; @@ -88,4 +94,3 @@ echo '
'; echo '
'; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/bases/ob/school.php b/system/views/components/bases/ob/school.php index 32773aa11..fbdefdcee 100755 --- a/system/views/components/bases/ob/school.php +++ b/system/views/components/bases/ob/school.php @@ -7,9 +7,15 @@ # require # {orbitalBase} ob_school -include_once ARES; -include_once ZEUS; -include_once GAIA; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Zeus\Helper\CheckName; +use Asylamba\Modules\Ares\Model\Commander; +use Asylamba\Modules\Zeus\Model\PlayerBonus; +use Asylamba\Modules\Athena\Resource\SchoolClassResource; +use Asylamba\Modules\Ares\Resource\CommanderResources; +use Asylamba\Modules\Gaia\Resource\PlaceResource; $S_COM1 = ASM::$com->getCurrentSession(); ASM::$com->newSession(); @@ -177,4 +183,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/bases/ob/situation.php b/system/views/components/bases/ob/situation.php index 394f38e38..8f544eaff 100755 --- a/system/views/components/bases/ob/situation.php +++ b/system/views/components/bases/ob/situation.php @@ -1,4 +1,10 @@ '; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/bases/ob/spatioport.php b/system/views/components/bases/ob/spatioport.php index 076410b7e..c50de9096 100755 --- a/system/views/components/bases/ob/spatioport.php +++ b/system/views/components/bases/ob/spatioport.php @@ -7,6 +7,16 @@ # require # {orbitalBase} ob_spatioport +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Zeus\Model\PlayerBonus; +use Asylamba\Modules\Demeter\Resource\ColorResource; +use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Gaia\Resource\PlaceResource; +use Asylamba\Classes\Library\Game; + $S_CRM1 = ASM::$crm->getCurrentSession(); ASM::$crm->changeSession($ob_spatioport->routeManager); @@ -157,7 +167,7 @@ } } - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT pa.rColor AS playerColor, pa.avatar AS playerAvatar, diff --git a/system/views/components/bases/ob/storage.php b/system/views/components/bases/ob/storage.php index 8ec8e17fc..656a6e380 100755 --- a/system/views/components/bases/ob/storage.php +++ b/system/views/components/bases/ob/storage.php @@ -7,6 +7,11 @@ # require # {orbitalBase} ob_storage +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; +use Asylamba\Modules\Zeus\Model\PlayerBonus; + echo '
'; echo '
'; echo ''; @@ -84,4 +89,3 @@ echo '
'; echo '
'; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/bases/ob/technosphere.php b/system/views/components/bases/ob/technosphere.php index 740c6fac0..7f35f16eb 100755 --- a/system/views/components/bases/ob/technosphere.php +++ b/system/views/components/bases/ob/technosphere.php @@ -7,8 +7,19 @@ # require # {orbitalBase} ob_tech -include_once PROMETHEE; -include_once DEMETER; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Game; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Library\Chronos; +use Asylamba\Modules\Promethee\Resource\TechnologyResource; +use Asylamba\Modules\Promethee\Model\Technology; +use Asylamba\Modules\Athena\Model\OrbitalBase; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; +use Asylamba\Modules\Zeus\Model\PlayerBonus; +use Asylamba\Modules\Demeter\Resource\ColorResource; +use Asylamba\Classes\Library\Format; + $technology = new Technology(CTR::$data->get('playerId')); # session avec les technos de cette base @@ -387,4 +398,3 @@ ASM::$tqm->changeSession($S_TQM1); ASM::$rsm->changeSession($S_RSM1); -?> \ No newline at end of file diff --git a/system/views/components/conversation/create.php b/system/views/components/conversation/create.php index bbbd2d629..d4ad36a58 100644 --- a/system/views/components/conversation/create.php +++ b/system/views/components/conversation/create.php @@ -1,4 +1,10 @@ '; echo '
'; echo '

Démarrer une nouvelle conversation

'; diff --git a/system/views/components/conversation/list.php b/system/views/components/conversation/list.php index adc345558..111e5bfca 100644 --- a/system/views/components/conversation/list.php +++ b/system/views/components/conversation/list.php @@ -1,4 +1,10 @@ '; echo '

Messagerie

'; diff --git a/system/views/components/conversation/manage.php b/system/views/components/conversation/manage.php index 896db30f9..bbfd6779d 100644 --- a/system/views/components/conversation/manage.php +++ b/system/views/components/conversation/manage.php @@ -1,4 +1,10 @@ '; echo '
'; echo '
'; diff --git a/system/views/components/conversation/messages.php b/system/views/components/conversation/messages.php index 31942e274..477054cd9 100644 --- a/system/views/components/conversation/messages.php +++ b/system/views/components/conversation/messages.php @@ -1,4 +1,13 @@ '; echo '
'; diff --git a/system/views/components/embassy/diary/bases.php b/system/views/components/embassy/diary/bases.php index 2877aa374..62aa69eaf 100644 --- a/system/views/components/embassy/diary/bases.php +++ b/system/views/components/embassy/diary/bases.php @@ -27,4 +27,3 @@ echo '
'; echo '
'; echo '
'; -?> \ No newline at end of file diff --git a/system/views/components/embassy/diary/rolplay.php b/system/views/components/embassy/diary/rolplay.php index f9f1e4458..f509c080e 100644 --- a/system/views/components/embassy/diary/rolplay.php +++ b/system/views/components/embassy/diary/rolplay.php @@ -7,6 +7,9 @@ # require # {player} player_diaryRoplay +use Asylamba\Modules\Demeter\Resource\ColorResource; +use Asylamba\Classes\Library\Format; + echo '
'; echo '
'; echo '

Journal

'; @@ -51,4 +54,3 @@ echo '
'; echo '
'; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/embassy/diary/search.php b/system/views/components/embassy/diary/search.php index 6a8ce37c8..5c0e8f4fd 100644 --- a/system/views/components/embassy/diary/search.php +++ b/system/views/components/embassy/diary/search.php @@ -9,6 +9,10 @@ # {ob} ob_selected # bool player_ishim +use Asylamba\Modules\Demeter\Resource\ColorResource; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Worker\CTR; + $status = ColorResource::getInfo($player_selected->rColor, 'status'); echo '
'; @@ -38,4 +42,3 @@ echo '
'; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/embassy/faction/flag.php b/system/views/components/embassy/faction/flag.php index 48c5ca1ac..5114f5d5d 100644 --- a/system/views/components/embassy/faction/flag.php +++ b/system/views/components/embassy/faction/flag.php @@ -1,4 +1,7 @@ '; echo '
'; echo '

A propos

'; @@ -14,4 +17,3 @@ echo '
'; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/embassy/faction/government.php b/system/views/components/embassy/faction/government.php index 340109c09..a8c072016 100644 --- a/system/views/components/embassy/faction/government.php +++ b/system/views/components/embassy/faction/government.php @@ -1,4 +1,9 @@ getCurrentSession(); ASM::$pam->changeSession($FACTION_GOV_TOKEN); diff --git a/system/views/components/embassy/faction/nav.php b/system/views/components/embassy/faction/nav.php index 6dc618222..3c59c4047 100644 --- a/system/views/components/embassy/faction/nav.php +++ b/system/views/components/embassy/faction/nav.php @@ -1,4 +1,7 @@ '; echo '
'; echo '

Ambassades

'; diff --git a/system/views/components/faction/data/diplomacy/about.php b/system/views/components/faction/data/diplomacy/about.php index d00ae9165..cf04caba4 100644 --- a/system/views/components/faction/data/diplomacy/about.php +++ b/system/views/components/faction/data/diplomacy/about.php @@ -1,4 +1,8 @@ get('playerInfo')->get('color'); @@ -32,4 +36,3 @@ echo '
'; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/faction/data/diplomacy/main.php b/system/views/components/faction/data/diplomacy/main.php index 2ec7ab973..03c04da28 100644 --- a/system/views/components/faction/data/diplomacy/main.php +++ b/system/views/components/faction/data/diplomacy/main.php @@ -1,4 +1,8 @@ get('playerInfo')->get('color'); @@ -41,4 +45,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/faction/data/financial/donations.php b/system/views/components/faction/data/financial/donations.php index 432f8f35b..0dfaebbed 100755 --- a/system/views/components/faction/data/financial/donations.php +++ b/system/views/components/faction/data/financial/donations.php @@ -1,4 +1,10 @@ getCurrentSession(); ASM::$crt->newSession(); @@ -71,4 +77,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/faction/data/financial/sectors-tax.php b/system/views/components/faction/data/financial/sectors-tax.php index ad61c060f..5413597e3 100755 --- a/system/views/components/faction/data/financial/sectors-tax.php +++ b/system/views/components/faction/data/financial/sectors-tax.php @@ -1,5 +1,6 @@ getCurrentSession(); ASM::$sem->newSession(); @@ -29,4 +30,3 @@ echo ''; ASM::$sem->changeSession($S_SEM_T); -?> \ No newline at end of file diff --git a/system/views/components/faction/data/financial/stats.php b/system/views/components/faction/data/financial/stats.php index 9b7f1d29a..4513c6254 100755 --- a/system/views/components/faction/data/financial/stats.php +++ b/system/views/components/faction/data/financial/stats.php @@ -1,5 +1,7 @@ getCurrentSession(); ASM::$frm->newSession(); @@ -51,4 +53,3 @@ echo ''; ASM::$frm->changeSession($S_FRM1); -?> \ No newline at end of file diff --git a/system/views/components/faction/data/law/list.php b/system/views/components/faction/data/law/list.php index 8fbf0c3e1..26888e2d9 100755 --- a/system/views/components/faction/data/law/list.php +++ b/system/views/components/faction/data/law/list.php @@ -1,5 +1,7 @@ id, 'status'); @@ -28,4 +30,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/faction/data/nav.php b/system/views/components/faction/data/nav.php index b45950dc1..9d6992a3c 100755 --- a/system/views/components/faction/data/nav.php +++ b/system/views/components/faction/data/nav.php @@ -1,4 +1,7 @@ '; echo '
'; echo '

Registres

'; diff --git a/system/views/components/faction/data/tactical/map.php b/system/views/components/faction/data/tactical/map.php index 5b2bf7c2b..928a2964a 100755 --- a/system/views/components/faction/data/tactical/map.php +++ b/system/views/components/faction/data/tactical/map.php @@ -1,4 +1,8 @@ load(); $rate = 750 / GalaxyConfiguration::$galaxy['size']; diff --git a/system/views/components/faction/data/tactical/sectors.php b/system/views/components/faction/data/tactical/sectors.php index 1633adc75..f2052c46b 100755 --- a/system/views/components/faction/data/tactical/sectors.php +++ b/system/views/components/faction/data/tactical/sectors.php @@ -1,4 +1,9 @@ getCurrentSession(); ASM::$clm->newSession(); ASM::$clm->load(); @@ -20,7 +25,7 @@ $qr .= ' FROM sector AS se ORDER BY (nbc' . $faction->id . ' / nbc0) DESC'; -$db = DataBase::getInstance(); +$db = Database::getInstance(); $qr = $db->prepare($qr); $qr->execute(); $aw = $qr->fetchAll(); $qr->closeCursor(); @@ -86,4 +91,3 @@ echo '
'; echo ''; ASM::$clm->changeSession($_CLM); -?> \ No newline at end of file diff --git a/system/views/components/faction/data/tactical/targets.php b/system/views/components/faction/data/tactical/targets.php index 68a0babdc..a8d48070f 100755 --- a/system/views/components/faction/data/tactical/targets.php +++ b/system/views/components/faction/data/tactical/targets.php @@ -1,4 +1,8 @@ '; diff --git a/system/views/components/faction/data/trade/rc-stats.php b/system/views/components/faction/data/trade/rc-stats.php index 8301c60d9..9142c5869 100755 --- a/system/views/components/faction/data/trade/rc-stats.php +++ b/system/views/components/faction/data/trade/rc-stats.php @@ -1,4 +1,9 @@ prepare('SELECT COUNT(cr.id) AS nb, @@ -78,4 +83,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/faction/data/trade/tax-in.php b/system/views/components/faction/data/trade/tax-in.php index c0a2484ce..455464d56 100755 --- a/system/views/components/faction/data/trade/tax-in.php +++ b/system/views/components/faction/data/trade/tax-in.php @@ -1,5 +1,7 @@ getCurrentSession(); ASM::$ctm->newSession(); @@ -26,4 +28,3 @@ echo ''; ASM::$ctm->changeSession($S_CTM_T); -?> \ No newline at end of file diff --git a/system/views/components/faction/data/trade/tax-out.php b/system/views/components/faction/data/trade/tax-out.php index c46199aa3..6bab39d01 100755 --- a/system/views/components/faction/data/trade/tax-out.php +++ b/system/views/components/faction/data/trade/tax-out.php @@ -1,5 +1,7 @@ getCurrentSession(); ASM::$ctm->newSession(); @@ -25,5 +27,4 @@ echo ''; echo ''; -ASM::$ctm->changeSession($S_CTM_T); -?> \ No newline at end of file +ASM::$ctm->changeSession($S_CTM_T); \ No newline at end of file diff --git a/system/views/components/faction/data/war/incoming.php b/system/views/components/faction/data/war/incoming.php index 40622c769..f44577639 100755 --- a/system/views/components/faction/data/war/incoming.php +++ b/system/views/components/faction/data/war/incoming.php @@ -1,7 +1,8 @@ prepare('SELECT COUNT(c.id) AS nb @@ -37,4 +38,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/faction/data/war/levels.php b/system/views/components/faction/data/war/levels.php index bbaae711b..62630a02d 100755 --- a/system/views/components/faction/data/war/levels.php +++ b/system/views/components/faction/data/war/levels.php @@ -1,5 +1,7 @@ '; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/faction/data/war/reports-attack.php b/system/views/components/faction/data/war/reports-attack.php index 1f0fc8173..b93da0c83 100755 --- a/system/views/components/faction/data/war/reports-attack.php +++ b/system/views/components/faction/data/war/reports-attack.php @@ -1,6 +1,7 @@ getCurrentSession(); @@ -43,4 +44,3 @@ echo ''; ASM::$lrm->changeSession($S_LRM1); -?> \ No newline at end of file diff --git a/system/views/components/faction/data/war/reports-defend.php b/system/views/components/faction/data/war/reports-defend.php index 7f632596a..fc03952a6 100644 --- a/system/views/components/faction/data/war/reports-defend.php +++ b/system/views/components/faction/data/war/reports-defend.php @@ -1,6 +1,7 @@ getCurrentSession(); @@ -41,4 +42,3 @@ echo ''; ASM::$lrm->changeSession($S_LRM1); -?> \ No newline at end of file diff --git a/system/views/components/faction/data/war/stats.php b/system/views/components/faction/data/war/stats.php index 44b18592c..21daea701 100755 --- a/system/views/components/faction/data/war/stats.php +++ b/system/views/components/faction/data/war/stats.php @@ -1,7 +1,12 @@ prepare('SELECT COUNT(c.id) AS nb, @@ -94,4 +99,3 @@ echo ''; echo ''; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/faction/overview/stat.php b/system/views/components/faction/overview/stat.php index 179158b01..5e91de4be 100755 --- a/system/views/components/faction/overview/stat.php +++ b/system/views/components/faction/overview/stat.php @@ -12,7 +12,6 @@ $status = ColorResource::getInfo($faction->id, 'status'); # ranking -include_once ATLAS; $S_FRM1 = ASM::$frm->getCurrentSession(); ASM::$frm->newSession(); ASM::$frm->loadLastContext(); diff --git a/system/views/components/financial/fleetFeesFinancial.php b/system/views/components/financial/fleetFeesFinancial.php index dc3806d23..7f13e2027 100755 --- a/system/views/components/financial/fleetFeesFinancial.php +++ b/system/views/components/financial/fleetFeesFinancial.php @@ -7,6 +7,9 @@ # require # [{commander}] commander_fleetFeesFinancial +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Ares\Resource\CommanderResources; + $commanderByBase = array(); foreach ($commander_fleetFeesFinancial as $commander) { diff --git a/system/views/components/financial/generalFinancial.php b/system/views/components/financial/generalFinancial.php index 00a59fc4a..2c3047cc8 100755 --- a/system/views/components/financial/generalFinancial.php +++ b/system/views/components/financial/generalFinancial.php @@ -8,6 +8,9 @@ # * # view part + +use Asylamba\Classes\Library\Format; + echo '
'; echo '
'; echo '

Finance

'; @@ -164,4 +167,3 @@ echo '
'; echo '
'; echo ''; -?> \ No newline at end of file diff --git a/system/views/components/financial/impositionFinancial.php b/system/views/components/financial/impositionFinancial.php index 38b16a5b9..e3fe2aa8e 100755 --- a/system/views/components/financial/impositionFinancial.php +++ b/system/views/components/financial/impositionFinancial.php @@ -8,6 +8,10 @@ # [{orbitalBase}] ob_impositionFinancial # view part + +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Library\Game; + echo '
'; echo '
'; echo ''; diff --git a/system/views/components/financial/investFinancial.php b/system/views/components/financial/investFinancial.php index d74b63c40..9ecafa679 100755 --- a/system/views/components/financial/investFinancial.php +++ b/system/views/components/financial/investFinancial.php @@ -8,6 +8,9 @@ # [{orbitalBase}] ob_investFinancial # view part + +use Asylamba\Classes\Library\Format; + echo '
'; echo '
'; echo ''; diff --git a/system/views/components/financial/last-receive-credit.php b/system/views/components/financial/last-receive-credit.php index b333b7d52..9338b6278 100755 --- a/system/views/components/financial/last-receive-credit.php +++ b/system/views/components/financial/last-receive-credit.php @@ -1,4 +1,8 @@ getCurrentSession(); ASM::$crt->newSession(); diff --git a/system/views/components/financial/last-send-credit.php b/system/views/components/financial/last-send-credit.php index 7c4bccbd3..b2457c996 100755 --- a/system/views/components/financial/last-send-credit.php +++ b/system/views/components/financial/last-send-credit.php @@ -1,4 +1,8 @@ getCurrentSession(); ASM::$crt->newSession(); diff --git a/system/views/components/financial/msFeesFinancial.php b/system/views/components/financial/msFeesFinancial.php index d50d4bea3..1d918e8bc 100755 --- a/system/views/components/financial/msFeesFinancial.php +++ b/system/views/components/financial/msFeesFinancial.php @@ -8,6 +8,9 @@ # [{mothership}] ob_msFeesFinancial # view part + +use Asylamba\Modules\Hermes\Model\Notification; + echo '
'; echo '
'; echo 'vaisseau mère'; @@ -17,7 +20,6 @@ echo '
'; echo '
'; echo '

Rien pour le moment !

'; - include_once HERMES; $notif = new Notification(); echo '
'; echo '
'; diff --git a/system/views/components/financial/routeFinancial.php b/system/views/components/financial/routeFinancial.php index 3d57ff3b5..90f2c9e58 100755 --- a/system/views/components/financial/routeFinancial.php +++ b/system/views/components/financial/routeFinancial.php @@ -8,6 +8,10 @@ # [{orbitalBase}] ob_routeFinancial # view part + +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Format; + echo '
'; echo '
'; echo 'route commerciale'; diff --git a/system/views/components/financial/send-credit-faction.php b/system/views/components/financial/send-credit-faction.php index dad5fb1ad..ce8765e26 100755 --- a/system/views/components/financial/send-credit-faction.php +++ b/system/views/components/financial/send-credit-faction.php @@ -8,6 +8,9 @@ # [{orbitalBase}] ob_routeFinancial # view part + +use Asylamba\Classes\Library\Format; + echo '
'; echo '
'; echo '
'; diff --git a/system/views/components/financial/send-credit-player.php b/system/views/components/financial/send-credit-player.php index ab242f46b..65c87ea03 100755 --- a/system/views/components/financial/send-credit-player.php +++ b/system/views/components/financial/send-credit-player.php @@ -8,6 +8,9 @@ # [{orbitalBase}] ob_routeFinancial # view part + +use Asylamba\Classes\Library\Format; + echo '
'; echo '
'; echo '

Envoi de crédit

'; diff --git a/system/views/components/financial/shipFeesFinancial.php b/system/views/components/financial/shipFeesFinancial.php index ff0cfad78..4cb386a08 100644 --- a/system/views/components/financial/shipFeesFinancial.php +++ b/system/views/components/financial/shipFeesFinancial.php @@ -1,5 +1,10 @@ getRBase()])) { diff --git a/system/views/components/financial/taxOutFinancial.php b/system/views/components/financial/taxOutFinancial.php index d61f45916..27a599be2 100755 --- a/system/views/components/financial/taxOutFinancial.php +++ b/system/views/components/financial/taxOutFinancial.php @@ -8,6 +8,10 @@ # [{orbitalBase}] ob_taxOutFinancial # view part + +use Asylamba\Classes\Library\Game; +use Asylamba\Classes\Library\Format; + echo '
'; echo '
'; echo ''; diff --git a/system/views/components/fleet/commanderDetail.php b/system/views/components/fleet/commanderDetail.php index eff73526c..698b48bb2 100755 --- a/system/views/components/fleet/commanderDetail.php +++ b/system/views/components/fleet/commanderDetail.php @@ -7,6 +7,11 @@ # require # {commander} commander_commanderDetail +use Asylamba\Modules\Ares\Model\Commander; +use Asylamba\Modules\Ares\Resource\CommanderResources; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Library\Game; + echo '
'; echo '
'; echo '
'; diff --git a/system/views/components/fleet/commanderFleet.php b/system/views/components/fleet/commanderFleet.php index be36cad9d..13aa3493c 100755 --- a/system/views/components/fleet/commanderFleet.php +++ b/system/views/components/fleet/commanderFleet.php @@ -8,6 +8,9 @@ # {commander} commander_commanderFleet # {orbitalBase} ob_commanderFleet +use Asylamba\Modules\Ares\Resource\CommanderResources; +use Asylamba\Modules\Athena\Resource\ShipResource; + $dockStorage = $ob_commanderFleet->getShipStorage(); $lineCoord = $commander_commanderFleet->getFormatLineCoord(); diff --git a/system/views/components/fleet/list-report.php b/system/views/components/fleet/list-report.php index 7a91614b8..504384658 100644 --- a/system/views/components/fleet/list-report.php +++ b/system/views/components/fleet/list-report.php @@ -8,6 +8,11 @@ # [{report}] report_listReport # (INT) type_listReport +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Container\Params; +use Asylamba\Classes\Library\Chronos; +use Asylamba\Classes\Worker\CTR; + echo '
'; echo '
'; if ($type_listReport == 1) { @@ -61,4 +66,3 @@ echo '
'; echo '
'; echo '
'; -?> \ No newline at end of file diff --git a/system/views/components/fleet/listFleet.php b/system/views/components/fleet/listFleet.php index 802223bd1..507231701 100755 --- a/system/views/components/fleet/listFleet.php +++ b/system/views/components/fleet/listFleet.php @@ -7,6 +7,15 @@ # require # [{commander}] commander_listFleetIncoming +use Asylamba\Modules\Gaia\Resource\PlaceResource; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Container\Params; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Ares\Model\Commander; +use Asylamba\Modules\Ares\Resource\CommanderResources; +use Asylamba\Classes\Library\Game; + echo '
'; echo '
'; echo '

Centre des opérations

'; diff --git a/system/views/components/fleet/listSpy.php b/system/views/components/fleet/listSpy.php index 234dac7cd..8e9c80a4a 100755 --- a/system/views/components/fleet/listSpy.php +++ b/system/views/components/fleet/listSpy.php @@ -7,6 +7,10 @@ # require # [{spyreport}] spyreport_listSpy +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Library\Chronos; +use Asylamba\Classes\Worker\CTR; + $i = 0; echo '
'; @@ -45,4 +49,3 @@ echo '
'; echo '
'; echo '
'; -?> \ No newline at end of file diff --git a/system/views/components/fleet/manage-report.php b/system/views/components/fleet/manage-report.php index 062e25e05..f1c99b9ce 100644 --- a/system/views/components/fleet/manage-report.php +++ b/system/views/components/fleet/manage-report.php @@ -4,6 +4,8 @@ # liste tous les derniers rapports de combats du joueur +use Asylamba\Classes\Library\Format; + echo '
'; echo '
'; echo '
'; diff --git a/system/views/components/fleet/overview.php b/system/views/components/fleet/overview.php index 1abd3093a..89a7c4b18 100755 --- a/system/views/components/fleet/overview.php +++ b/system/views/components/fleet/overview.php @@ -7,6 +7,11 @@ # require # [{commander}] commander_listFleetIncoming +use Asylamba\Modules\Athena\Resource\ShipResource; +use Asylamba\Modules\Gaia\Resource\PlaceResource; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Ares\Resource\CommanderResources; + echo '
'; echo '
'; echo '

Aperçu des armées

'; diff --git a/system/views/components/fleet/report.php b/system/views/components/fleet/report.php index 7a612304c..f0d2a3bb6 100755 --- a/system/views/components/fleet/report.php +++ b/system/views/components/fleet/report.php @@ -9,6 +9,11 @@ # {player} attacker_report # {player} defender_report +use Asylamba\Modules\Ares\Resource\CommanderResources; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Ares\Model\Commander; +use Asylamba\Modules\Athena\Resource\ShipResource; + echo '
'; echo '
'; echo '' . $attacker_report->name . ''; diff --git a/system/views/components/fleet/spyReport.php b/system/views/components/fleet/spyReport.php index c40f4204f..e129b4194 100755 --- a/system/views/components/fleet/spyReport.php +++ b/system/views/components/fleet/spyReport.php @@ -8,6 +8,12 @@ # {report} spyreport # {place} place_spy +use Asylamba\Modules\Artemis\Model\SpyReport; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Gaia\Resource\PlaceResource; +use Asylamba\Modules\Artemis\Model\SpyReport; +use Asylamba\Classes\Library\Game; + echo '
'; echo '
'; echo ($spyreport->rEnemy == 0) @@ -168,4 +174,3 @@ echo '
'; echo '
'; echo '
'; -?> \ No newline at end of file diff --git a/system/views/components/notif/archived.php b/system/views/components/notif/archived.php index b2ac32b31..2be72e999 100755 --- a/system/views/components/notif/archived.php +++ b/system/views/components/notif/archived.php @@ -7,6 +7,10 @@ # require # [{notification}] notification_archivedNotif +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Library\Chronos; + $S_NTM_SCOPE = ASM::$ntm->getCurrentSession(); ASM::$ntm->changeSession($C_NTM2); @@ -35,4 +39,3 @@ echo '
'; ASM::$ntm->changeSession($S_NTM_SCOPE); -?> \ No newline at end of file diff --git a/system/views/components/notif/last.php b/system/views/components/notif/last.php index 116543247..4c6531e20 100755 --- a/system/views/components/notif/last.php +++ b/system/views/components/notif/last.php @@ -7,6 +7,10 @@ # require # [{notification}] notification_lastNotif +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Library\Chronos; + $S_NTM_SCOPE = ASM::$ntm->getCurrentSession(); ASM::$ntm->changeSession($C_NTM1); @@ -51,4 +55,3 @@ echo '
'; ASM::$ntm->changeSession($S_NTM_SCOPE); -?> \ No newline at end of file diff --git a/system/views/components/params/chat.php b/system/views/components/params/chat.php index baef93f8d..231f2b34c 100644 --- a/system/views/components/params/chat.php +++ b/system/views/components/params/chat.php @@ -1,4 +1,8 @@ '; echo '
'; echo '

Paramètres du chat

'; diff --git a/system/views/components/params/display.php b/system/views/components/params/display.php index 3ff16c350..4f4329f12 100755 --- a/system/views/components/params/display.php +++ b/system/views/components/params/display.php @@ -1,4 +1,8 @@ '; echo '
'; diff --git a/system/views/components/params/general.php b/system/views/components/params/general.php index 2e947bd1b..a035ac819 100755 --- a/system/views/components/params/general.php +++ b/system/views/components/params/general.php @@ -1,4 +1,5 @@ '; echo '
'; @@ -13,4 +14,3 @@ echo '
'; echo '
'; echo '
'; -?> \ No newline at end of file diff --git a/system/views/components/player/playerRoleplayProfil.php b/system/views/components/player/playerRoleplayProfil.php index a44f79159..dffe74315 100755 --- a/system/views/components/player/playerRoleplayProfil.php +++ b/system/views/components/player/playerRoleplayProfil.php @@ -7,6 +7,11 @@ # require # {player} player_playerRoleplayProfil + +use Asylamba\Modules\Demeter\Resource\ColorResource; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Format; + echo '
'; echo '
'; echo '

Votre profil

'; @@ -48,4 +53,3 @@ echo '
'; echo '
'; echo '
'; -?> \ No newline at end of file diff --git a/system/views/components/player/playerTechnicalProfil.php b/system/views/components/player/playerTechnicalProfil.php index fc3bdb385..de4b8a57f 100755 --- a/system/views/components/player/playerTechnicalProfil.php +++ b/system/views/components/player/playerTechnicalProfil.php @@ -7,6 +7,8 @@ # require # {player} player_playerTechnicalProfil +use Asylamba\Classes\Library\Format; + echo '
'; echo '
'; echo '
'; @@ -51,4 +53,3 @@ echo '
'; echo '
'; echo '
'; -?> \ No newline at end of file diff --git a/system/views/components/rank/faction/front.php b/system/views/components/rank/faction/front.php index 4fe546b5c..c036983a3 100755 --- a/system/views/components/rank/faction/front.php +++ b/system/views/components/rank/faction/front.php @@ -7,6 +7,9 @@ # require # _T PRM FACTION_RANKING_FRONT +use Asylamba\Classes\Worker\ASM; +use Asylamba\Modules\Demeter\Resource\ColorResource; + ASM::$frm->changeSession($FACTION_RANKING_FRONT); $f = ASM::$frm->get(0); diff --git a/system/views/components/rank/faction/general.php b/system/views/components/rank/faction/general.php index e545013c6..9392eb7af 100755 --- a/system/views/components/rank/faction/general.php +++ b/system/views/components/rank/faction/general.php @@ -7,6 +7,8 @@ # require # _T PRM FACTION_RANKING_GENERAL +use Asylamba\Classes\Worker\ASM; + ASM::$frm->changeSession($FACTION_RANKING_GENERAL); echo '
'; diff --git a/system/views/components/rank/faction/info-victory.php b/system/views/components/rank/faction/info-victory.php index 8dd56fcd8..03b895dc1 100644 --- a/system/views/components/rank/faction/info-victory.php +++ b/system/views/components/rank/faction/info-victory.php @@ -7,6 +7,9 @@ # require # _T PRM FACTION_RANKING_POINTS +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Format; + ASM::$frm->changeSession($FACTION_RANKING_POINTS); echo '
'; diff --git a/system/views/components/rank/faction/points.php b/system/views/components/rank/faction/points.php index d5c95f773..0a7c71485 100644 --- a/system/views/components/rank/faction/points.php +++ b/system/views/components/rank/faction/points.php @@ -7,6 +7,9 @@ # require # _T PRM FACTION_RANKING_POINTS +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Utils; + ASM::$frm->changeSession($FACTION_RANKING_POINTS); echo '
'; diff --git a/system/views/components/rank/faction/territorial.php b/system/views/components/rank/faction/territorial.php index 076eff7bf..ad2be0683 100755 --- a/system/views/components/rank/faction/territorial.php +++ b/system/views/components/rank/faction/territorial.php @@ -7,6 +7,8 @@ # require # _T PRM FACTION_RANKING_TERRITORIAL +use Asylamba\Classes\Worker\ASM; + ASM::$frm->changeSession($FACTION_RANKING_TERRITORIAL); echo '
'; diff --git a/system/views/components/rank/faction/wealth.php b/system/views/components/rank/faction/wealth.php index c71400eaf..91bdac2af 100755 --- a/system/views/components/rank/faction/wealth.php +++ b/system/views/components/rank/faction/wealth.php @@ -7,6 +7,8 @@ # require # _T PRM FACTION_RANKING_WEALTH +use Asylamba\Classes\Worker\ASM; + ASM::$frm->changeSession($FACTION_RANKING_WEALTH); echo '
'; diff --git a/system/views/components/rank/player/armies.php b/system/views/components/rank/player/armies.php index 55b55dfd3..73877b0c3 100755 --- a/system/views/components/rank/player/armies.php +++ b/system/views/components/rank/player/armies.php @@ -7,6 +7,8 @@ # require # _T PRM PLAYER_RANKING_ARMIES +use Asylamba\Classes\Worker\ASM; + ASM::$prm->changeSession($PLAYER_RANKING_ARMIES); echo '
'; diff --git a/system/views/components/rank/player/butcher.php b/system/views/components/rank/player/butcher.php index d793fc22d..18c2f3fe7 100755 --- a/system/views/components/rank/player/butcher.php +++ b/system/views/components/rank/player/butcher.php @@ -7,6 +7,8 @@ # require # _T PRM PLAYER_RANKING_BUTCHER +use Asylamba\Classes\Worker\ASM; + ASM::$prm->changeSession($PLAYER_RANKING_BUTCHER); echo '
'; diff --git a/system/views/components/rank/player/fight.php b/system/views/components/rank/player/fight.php index 544b9a25e..5eaced017 100755 --- a/system/views/components/rank/player/fight.php +++ b/system/views/components/rank/player/fight.php @@ -7,6 +7,8 @@ # require # _T PRM PLAYER_RANKING_FIGHT +use Asylamba\Classes\Worker\ASM; + ASM::$prm->changeSession($PLAYER_RANKING_FIGHT); echo '
'; diff --git a/system/views/components/rank/player/front.php b/system/views/components/rank/player/front.php index a74e912fc..660151515 100755 --- a/system/views/components/rank/player/front.php +++ b/system/views/components/rank/player/front.php @@ -7,8 +7,8 @@ # require # _T PRM PLAYER_RANKING_FRONT -include_once ZEUS; -include_once DEMETER; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Modules\Demeter\Resource\ColorResource; ASM::$prm->changeSession($PLAYER_RANKING_FRONT); $p = ASM::$prm->get(0); diff --git a/system/views/components/rank/player/general.php b/system/views/components/rank/player/general.php index d7d69a60e..363c811ab 100755 --- a/system/views/components/rank/player/general.php +++ b/system/views/components/rank/player/general.php @@ -7,6 +7,8 @@ # require # _T PRM PLAYER_RANKING_GENERAL +use Asylamba\Classes\Worker\ASM; + ASM::$prm->changeSession($PLAYER_RANKING_GENERAL); echo '
'; diff --git a/system/views/components/rank/player/resources.php b/system/views/components/rank/player/resources.php index dc8db8464..139e3df03 100755 --- a/system/views/components/rank/player/resources.php +++ b/system/views/components/rank/player/resources.php @@ -7,6 +7,8 @@ # require # _T PRM PLAYER_RANKING_RESOURCES +use Asylamba\Classes\Worker\ASM; + ASM::$prm->changeSession($PLAYER_RANKING_RESOURCES); echo '
'; diff --git a/system/views/components/rank/player/stats.php b/system/views/components/rank/player/stats.php index 75c957c07..a7aecab85 100755 --- a/system/views/components/rank/player/stats.php +++ b/system/views/components/rank/player/stats.php @@ -1,6 +1,9 @@ '; echo '
'; echo '
'; diff --git a/system/views/components/rank/player/trader.php b/system/views/components/rank/player/trader.php index 14f75521c..ff6de4dfa 100755 --- a/system/views/components/rank/player/trader.php +++ b/system/views/components/rank/player/trader.php @@ -7,6 +7,8 @@ # require # _T PRM PLAYER_RANKING_TRADER +use Asylamba\Classes\Worker\ASM; + ASM::$prm->changeSession($PLAYER_RANKING_TRADER); echo '
'; diff --git a/system/views/components/rank/player/xp.php b/system/views/components/rank/player/xp.php index 0b0bb36dd..334aab8dd 100755 --- a/system/views/components/rank/player/xp.php +++ b/system/views/components/rank/player/xp.php @@ -7,6 +7,8 @@ # require # _T PRM PLAYER_RANKING_XP +use Asylamba\Classes\Worker\ASM; + ASM::$prm->changeSession($PLAYER_RANKING_XP); echo '
'; diff --git a/system/views/components/sponsorship/list-godson.php b/system/views/components/sponsorship/list-godson.php index 995bd6344..573c9d7f6 100644 --- a/system/views/components/sponsorship/list-godson.php +++ b/system/views/components/sponsorship/list-godson.php @@ -1,4 +1,7 @@ getCurrentSession(); ASM::$pam->newSession(); ASM::$pam->load( diff --git a/system/views/components/sponsorship/send-mail.php b/system/views/components/sponsorship/send-mail.php index c00f783f3..59d356ce1 100644 --- a/system/views/components/sponsorship/send-mail.php +++ b/system/views/components/sponsorship/send-mail.php @@ -1,4 +1,8 @@ '; echo '
'; diff --git a/system/views/components/tech/infoTech.php b/system/views/components/tech/infoTech.php index 4da608a9c..8f6d8a0ee 100755 --- a/system/views/components/tech/infoTech.php +++ b/system/views/components/tech/infoTech.php @@ -1,4 +1,8 @@ '; echo '
'; echo '
'; @@ -44,4 +48,3 @@ echo '
'; echo '
'; echo '
'; -?> \ No newline at end of file diff --git a/system/views/components/tech/university.php b/system/views/components/tech/university.php index 5aeb6d980..abb19f368 100755 --- a/system/views/components/tech/university.php +++ b/system/views/components/tech/university.php @@ -8,7 +8,11 @@ # {player} player_university # work -include_once PROMETHEE; + +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Modules\Zeus\Model\PlayerBonus; +use Asylamba\Modules\Promethee\Resource\ResearchResource; echo '
'; echo '
'; @@ -248,4 +252,3 @@ echo '
'; echo '
'; echo '
'; -?> \ No newline at end of file From a17317a9699c1cd849775e64bef3c1151ad6ade3 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:23:17 +0200 Subject: [PATCH 24/64] Implement namespaces usage in scripts --- system/script/main.php | 49 ++++++++++--------- system/script/scripts/cron/daily.php | 12 +++-- system/script/scripts/cron/factionRanking.php | 7 --- system/script/scripts/cron/playerRanking.php | 4 -- system/script/scripts/deploy/dbinstall.php | 23 ++++++--- system/script/scripts/deploy/newgalaxy.php | 5 +- .../scripts/migration/add-conversation.php | 9 ++-- .../scripts/migration/remove-message.php | 5 +- .../script/scripts/migration/updateColor.php | 6 ++- .../migration/updateFactionRanking.php | 5 +- .../scripts/migration/updateRecycling.php | 7 +-- .../script/scripts/migration/updateSector.php | 5 +- system/script/scripts/test/test.php | 3 ++ system/script/scripts/test/updateSenate.php | 8 ++- .../script/scripts/utils/commanderAttack.php | 4 +- .../scripts/utils/find-sector-infos.php | 1 - system/script/scripts/utils/get-stats.php | 5 +- system/script/scripts/utils/map-render.php | 4 +- .../script/scripts/utils/recolor-sector.php | 4 +- system/script/template/close.php | 3 +- system/script/template/open.php | 6 ++- 21 files changed, 102 insertions(+), 73 deletions(-) diff --git a/system/script/main.php b/system/script/main.php index 910083c8c..fc7a2bb93 100755 --- a/system/script/main.php +++ b/system/script/main.php @@ -1,34 +1,37 @@ [ - ['deploy.dbinstall', '/deploy/dbinstall.php'], - ['deploy.newgalaxy', '/deploy/newgalaxy.php'], + ['deploy_dbinstall', '/deploy/dbinstall.php'], + ['deploy_newgalaxy', '/deploy/newgalaxy.php'], ], 'Tâches Cron' => [ - ['cron.daily', '/cron/daily.php'], - ['cron.playerranking', '/cron/playerRanking.php'], - ['cron.factionranking', '/cron/factionRanking.php'], + ['cron_daily', '/cron/daily.php'], + ['cron_playerranking', '/cron/playerRanking.php'], + ['cron_factionranking', '/cron/factionRanking.php'], ], 'Utilitaires' => [ - ['utils.commanderAttack', '/utils/commanderAttack.php'], - ['utils.sectors', '/utils/sectors.php'], - ['utils.maprender', '/utils/map-render.php'], - ['utils.findsectorinfos', '/utils/find-sector-infos.php'], - ['utils.getstatistic', '/utils/get-stats.php'], - ['utils.recolorsector', '/utils/recolor-sector.php'], + ['utils_commanderAttack', '/utils/commanderAttack.php'], + ['utils_sectors', '/utils/sectors.php'], + ['utils_maprender', '/utils/map-render.php'], + ['utils_findsectorinfos', '/utils/find-sector-infos.php'], + ['utils_getstatistic', '/utils/get-stats.php'], + ['utils_recolorsector', '/utils/recolor-sector.php'], ], 'Test' => [ - ['test.main', '/test/test.php'], - ['test.http', '/test/http-data.php'], - ['test.updateSenatAphera', '/test/updateSenate.php'], + ['test_main', '/test/test.php'], + ['test_http', '/test/http-data.php'], + ['test_updateSenatAphera', '/test/updateSenate.php'], ], 'Migration' => [ - ['migration.color', '/migration/updateColor.php'], - ['migration.recycling', '/migration/updateRecycling.php'], - ['migration.sector', '/migration/updateSector.php'], - ['migration.factionranking', '/migration/updateFactionRanking.php'], - ['migration.addconversation', '/migration/add-conversation.php'], - ['migration.removemessage', '/migration/remove-message.php'], + ['migration_color', '/migration/updateColor.php'], + ['migration_recycling', '/migration/updateRecycling.php'], + ['migration_sector', '/migration/updateSector.php'], + ['migration_factionranking', '/migration/updateFactionRanking.php'], + ['migration_addconversation', '/migration/add-conversation.php'], + ['migration_removemessage', '/migration/remove-message.php'], ] ]; @@ -60,9 +63,10 @@ echo '
'; echo '
'; } else { + $requestedScript = CTR::$get->get('a'); foreach ($scripts as $typeScripts) { foreach ($typeScripts as $i => $script) { - if (CTR::$get->get('a') == $script[0]) { + if ($requestedScript === $script[0]) { $scrp = SCRIPT . 'scripts' . $script[1]; $name = $script[1]; } @@ -82,5 +86,4 @@ } } -include SCRIPT . 'template/close.php'; -?> \ No newline at end of file +include SCRIPT . 'template/close.php'; \ No newline at end of file diff --git a/system/script/scripts/cron/daily.php b/system/script/scripts/cron/daily.php index 8fb48b1d2..8b2c8975c 100755 --- a/system/script/scripts/cron/daily.php +++ b/system/script/scripts/cron/daily.php @@ -8,9 +8,15 @@ # ... # worker -include_once HERMES; + +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Bug; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Library\Benchmark; +use Asylamba\Classes\Worker\API; +use Asylamba\Modules\Gaia\Manager\GalaxyColorManager; + $S_NTM1 = ASM::$ntm->getCurrentSession(); -include_once ZEUS; $S_PAM1 = ASM::$pam->getCurrentSession(); $path = 'public/log/cron/' . date('Y') . '-' . date('m') . '.log'; @@ -90,7 +96,6 @@ } # applique en cascade le changement de couleur des sytèmes -include_once GAIA; GalaxyColorManager::apply(); Bug::writeLog($path, '# [OK] Status'); @@ -105,4 +110,3 @@ ASM::$pam->changeSession($S_PAM1); Bug::writeLog($path, ''); -?> diff --git a/system/script/scripts/cron/factionRanking.php b/system/script/scripts/cron/factionRanking.php index 76ef5df32..5e2274414 100755 --- a/system/script/scripts/cron/factionRanking.php +++ b/system/script/scripts/cron/factionRanking.php @@ -2,8 +2,6 @@ # daily cron # call at x am. every day -include_once ATHENA; -include_once ATLAS; $S_FRM1 = ASM::$frm->getCurrentSession(); ASM::$frm->newSession(); ASM::$frm->loadLastContext(); @@ -12,16 +10,12 @@ ASM::$prm->newSession(); ASM::$prm->loadLastContext(); -include_once ZEUS; $S_PAM1 = ASM::$pam->getCurrentSession(); ASM::$pam->newSession(FALSE); -include_once DEMETER; $S_CLM1 = ASM::$clm->getCurrentSession(); ASM::$clm->newSession(FALSE); -include_once GAIA; # for Sector and SectorManager - # create a new ranking $db = DataBase::getInstance(); $qr = $db->prepare('INSERT INTO ranking(dRanking, player, faction) VALUES (?, 0, 1)'); @@ -289,7 +283,6 @@ function setPositions($list, $attribute) { $content = 'Salut,

La victoire vient d\'être remportée par :
' . $winnerName . '
'; $content .= 'Cette faction a atteint les ' . POINTS_TO_WIN . ' points, la partie est donc terminée.

Bravo et un grand merci à tous les participants !'; - include_once HERMES; $S_CVM1 = ASM::$cvm->getCurrentSession(); ASM::$cvm->newSession(); ASM::$cvm->load( diff --git a/system/script/scripts/cron/playerRanking.php b/system/script/scripts/cron/playerRanking.php index 2ba6d5074..5cb272a05 100755 --- a/system/script/scripts/cron/playerRanking.php +++ b/system/script/scripts/cron/playerRanking.php @@ -2,17 +2,13 @@ # daily cron # call at x am. every day -include_once ATLAS; $S_PRM1 = ASM::$prm->getCurrentSession(); ASM::$prm->newSession(); ASM::$prm->loadLastContext(); -include_once ZEUS; $S_PAM1 = ASM::$pam->getCurrentSession(); ASM::$pam->newSession(FALSE); -include_once ATHENA; -include_once ARES; # create a new ranking $db = DataBase::getInstance(); diff --git a/system/script/scripts/deploy/dbinstall.php b/system/script/scripts/deploy/dbinstall.php index 7fd31a44c..ff82e4dcb 100755 --- a/system/script/scripts/deploy/dbinstall.php +++ b/system/script/scripts/deploy/dbinstall.php @@ -1,12 +1,19 @@ query('SET FOREIGN_KEY_CHECKS = 0;'); @@ -957,7 +964,7 @@ echo '

Ajout de la table Conversation

'; -$db = DataBase::getInstance(); +$db = Database::getInstance(); $db->query("DROP TABLE IF EXISTS `conversation`"); $qr = $db->prepare("CREATE TABLE IF NOT EXISTS `conversation` ( `id` INT(11) NOT NULL AUTO_INCREMENT, @@ -972,7 +979,7 @@ echo '

Ajout de la table userConversation

'; -$db = DataBase::getInstance(); +$db = Database::getInstance(); $db->query("DROP TABLE IF EXISTS `conversationUser`"); $qr = $db->prepare("CREATE TABLE IF NOT EXISTS `conversationUser` ( `id` INT(11) NOT NULL AUTO_INCREMENT, @@ -987,7 +994,7 @@ echo '

Ajout de la table messageConversation

'; -$db = DataBase::getInstance(); +$db = Database::getInstance(); $db->query("DROP TABLE IF EXISTS `conversationMessage`"); $qr = $db->prepare("CREATE TABLE IF NOT EXISTS `conversationMessage` ( `id` INT(11) NOT NULL AUTO_INCREMENT, diff --git a/system/script/scripts/deploy/newgalaxy.php b/system/script/scripts/deploy/newgalaxy.php index 036a4835f..d79fbecf5 100755 --- a/system/script/scripts/deploy/newgalaxy.php +++ b/system/script/scripts/deploy/newgalaxy.php @@ -1,7 +1,8 @@ Test galaxy'; GalaxyGenerator::generate(); echo GalaxyGenerator::getLog(); -?> \ No newline at end of file diff --git a/system/script/scripts/migration/add-conversation.php b/system/script/scripts/migration/add-conversation.php index 404c3d962..d767f6dea 100644 --- a/system/script/scripts/migration/add-conversation.php +++ b/system/script/scripts/migration/add-conversation.php @@ -1,9 +1,12 @@ Ajout du module de Conversation'; echo '

Ajout de la table Conversation

'; -$db = DataBase::getInstance(); +$db = Database::getInstance(); $qr = $db->prepare("CREATE TABLE IF NOT EXISTS `conversation` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `title` VARCHAR(255) NULL, @@ -17,7 +20,7 @@ echo '

Ajout de la table userConversation

'; -$db = DataBase::getInstance(); +$db = Database::getInstance(); $qr = $db->prepare("CREATE TABLE IF NOT EXISTS `conversationUser` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `rConversation` INT(11) NOT NULL, @@ -31,7 +34,7 @@ echo '

Ajout de la table messageConversation

'; -$db = DataBase::getInstance(); +$db = Database::getInstance(); $qr = $db->prepare("CREATE TABLE IF NOT EXISTS `conversationMessage` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `rConversation` INT(11) NOT NULL, diff --git a/system/script/scripts/migration/remove-message.php b/system/script/scripts/migration/remove-message.php index ed5b34797..b020eb6ca 100644 --- a/system/script/scripts/migration/remove-message.php +++ b/system/script/scripts/migration/remove-message.php @@ -1,8 +1,11 @@ Suppression du module de Message'; echo '

Suppression de la table Message

'; -$db = DataBase::getInstance(); +$db = Database::getInstance(); $qr = $db->prepare("DROP TABLE `message`;"); $qr->execute(); \ No newline at end of file diff --git a/system/script/scripts/migration/updateColor.php b/system/script/scripts/migration/updateColor.php index 5e3a01f9b..d64014b20 100755 --- a/system/script/scripts/migration/updateColor.php +++ b/system/script/scripts/migration/updateColor.php @@ -1,7 +1,9 @@ Ajout de isInGame dans color'; diff --git a/system/script/scripts/migration/updateFactionRanking.php b/system/script/scripts/migration/updateFactionRanking.php index 6991fc4d6..5cf95ab43 100644 --- a/system/script/scripts/migration/updateFactionRanking.php +++ b/system/script/scripts/migration/updateFactionRanking.php @@ -1,5 +1,8 @@ Ajout du classement total (points) dans playerRanking'; diff --git a/system/script/scripts/migration/updateRecycling.php b/system/script/scripts/migration/updateRecycling.php index a38637fc0..5ea2c067a 100644 --- a/system/script/scripts/migration/updateRecycling.php +++ b/system/script/scripts/migration/updateRecycling.php @@ -1,8 +1,9 @@ Ajout de addToNextMission dans recyclingMission'; $db->query("ALTER TABLE `recyclingMission` ADD `addToNextMission` SMALLINT unsigned NOT NULL AFTER `recyclerQuantity`;"); - -?> \ No newline at end of file diff --git a/system/script/scripts/migration/updateSector.php b/system/script/scripts/migration/updateSector.php index 44a69c359..b7d87ea3d 100644 --- a/system/script/scripts/migration/updateSector.php +++ b/system/script/scripts/migration/updateSector.php @@ -1,5 +1,8 @@ Ajout de points dans sector'; diff --git a/system/script/scripts/test/test.php b/system/script/scripts/test/test.php index a29e6af7b..2ae1ca225 100644 --- a/system/script/scripts/test/test.php +++ b/system/script/scripts/test/test.php @@ -1,2 +1,5 @@ Mise à jour du sénat d\'Aphera'; diff --git a/system/script/scripts/utils/commanderAttack.php b/system/script/scripts/utils/commanderAttack.php index 59343651c..37f44db52 100644 --- a/system/script/scripts/utils/commanderAttack.php +++ b/system/script/scripts/utils/commanderAttack.php @@ -1,7 +1,7 @@ newSession(); ASM::$com->load(['c.statement' => Commander::MOVING]); diff --git a/system/script/scripts/utils/find-sector-infos.php b/system/script/scripts/utils/find-sector-infos.php index da7a65e8d..b9fcdf9f2 100755 --- a/system/script/scripts/utils/find-sector-infos.php +++ b/system/script/scripts/utils/find-sector-infos.php @@ -1,5 +1,4 @@ Création automatisée de statistiques'; diff --git a/system/script/scripts/utils/map-render.php b/system/script/scripts/utils/map-render.php index 51c3f52fa..0df47d82a 100755 --- a/system/script/scripts/utils/map-render.php +++ b/system/script/scripts/utils/map-render.php @@ -1,5 +1,6 @@ getCurrentSession(); ASM::$sys->newSession(FALSE); @@ -86,4 +87,3 @@ function getPosition($type, $x, $y, $multiply = 4) { } } echo '
'; -?> \ No newline at end of file diff --git a/system/script/scripts/utils/recolor-sector.php b/system/script/scripts/utils/recolor-sector.php index c1ef285a7..b46589773 100644 --- a/system/script/scripts/utils/recolor-sector.php +++ b/system/script/scripts/utils/recolor-sector.php @@ -1,3 +1,3 @@ '; -echo ''; -?> \ No newline at end of file +echo ''; \ No newline at end of file diff --git a/system/script/template/open.php b/system/script/template/open.php index e10a9fc38..aa77ef6c3 100755 --- a/system/script/template/open.php +++ b/system/script/template/open.php @@ -1,4 +1,7 @@ '; echo ''; @@ -14,5 +17,4 @@ echo ''; echo ''; -echo ''; -?> \ No newline at end of file +echo ''; \ No newline at end of file From c9938385068024f47e5fa078411c7b21920ab45a Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:23:28 +0200 Subject: [PATCH 25/64] Implement namespaces usage in inscription --- system/inscription/check.php | 16 +++++++------- system/inscription/content.php | 6 +++-- system/inscription/step/ally.php | 6 ++--- .../step/inscriptionElement/movers.php | 3 +-- .../step/inscriptionElement/subnav.php | 6 ++--- system/inscription/step/place.php | 7 +++--- system/inscription/step/profil.php | 4 ++-- system/inscription/step/save.php | 22 ++++++++++++------- 8 files changed, 39 insertions(+), 31 deletions(-) diff --git a/system/inscription/check.php b/system/inscription/check.php index c57732d82..0f103a472 100755 --- a/system/inscription/check.php +++ b/system/inscription/check.php @@ -1,5 +1,12 @@ get('step') == 1 || !CTR::$get->exist('step')) { if (CTR::$get->exist('bindkey')) { @@ -30,7 +37,6 @@ $api = new API(GETOUT_ROOT, APP_ID, KEY_API); if ($api->userExist(CTR::$data->get('prebindkey'))) { - include_once ZEUS; $S_PAM_INSCR = ASM::$pam->getCurrentSession(); ASM::$pam->newSession(); @@ -98,7 +104,6 @@ } } elseif (CTR::$get->get('step') == 3) { if (CTR::$data->exist('inscription')) { - include_once ZEUS; # check nom dejà utilisé $S_PAM_INSCR2 = ASM::$pam->getCurrentSession(); @@ -106,7 +111,6 @@ ASM::$pam->load(array('name' => CTR::$post->get('pseudo'))); if (ASM::$pam->size() == 0) { - include_once ZEUS; $check = new CheckName(); if (CTR::$post->exist('pseudo') && $check->checkLength(CTR::$post->get('pseudo')) && $check->checkChar(CTR::$post->get('pseudo'))) { @@ -133,20 +137,17 @@ exit(); } } elseif (CTR::$get->get('step') == 4) { - include_once ZEUS; $S_PAM_INSCR = ASM::$pam->getCurrentSession(); ASM::$pam->newSession(); ASM::$pam->load(array('bind' => CTR::$data->get('bindkey'))); if (ASM::$pam->size() == 0) { if (CTR::$data->exist('inscription')) { - include_once ZEUS; $check = new CheckName(); if (CTR::$post->exist('base') && $check->checkLength(CTR::$post->get('base')) && $check->checkChar(CTR::$post->get('base'))) { CTR::$data->get('inscription')->add('base', CTR::$post->get('base')); - include_once GAIA; $sm = new SectorManager(); $sm->load(); @@ -178,4 +179,3 @@ ASM::$pam->changeSession($S_PAM_INSCR); } -?> \ No newline at end of file diff --git a/system/inscription/content.php b/system/inscription/content.php index 9365e835a..d1e235636 100755 --- a/system/inscription/content.php +++ b/system/inscription/content.php @@ -1,4 +1,7 @@ get('step') == 1 || !CTR::$get->exist('step')) { if (!CTR::$get->exist('bindkey')) { @@ -10,5 +13,4 @@ include INSCRIPTION . 'step/place.php'; } elseif (CTR::$get->get('step') == 4) { include INSCRIPTION . 'step/save.php'; -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/inscription/step/ally.php b/system/inscription/step/ally.php index afe1e490f..aa8323b71 100755 --- a/system/inscription/step/ally.php +++ b/system/inscription/step/ally.php @@ -1,6 +1,7 @@
'; @@ -97,4 +98,3 @@ ASM::$clm->changeSession($_CLM); echo '
'; -?> \ No newline at end of file diff --git a/system/inscription/step/inscriptionElement/movers.php b/system/inscription/step/inscriptionElement/movers.php index 6d9e1fd45..1a330c279 100755 --- a/system/inscription/step/inscriptionElement/movers.php +++ b/system/inscription/step/inscriptionElement/movers.php @@ -2,5 +2,4 @@ echo '
'; echo ''; echo ''; -echo '
'; -?> \ No newline at end of file +echo '
'; \ No newline at end of file diff --git a/system/inscription/step/inscriptionElement/subnav.php b/system/inscription/step/inscriptionElement/subnav.php index 2e80b23e1..e6ff5d771 100755 --- a/system/inscription/step/inscriptionElement/subnav.php +++ b/system/inscription/step/inscriptionElement/subnav.php @@ -1,5 +1,6 @@ '; echo '
'; @@ -20,5 +21,4 @@ echo ''; echo '
'; echo '
'; -echo '
'; -?> \ No newline at end of file +echo '
'; \ No newline at end of file diff --git a/system/inscription/step/place.php b/system/inscription/step/place.php index 4486de0b9..af7390e98 100755 --- a/system/inscription/step/place.php +++ b/system/inscription/step/place.php @@ -1,6 +1,8 @@
'; @@ -77,4 +79,3 @@ echo '
'; echo ''; echo '
'; -?> \ No newline at end of file diff --git a/system/inscription/step/profil.php b/system/inscription/step/profil.php index cbace2500..21a14528a 100755 --- a/system/inscription/step/profil.php +++ b/system/inscription/step/profil.php @@ -1,5 +1,6 @@
'; @@ -87,4 +88,3 @@ echo '
'; echo ''; echo '
'; -?> \ No newline at end of file diff --git a/system/inscription/step/save.php b/system/inscription/step/save.php index ac29aada1..8f1bce728 100755 --- a/system/inscription/step/save.php +++ b/system/inscription/step/save.php @@ -1,10 +1,18 @@ get('inscription')->get('ally'); @@ -242,7 +250,6 @@ CTR::$data->remove('inscription'); CTR::$data->remove('prebindkey'); - include_once GAIA; GalaxyColorManager::apply(); # ajout aux conversation de faction et techniques @@ -288,4 +295,3 @@ CTR::$alert->add('erreur' . $e->getMessage()); CTR::redirect('inscription/step-3'); } -?> \ No newline at end of file From 7464849f6f7f39b0f9e02dedd217a66aa861a22f Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:23:36 +0200 Subject: [PATCH 26/64] Implement namespaces usage in event --- system/event/executeEvent.php | 7 ++++--- system/event/loadEvent.php | 9 +++++---- system/event/updateGame.php | 6 ++++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/system/event/executeEvent.php b/system/event/executeEvent.php index d39d95748..3a382c394 100755 --- a/system/event/executeEvent.php +++ b/system/event/executeEvent.php @@ -1,7 +1,9 @@ get('playerEvent')->clearPastEvents($now); } -?> \ No newline at end of file diff --git a/system/event/loadEvent.php b/system/event/loadEvent.php index 371f08104..cf479cb5c 100755 --- a/system/event/loadEvent.php +++ b/system/event/loadEvent.php @@ -1,9 +1,11 @@ get('lastUpdate')->get('event'), Utils::now(), 's') > TIME_EVENT_UPDATE) { - include_once ZEUS; - include_once ARES; - include_once GAIA; # update de l'heure dans le contrôleur CTR::$data->get('lastUpdate')->add('event', Utils::now()); @@ -68,4 +70,3 @@ ASM::$pam->get()->setDLastActivity(Utils::now()); ASM::$pam->changeSession($S_PAM1); } -?> \ No newline at end of file diff --git a/system/event/updateGame.php b/system/event/updateGame.php index 8c4e2cd22..cce4d21ab 100755 --- a/system/event/updateGame.php +++ b/system/event/updateGame.php @@ -1,6 +1,9 @@ get('lastUpdate')->get('game'), Utils::now(), 'h') > 0) { @@ -52,4 +55,3 @@ $path = 'public/log/stats/tmp.log'; Bug::writeLog($path, "### recharge à : " . date('H:i:s') . " ###"); }*/ -?> \ No newline at end of file From 878ac013f4ed785c234ced89441e63c40144b93f Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:23:58 +0200 Subject: [PATCH 27/64] Implement namespaces usage in config --- system/config/app.config.global.php | 1 - system/config/galaxies/GalaxyConfiguration.v4.php | 1 - 2 files changed, 2 deletions(-) diff --git a/system/config/app.config.global.php b/system/config/app.config.global.php index acb46530d..ae9e581e9 100755 --- a/system/config/app.config.global.php +++ b/system/config/app.config.global.php @@ -73,4 +73,3 @@ # 20 jours = 480h define('HOURS_BEFORE_START_OF_RANKING', 480); define('POINTS_TO_WIN', 2000); -?> \ No newline at end of file diff --git a/system/config/galaxies/GalaxyConfiguration.v4.php b/system/config/galaxies/GalaxyConfiguration.v4.php index f5541987e..bb9610822 100644 --- a/system/config/galaxies/GalaxyConfiguration.v4.php +++ b/system/config/galaxies/GalaxyConfiguration.v4.php @@ -577,4 +577,3 @@ public static function fillSectorsData() { # display params public static $scale = 20; } -?> \ No newline at end of file From dff395d5af8ade74ad8ed186b0f66be2a626cd99 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:24:09 +0200 Subject: [PATCH 28/64] Implement namespaces usage in connection --- system/connection/create-session.php | 12 +++++++----- system/connection/main.php | 8 ++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/system/connection/create-session.php b/system/connection/create-session.php index e827d7073..9d0a44e90 100755 --- a/system/connection/create-session.php +++ b/system/connection/create-session.php @@ -1,8 +1,11 @@ initPlayerInfo(); @@ -179,4 +182,3 @@ } ASM::$plm->changeSession($S_PLM1); ASM::$com->changeSession($S_COM2); -?> \ No newline at end of file diff --git a/system/connection/main.php b/system/connection/main.php index 263cc812a..98b1502f9 100755 --- a/system/connection/main.php +++ b/system/connection/main.php @@ -1,7 +1,12 @@ get('bindkey'), KEY_SERVER); @@ -49,4 +54,3 @@ } ASM::$pam->changeSession($S_PAM1); -?> \ No newline at end of file From 668ed90adc69837cc4dfc2d126ebffcb49910845 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:24:19 +0200 Subject: [PATCH 29/64] Implement namespaces usage in buffer --- system/buffer/main.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/buffer/main.php b/system/buffer/main.php index 891ed05a6..a302fb8d0 100755 --- a/system/buffer/main.php +++ b/system/buffer/main.php @@ -1,6 +1,11 @@ equal('key', KEY_BUFFER)) { -include_once ZEUS; $S_PAM1 = ASM::$pam->getCurrentSession(); ASM::$pam->newSession(FALSE); From 49984bbd55daca4b1ee969e09d9db566a29e1d90 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:24:30 +0200 Subject: [PATCH 30/64] Implement namespaces usage in api --- system/api/apis/ban.php | 7 ++++--- system/api/main.php | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/system/api/apis/ban.php b/system/api/apis/ban.php index ae324557e..4b69517c2 100755 --- a/system/api/apis/ban.php +++ b/system/api/apis/ban.php @@ -1,5 +1,7 @@ exist('bindkey')) { $S_PAM_1 = ASM::$pam->getCurrentSession(); @@ -23,5 +25,4 @@ 'statement' => 'error', 'message' => 'Donnée manquante' )); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/api/main.php b/system/api/main.php index 8f117033c..4d87fca94 100755 --- a/system/api/main.php +++ b/system/api/main.php @@ -4,6 +4,9 @@ # uncrpyt a # ajout dans le add +use Asylamba\Classes\Worker\API; +use Asylamba\Classes\Worker\CTR; + $query = API::unParse($_SERVER['REQUEST_URI']); $query = explode('/', $query); @@ -34,5 +37,4 @@ 'statement' => 'error', 'message' => 'Accès refusé' )); -} -?> \ No newline at end of file +} \ No newline at end of file From 20db4d29e7f75e15a4c6e59ebf884ee065116ba1 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:24:44 +0200 Subject: [PATCH 31/64] Implement namespaces usage in standard actions --- system/action/std/ares/commander/affect.php | 16 +++++++------ .../action/std/ares/commander/changeLine.php | 13 +++++----- system/action/std/ares/commander/empty.php | 10 ++++---- system/action/std/ares/commander/fire.php | 10 ++++---- .../action/std/ares/commander/putInSchool.php | 13 +++++----- .../action/std/ares/commander/updateName.php | 10 ++++---- system/action/std/ares/fleet/cancel.php | 11 +++++---- system/action/std/ares/fleet/colonize.php | 14 +++++++---- system/action/std/ares/fleet/conquer.php | 11 +++++---- system/action/std/ares/fleet/loot.php | 12 ++++++---- system/action/std/ares/fleet/move.php | 14 +++++++---- system/action/std/ares/report/archive.php | 5 +++- system/action/std/ares/report/delete.php | 5 +++- system/action/std/ares/report/deleteAll.php | 5 +++- system/action/std/artemis/delete.php | 5 ++-- system/action/std/artemis/deleteAll.php | 3 ++- system/action/std/artemis/spy.php | 12 +++++++--- system/action/std/athena/building/build.php | 18 ++++++++++---- system/action/std/athena/building/dequeue.php | 9 ++++--- .../std/athena/general/changeBaseType.php | 24 +++++++++++-------- .../std/athena/general/createSchoolClass.php | 19 ++++++++++----- .../std/athena/general/giveResource.php | 14 ++++++++--- .../action/std/athena/general/giveShips.php | 15 +++++++++--- .../action/std/athena/general/leaveBase.php | 11 +++++---- .../action/std/athena/general/renameBase.php | 10 +++++--- .../std/athena/general/switchDockMode.php | 8 ++++--- .../std/athena/general/updateInvest.php | 8 ++++--- .../std/athena/recycling/addToMission.php | 12 ++++++---- .../std/athena/recycling/cancelMission.php | 11 +++++---- .../std/athena/recycling/createMission.php | 13 ++++++---- system/action/std/athena/route/accept.php | 17 +++++++++---- system/action/std/athena/route/cancel.php | 9 ++++--- system/action/std/athena/route/delete.php | 9 ++++--- system/action/std/athena/route/propose.php | 14 +++++++---- system/action/std/athena/route/refuse.php | 10 +++++--- system/action/std/athena/ship/build.php | 24 +++++++++++++------ system/action/std/athena/ship/dequeue.php | 9 ++++--- system/action/std/athena/ship/recycle.php | 7 ++++-- .../action/std/athena/transaction/accept.php | 17 ++++++++----- .../action/std/athena/transaction/cancel.php | 11 +++++---- .../action/std/athena/transaction/propose.php | 12 +++++++--- system/action/std/common/discordRequest.php | 5 +++- .../std/common/sendSponsorshipEmail.php | 6 ++++- system/action/std/common/switchBase.php | 5 +++- system/action/std/common/switchParams.php | 5 +++- system/action/std/demeter/donate.php | 7 ++++-- .../action/std/demeter/election/abdicate.php | 12 ++++++---- .../std/demeter/election/chooseGovernment.php | 9 ++++--- system/action/std/demeter/election/fire.php | 9 ++++--- .../action/std/demeter/election/makeACoup.php | 16 ++++++++----- .../action/std/demeter/election/postulate.php | 12 +++++++--- system/action/std/demeter/election/resign.php | 3 ++- system/action/std/demeter/election/vote.php | 9 ++++--- system/action/std/demeter/law/cancelLaw.php | 7 ++++-- system/action/std/demeter/law/createLaw.php | 11 ++++++--- system/action/std/demeter/law/vote.php | 8 +++++-- system/action/std/demeter/message/edit.php | 5 +++- system/action/std/demeter/message/write.php | 10 +++++--- system/action/std/demeter/news/delete.php | 5 +++- system/action/std/demeter/news/edit.php | 5 +++- system/action/std/demeter/news/pin.php | 5 +++- system/action/std/demeter/news/write.php | 4 +++- system/action/std/demeter/topic/archive.php | 5 +++- system/action/std/demeter/topic/close.php | 5 +++- .../action/std/demeter/topic/createTopic.php | 12 +++++++--- system/action/std/demeter/topic/move.php | 6 ++++- system/action/std/demeter/topic/up.php | 5 +++- .../action/std/demeter/updateFactionDesc.php | 6 +++-- .../std/hermes/conversation/addUser.php | 8 +++++-- .../action/std/hermes/conversation/leave.php | 8 ++++++- .../action/std/hermes/conversation/start.php | 14 ++++++++--- .../std/hermes/conversation/updateDisplay.php | 6 ++++- .../std/hermes/conversation/updateTitle.php | 7 ++++-- .../action/std/hermes/conversation/write.php | 11 +++++++-- .../std/hermes/conversation/writeFaction.php | 7 ++++-- .../std/hermes/conversation/writeOfficial.php | 9 +++++-- .../std/hermes/notification/archive.php | 4 +++- .../action/std/hermes/notification/delete.php | 4 +++- .../std/hermes/notification/deleteAll.php | 3 ++- .../std/hermes/notification/readAll.php | 3 ++- system/action/std/hermes/radio/write.php | 7 +++--- system/action/std/hermes/roadmap/write.php | 9 ++++--- system/action/std/main.php | 5 ++-- .../action/std/promethee/technology/build.php | 20 ++++++++++------ .../std/promethee/technology/dequeue.php | 11 +++++---- .../action/std/zeus/player/abandonServer.php | 10 ++++---- system/action/std/zeus/player/disconnect.php | 6 +++-- .../action/std/zeus/player/searchPlayer.php | 9 ++++--- system/action/std/zeus/player/sendCredit.php | 13 ++++++++-- .../std/zeus/player/sendCreditFromFaction.php | 10 ++++++-- .../std/zeus/player/sendCreditToFaction.php | 7 ++++-- .../std/zeus/player/switchAdvertisement.php | 5 +++- .../std/zeus/player/updateUniInvest.php | 10 +++++--- .../action/std/zeus/tutorial/validateStep.php | 8 ++++--- 94 files changed, 611 insertions(+), 280 deletions(-) diff --git a/system/action/std/ares/commander/affect.php b/system/action/std/ares/commander/affect.php index 46bfadd71..647f08107 100755 --- a/system/action/std/ares/commander/affect.php +++ b/system/action/std/ares/commander/affect.php @@ -1,14 +1,18 @@ getCurrentSession(); @@ -98,6 +102,4 @@ ASM::$com->changeSession($S_COM1); } else { CTR::$alert->add('erreur dans le traitement de la requête', ALERT_BUG_ERROR); -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/ares/commander/changeLine.php b/system/action/std/ares/commander/changeLine.php index 06522c5a6..845ed6fa9 100755 --- a/system/action/std/ares/commander/changeLine.php +++ b/system/action/std/ares/commander/changeLine.php @@ -1,7 +1,10 @@ changeSession($S_COM1); } else { CTR::$alert->add('erreur dans le traitement de la requête', ALERT_BUG_ERROR); -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/ares/commander/empty.php b/system/action/std/ares/commander/empty.php index 1897e5552..2fc880ab3 100755 --- a/system/action/std/ares/commander/empty.php +++ b/system/action/std/ares/commander/empty.php @@ -1,11 +1,13 @@ changeSession($S_COM1); } else { CTR::$alert->add('manque d\'information pour le traitement de la requête', ALERT_BUG_ERROR); -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/ares/commander/fire.php b/system/action/std/ares/commander/fire.php index 47a13cbab..24deae9b9 100755 --- a/system/action/std/ares/commander/fire.php +++ b/system/action/std/ares/commander/fire.php @@ -1,11 +1,13 @@ changeSession($S_COM1); } else { CTR::$alert->add('manque d\'information pour le traitement de la requête', ALERT_BUG_ERROR); -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/ares/commander/putInSchool.php b/system/action/std/ares/commander/putInSchool.php index 357866575..0e52cb614 100755 --- a/system/action/std/ares/commander/putInSchool.php +++ b/system/action/std/ares/commander/putInSchool.php @@ -1,12 +1,15 @@ changeSession($S_COM1); } else { CTR::$alert->add('erreur dans le traitement de la requête', ALERT_BUG_ERROR); -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/ares/commander/updateName.php b/system/action/std/ares/commander/updateName.php index 84cd2d52c..ab25eed37 100755 --- a/system/action/std/ares/commander/updateName.php +++ b/system/action/std/ares/commander/updateName.php @@ -1,11 +1,15 @@ add('manque d\'information', ALERT_BUG_ERROR); -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/ares/fleet/cancel.php b/system/action/std/ares/fleet/cancel.php index d2be03dff..16c25fa34 100755 --- a/system/action/std/ares/fleet/cancel.php +++ b/system/action/std/ares/fleet/cancel.php @@ -1,12 +1,13 @@ travelType != COM_BACK) { $interval = Utils::interval($commander->dArrival, Utils::now(), 's'); - $dStart = new DateTime(Utils::now()); + $dStart = new \DateTime(Utils::now()); $dStart->modify('-' . $interval . ' second'); $duration = Utils::interval($commander->dStart, $commander->dArrival, 's'); - $dArrival = new DateTime($dStart->format('Y-m-d H:i:s')); + $dArrival = new \DateTime($dStart->format('Y-m-d H:i:s')); $dArrival->modify('+' . $duration . ' second'); $rDestinationPlace = $commander->rDestinationPlace; diff --git a/system/action/std/ares/fleet/colonize.php b/system/action/std/ares/fleet/colonize.php index fb297aadc..62f76eafa 100755 --- a/system/action/std/ares/fleet/colonize.php +++ b/system/action/std/ares/fleet/colonize.php @@ -1,14 +1,18 @@ get('playerBase')->get('ob')->size(); # count ob quantity via request to be sure (the session is sometimes not valid) - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('SELECT COUNT(*) AS count FROM `orbitalBase` WHERE `rPlayer`=?'); $qr->execute([CTR::$data->get('playerId')]); $aw = $qr->fetch(); diff --git a/system/action/std/ares/fleet/conquer.php b/system/action/std/ares/fleet/conquer.php index ec488726f..0191f9134 100755 --- a/system/action/std/ares/fleet/conquer.php +++ b/system/action/std/ares/fleet/conquer.php @@ -1,13 +1,16 @@ move($place->getId(), $commander->rBase, Commander::MOVE, $length, $duration); if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_CommercialRelation(`from`, `to`, type, weight, dAction) VALUES(?, ?, ?, ?, ?)' diff --git a/system/action/std/ares/report/archive.php b/system/action/std/ares/report/archive.php index de413ed45..7a67e9fac 100755 --- a/system/action/std/ares/report/archive.php +++ b/system/action/std/ares/report/archive.php @@ -2,7 +2,10 @@ # archive or unarchive action # int id id du rapport -include_once ARES; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Modules\Ares\Model\Report; $id = Utils::getHTTPData('id'); diff --git a/system/action/std/ares/report/delete.php b/system/action/std/ares/report/delete.php index ac47b715a..3fea3e867 100755 --- a/system/action/std/ares/report/delete.php +++ b/system/action/std/ares/report/delete.php @@ -1,7 +1,10 @@ getCurrentSession(); ASM::$lrm->newSession(); diff --git a/system/action/std/artemis/delete.php b/system/action/std/artemis/delete.php index 0e468b40d..fc4936d9f 100755 --- a/system/action/std/artemis/delete.php +++ b/system/action/std/artemis/delete.php @@ -3,11 +3,12 @@ # int id id du rapport -include_once ARTEMIS; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; $id = Utils::getHTTPData('id'); - if ($id) { $S_SRM1 = ASM::$srm->getCurrentSession(); ASM::$srm->newSession(); diff --git a/system/action/std/artemis/deleteAll.php b/system/action/std/artemis/deleteAll.php index 588f8e1d5..edd902175 100755 --- a/system/action/std/artemis/deleteAll.php +++ b/system/action/std/artemis/deleteAll.php @@ -1,7 +1,8 @@ getCurrentSession(); ASM::$srm->newSession(ASM_UMODE); diff --git a/system/action/std/artemis/spy.php b/system/action/std/artemis/spy.php index c9956288a..c3e562423 100755 --- a/system/action/std/artemis/spy.php +++ b/system/action/std/artemis/spy.php @@ -4,9 +4,15 @@ # int rplace id of the place to spy # int price credit price for spying -include_once GAIA; -include_once ARTEMIS; -include_once ZEUS; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Library\Game; +use Asylamba\Modules\Artemis\Model\SpyReport; +use Asylamba\Modules\Gaia\Model\Place; +use Asylamba\Modules\Hermes\Model\Notification; +use Asylamba\Modules\Zeus\Helper\TutorialHelper; +use Asylamba\Modules\Zeus\Resource\TutorialResource; $rPlace = Utils::getHTTPData('rplace'); $price = Utils::getHTTPData('price'); diff --git a/system/action/std/athena/building/build.php b/system/action/std/athena/building/build.php index 2682ee5af..a2cc0a3a6 100755 --- a/system/action/std/athena/building/build.php +++ b/system/action/std/athena/building/build.php @@ -1,11 +1,21 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -36,7 +46,6 @@ # tutorial if (CTR::$data->get('playerInfo')->get('stepDone') == FALSE) { - include_once ZEUS; switch (CTR::$data->get('playerInfo')->get('stepTutorial')) { case TutorialResource::GENERATOR_LEVEL_2: if ($building == OrbitalBaseResource::GENERATOR AND $currentLevel + 1 >= 2) { @@ -151,5 +160,4 @@ } } else { CTR::$alert->add('pas assez d\'informations pour construire un bâtiment', ALERT_STD_FILLFORM); -} -?> +} \ No newline at end of file diff --git a/system/action/std/athena/building/dequeue.php b/system/action/std/athena/building/dequeue.php index ad447abc3..4b73fcdb6 100755 --- a/system/action/std/athena/building/dequeue.php +++ b/system/action/std/athena/building/dequeue.php @@ -1,10 +1,14 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -75,5 +79,4 @@ } } else { CTR::$alert->add('pas assez d\'informations pour annuler la construction d\'un bâtiment', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/general/changeBaseType.php b/system/action/std/athena/general/changeBaseType.php index 6afd70014..16b4fabf3 100755 --- a/system/action/std/athena/general/changeBaseType.php +++ b/system/action/std/athena/general/changeBaseType.php @@ -1,13 +1,19 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -46,7 +52,7 @@ } } if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_BaseAction(`from`, type, opt1, weight, dAction) VALUES(?, ?, ?, ?, ?)' @@ -75,7 +81,7 @@ } if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_BaseAction(`from`, type, opt1, weight, dAction) VALUES(?, ?, ?, ?, ?)' @@ -125,7 +131,7 @@ } if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_BaseAction(`from`, type, opt1, weight, dAction) VALUES(?, ?, ?, ?, ?)' @@ -166,7 +172,6 @@ # verify if fleets are moving or not # transfer to the mess the extra commanders and change line if needed - include_once ARES; $S_COM2 = ASM::$com->getCurrentSession(); ASM::$com->newSession(); @@ -471,5 +476,4 @@ ASM::$obm->changeSession($S_OBM1); } else { CTR::$alert->add('pas assez d\'informations pour changer le type de la base orbitale', ALERT_STD_FILLFORM); -} -?> +} \ No newline at end of file diff --git a/system/action/std/athena/general/createSchoolClass.php b/system/action/std/athena/general/createSchoolClass.php index df10057d8..8434bd9e5 100755 --- a/system/action/std/athena/general/createSchoolClass.php +++ b/system/action/std/athena/general/createSchoolClass.php @@ -1,8 +1,4 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -34,7 +42,7 @@ if (ASM::$com->size() < PlaceResource::get(ASM::$obm->get()->typeOfBase, 'school-size')) { ASM::$com->load(array('c.statement' => Commander::RESERVE, 'c.rBase' => $baseId)); - if (ASM::$com->size() < Orbitalbase::MAXCOMMANDERINMESS) { + if (ASM::$com->size() < OrbitalBase::MAXCOMMANDERINMESS) { $school = intval($school); $nbrCommandersToCreate = rand(SchoolClassResource::getInfo($school, 'minSize'), SchoolClassResource::getInfo($school, 'maxSize')); @@ -42,7 +50,6 @@ if (SchoolClassResource::getInfo($school, 'credit') <= CTR::$data->get('playerInfo')->get('credit')) { # tutorial if (CTR::$data->get('playerInfo')->get('stepDone') == FALSE) { - include_once ZEUS; switch (CTR::$data->get('playerInfo')->get('stepTutorial')) { case TutorialResource::CREATE_COMMANDER: TutorialHelper::setStepDone(); diff --git a/system/action/std/athena/general/giveResource.php b/system/action/std/athena/general/giveResource.php index ee23d5789..70f798209 100755 --- a/system/action/std/athena/general/giveResource.php +++ b/system/action/std/athena/general/giveResource.php @@ -1,12 +1,20 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -92,7 +100,7 @@ } if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_CommercialRelation(`from`, `to`, type, weight, dAction) VALUES(?, ?, ?, ?, ?)' diff --git a/system/action/std/athena/general/giveShips.php b/system/action/std/athena/general/giveShips.php index 67d8e32ff..8968621f8 100644 --- a/system/action/std/athena/general/giveShips.php +++ b/system/action/std/athena/general/giveShips.php @@ -1,6 +1,4 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -120,7 +129,7 @@ } if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_CommercialRelation(`from`, `to`, type, weight, dAction) VALUES(?, ?, ?, ?, ?)' diff --git a/system/action/std/athena/general/leaveBase.php b/system/action/std/athena/general/leaveBase.php index 0688ec0e9..59e2cecb6 100755 --- a/system/action/std/athena/general/leaveBase.php +++ b/system/action/std/athena/general/leaveBase.php @@ -1,13 +1,16 @@ avec message # int id id (rPlace) de la base orbitale +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; +use Asylamba\Classes\Library\Format; +use Asylamba\Modules\Athena\Model\OrbitalBase; + $baseId = Utils::getHTTPData('id'); for ($i = 0; $i < CTR::$data->get('playerBase')->get('ob')->size(); $i++) { diff --git a/system/action/std/athena/general/renameBase.php b/system/action/std/athena/general/renameBase.php index 91bb64115..53a1954c6 100755 --- a/system/action/std/athena/general/renameBase.php +++ b/system/action/std/athena/general/renameBase.php @@ -1,10 +1,15 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -51,5 +56,4 @@ ASM::$obm->changeSession($S_OBM1); } else { CTR::$alert->add('pas assez d\'informations pour changer le nom de la base orbitale', ALERT_STD_FILLFORM); -} -?> +} \ No newline at end of file diff --git a/system/action/std/athena/general/switchDockMode.php b/system/action/std/athena/general/switchDockMode.php index 117c2aea4..9f125088b 100755 --- a/system/action/std/athena/general/switchDockMode.php +++ b/system/action/std/athena/general/switchDockMode.php @@ -1,10 +1,13 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -45,5 +48,4 @@ ASM::$obm->changeSession($S_OBM1); } else { CTR::$alert->add('pas assez d\'informations pour changer le mode du dock', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/general/updateInvest.php b/system/action/std/athena/general/updateInvest.php index 2d6e2b2ed..057435615 100755 --- a/system/action/std/athena/general/updateInvest.php +++ b/system/action/std/athena/general/updateInvest.php @@ -1,11 +1,14 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -49,5 +52,4 @@ ASM::$obm->changeSession($S_OBM1); } else { CTR::$alert->add('pas assez d\'informations pour modifier un investissement', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/recycling/addToMission.php b/system/action/std/athena/recycling/addToMission.php index f0a6651d5..9d583a185 100644 --- a/system/action/std/athena/recycling/addToMission.php +++ b/system/action/std/athena/recycling/addToMission.php @@ -1,13 +1,16 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -65,5 +68,4 @@ } } else { CTR::$alert->add('pas assez d\'informations pour créer une mission de recyclage', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/recycling/cancelMission.php b/system/action/std/athena/recycling/cancelMission.php index f513fb322..5ee5c23a6 100755 --- a/system/action/std/athena/recycling/cancelMission.php +++ b/system/action/std/athena/recycling/cancelMission.php @@ -1,12 +1,14 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -41,5 +43,4 @@ ASM::$obm->changeSession($S_OBM1); } else { CTR::$alert->add('pas assez d\'informations pour supprimer une mission de recyclage', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/recycling/createMission.php b/system/action/std/athena/recycling/createMission.php index 728a19e8c..292bc71d2 100755 --- a/system/action/std/athena/recycling/createMission.php +++ b/system/action/std/athena/recycling/createMission.php @@ -1,13 +1,17 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -86,5 +90,4 @@ } } else { CTR::$alert->add('pas assez d\'informations pour créer une mission de recyclage', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/route/accept.php b/system/action/std/athena/route/accept.php index f4b387f30..9054842dd 100755 --- a/system/action/std/athena/route/accept.php +++ b/system/action/std/athena/route/accept.php @@ -1,11 +1,19 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -96,7 +104,7 @@ ASM::$ntm->add($n); if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_CommercialRelation(`from`, `to`, type, weight, dAction) VALUES(?, ?, ?, ?, ?)' @@ -122,5 +130,4 @@ ASM::$crm->changeSession($S_CRM1); } else { CTR::$alert->add('pas assez d\'informations pour accepter une route commerciale', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/route/cancel.php b/system/action/std/athena/route/cancel.php index 66c500875..ce519371a 100755 --- a/system/action/std/athena/route/cancel.php +++ b/system/action/std/athena/route/cancel.php @@ -1,10 +1,14 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -54,5 +58,4 @@ ASM::$crm->changeSession($S_CRM1); } else { CTR::$alert->add('pas assez d\'informations pour annuler une route commerciale', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/route/delete.php b/system/action/std/athena/route/delete.php index 1f5fa0219..8445b29ef 100755 --- a/system/action/std/athena/route/delete.php +++ b/system/action/std/athena/route/delete.php @@ -1,10 +1,14 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -75,5 +79,4 @@ ASM::$crm->changeSession($S_CRM1); } else { CTR::$alert->add('pas assez d\'informations pour supprimer une route commerciale', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/route/propose.php b/system/action/std/athena/route/propose.php index b3fdc53a4..e93a13b06 100755 --- a/system/action/std/athena/route/propose.php +++ b/system/action/std/athena/route/propose.php @@ -1,11 +1,18 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -154,5 +161,4 @@ ASM::$obm->changeSession($S_OBM1); } else { CTR::$alert->add('pas assez d\'informations pour proposer une route commerciale', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/route/refuse.php b/system/action/std/athena/route/refuse.php index 4ce538831..85f357e3b 100755 --- a/system/action/std/athena/route/refuse.php +++ b/system/action/std/athena/route/refuse.php @@ -1,10 +1,15 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -54,5 +59,4 @@ ASM::$crm->changeSession($S_CRM1); } else { CTR::$alert->add('pas assez d\'informations pour refuser une route commerciale', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/ship/build.php b/system/action/std/athena/ship/build.php index 83e854ea8..40b1c7e41 100755 --- a/system/action/std/athena/ship/build.php +++ b/system/action/std/athena/ship/build.php @@ -1,13 +1,25 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -45,7 +57,6 @@ # tutorial if (CTR::$data->get('playerInfo')->get('stepDone') == FALSE) { - include_once ZEUS; switch (CTR::$data->get('playerInfo')->get('stepTutorial')) { case TutorialResource::BUILD_SHIP0: if ($ship == ShipResource::PEGASE) { @@ -106,7 +117,7 @@ CTR::$data->get('playerEvent')->add($sq->dEnd, EVENT_BASE, $baseId); if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_BaseAction(`from`, type, opt1, opt2, weight, dAction) VALUES(?, ?, ?, ?, ?, ?)' @@ -133,5 +144,4 @@ } } else { CTR::$alert->add('pas assez d\'informations pour construire un vaisseau', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/ship/dequeue.php b/system/action/std/athena/ship/dequeue.php index 93400a126..22eee7eca 100755 --- a/system/action/std/athena/ship/dequeue.php +++ b/system/action/std/athena/ship/dequeue.php @@ -1,11 +1,15 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -80,5 +84,4 @@ } } else { CTR::$alert->add('pas assez d\'informations pour enlever un vaisseau de la file d\'attente', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/athena/ship/recycle.php b/system/action/std/athena/ship/recycle.php index b8ca8c2ce..424d87eec 100644 --- a/system/action/std/athena/ship/recycle.php +++ b/system/action/std/athena/ship/recycle.php @@ -1,11 +1,15 @@ add('pas assez d\'informations', ALERT_STD_FILLFORM); } -?> \ No newline at end of file diff --git a/system/action/std/athena/transaction/accept.php b/system/action/std/athena/transaction/accept.php index 77cc6a2dd..b07cb7f4c 100755 --- a/system/action/std/athena/transaction/accept.php +++ b/system/action/std/athena/transaction/accept.php @@ -1,13 +1,19 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -132,7 +138,7 @@ ASM::$ntm->add($n); if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_CommercialRelation(`from`, `to`, type, weight, dAction) VALUES(?, ?, ?, ?, ?)' @@ -158,4 +164,3 @@ } else { CTR::$alert->add('pas assez d\'informations pour accepter une proposition sur le marché', ALERT_STD_FILLFORM); } -?> \ No newline at end of file diff --git a/system/action/std/athena/transaction/cancel.php b/system/action/std/athena/transaction/cancel.php index 364a57e22..c86006ea9 100755 --- a/system/action/std/athena/transaction/cancel.php +++ b/system/action/std/athena/transaction/cancel.php @@ -1,10 +1,15 @@ addShipToDock($transaction->identifier, $transaction->quantity); break; case Transaction::TYP_COMMANDER : - include_once ARES; $S_COM1 = ASM::$com->getCurrentSession(); ASM::$com->newSession(ASM_UMODE); ASM::$com->load(array('c.id' => $transaction->identifier)); @@ -108,4 +112,3 @@ } else { CTR::$alert->add('pas assez d\'informations pour annuler une proposition sur le marché', ALERT_STD_FILLFORM); } -?> \ No newline at end of file diff --git a/system/action/std/athena/transaction/propose.php b/system/action/std/athena/transaction/propose.php index a213e28db..c5cbdff9c 100755 --- a/system/action/std/athena/transaction/propose.php +++ b/system/action/std/athena/transaction/propose.php @@ -1,5 +1,4 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -47,7 +55,6 @@ } break; case Transaction::TYP_COMMANDER : - include_once ARES; if ($identifier === FALSE OR $identifier < 1) { $valid = FALSE; } @@ -191,4 +198,3 @@ } else { CTR::$alert->add('pas assez d\'informations pour faire une proposition sur le marché', ALERT_STD_FILLFORM); } -?> \ No newline at end of file diff --git a/system/action/std/common/discordRequest.php b/system/action/std/common/discordRequest.php index 26acc35b2..d4a3520ce 100644 --- a/system/action/std/common/discordRequest.php +++ b/system/action/std/common/discordRequest.php @@ -1,4 +1,8 @@ add('il faut entrer votre identifiant Discord dans le champ de texte', ALERT_STD_FILLFORM); } -?> diff --git a/system/action/std/common/sendSponsorshipEmail.php b/system/action/std/common/sendSponsorshipEmail.php index 6cf4a43c8..219c919f6 100644 --- a/system/action/std/common/sendSponsorshipEmail.php +++ b/system/action/std/common/sendSponsorshipEmail.php @@ -1,4 +1,9 @@ get('playerId') . '/s-' . APP_ID; @@ -13,4 +18,3 @@ CTR::$alert->add('L\'e-mail n\'a pas pu être envoyé, veuillez ré-essayer. Si cela persiste, contactez un administrateur.', ALERT_STD_ERROR); } -?> \ No newline at end of file diff --git a/system/action/std/common/switchBase.php b/system/action/std/common/switchBase.php index e02555506..744c97b69 100755 --- a/system/action/std/common/switchBase.php +++ b/system/action/std/common/switchBase.php @@ -1,4 +1,8 @@ \ No newline at end of file diff --git a/system/action/std/common/switchParams.php b/system/action/std/common/switchParams.php index 670146df9..d65d6e76d 100755 --- a/system/action/std/common/switchParams.php +++ b/system/action/std/common/switchParams.php @@ -1,4 +1,8 @@ \ No newline at end of file diff --git a/system/action/std/demeter/donate.php b/system/action/std/demeter/donate.php index ff22cfaae..975c86830 100755 --- a/system/action/std/demeter/donate.php +++ b/system/action/std/demeter/donate.php @@ -1,8 +1,11 @@ get('playerInfo')->get('color'), 'regime') == Color::DEMOCRATIC) { if (CTR::$data->get('playerInfo')->get('status') == PAM_CHIEF) { @@ -14,7 +18,7 @@ ASM::$clm->load(['id' => CTR::$data->get('playerInfo')->get('color')]); if (ASM::$clm->get()->electionStatement == Color::MANDATE) { - $date = new DateTime(Utils::now()); + $date = new \DateTime(Utils::now()); $date->modify('-' . ASM::$clm->get()->mandateDuration . ' second'); $date = $date->format('Y-m-d H:i:s'); ASM::$clm->get()->dLastElection = $date; diff --git a/system/action/std/demeter/election/chooseGovernment.php b/system/action/std/demeter/election/chooseGovernment.php index c3b853318..fabe74fba 100755 --- a/system/action/std/demeter/election/chooseGovernment.php +++ b/system/action/std/demeter/election/chooseGovernment.php @@ -2,12 +2,15 @@ #rplayer id du joueur #department +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Modules\Hermes\Model\Notification; +use Asylamba\Modules\Demeter\Resource\ColorResource; + $rPlayer = Utils::getHTTPData('rplayer'); $department = Utils::getHTTPData('department'); -include_once ZEUS; -include_once DEMETER; - if ($rPlayer !== FALSE && $department !== FALSE) { $_PAM2 = ASM::$pam->getCurrentsession(); ASM::$pam->newSession(); diff --git a/system/action/std/demeter/election/fire.php b/system/action/std/demeter/election/fire.php index 6e787c1f7..a242c800c 100755 --- a/system/action/std/demeter/election/fire.php +++ b/system/action/std/demeter/election/fire.php @@ -1,10 +1,13 @@ get('playerInfo')->get('status') == PAM_CHIEF) { diff --git a/system/action/std/demeter/election/makeACoup.php b/system/action/std/demeter/election/makeACoup.php index ddb6d6209..14f979f2b 100755 --- a/system/action/std/demeter/election/makeACoup.php +++ b/system/action/std/demeter/election/makeACoup.php @@ -7,16 +7,20 @@ #warlordchoice #ministerchoice +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Modules\Demeter\Model\Election\Election; +use Asylamba\Modules\Demeter\Model\Election\Candidate; +use Asylamba\Modules\Demeter\Model\Forum\ForumTopic; +use Asylamba\Modules\Demeter\Model\Election\Vote; + $program = Utils::getHTTPData('program'); $chiefChoice = Utils::getHTTPData('chiefchoice'); $treasurerChoice = Utils::getHTTPData('treasurerchoice'); $warlordChoice = Utils::getHTTPData('warlordchoice'); $ministerChoice = Utils::getHTTPData('ministerchoice'); -include_once DEMETER; -include_once ZEUS; -include_once HERMES; - if ($program !== FALSE) { if (CTR::$data->get('playerInfo')->get('status') > PAM_STANDARD && CTR::$data->get('playerInfo')->get('status') < PAM_CHIEF) { $_CLM = ASM::$clm->getCurrentSession(); @@ -29,13 +33,13 @@ $election = new Election(); $election->rColor = ASM::$clm->get()->id; - $date = new DateTime(Utils::now()); + $date = new \DateTime(Utils::now()); $date->modify('+' . COLOR::PUTSCHTIME . ' second'); $election->dElection = $date->format('Y-m-d H:i:s'); ASM::$elm->add($election); - $candidate = new candidate(); + $candidate = new Candidate(); $candidate->rElection = $election->id; $candidate->rPlayer = CTR::$data->get('playerId'); $candidate->chiefChoice = $chiefChoice; diff --git a/system/action/std/demeter/election/postulate.php b/system/action/std/demeter/election/postulate.php index 0360ac4e4..915e85ae3 100755 --- a/system/action/std/demeter/election/postulate.php +++ b/system/action/std/demeter/election/postulate.php @@ -7,6 +7,15 @@ #warlordchoice #ministerchoice +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Modules\Demeter\Model\Election\Candidate; +use Asylamba\Modules\Demeter\Model\Forum\ForumTopic; +use Asylamba\Modules\Demeter\Model\Election\Vote; +use Asylamba\Modules\Demeter\Model\Color; +use Asylamba\Modules\Demeter\Resource\ColorResource; + $rElection = Utils::getHTTPData('relection'); $program = Utils::getHTTPData('program'); $chiefChoice = Utils::getHTTPData('chiefchoice'); @@ -14,9 +23,6 @@ $warlordChoice = Utils::getHTTPData('warlordchoice'); $ministerChoice = Utils::getHTTPData('ministerchoice'); -include_once DEMETER; -include_once ZEUS; - if ($rElection !== FALSE && $program !== FALSE) { $_ELM = ASM::$elm->getCurrentSession(); ASM::$elm->newSession(); diff --git a/system/action/std/demeter/election/resign.php b/system/action/std/demeter/election/resign.php index 13de6a86a..9c32f9201 100644 --- a/system/action/std/demeter/election/resign.php +++ b/system/action/std/demeter/election/resign.php @@ -1,7 +1,8 @@ get('playerInfo')->get('status') > PAM_PARLIAMENT && CTR::$data->get('playerInfo')->get('status') < PAM_CHIEF) { $_PAM = ASM::$pam->getCurrentsession(); diff --git a/system/action/std/demeter/election/vote.php b/system/action/std/demeter/election/vote.php index 5bc35b3d8..198f5b24d 100755 --- a/system/action/std/demeter/election/vote.php +++ b/system/action/std/demeter/election/vote.php @@ -3,12 +3,15 @@ #rcandidate id du candidat #relection id election +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Demeter\Model\Election\Vote; +use Asylamba\Classes\Library\Utils; + $rElection = Utils::getHTTPData('relection'); $rCandidate = Utils::getHTTPData('rcandidate'); -include_once DEMETER; -include_once ZEUS; - if ($rElection !== FALSE && $rCandidate !== FALSE) { $_ELM = ASM::$elm->getCurrentSession(); ASM::$elm->newSession(); diff --git a/system/action/std/demeter/law/cancelLaw.php b/system/action/std/demeter/law/cancelLaw.php index 6329edcdb..5677983b3 100755 --- a/system/action/std/demeter/law/cancelLaw.php +++ b/system/action/std/demeter/law/cancelLaw.php @@ -1,9 +1,12 @@ get('playerInfo')->get('stepDone') == FALSE) { - include_once ZEUS; switch (CTR::$data->get('playerInfo')->get('stepTutorial')) { case TutorialResource::FACTION_FORUM : TutorialHelper::setStepDone(); @@ -41,7 +45,7 @@ } if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_SocialRelation(`from`, type, message, dAction) VALUES(?, ?, ?, ?)' diff --git a/system/action/std/demeter/news/delete.php b/system/action/std/demeter/news/delete.php index 1c3933c2d..0b47854dd 100644 --- a/system/action/std/demeter/news/delete.php +++ b/system/action/std/demeter/news/delete.php @@ -1,5 +1,8 @@ get('playerInfo')->get('stepDone') == FALSE) { - include_once ZEUS; switch (CTR::$data->get('playerInfo')->get('stepTutorial')) { case TutorialResource::FACTION_FORUM : TutorialHelper::setStepDone(); @@ -42,7 +48,7 @@ } if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_SocialRelation(`from`, type, message, dAction) VALUES(?, ?, ?, ?)' diff --git a/system/action/std/demeter/topic/move.php b/system/action/std/demeter/topic/move.php index eca3471a6..2af7121b0 100755 --- a/system/action/std/demeter/topic/move.php +++ b/system/action/std/demeter/topic/move.php @@ -1,5 +1,9 @@ add($message); if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_SocialRelation(`from`, `to`, `type`, `message`, dAction) VALUES(?, ?, ?, ?, ?)' diff --git a/system/action/std/hermes/conversation/updateDisplay.php b/system/action/std/hermes/conversation/updateDisplay.php index 30cf1d120..54c365ccc 100644 --- a/system/action/std/hermes/conversation/updateDisplay.php +++ b/system/action/std/hermes/conversation/updateDisplay.php @@ -1,5 +1,9 @@ getCurrentSession(); ASM::$ntm->newSession(ASM_UMODE); diff --git a/system/action/std/hermes/notification/readAll.php b/system/action/std/hermes/notification/readAll.php index 4c3ef7586..9c7f65ba6 100755 --- a/system/action/std/hermes/notification/readAll.php +++ b/system/action/std/hermes/notification/readAll.php @@ -1,7 +1,8 @@ getCurrentSession(); ASM::$ntm->newSession(ASM_UMODE); diff --git a/system/action/std/hermes/radio/write.php b/system/action/std/hermes/radio/write.php index 2c3b47697..eec0e8c7e 100755 --- a/system/action/std/hermes/radio/write.php +++ b/system/action/std/hermes/radio/write.php @@ -1,10 +1,12 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('sector'); } @@ -33,5 +35,4 @@ CTR::$alert->add('Message envoyé', ALERT_STD_SUCCESS); } else { CTR::$alert->add('pas assez d\'informations pour écrire un message dans une radio', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/hermes/roadmap/write.php b/system/action/std/hermes/roadmap/write.php index 0240bf71c..facf50b1e 100755 --- a/system/action/std/hermes/roadmap/write.php +++ b/system/action/std/hermes/roadmap/write.php @@ -1,10 +1,14 @@ get('playerInfo')->get('admin') == FALSE) { CTR::redirect('profil'); } else { @@ -30,5 +34,4 @@ } else { CTR::$alert->add('pas assez d\'informations pour écrire un message dans la roadmap', ALERT_STD_FILLFORM); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/main.php b/system/action/std/main.php index c342f8c04..c0413b734 100755 --- a/system/action/std/main.php +++ b/system/action/std/main.php @@ -1,4 +1,6 @@ add('votre token CSRF a expiré', ALERT_STD_ERROR); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/promethee/technology/build.php b/system/action/std/promethee/technology/build.php index 7d38ac8ed..feb0d65dd 100755 --- a/system/action/std/promethee/technology/build.php +++ b/system/action/std/promethee/technology/build.php @@ -1,13 +1,21 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -57,7 +65,6 @@ # tutorial if (CTR::$data->get('playerInfo')->get('stepDone') == FALSE) { - include_once ZEUS; switch (CTR::$data->get('playerInfo')->get('stepTutorial')) { case TutorialResource::SHIP0_UNBLOCK: if ($techno == Technology::SHIP0_UNBLOCK) { @@ -112,7 +119,7 @@ CTR::$data->get('playerEvent')->add($tq->dEnd, EVENT_BASE, $baseId); if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_BaseAction(`from`, type, opt1, opt2, weight, dAction) VALUES(?, ?, ?, ?, ?, ?)' @@ -141,4 +148,3 @@ } else { CTR::$alert->add('pas assez d\'informations pour développer une technologie', ALERT_STD_FILLFORM); } -?> \ No newline at end of file diff --git a/system/action/std/promethee/technology/dequeue.php b/system/action/std/promethee/technology/dequeue.php index dc4b442ca..35f50f182 100755 --- a/system/action/std/promethee/technology/dequeue.php +++ b/system/action/std/promethee/technology/dequeue.php @@ -1,12 +1,14 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -87,5 +89,4 @@ } } else { CTR::$alert->add('pas assez d\'informations pour annuler le développement d\'une technologie', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/zeus/player/abandonServer.php b/system/action/std/zeus/player/abandonServer.php index fe9c9ab18..e631633fb 100644 --- a/system/action/std/zeus/player/abandonServer.php +++ b/system/action/std/zeus/player/abandonServer.php @@ -1,5 +1,8 @@ getCurrentSession(); ASM::$pam->newSession(); @@ -28,7 +31,4 @@ CTR::$alert->add('Une erreur s\'est produite. Contactez un administrateur pour résoudre ce problème.', ALERT_STD_ERROR); } -ASM::$pam->changeSession($S_PAM1); - - -?> +ASM::$pam->changeSession($S_PAM1); \ No newline at end of file diff --git a/system/action/std/zeus/player/disconnect.php b/system/action/std/zeus/player/disconnect.php index b020adaff..022cef067 100755 --- a/system/action/std/zeus/player/disconnect.php +++ b/system/action/std/zeus/player/disconnect.php @@ -1,4 +1,6 @@ destroy(); -CTR::redirect(GETOUT_ROOT . 'profil', TRUE); -?> \ No newline at end of file +CTR::redirect(GETOUT_ROOT . 'profil', TRUE); \ No newline at end of file diff --git a/system/action/std/zeus/player/searchPlayer.php b/system/action/std/zeus/player/searchPlayer.php index f8d5a8d65..97d371232 100755 --- a/system/action/std/zeus/player/searchPlayer.php +++ b/system/action/std/zeus/player/searchPlayer.php @@ -1,5 +1,9 @@ changeSession($S_PAM1); } else { CTR::$alert->add('pas assez d\'informations pour chercher un joueur', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/zeus/player/sendCredit.php b/system/action/std/zeus/player/sendCredit.php index 1fc56131e..5de3e88d8 100755 --- a/system/action/std/zeus/player/sendCredit.php +++ b/system/action/std/zeus/player/sendCredit.php @@ -1,5 +1,14 @@ add($n); if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_CommercialRelation(`from`, `to`, type, weight, dAction) VALUES(?, ?, ?, ?, ?)' diff --git a/system/action/std/zeus/player/sendCreditFromFaction.php b/system/action/std/zeus/player/sendCreditFromFaction.php index af6eb6cc0..e941f56c2 100644 --- a/system/action/std/zeus/player/sendCreditFromFaction.php +++ b/system/action/std/zeus/player/sendCreditFromFaction.php @@ -1,6 +1,12 @@ getCurrentSession(); diff --git a/system/action/std/zeus/player/updateUniInvest.php b/system/action/std/zeus/player/updateUniInvest.php index 9262c56e1..2d30c689d 100755 --- a/system/action/std/zeus/player/updateUniInvest.php +++ b/system/action/std/zeus/player/updateUniInvest.php @@ -1,9 +1,14 @@ add('pas assez d\'informations pour modifier cet investissement', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/std/zeus/tutorial/validateStep.php b/system/action/std/zeus/tutorial/validateStep.php index eefc78421..c31fcb986 100755 --- a/system/action/std/zeus/tutorial/validateStep.php +++ b/system/action/std/zeus/tutorial/validateStep.php @@ -1,8 +1,11 @@ get('playerId'); $stepTutorial = CTR::$data->get('playerInfo')->get('stepTutorial'); $stepDone = CTR::$data->get('playerInfo')->get('stepDone'); @@ -244,4 +247,3 @@ } else { CTR::$alert->add('Impossible de valider l\'étape avant de l\'avoir effectuée.', ALERT_STD_FILLFORM); } -?> \ No newline at end of file From 4dd71a0930464c847fc25aa1ce721bcc20328b78 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:24:58 +0200 Subject: [PATCH 32/64] Implement namespaces usage in ajax actions --- system/action/ajax/ares/ship/assign.php | 12 ++++++++---- system/action/ajax/ares/squadron/update.php | 12 ++++++++---- system/action/ajax/autocomplete/orbitalBase.php | 7 ++++--- system/action/ajax/autocomplete/player.php | 8 ++++---- system/action/ajax/common/switchParams.php | 7 +++++-- system/action/ajax/hermes/notification/archive.php | 4 +++- system/action/ajax/hermes/notification/delete.php | 4 +++- system/action/ajax/hermes/notification/read.php | 8 +++++--- system/action/ajax/main.php | 6 ++++-- .../action/ajax/zeus/university/decreaseInvest.php | 7 ++++--- .../action/ajax/zeus/university/increaseInvest.php | 9 ++++++--- 11 files changed, 54 insertions(+), 30 deletions(-) diff --git a/system/action/ajax/ares/ship/assign.php b/system/action/ajax/ares/ship/assign.php index 6e960aea1..388e22789 100755 --- a/system/action/ajax/ares/ship/assign.php +++ b/system/action/ajax/ares/ship/assign.php @@ -1,6 +1,4 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -93,5 +98,4 @@ } } else { CTR::$alert->add('Pas assez d\'informations pour assigner un vaisseau', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/ajax/ares/squadron/update.php b/system/action/ajax/ares/squadron/update.php index 6803556bd..b8802000e 100755 --- a/system/action/ajax/ares/squadron/update.php +++ b/system/action/ajax/ares/squadron/update.php @@ -1,6 +1,4 @@ get('playerBase')->get('ob')->size(); $i++) { $verif[] = CTR::$data->get('playerBase')->get('ob')->get($i)->get('id'); } @@ -100,5 +105,4 @@ } } else { CTR::$alert->add('Pas assez d\'informations pour assigner un vaisseau.', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/ajax/autocomplete/orbitalBase.php b/system/action/ajax/autocomplete/orbitalBase.php index 184b57091..4cd0d30d8 100755 --- a/system/action/ajax/autocomplete/orbitalBase.php +++ b/system/action/ajax/autocomplete/orbitalBase.php @@ -1,5 +1,7 @@ newSession(FALSE); ASM::$plm->search($_GET['q'], array('pl.id', 'DESC'), array(0, 20)); @@ -15,5 +17,4 @@ } } -ASM::$plm->changeSession($S_PLM1); -?> \ No newline at end of file +ASM::$plm->changeSession($S_PLM1); \ No newline at end of file diff --git a/system/action/ajax/autocomplete/player.php b/system/action/ajax/autocomplete/player.php index 34dbb0667..1eb9a0fc3 100755 --- a/system/action/ajax/autocomplete/player.php +++ b/system/action/ajax/autocomplete/player.php @@ -1,6 +1,7 @@ newSession(FALSE); @@ -25,5 +26,4 @@ } } } -ASM::$pam->changeSession($S_PAM1); -?> \ No newline at end of file +ASM::$pam->changeSession($S_PAM1); \ No newline at end of file diff --git a/system/action/ajax/common/switchParams.php b/system/action/ajax/common/switchParams.php index 670146df9..01b0a66d3 100644 --- a/system/action/ajax/common/switchParams.php +++ b/system/action/ajax/common/switchParams.php @@ -1,4 +1,8 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/ajax/hermes/notification/archive.php b/system/action/ajax/hermes/notification/archive.php index b8a26366d..375800ac3 100755 --- a/system/action/ajax/hermes/notification/archive.php +++ b/system/action/ajax/hermes/notification/archive.php @@ -2,7 +2,9 @@ # archive or unarchive action # int id id de la notif -include_once HERMES; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; $id = Utils::getHTTPData('id'); diff --git a/system/action/ajax/hermes/notification/delete.php b/system/action/ajax/hermes/notification/delete.php index d6685a419..e5cfab301 100755 --- a/system/action/ajax/hermes/notification/delete.php +++ b/system/action/ajax/hermes/notification/delete.php @@ -3,7 +3,9 @@ # int id id de la notif -include_once HERMES; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Worker\CTR; $id = Utils::getHTTPData('id'); diff --git a/system/action/ajax/hermes/notification/read.php b/system/action/ajax/hermes/notification/read.php index 59cd1c713..51997310e 100755 --- a/system/action/ajax/hermes/notification/read.php +++ b/system/action/ajax/hermes/notification/read.php @@ -1,9 +1,12 @@ changeSession($S_NTM1); } else { CTR::$alert->add('Erreur dans la requête AJAX', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/ajax/main.php b/system/action/ajax/main.php index a9efb4ef0..c6422a5e6 100755 --- a/system/action/ajax/main.php +++ b/system/action/ajax/main.php @@ -1,4 +1,7 @@ get('a')) { # COMMON case 'switchparams': include AJAX . 'common/switchParams.php'; break; @@ -36,5 +39,4 @@ default: CTR::$alert->add('action inconnue ou non-référencée', ALERT_STD_ERROR); break; -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/ajax/zeus/university/decreaseInvest.php b/system/action/ajax/zeus/university/decreaseInvest.php index 9c0f44ec6..239e2f140 100755 --- a/system/action/ajax/zeus/university/decreaseInvest.php +++ b/system/action/ajax/zeus/university/decreaseInvest.php @@ -1,9 +1,11 @@ add('Pas assez d\'informations pour augmenter l\'investissement', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/action/ajax/zeus/university/increaseInvest.php b/system/action/ajax/zeus/university/increaseInvest.php index 18953d93a..e90b4da14 100755 --- a/system/action/ajax/zeus/university/increaseInvest.php +++ b/system/action/ajax/zeus/university/increaseInvest.php @@ -1,10 +1,14 @@ add('Pas assez d\'informations pour augmenter l\'investissement', ALERT_STD_FILLFORM); -} -?> \ No newline at end of file +} \ No newline at end of file From dc38e6b51174c3cfe3fa4fe7d468674cb9277f00 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:25:19 +0200 Subject: [PATCH 33/64] Remove modules including statements --- system/Classes/Library/Game.php | 11 ----------- system/Classes/Library/Parser.php | 2 -- system/Classes/Worker/CTR.php | 1 - system/Modules/Ares/FightController.php | 2 -- system/Modules/Ares/Model/Commander.php | 10 +--------- system/Modules/Ares/Model/Report.php | 2 -- system/Modules/Ares/Model/Ship.php | 2 -- .../Modules/Athena/Manager/OrbitalBaseManager.php | 6 ------ system/Modules/Athena/Model/CommercialShipping.php | 1 - system/Modules/Athena/Model/OrbitalBase.php | 5 ----- system/Modules/Athena/Resource/ShipResource.php | 2 -- system/Modules/Demeter/Manager/ColorManager.php | 4 ---- system/Modules/Demeter/Model/Color.php | 5 ----- system/Modules/Gaia/Manager/PlaceManager.php | 2 -- system/Modules/Gaia/Model/Place.php | 13 ------------- .../Promethee/Resource/TechnologyResource.php | 1 + system/Modules/Zeus/Helper/TutorialHelper.php | 1 - system/Modules/Zeus/Manager/PlayerManager.php | 4 ---- system/Modules/Zeus/Model/Player.php | 7 ------- system/Modules/Zeus/Model/PlayerBonus.php | 3 --- 20 files changed, 2 insertions(+), 82 deletions(-) diff --git a/system/Classes/Library/Game.php b/system/Classes/Library/Game.php index e59f9175c..0d8b129c1 100644 --- a/system/Classes/Library/Game.php +++ b/system/Classes/Library/Game.php @@ -109,14 +109,10 @@ public static function getTimeTravelOutOfSystem($bonus, $startX, $startY, $desti } public static function getRCPrice($distance) { - include_once ATHENA; - return $distance * CommercialRoute::COEF_PRICE; } public static function getRCIncome($distance, $bonusA = 1, $bonusB = 1) { - include_once ATHENA; - $income = CommercialRoute::COEF_INCOME_2 * sqrt($distance * CommercialRoute::COEF_INCOME_1); $maxIncome = CommercialRoute::COEF_INCOME_2 * sqrt(100 * CommercialRoute::COEF_INCOME_1); if ($income > $maxIncome) { @@ -220,7 +216,6 @@ public static function getAntiSpyEntryTime($startPlace, $destinationPlace, $arri } public static function getCommercialShipQuantityNeeded($transactionType, $quantity, $identifier = 0) { - include_once ATHENA; switch ($transactionType) { case Transaction::TYP_RESOURCE : # 1000 ressources => 1 commercialShip @@ -257,7 +252,6 @@ public static function calculateCurrentRate($currentRate, $transactionType, $qua break; case Transaction::TYP_SHIP : # 1 resource = x credit - include_once ATHENA; if (ShipResource::isAShip($identifier)) { $resourceQuantity = ShipResource::getInfo($identifier, 'resourcePrice') * $quantity; $thisRate = $price / $resourceQuantity; @@ -289,7 +283,6 @@ public static function calculateRate($transactionType, $quantity, $identifier, $ break; case Transaction::TYP_SHIP : # 1 resource = x credit - include_once ATHENA; if (ShipResource::isAShip($identifier)) { $resourceQuantity = ShipResource::getInfo($identifier, 'resourcePrice') * $quantity; return $price / $resourceQuantity; @@ -313,7 +306,6 @@ public static function getMinPriceRelativeToRate($transactionType, $quantity, $i $minRate = Transaction::MIN_RATE_RESOURCE; break; case Transaction::TYP_SHIP: - include_once ATHENA; $minRate = Transaction::MIN_RATE_SHIP; $quantity = ShipResource::getInfo($identifier, 'resourcePrice') * $quantity; break; @@ -337,7 +329,6 @@ public static function getMaxPriceRelativeToRate($transactionType, $quantity, $i $minRate = Transaction::MAX_RATE_RESOURCE; break; case Transaction::TYP_SHIP: - include_once ATHENA; $minRate = Transaction::MAX_RATE_SHIP; $quantity = ShipResource::getInfo($identifier, 'resourcePrice') * $quantity; break; @@ -365,7 +356,6 @@ public static function getSpySuccess($antiSpy, $priceInvested) { } public static function getTypeOfSpy($success, $antiSpy) { - include_once ARTEMIS; if ($antiSpy < 1000) { return SpyReport::TYP_NOT_CAUGHT; } @@ -419,7 +409,6 @@ public static function getImprovementFromScientificCoef($coef) { } public static function getFleetCost($ships, $affected = TRUE) { - include_once ATHENA; $cost = 0; for ($i = 0; $i < ShipResource::SHIP_QUANTITY; $i++) { $cost += ShipResource::getInfo($i, 'cost') * $ships[$i]; diff --git a/system/Classes/Library/Parser.php b/system/Classes/Library/Parser.php index 0d1a55c0b..d2617c422 100644 --- a/system/Classes/Library/Parser.php +++ b/system/Classes/Library/Parser.php @@ -94,7 +94,6 @@ protected function parsePlayer($string) { return preg_replace_callback( '#\[\@(.+)\]#isU', function($m) { - include_once ZEUS; $S_PAM1 = ASM::$pam->getCurrentSession(); ASM::$pam->newSession(FALSE); ASM::$pam->load(array('name' => $m[1])); @@ -115,7 +114,6 @@ protected function parsePlace($string) { return preg_replace_callback( '#\[\#(.+)\]#isU', function($m) { - include_once GAIA; $S_PLM1 = ASM::$plm->getCurrentSession(); ASM::$plm->newSession(FALSE); diff --git a/system/Classes/Worker/CTR.php b/system/Classes/Worker/CTR.php index c49e32cf1..972137ead 100644 --- a/system/Classes/Worker/CTR.php +++ b/system/Classes/Worker/CTR.php @@ -262,7 +262,6 @@ public static function save() { # application de la galaxie si necessaire if (CTR::$applyGalaxy) { - include_once GAIA; GalaxyColorManager::applyAndSave(); } diff --git a/system/Modules/Ares/FightController.php b/system/Modules/Ares/FightController.php index 5815bf4c5..22ca2f785 100644 --- a/system/Modules/Ares/FightController.php +++ b/system/Modules/Ares/FightController.php @@ -226,8 +226,6 @@ public function setEnvironmentBonus($ABonus, $DBonus) { */ public function startFight($commanderA, $playerA, $commanderD, $playerD = NULL) { - include_once DEMETER; - $commanderA->setIsAttacker(TRUE); $commanderD->setIsAttacker(FALSE); diff --git a/system/Modules/Ares/Model/Commander.php b/system/Modules/Ares/Model/Commander.php index 989fec091..bdba8fbbd 100644 --- a/system/Modules/Ares/Model/Commander.php +++ b/system/Modules/Ares/Model/Commander.php @@ -287,7 +287,6 @@ private function setArmyAtEnd() { private function setEarnedExperience($enemyCommander) { $this->setArmy(); - include_once ZEUS; $finalOwnPev = 0; foreach ($this->army AS $squadron) { @@ -372,8 +371,6 @@ public function experienceToLevelUp() { } public function emptySquadrons() { - include_once ATHENA; - $S_OBM = ASM::$obm->getCurrentSession(); ASM::$obm->newSession(); ASM::$obm->load(array('rPlace' => $this->rBase)); @@ -518,15 +515,12 @@ public function uCommander() { $nbrHours = Utils::intervalDates($now, $this->uCommander); $this->uCommander = $now; - include_once ATHENA; - $S_OBM = ASM::$obm->getCurrentSession(); ASM::$obm->newSession(); ASM::$obm->load(array('rPlace' => $this->rBase)); $ob = ASM::$obm->get(); ASM::$obm->changeSession($S_OBM); - - include_once ZEUS; + $playerBonus = 0; if ($this->rPlayer != CTR::$data->get('playerId')) { $playerBonus = new PlayerBonus($this->rPlayer); @@ -543,8 +537,6 @@ public function uCommander() { # test si il y a des combats if ($this->dArrival <= Utils::now() AND $this->statement == self::MOVING AND $this->hasToU) { - include_once GAIA; - $this->hasToU = FALSE; $S_PLM = ASM::$plm->getCurrentSession(); diff --git a/system/Modules/Ares/Model/Report.php b/system/Modules/Ares/Model/Report.php index f010992c8..cbfd56740 100644 --- a/system/Modules/Ares/Model/Report.php +++ b/system/Modules/Ares/Model/Report.php @@ -132,8 +132,6 @@ public function getTypeOfReport($playerColor) { } public function setPev() { - include_once ATHENA; - for ($i = 0; $i < 12; $i++) { $this->pevInBeginA += ShipResource::getInfo($i, 'pev') * $this->totalInBeginA[$i]; $this->pevInBeginD += ShipResource::getInfo($i, 'pev') * $this->totalInBeginD[$i]; diff --git a/system/Modules/Ares/Model/Ship.php b/system/Modules/Ares/Model/Ship.php index 86b3fda1a..c4baea40b 100644 --- a/system/Modules/Ares/Model/Ship.php +++ b/system/Modules/Ares/Model/Ship.php @@ -10,8 +10,6 @@ * @update 14.02.14 */ -include_once ATHENA; - namespace Asylamba\Modules\Ares\Model; use Asylamba\Modules\Athena\Resource\ShipResource; diff --git a/system/Modules/Athena/Manager/OrbitalBaseManager.php b/system/Modules/Athena/Manager/OrbitalBaseManager.php index 4db1109d4..7c8a5e17f 100644 --- a/system/Modules/Athena/Manager/OrbitalBaseManager.php +++ b/system/Modules/Athena/Manager/OrbitalBaseManager.php @@ -21,9 +21,6 @@ use Asylamba\Modules\Ares\Model\Commander; use Asylamba\Modules\Athena\Model\OrbitalBase; -include_once HERMES; -include_once ZEUS; - class OrbitalBaseManager extends Manager { protected $managerType = '_OrbitalBase'; @@ -303,7 +300,6 @@ protected function fill($qr) { ASM::$crm->changeSession($S_CRM1); # TechnologyQueueManager - include_once PROMETHEE; $S_TQM1 = ASM::$tqm->getCurrentSession(); ASM::$tqm->newSession(ASM_UMODE); ASM::$tqm->load(array('rPlace' => $aw['rPlace']), array('dEnd')); @@ -328,7 +324,6 @@ protected function fill($qr) { public function add(OrbitalBase $b) { # prépare le rechargement de la map - include_once GAIA; GalaxyColorManager::apply(); $db = Database::getInstance(); @@ -529,7 +524,6 @@ public function changeOwnerById($id, $base, $newOwner, $routeSession, $recycling ASM::$obm->changeSession($S_OBM2); # applique en cascade le changement de couleur des sytèmes - include_once GAIA; GalaxyColorManager::apply(); } else { CTR::$alert->add('Cette base orbitale n\'exite pas !', ALERT_BUG_INFO); diff --git a/system/Modules/Athena/Model/CommercialShipping.php b/system/Modules/Athena/Model/CommercialShipping.php index b8bd6f2dd..9a1afa20e 100644 --- a/system/Modules/Athena/Model/CommercialShipping.php +++ b/system/Modules/Athena/Model/CommercialShipping.php @@ -156,7 +156,6 @@ public function render() { case Transaction::TYP_RESOURCE: $class = 'resources'; break; case Transaction::TYP_COMMANDER: $class = 'commander'; break; case Transaction::TYP_SHIP: - include_once ARES; $class = 'ship'; break; default: break; diff --git a/system/Modules/Athena/Model/OrbitalBase.php b/system/Modules/Athena/Model/OrbitalBase.php index 9137bc5fc..e9d7dab41 100644 --- a/system/Modules/Athena/Model/OrbitalBase.php +++ b/system/Modules/Athena/Model/OrbitalBase.php @@ -357,7 +357,6 @@ public function uMethod() { # load commander if it's a commander shipping if ($transaction->type == Transaction::TYP_COMMANDER) { - include_once ARES; $S_COM1 = ASM::$com->getCurrentSession(); ASM::$com->newSession(); ASM::$com->load(array('c.id' => $transaction->identifier)); @@ -402,7 +401,6 @@ public function uMethod() { $recyclingQuantity = floor($interval / $mission->cycleTime); # Place - include_once GAIA; $S_PLM = ASM::$plm->getCurrentSession(); ASM::$plm->newSession(ASM_UMODE); ASM::$plm->load(array('id' => $mission->rTarget)); @@ -442,7 +440,6 @@ public function uAntiSpy() { } public function uBuildingQueue($queue, $player) { - include_once DEMETER; # update builded building $this->setBuildingLevel($queue->buildingNumber, ($this->getBuildingLevel($queue->buildingNumber) + 1)); # update the points of the orbitalBase @@ -460,7 +457,6 @@ public function uBuildingQueue($queue, $player) { } public function uShipQueue1($sq, $player) { - include_once DEMETER; # vaisseau construit $this->setShipStorage($sq->shipNumber, $this->getShipStorage($sq->shipNumber) + $sq->quantity); # increase player experience @@ -484,7 +480,6 @@ public function uShipQueue1($sq, $player) { } public function uShipQueue2($sq, $player) { - include_once DEMETER; # vaisseau construit $this->setShipStorage($sq->shipNumber, $this->getShipStorage($sq->shipNumber) + 1); # increase player experience diff --git a/system/Modules/Athena/Resource/ShipResource.php b/system/Modules/Athena/Resource/ShipResource.php index 8522e8ce6..cbb861c4f 100644 --- a/system/Modules/Athena/Resource/ShipResource.php +++ b/system/Modules/Athena/Resource/ShipResource.php @@ -8,8 +8,6 @@ use Asylamba\Modules\Demeter\Resource\ColorResource; use Asylamba\Modules\Promethee\Resource\TechnologyResource; -include_once DEMETER; - class ShipResource { const PEGASE = 0; diff --git a/system/Modules/Demeter/Manager/ColorManager.php b/system/Modules/Demeter/Manager/ColorManager.php index 8427089c6..344442de4 100644 --- a/system/Modules/Demeter/Manager/ColorManager.php +++ b/system/Modules/Demeter/Manager/ColorManager.php @@ -235,8 +235,6 @@ public static function updateInfos($id) { } public static function updatePlayers($id) { - include_once ZEUS; - $_CLM1 = ASM::$clm->getCurrentSession(); ASM::$clm->newSession(); ASM::$clm->load(array('id' => $id)); @@ -252,8 +250,6 @@ public static function updatePlayers($id) { } public static function updateActivePlayers($id) { - include_once ZEUS; - $_CLM1 = ASM::$clm->getCurrentSession(); ASM::$clm->newSession(); ASM::$clm->load(array('id' => $id)); diff --git a/system/Modules/Demeter/Model/Color.php b/system/Modules/Demeter/Model/Color.php index f52b3f0e1..9839115fa 100644 --- a/system/Modules/Demeter/Model/Color.php +++ b/system/Modules/Demeter/Model/Color.php @@ -143,8 +143,6 @@ public function decreaseCredit($credit) { } public function sendSenateNotif($fromChief = FALSE) { - include_once HERMES; - $_PAM121 = ASM::$pam->getCurrentsession(); ASM::$pam->newSession(); ASM::$pam->load(['rColor' => $this->id, 'status' => PAM_PARLIAMENT]); @@ -173,7 +171,6 @@ public function sendSenateNotif($fromChief = FALSE) { } public function updateStatus($token_pam) { - include_once ZEUS; $limit = round($this->players / 4); if ($limit < 10) { $limit = 10; } if ($limit > 40) { $limit = 40; } @@ -665,8 +662,6 @@ public function uFinishPunition($law, $player) { public function uMethod() { // 604800s = 7j - include_once GAIA; - $token_ctc = CTC::createContext('Color'); if ($this->regime == self::DEMOCRATIC) { diff --git a/system/Modules/Gaia/Manager/PlaceManager.php b/system/Modules/Gaia/Manager/PlaceManager.php index 70036fecd..f5c65f4a3 100644 --- a/system/Modules/Gaia/Manager/PlaceManager.php +++ b/system/Modules/Gaia/Manager/PlaceManager.php @@ -23,8 +23,6 @@ class PlaceManager extends Manager { protected $managerType = '_Place'; public function load($where = array(), $order = array(), $limit = array()) { - include_once ARES; - $formatWhere = Utils::arrayToWhere($where, 'p.'); $formatOrder = Utils::arrayToOrder($order, 'p.'); $formatLimit = Utils::arrayToLimit($limit); diff --git a/system/Modules/Gaia/Model/Place.php b/system/Modules/Gaia/Model/Place.php index 5d5443bcf..31795ee24 100644 --- a/system/Modules/Gaia/Model/Place.php +++ b/system/Modules/Gaia/Model/Place.php @@ -199,9 +199,6 @@ public function uMethod() { CTC::add($hour, $this, 'uDanger', array()); } } - - include_once ARES; - $S_COM_OUT = ASM::$com->getCurrentSession(); ASM::$com->newSession(); ASM::$com->load([ @@ -211,10 +208,6 @@ public function uMethod() { ); if (ASM::$com->size() > 0) { - include_once ATHENA; - include_once ZEUS; - include_once DEMETER; - $places = array(); $playerBonuses = array(); @@ -694,8 +687,6 @@ public function uConquer($commander, $commanderPlace, $playerBonus, $commanderPl # victoire if ($commander->getStatement() != COM_DEAD) { - include_once ATHENA; - if ($nbrBattle == 0) { $this->sendNotif(self::CONQUERPLAYERWHITOUTBATTLESUCCESS, $commander, NULL); } else { @@ -776,8 +767,6 @@ public function uConquer($commander, $commanderPlace, $playerBonus, $commanderPl $this->typeOfBase = 4; # créer une base - include_once ATHENA; - $ob = new OrbitalBase(); $ob->rPlace = $this->id; $ob->setRPlayer($commander->getRPlayer()); @@ -959,8 +948,6 @@ private function createReport() { } private function sendNotif($case, $commander, $report = NULL) { - include_once HERMES; - switch ($case) { case self::CHANGESUCCESS: $notif = new Notification(); diff --git a/system/Modules/Promethee/Resource/TechnologyResource.php b/system/Modules/Promethee/Resource/TechnologyResource.php index 219a5674d..2faa09ceb 100644 --- a/system/Modules/Promethee/Resource/TechnologyResource.php +++ b/system/Modules/Promethee/Resource/TechnologyResource.php @@ -9,6 +9,7 @@ use Asylamba\Modules\Promethee\Resource\ResearchResource; use Asylamba\Classes\Container\StackList; use Asylamba\Classes\Container\ArrayList; +use Asylamba\Modules\Promethee\Model\Technology; class TechnologyResource { private static $technologies = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, diff --git a/system/Modules/Zeus/Helper/TutorialHelper.php b/system/Modules/Zeus/Helper/TutorialHelper.php index e0a70d93a..0aa4fbb59 100644 --- a/system/Modules/Zeus/Helper/TutorialHelper.php +++ b/system/Modules/Zeus/Helper/TutorialHelper.php @@ -98,7 +98,6 @@ public static function isNextBuildingStepAlreadyDone($playerId, $buildingId, $le public static function isNextTechnoStepAlreadyDone($playerId, $technoId, $level = 1) { $nextStepAlreadyDone = FALSE; - include_once PROMETHEE; $tech = new Technology($playerId); if ($tech->getTechnology($technoId) >= $level) { $nextStepAlreadyDone = TRUE; diff --git a/system/Modules/Zeus/Manager/PlayerManager.php b/system/Modules/Zeus/Manager/PlayerManager.php index 050717c72..7eaad4b0d 100644 --- a/system/Modules/Zeus/Manager/PlayerManager.php +++ b/system/Modules/Zeus/Manager/PlayerManager.php @@ -301,10 +301,6 @@ public function kill($player) { } public function reborn($player) { - include_once GAIA; - include_once ATHENA; - include_once HERMES; - $S_PAM1 = ASM::$pam->getCurrentSession(); ASM::$pam->newSession(FALSE); ASM::$pam->load(array('id' => $player)); diff --git a/system/Modules/Zeus/Model/Player.php b/system/Modules/Zeus/Model/Player.php index 1c2d3cc96..dc8ed1a5d 100644 --- a/system/Modules/Zeus/Model/Player.php +++ b/system/Modules/Zeus/Model/Player.php @@ -147,13 +147,6 @@ public function uMethod() { $hours = Utils::intervalDates($now, $this->uPlayer); $this->uPlayer = $now; - include_once ATHENA; - include_once HERMES; - include_once PROMETHEE; - include_once ARES; - include_once DEMETER; - include_once GAIA; - # load orbital bases $S_OBM1 = ASM::$obm->getCurrentSession(); ASM::$obm->newSession(); diff --git a/system/Modules/Zeus/Model/PlayerBonus.php b/system/Modules/Zeus/Model/PlayerBonus.php index 273e70fbb..4e1132865 100644 --- a/system/Modules/Zeus/Model/PlayerBonus.php +++ b/system/Modules/Zeus/Model/PlayerBonus.php @@ -161,7 +161,6 @@ private function addTechnoToBonus($techno, $bonus) { } private function addLawBonus() { - include_once DEMETER; $_LAM = ASM::$lam->getCurrentSession(); ASM::$lam->newSession(); ASM::$lam->load(array('rColor' => $this->playerColor, 'statement' => Law::EFFECTIVE)); @@ -186,8 +185,6 @@ private function addLawBonus() { ASM::$lam->changeSession($_LAM); } private function addFactionBonus() { - include_once DEMETER; - $_CLM = ASM::$clm->getCurrentSession(); ASM::$clm->newSession(); ASM::$clm->load(['id' => $this->playerColor]); From b2872eaba062848332f45dba110b817dd787df87 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:26:15 +0200 Subject: [PATCH 34/64] Update the index entrypoint --- index.default.php | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/index.default.php b/index.default.php index 70bc9a969..d67f8d3a2 100755 --- a/index.default.php +++ b/index.default.php @@ -1,7 +1,13 @@ \ No newline at end of file From 8fdfb520d55f6d98c2b0a1036ef4c8b23b1068c9 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:27:34 +0200 Subject: [PATCH 35/64] Update dependencies --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index afda12550..e4ccb4138 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "2435da5187a3336f5cc90c84a0bcbe29", + "hash": "d73d500424d007f0a2b58c7e314ccfc0", "content-hash": "0937eb1ab5aa97aad3755e31a382ea92", "packages": [ { From 6f509ee24af280bdb095e8f3c8e4dca82625e4cb Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:33:46 +0200 Subject: [PATCH 36/64] Add missing replacements for the old database class name --- system/Modules/Promethee/Manager/ResearchManager.php | 2 +- system/Modules/Zeus/Manager/PlayerManager.php | 2 +- system/action/std/athena/building/build.php | 2 +- system/action/std/hermes/conversation/write.php | 2 +- system/inscription/step/save.php | 2 +- system/script/scripts/cron/factionRanking.php | 4 ++-- system/script/scripts/cron/playerRanking.php | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/system/Modules/Promethee/Manager/ResearchManager.php b/system/Modules/Promethee/Manager/ResearchManager.php index c8b47bc5e..5cca4d42e 100644 --- a/system/Modules/Promethee/Manager/ResearchManager.php +++ b/system/Modules/Promethee/Manager/ResearchManager.php @@ -160,7 +160,7 @@ public function save() { /* This will no longer work public static function deleteByRPlayer($rPlayer) { try { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('DELETE FROM research WHERE rPlayer = ?'); $qr->execute(array($rPlayer)); return TRUE; diff --git a/system/Modules/Zeus/Manager/PlayerManager.php b/system/Modules/Zeus/Manager/PlayerManager.php index 7eaad4b0d..2af396380 100644 --- a/system/Modules/Zeus/Manager/PlayerManager.php +++ b/system/Modules/Zeus/Manager/PlayerManager.php @@ -66,7 +66,7 @@ public function load($where = array(), $order = array(), $limit = array()) { // $formatOrder = Utils::arrayToOrder($order); // $formatLimit = Utils::arrayToLimit([]); - // $db = DataBase::getInstance(); + // $db = Database::getInstance(); // $qr = $db->prepare('SELECT p.* // FROM playerRanking AS pl // LEFT JOIN player AS p diff --git a/system/action/std/athena/building/build.php b/system/action/std/athena/building/build.php index a2cc0a3a6..aabbacfa8 100755 --- a/system/action/std/athena/building/build.php +++ b/system/action/std/athena/building/build.php @@ -134,7 +134,7 @@ $ob->decreaseResources(OrbitalBaseResource::getBuildingInfo($building, 'level', $currentLevel + 1, 'resourcePrice')); if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_BaseAction(`from`, type, opt1, opt2, weight, dAction) VALUES(?, ?, ?, ?, ?, ?)' diff --git a/system/action/std/hermes/conversation/write.php b/system/action/std/hermes/conversation/write.php index 3e193adb2..d380e4b0d 100644 --- a/system/action/std/hermes/conversation/write.php +++ b/system/action/std/hermes/conversation/write.php @@ -57,7 +57,7 @@ ASM::$cme->add($message); if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_SocialRelation(`from`, `to`, `type`, `message`, dAction) VALUES(?, ?, ?, ?, ?)' diff --git a/system/inscription/step/save.php b/system/inscription/step/save.php index 8f1bce728..c5b3d9db2 100755 --- a/system/inscription/step/save.php +++ b/system/inscription/step/save.php @@ -238,7 +238,7 @@ # enregistrement DA if (DATA_ANALYSIS) { - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_Player(id, color, dInscription) VALUES(?, ?, ?)' diff --git a/system/script/scripts/cron/factionRanking.php b/system/script/scripts/cron/factionRanking.php index 5e2274414..6e77460b5 100755 --- a/system/script/scripts/cron/factionRanking.php +++ b/system/script/scripts/cron/factionRanking.php @@ -17,7 +17,7 @@ ASM::$clm->newSession(FALSE); # create a new ranking -$db = DataBase::getInstance(); +$db = Database::getInstance(); $qr = $db->prepare('INSERT INTO ranking(dRanking, player, faction) VALUES (?, 0, 1)'); $qr->execute(array(Utils::now())); @@ -102,7 +102,7 @@ function setPositions($list, $attribute) { } #-------------------------------- WEALTH RANKING ----------------------------------# -$db = DataBase::getInstance(); +$db = Database::getInstance(); for ($i = 0; $i < ASM::$clm->size(); $i++) { $color = ASM::$clm->get($i)->id; diff --git a/system/script/scripts/cron/playerRanking.php b/system/script/scripts/cron/playerRanking.php index 5cb272a05..16acc88a6 100755 --- a/system/script/scripts/cron/playerRanking.php +++ b/system/script/scripts/cron/playerRanking.php @@ -11,7 +11,7 @@ # create a new ranking -$db = DataBase::getInstance(); +$db = Database::getInstance(); $qr = $db->prepare('INSERT INTO ranking(dRanking, player, faction) VALUES (?, 1, 0)'); $qr->execute(array(Utils::now())); @@ -456,7 +456,7 @@ function cmpTrader($a, $b) { if (DATA_ANALYSIS) { $p = ASM::$pam->getById($player); - $db = DataBase::getInstance(); + $db = Database::getInstance(); $qr = $db->prepare('INSERT INTO DA_PlayerDaily(rPlayer, credit, experience, level, victory, defeat, status, resources, fleetSize, nbPlanet, planetPoints, rkGeneral, rkFighter, rkProducer, rkButcher, rkTrader, dStorage) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' From af5b737e70421404bd3fac6f376a2d21103504ff Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 00:34:01 +0200 Subject: [PATCH 37/64] Close #6: implement psr-4 autoload and classes namespaces --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c4e44e41..15462d241 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,3 +2,12 @@ ### Added * Composer project file * PHPUnit configuration file +* PSR-4 Autoload + +### Changed +* Classes are loaded by namespaces instead of manual loading +* Scripts keys dots replaced by underscores + +### Removed +* Manual include of the modules +* Modules location constants From 2e9455b84cefd54a32bc157efa0288df06a45ddf Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 25 Oct 2016 01:11:40 +0200 Subject: [PATCH 38/64] WIP --- system/Modules/Athena/Model/OrbitalBase.php | 1 + system/action/std/hermes/notification/readAll.php | 9 ++++++--- system/event/executeEvent.php | 1 + system/views/pages/desktop/message.php | 6 ++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/system/Modules/Athena/Model/OrbitalBase.php b/system/Modules/Athena/Model/OrbitalBase.php index e9d7dab41..a616b9fbb 100644 --- a/system/Modules/Athena/Model/OrbitalBase.php +++ b/system/Modules/Athena/Model/OrbitalBase.php @@ -17,6 +17,7 @@ use Asylamba\Classes\Library\Utils; use Asylamba\Classes\Library\Game; +use Asylamba\Classes\Library\Format; use Asylamba\Modules\Zeus\Model\PlayerBonus; use Asylamba\Modules\Hermes\Model\Notification; diff --git a/system/action/std/hermes/notification/readAll.php b/system/action/std/hermes/notification/readAll.php index 9c7f65ba6..ae1f2169f 100755 --- a/system/action/std/hermes/notification/readAll.php +++ b/system/action/std/hermes/notification/readAll.php @@ -7,13 +7,16 @@ $S_NTM1 = ASM::$ntm->getCurrentSession(); ASM::$ntm->newSession(ASM_UMODE); ASM::$ntm->load(array('rPlayer' => CTR::$data->get('playerId'), 'readed' => 0)); -for ($i = 0; $i < ASM::$ntm->size(); $i++) { + +$nbNotifications = ASM::$ntm->size(); + +for ($i = 0; $i < $nbNotifications; $i++) { $notif = ASM::$ntm->get($i); $notif->setReaded(1); } -if (ASM::$ntm->size() > 1) { - CTR::$alert->add(ASM::$ntm->size() . ' notifications ont été marquées comme lues.', ALERT_STD_SUCCESS); +if ($nbNotifications > 1) { + CTR::$alert->add($nbNotifications . ' notifications ont été marquées comme lues.', ALERT_STD_SUCCESS); } else if (ASM::$ntm->size() == 1) { CTR::$alert->add('Une notification a été marquée comme lue.', ALERT_STD_SUCCESS); } else { diff --git a/system/event/executeEvent.php b/system/event/executeEvent.php index 3a382c394..4a6c9082c 100755 --- a/system/event/executeEvent.php +++ b/system/event/executeEvent.php @@ -4,6 +4,7 @@ use Asylamba\Classes\Library\Utils; use Asylamba\Classes\Worker\CTR; use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Container\StackList; $now = Utils::now(); diff --git a/system/views/pages/desktop/message.php b/system/views/pages/desktop/message.php index fca94c546..57deefa4b 100755 --- a/system/views/pages/desktop/message.php +++ b/system/views/pages/desktop/message.php @@ -1,4 +1,10 @@
'; From 9071c7c45ca188c7de8b0f8e231cccbc8886fec6 Mon Sep 17 00:00:00 2001 From: acknowledge Date: Wed, 26 Oct 2016 14:05:53 +0200 Subject: [PATCH 39/64] debug objects saving --- system/Classes/Worker/Manager.php | 18 ++++++++---------- system/inscription/step/place.php | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/system/Classes/Worker/Manager.php b/system/Classes/Worker/Manager.php index 5242c3799..35f24c3d9 100644 --- a/system/Classes/Worker/Manager.php +++ b/system/Classes/Worker/Manager.php @@ -135,19 +135,17 @@ protected function _Remove($id) { return NULL; } - public function _Save() { - if (!empty($this->objects)) { - return []; - } + public function _Save() { $savingList = array(); - foreach ($this->sessions AS $s) { - foreach ($this->objects[$s->getId()] AS $k => $o) { - if ($this->objects[$s->getId()][$k] != $this->origin[$s->getId()][$k]) { - $savingList[] = $o; + if (!empty($this->objects)) { + foreach ($this->sessions AS $s) { + foreach ($this->objects[$s->getId()] AS $k => $o) { + if ($this->objects[$s->getId()][$k] != $this->origin[$s->getId()][$k]) { + $savingList[] = $o; + } } - } + } $this->statSavingObject = count($savingList); } - $this->statSavingObject = count($savingList); return $savingList; } diff --git a/system/inscription/step/place.php b/system/inscription/step/place.php index af7390e98..d32cb5058 100755 --- a/system/inscription/step/place.php +++ b/system/inscription/step/place.php @@ -1,7 +1,6 @@ Date: Wed, 26 Oct 2016 15:19:40 +0200 Subject: [PATCH 40/64] continue autoload --- system/Modules/Demeter/Resource/ForumResources.php | 2 +- system/action/std/artemis/spy.php | 1 + system/action/std/demeter/message/write.php | 1 + system/action/std/zeus/tutorial/validateStep.php | 4 ++-- system/script/scripts/cron/factionRanking.php | 6 ++++++ system/script/scripts/cron/playerRanking.php | 10 ++++++++++ system/views/components/faction/forum/createTopic.php | 4 ++++ system/views/components/faction/forum/forum.php | 3 +++ system/views/components/faction/forum/topic.php | 6 ++++++ system/views/components/faction/forum/topics.php | 3 +++ system/views/components/faction/overview/laws.php | 2 +- system/views/components/faction/overview/news.php | 2 ++ system/views/components/faction/overview/stat.php | 7 ++++++- system/views/components/tech/university.php | 1 + system/views/pages/desktop/faction.php | 6 ++++++ system/views/pages/desktop/financial.php | 7 +++++++ system/views/pages/desktop/mapElement/content.php | 2 -- .../views/pages/desktop/mapElement/layer/attacks.php | 1 - .../desktop/mapElement/layer/commercialroutes.php | 1 - .../pages/desktop/mapElement/layer/fleetmovements.php | 1 - .../views/pages/desktop/mapElement/layer/ownbase.php | 1 - .../views/pages/desktop/mapElement/layer/sectors.php | 2 -- system/views/pages/desktop/mapElement/layer/spying.php | 1 - .../views/pages/desktop/mapElement/layer/systems.php | 1 - system/views/pages/desktop/rank.php | 6 ++++++ system/views/pages/desktop/technology.php | 4 ++++ 26 files changed, 70 insertions(+), 15 deletions(-) diff --git a/system/Modules/Demeter/Resource/ForumResources.php b/system/Modules/Demeter/Resource/ForumResources.php index 8633059f9..746109a8d 100755 --- a/system/Modules/Demeter/Resource/ForumResources.php +++ b/system/Modules/Demeter/Resource/ForumResources.php @@ -9,7 +9,7 @@ * @package Demeter * @update 06.10.13 */ -namespace Asylamba\Modules\Promethee\Resource; +namespace Asylamba\Modules\Demeter\Resource; #id des forums : < 10 = pour tous les gens d'une faction, >= 10 < 20 = pour le gouvernement d'une fac, >= 20 pour les chefs de toutes les factions Class ForumResources { diff --git a/system/action/std/artemis/spy.php b/system/action/std/artemis/spy.php index c3e562423..7e0cdbbc7 100755 --- a/system/action/std/artemis/spy.php +++ b/system/action/std/artemis/spy.php @@ -13,6 +13,7 @@ use Asylamba\Modules\Hermes\Model\Notification; use Asylamba\Modules\Zeus\Helper\TutorialHelper; use Asylamba\Modules\Zeus\Resource\TutorialResource; +use Asylamba\Modules\Athena\Model\OrbitalBase; $rPlace = Utils::getHTTPData('rplace'); $price = Utils::getHTTPData('price'); diff --git a/system/action/std/demeter/message/write.php b/system/action/std/demeter/message/write.php index abe59dd87..4f5563f28 100755 --- a/system/action/std/demeter/message/write.php +++ b/system/action/std/demeter/message/write.php @@ -9,6 +9,7 @@ use Asylamba\Modules\Zeus\Helper\TutorialHelper; use Asylamba\Modules\Zeus\Resource\TutorialResource; use Asylamba\Classes\Database\Database; +use Asylamba\Modules\Demeter\Model\Forum\ForumMessage; $content = Utils::getHTTPData('content'); $rTopic = Utils::getHTTPData('rtopic'); diff --git a/system/action/std/zeus/tutorial/validateStep.php b/system/action/std/zeus/tutorial/validateStep.php index c31fcb986..809c020da 100755 --- a/system/action/std/zeus/tutorial/validateStep.php +++ b/system/action/std/zeus/tutorial/validateStep.php @@ -5,6 +5,7 @@ use Asylamba\Classes\Worker\ASM; use Asylamba\Modules\Zeus\Resource\TutorialResource; use Asylamba\Modules\Zeus\Helper\TutorialHelper; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; $playerId = CTR::$data->get('playerId'); $stepTutorial = CTR::$data->get('playerInfo')->get('stepTutorial'); @@ -224,9 +225,8 @@ $nextStepAlreadyDone = TRUE; break; } - if (!$nextStepAlreadyDone) { - $player->stepDone = FALSE; + $player->stepDone = 0; CTR::$data->get('playerInfo')->add('stepDone', FALSE); } $player->stepTutorial = $nextStep; diff --git a/system/script/scripts/cron/factionRanking.php b/system/script/scripts/cron/factionRanking.php index 6e77460b5..a2e7a4c13 100755 --- a/system/script/scripts/cron/factionRanking.php +++ b/system/script/scripts/cron/factionRanking.php @@ -2,6 +2,12 @@ # daily cron # call at x am. every day +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; +use Asylamba\Modules\Gaia\Manager\SectorManager; +use Asylamba\Modules\Atlas\Model\FactionRanking; + $S_FRM1 = ASM::$frm->getCurrentSession(); ASM::$frm->newSession(); ASM::$frm->loadLastContext(); diff --git a/system/script/scripts/cron/playerRanking.php b/system/script/scripts/cron/playerRanking.php index 16acc88a6..69efb91db 100755 --- a/system/script/scripts/cron/playerRanking.php +++ b/system/script/scripts/cron/playerRanking.php @@ -2,6 +2,16 @@ # daily cron # call at x am. every day +use Asylamba\Classes\Worker\ASM; +use Asylamba\Classes\Database\Database; +use Asylamba\Classes\Library\Utils; +use Asylamba\Classes\Library\Game; +use Asylamba\Classes\Library\DataAnalysis; +use Asylamba\Modules\Athena\Resource\OrbitalBaseResource; +use Asylamba\Modules\Athena\Resource\ShipResource; +use Asylamba\Modules\Ares\Model\Commander; +use Asylamba\Modules\Atlas\Model\PlayerRanking; + $S_PRM1 = ASM::$prm->getCurrentSession(); ASM::$prm->newSession(); ASM::$prm->loadLastContext(); diff --git a/system/views/components/faction/forum/createTopic.php b/system/views/components/faction/forum/createTopic.php index 5d29a972b..f206314c2 100755 --- a/system/views/components/faction/forum/createTopic.php +++ b/system/views/components/faction/forum/createTopic.php @@ -4,6 +4,10 @@ # création d'un topic +use Asylamba\Classes\Worker\CTR; +use Asylamba\Classes\Library\Format; +use Asylamba\Classes\Library\Parser; + # require echo '
'; diff --git a/system/views/components/faction/forum/forum.php b/system/views/components/faction/forum/forum.php index 765c9bebc..144f811cc 100755 --- a/system/views/components/faction/forum/forum.php +++ b/system/views/components/faction/forum/forum.php @@ -4,6 +4,9 @@ # affichage du menu des forums +use Asylamba\Classes\Worker\CTR; +use Asylamba\Modules\Demeter\Resource\ForumResources; + # require echo '