Skip to content

Commit

Permalink
Merge pull request #61 from startersclan/chore/release-v3.2.0
Browse files Browse the repository at this point in the history
Chore: Release `3.2.0`
  • Loading branch information
leojonathanoh authored Jun 25, 2023
2 parents 3d31494 + 1f6451f commit d9709b3
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 4 additions & 7 deletions docs/full-bf2-stack-example/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docs/full-bf2-stack-example/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/ASP/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -44,4 +44,4 @@
require SYSTEM_PATH . DS . 'System.php';

// Load the controller, which in turn loads the current task
System::Run();
System::Run();
3 changes: 2 additions & 1 deletion src/ASP/system/sql/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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');
INSERT INTO `_version`(`updateid`, `version`) VALUES (30100, '3.1.0');
INSERT INTO `_version`(`updateid`, `version`) VALUES (30200, '3.2.0');
4 changes: 4 additions & 0 deletions src/ASP/system/sql/migrations/down/30100.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--
-- Always delete record from version table!!!
--
DELETE FROM `_version` WHERE updateid = 30200;
13 changes: 10 additions & 3 deletions src/ASP/system/sql/migrations/migrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
];
];
4 changes: 4 additions & 0 deletions src/ASP/system/sql/migrations/up/30200.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--
-- Always update version table!!!
--
INSERT INTO `_version`(`updateid`, `version`) VALUES (30200, '3.2.0');

0 comments on commit d9709b3

Please sign in to comment.