Skip to content
Permalink
Browse files

Merge pull request #10 from EvoTM/develop

Develop
  • Loading branch information...
brakerb committed Jun 7, 2019
2 parents 282c42f + abfa31b commit 28142834a7dc407f683710ba45da9d98f0050ad6
Showing with 1,516 additions and 756 deletions.
  1. +13 −9 README.md
  2. +2 −1 composer.json
  3. +58 −2 composer.lock
  4. +0 −192 core/Classes/Config.php
  5. +36 −0 core/Classes/File.php
  6. +7 −1 core/Classes/Log.php
  7. +5 −2 core/Classes/RestClient.php
  8. +1 −1 core/Controllers/ChatController.php
  9. +160 −0 core/Controllers/ConfigController.php
  10. +159 −1 core/Controllers/CountdownController.php
  11. +12 −4 core/Controllers/EventController.php
  12. +64 −178 core/Controllers/MapController.php
  13. +1 −0 core/Controllers/ModeScriptEventController.php
  14. +2 −2 core/Controllers/ModuleController.php
  15. +31 −0 core/Controllers/PlayerController.php
  16. +5 −3 core/Controllers/QueueController.php
  17. +3 −1 core/Controllers/TemplateController.php
  18. +2 −1 core/Modules/_tester/Templates/test.latte.xml
  19. +1 −1 core/Modules/_tester/TestModule.php
  20. +25 −8 core/Modules/added-time-info/AddedTimeInfo.php
  21. +0 −6 core/Modules/added-time-info/Templates/meter.latte.xml
  22. +9 −0 core/Modules/added-time-info/Templates/update.latte.xml
  23. +97 −0 core/Modules/added-time-info/Templates/widget.latte.xml
  24. +1 −1 core/Modules/alter-ui/AlterUi.php
  25. +2 −2 core/Modules/clock/Clock.php
  26. +35 −50 core/Modules/clock/Templates/clock.latte.xml
  27. +2 −2 core/Modules/clock/clock.config.json
  28. +2 −2 core/Modules/clock/module.json
  29. +2 −2 core/Modules/countdown/Templates/widget.latte.xml
  30. +2 −2 core/Modules/dedimania-records/Dedimania.php
  31. +2 −2 core/Modules/discord/discord.config.json
  32. +2 −2 core/Modules/donations/donations.config.json
  33. +0 −4 core/Modules/key-binds/Templates/script.latte.xml
  34. +1 −1 core/Modules/live-rankings/live-rankings.config.json
  35. +2 −2 core/Modules/map-list/map-list.config.json
  36. +82 −0 core/Modules/music-client/MusicClient.php
  37. +84 −29 core/Modules/music-client/Templates/music-client.latte.xml
  38. +17 −0 core/Modules/music-client/Templates/start-song.latte.xml
  39. 0 core/Modules/music-client/music-server/{index.php → index.php.bkp}
  40. +2 −2 core/Modules/music-client/music.config.json
  41. +1 −1 core/Modules/mx-details/MxMapDetails.php
  42. +2 −0 core/Modules/mx-download/MxDownload.php
  43. +2 −1 core/Modules/mx-karma/MxKarma.php
  44. +1 −1 core/Modules/mx-karma/mx-karma.config.json
  45. +1 −4 core/Modules/next-map/NextMap.php
  46. +6 −8 core/Modules/next-map/Templates/widget.latte.xml
  47. +23 −0 core/Modules/patreon-button/Patreon.php
  48. +73 −0 core/Modules/patreon-button/Template/widget.latte.xml
  49. +7 −0 core/Modules/patreon-button/patreon.config.json
  50. +4 −4 core/Modules/pay2play/Pay2Play.php
  51. +1 −1 core/Modules/pay2play/Templates/widget.latte.xml
  52. +4 −4 core/Modules/pay2play/pay2play.config.json
  53. +2 −2 core/Modules/paypal/paypal.config.json
  54. +3 −21 core/Modules/quick-buttons/QuickButtons.php
  55. +1 −1 core/Modules/quick-buttons/quick-buttons.config.json
  56. +86 −0 core/Modules/server-hopper/ServerHopper.php
  57. +12 −0 core/Modules/server-hopper/Template/update.latte.xml
  58. +92 −0 core/Modules/server-hopper/Template/widget.latte.xml
  59. +24 −0 core/Modules/server-hopper/server-hopper.config.json
  60. +0 −8 core/Modules/speedometer/Speedometer.php
  61. +10 −6 core/Modules/statistics/Classes/StatisticWidget.php
  62. +1 −0 core/Modules/statistics/Statistics.php
  63. +1 −1 core/Modules/statistics/Templates/widgets.latte.xml
  64. +2 −2 core/Modules/votes/Templates/vote.latte.xml
  65. +77 −48 core/Modules/votes/Votes.php
  66. +1 −1 core/Modules/votes/votes.config.json
  67. +6 −2 core/autoload.php
  68. +1 −1 core/global-functions.php
  69. +0 −2 core/import_uaseco.php
  70. +138 −0 core/migrate.php
  71. +1 −3 core/run.php
  72. +2 −118 esc
@@ -15,18 +15,22 @@ A server controller for Trackmania² based on PHP 7.2 with Maniaplanet 4.1 suppo
* PHP 7.2+
* MySQL or MariaDB Server

### Installation (git)
### Installation (From GitHub)
###### Requirements
* Composer
###### Installation
1. Clone project `git clone https://github.com/EvoTM/EvoSC.git`
2. Go into the directory and run `composer install`
3. Copy contents from `config/default` to `config` and fill out the required fields
4. Run `php esc migrate` to create the database tables.
5. Run EvoSC
###### Clean installation
1. Clone project `git clone https://github.com/EvoTM/EvoSC.git`.
2. Switch to the new directory.
3. (Checkout develop branch `git checkout develop` to get the latest version).
4. Install required packages with `composer install`.
5. Run the controller `php esc run` it will exit with "Cannot open socket" because the configs are empty (This step is nessecay to copy all required config files to the /config directory).
6. Run `php esc migrate` to create the database tables.
7. Run EvoSC with `php esc run`.

| ⚠ If the cache and log folder aren't created automatically, you need to create them and restart the controller. |
| ⚠ If the cache and log folder are not created automatically, you need to create them and restart the controller. |
| --- |
###### Updating a github installation
1. Go to the EvoSC directory you want to update and run `git pull`.

### Music server installation
Download the [music-server](https://github.com/EvoTM/EvoSC/raw/master/core/Modules/music-client/music-server.zip) and extract it to your webserver with the ogg-files. Copy the `music.config.json` from the music-client-module directory to your config directory and set `url` to the URL of your webserver.
@@ -39,7 +43,7 @@ Get all available commands `php esc list`

| Action | Description |
| --------- | -------------------------------------------- |
| Run EvoSC | In terminal type `php esc run (-v\|-vv\|-vvv)` |
| Run EvoSC | In terminal type `php esc run (-v|-vv|-vvv)` |
| Import data from UASECO | In terminal type `php esc import:uaseco {host} {database} {user} {password}` optionally add `{table_prefix}` |
| Fix player scores and ranking | Run `php esc fix:scores` to re-calculate all scores and fix the player ranks. |
| Creating a database migration | Run `php esc make:migration <MigrationClassName>`. The migration is saved to to /Migrations. Copy it to your module if necessary. |
@@ -7,6 +7,7 @@
"latte/latte" : "^2.4",
"illuminate/pagination" : "^5.6",
"symfony/process" : "^4.2",
"symfony/event-dispatcher" : "^4.2"
"symfony/event-dispatcher" : "^4.2",
"composer/ca-bundle": "^1.1"
}
}

Some generated files are not rendered by default. Learn more.

This file was deleted.

@@ -96,6 +96,10 @@ public static function createDirectory(string $name)
*/
public static function getDirectoryContents(string $path, string $filterPattern = null): Collection
{
if (!is_dir($path)) {
return collect();
}
if ($filterPattern) {
return collect(scandir($path))->filter(function ($file) use ($filterPattern) {
return preg_match($filterPattern, $file);
@@ -117,6 +121,10 @@ public static function getFilesRecursively(string $baseDirectory, string $filter
{
$files = collect();
if (!is_dir($baseDirectory)) {
return $files;
}
File::getDirectoryContents($baseDirectory)
->each(function ($file) use ($baseDirectory, $filterPattern, &$files) {
$path = $baseDirectory . DIRECTORY_SEPARATOR . $file;
@@ -136,6 +144,26 @@ public static function getFilesRecursively(string $baseDirectory, string $filter
return $files;
}
public static function getFiles(string $baseDirectory, string $filterPattern)
{
$files = collect();
File::getDirectoryContents($baseDirectory)
->each(function ($file) use ($baseDirectory, $filterPattern, &$files) {
$path = $baseDirectory . DIRECTORY_SEPARATOR . $file;
if (!is_dir($path)) {
//File is not directory
if (preg_match($filterPattern, $file)) {
//Add template
$files->push($path);
}
}
});
return $files;
}
/**
* Delete a file.
*
@@ -199,4 +227,12 @@ public static function rename(string $sourceFile, string $targetFile)
rename($sourceFile, $targetFile);
}
public static function copy(string $source, string $target)
{
$source = str_replace('/', DIRECTORY_SEPARATOR, $source);
$target = str_replace('/', DIRECTORY_SEPARATOR, $target);
copy($source, $target);
}
}
@@ -61,7 +61,13 @@ public static function logAddLine(string $prefix, string $string, $echo = true)
}
list($childClass, $caller) = debug_backtrace(false, 2);
$callingClass = $caller['class'] . $caller['type'] . $caller['function'];
if (isset($caller['class']) && isset($caller['type'])) {
$callingClass = $caller['class'] . $caller['type'] . $caller['function'];
}else{
$callingClass = $caller['function'];
}
if (isVerbose()) {
$callingClass .= '(';

0 comments on commit 2814283

Please sign in to comment.
You can’t perform that action at this time.