diff --git a/README.md b/README.md index 975a9455..57f8cb48 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ The new BF2Statistics 3.0 ASP, currently in public Beta. The GameSpy server to m ## Usage ```sh -docker pull startersclan/asp:3.1.0-nginx -docker pull startersclan/asp:3.1.0-php +docker pull startersclan/asp:3.2.0-nginx +docker pull startersclan/asp:3.2.0-php ``` -See [this](docs/full-bf2-stack-example) example showing how to deploy [Battlefield 2 1.5 server](https://github.com/startersclan/docker-bf2/), [PRMasterserver](https://github.com/startersclan/PRMasterServer) as the master server, and `bf2stats` as the stats web server, using `docker-compose`. +See [this](docs/full-bf2-stack-example) example showing how to deploy [Battlefield 2 1.5 server](https://github.com/startersclan/docker-bf2), [PRMasterserver](https://github.com/startersclan/PRMasterServer) as the master server, and `ASP` as the stats web server, using `docker-compose`. ## Development diff --git a/docs/full-bf2-stack-example/README.md b/docs/full-bf2-stack-example/README.md index 1e5f63af..c26a2cd8 100644 --- a/docs/full-bf2-stack-example/README.md +++ b/docs/full-bf2-stack-example/README.md @@ -1,11 +1,8 @@ # Full Battlefield 2 stack example -This example deploys a stack with BF2Statistics `ASP` `3.1.0`, which has some known quirks. If you prefer a fully working BF2Statistics v2, see [here](https://github.com/startersclan/bf2stats). +This example deploys a stack with BF2Statistics `ASP` `3.x.x`. -Quirks: - -- As of [BF2Statistics `3.1.0`](https://github.com/startersclan/asp), the [python files](https://github.com/startersclan/StatsPython) included in the [BF2 1.5 server docker image](https://github.com/startersclan/docker-bf2) fails to send stats snapshots to an `ASP` `nginx` webserver, with `nginx` responding with `499` because the `miniclient` library closes the connection before `nginx` sends the response (See solution [here](https://github.com/startersclan/bf2stats/pull/36)). Also, the python files will fail to initialize if the `ASP` webserver returns `Transfer Encoding: chunked` because `miniclient` cannot handle chunked responses (See solution [here](https://github.com/startersclan/bf2stats/pull/37)). This should be fixed in `3.2.0`. -- As of [BF2Statistics `3.1.0`](https://github.com/startersclan/asp), there is no working `bf2sclone`. The `bf2sclone` `2.2.0` included in this example does not work with BF2Statistics `3.1.0`, but is only for demonstrative purposes. The community has tried to [fix it](https://bf2statistics.com/threads/bf2sclone-v3.2972/), but so far none seem to have shared their working changes. Wilson212, the original author of BF2Statistics did mention to be working on it, see [here](https://bf2statistics.com/threads/bf2statistics-v3-1-0-full-release.3010/), so we might see it soon. +Note that the `bf2sclone` `2.2.0` included in this example does not work with BF2Statistics `3.x.x`, but is only for demonstrative purposes. The community has tried to [fix it](https://bf2statistics.com/threads/bf2sclone-v3.2972/), but so far none seem to have shared their working changes. Wilson212, the original author of BF2Statistics did mention to be working on it, see [here](https://bf2statistics.com/threads/bf2statistics-v3-1-0-full-release.3010/), so we might see it soon. If you want to have a working `bf2sclone`, use [BF2Statistics `2.x.x`](https://github.com/startersclan/bf2stats) in the meantime. ## Usage @@ -195,10 +192,10 @@ docker attach bf2stats_bf2_1 docker cp bf2stats_bf2_1:/server/bf2/python/bf2/logs . # Dump the DB -docker exec $( docker-compose ps | grep db | awk '{print $1}' ) mysqldump -uroot -padmin bf2stats | gzip > bf2stats.sql.gz +docker exec $( docker-compose ps | grep db | awk '{print $1}' ) mysqldump -uroot -pascent bf2stats | gzip > bf2stats.sql.gz # Restore the DB -zcat bf2stats.sql.gz | docker exec -i $( docker-compose ps | grep db | awk '{print $1}' ) mysql -uroot -padmin bf2stats +zcat bf2stats.sql.gz | docker exec -i $( docker-compose ps | grep db | awk '{print $1}' ) mysql -uroot -pascent bf2stats # Stop docker-compose down diff --git a/docs/full-bf2-stack-example/docker-compose.yml b/docs/full-bf2-stack-example/docker-compose.yml index 0a3dc8ce..8065763c 100644 --- a/docs/full-bf2-stack-example/docker-compose.yml +++ b/docs/full-bf2-stack-example/docker-compose.yml @@ -1,8 +1,8 @@ version: '2.2' services: - # Battlefield 2 1.5 server with bf2stats 3.1.0 python scripts + # Battlefield 2 1.5 server with bf2stats 3.2.0 python scripts bf2: - image: startersclan/docker-bf2:v1.5.3153.0-bf2stats-3.1.0 + image: startersclan/docker-bf2:v1.5.3153.0-bf2stats-3.2.0 volumes: - ./config/bf2/mods/bf2/ai/aidefault-custom.ai:/server/bf2/mods/bf2/ai/aidefault.ai:ro # Customize bots - ./config/bf2/mods/bf2/settings/serversettings-custom.con:/server/bf2/mods/bf2/settings/serversettings.con:ro # Server config @@ -158,7 +158,7 @@ services: # The gamespy ASP. The dashboard is available at https://asp.example.com/ASP asp-nginx: - image: startersclan/asp:3.1.0-nginx + image: startersclan/asp:3.2.0-nginx labels: - "traefik.enable=true" - "traefik.docker.network=${COMPOSE_PROJECT_NAME?err}_traefik-network" @@ -187,7 +187,7 @@ services: restart: unless-stopped asp-php: - image: startersclan/asp:3.1.0-php + image: startersclan/asp:3.2.0-php volumes: - ./config/ASP/config.php:/src/ASP/system/config/config.php # Main config file. Must be writeable or else ASP will throw an exception. Customize only if needed # - ./config/ASP/armyAbbreviationMap.php:/src/ASP/system/config/armyAbbreviationMap.php:ro # Optional: Customize as needed if using a custom mod diff --git a/src/ASP/index.php b/src/ASP/index.php index 77978739..a213e94d 100644 --- a/src/ASP/index.php +++ b/src/ASP/index.php @@ -13,9 +13,9 @@ * linking of files, Also define ROOT and system paths */ define('BF2_ADMIN', true); -define('CODE_VERSION', '3.1.0'); +define('CODE_VERSION', '3.2.0'); define('CODE_VERSION_DATE', '2021-4-21'); -define('DB_EXPECTED_VERSION', '3.1.0'); +define('DB_EXPECTED_VERSION', '3.2.0'); define('DS', DIRECTORY_SEPARATOR); define('ROOT', __DIR__); define('SYSTEM_PATH', ROOT . DS . 'system'); @@ -44,4 +44,4 @@ require SYSTEM_PATH . DS . 'System.php'; // Load the controller, which in turn loads the current task -System::Run(); \ No newline at end of file +System::Run(); diff --git a/src/ASP/system/sql/data.sql b/src/ASP/system/sql/data.sql index 6933bc8c..962dc6e8 100644 --- a/src/ASP/system/sql/data.sql +++ b/src/ASP/system/sql/data.sql @@ -262,4 +262,5 @@ INSERT INTO `_version`(`updateid`, `version`) VALUES (30050, '3.0.5'); INSERT INTO `_version`(`updateid`, `version`) VALUES (30060, '3.0.6'); INSERT INTO `_version`(`updateid`, `version`) VALUES (30070, '3.0.7'); INSERT INTO `_version`(`updateid`, `version`) VALUES (30080, '3.0.8'); -INSERT INTO `_version`(`updateid`, `version`) VALUES (30100, '3.1.0'); \ No newline at end of file +INSERT INTO `_version`(`updateid`, `version`) VALUES (30100, '3.1.0'); +INSERT INTO `_version`(`updateid`, `version`) VALUES (30200, '3.2.0'); diff --git a/src/ASP/system/sql/migrations/down/30100.sql b/src/ASP/system/sql/migrations/down/30100.sql new file mode 100644 index 00000000..8cca193e --- /dev/null +++ b/src/ASP/system/sql/migrations/down/30100.sql @@ -0,0 +1,4 @@ +-- +-- Always delete record from version table!!! +-- +DELETE FROM `_version` WHERE updateid = 30200; diff --git a/src/ASP/system/sql/migrations/migrations.php b/src/ASP/system/sql/migrations/migrations.php index 8515e008..0b355740 100644 --- a/src/ASP/system/sql/migrations/migrations.php +++ b/src/ASP/system/sql/migrations/migrations.php @@ -70,9 +70,16 @@ ], "3.1.0" => [ "comment" => "Added the 'eligible_' tables for easy sorting when selecting a SMOC or General.", - "up" => null, - "up_string" => "", + "up" => "30200", + "up_string" => "3.2.0", "down" => "30080", "down_string" => "3.0.8", + ], + "3.2.0" => [ + "comment" => "Added timestamp column to the player_unlock table.", + "up" => null, + "up_string" => "", + "down" => "30100", + "down_string" => "3.1.0", ] -]; \ No newline at end of file +]; diff --git a/src/ASP/system/sql/migrations/up/30200.sql b/src/ASP/system/sql/migrations/up/30200.sql new file mode 100644 index 00000000..c575fbcb --- /dev/null +++ b/src/ASP/system/sql/migrations/up/30200.sql @@ -0,0 +1,4 @@ +-- +-- Always update version table!!! +-- +INSERT INTO `_version`(`updateid`, `version`) VALUES (30200, '3.2.0');