Skip to content

Commit

Permalink
docs: 0.2.32, configuration, database connection configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Misat11 authored May 11, 2024
1 parent 3eed6d3 commit 5522efc
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.30
0.2.32
69 changes: 65 additions & 4 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ bungee:
server: hub
auto-game-connect: false
kick-when-proxy-too-slow: true
select-random-game: true
random-game-selection:
enabled: true
preselect-games: false
motd:
enabled: false
waiting: '%name%: Waiting for players [%current%/%max%]'
Expand Down Expand Up @@ -117,6 +119,7 @@ shop:
show-page-numbers: true
inventory-type: CHEST
citizens-enabled: false
allow-execution-of-console-commands: true
items:
jointeam: COMPASS
leavegame: SLIME_BALL
Expand Down Expand Up @@ -305,7 +308,15 @@ database:
user: root
password: secret
table-prefix: bw_
useSSL: false
type: mysql
driver: default
params:
useSSL: false
serverTimezone: Europe/Prague
autoReconnect: true
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
bossbar:
use-xp-bar: false
lobby:
Expand Down Expand Up @@ -398,7 +409,7 @@ removePurchaseFailedMessages: false
removeUpgradeMessages: false
disableCakeEating: true
disableDragonEggTeleport: true
preventArenaFromGriefing: false
preventArenaFromGriefing: true
update-checker:
zero:
console: true
Expand Down Expand Up @@ -495,9 +506,59 @@ resources:
spread: 1.0
```
## Database connection
In config.yml you can find a section called `database`. Under this section, you can configure the database connection. Currently only MySQL and MariaDB are officially supported, yet the configuration allows you to provide a custom driver for a newer version of the database system or a driver for a different SQL-like database system like PostgreSQL. Pull requests fixing support with different database systems are welcome :)
To enable the database connection, you have to set something to be saved in database. Currently only statistics can be saved to the database. To enable that, locate the `statistics` section and switch `type` from `yaml` to `database`.
There are following fields in the database section:
* `host` is the hostname or IP address of the database server, defaults to `localhost`.
* `port` is the port of the database server, defaults to `3306` which is the default port for MySQL/MariaDB.
* `db` is the name of the database, defaults to `database`
* `user` is the user of the database system with access to database specified `db`. The user needs to be able to change the structure of the database. Defaults to `root`, though applications should not have root access.
* `password` is the password of the database user. Defaults to `secret`, though you should choose better password (possibly generated).
* `table-prefix` is a string which is prepended to table names, defaults to `bw_`.
* `type` is type of the database system, defaults to `mysql` (valid for both MySQL and MariaDB when the MySQL driver is used).
* `driver` is the driver, which is going to be used. There are two possible options:
* You can set it to `default`. The driver will be chosen based on the type. Both Spigot and Paper servers provide driver for type `mysql`. Other plugins may provide other drivers to the classpath.
* To use a third-party driver, specify the path, for example `mysql-connector-j-8.0.0.jar`. The path is always relative to the `plugins/BedWars` folder, so we recommend putting the jar to this folder. The driver needs to be JDBC 4-compatible. The driver is not available to other plugins, and does not affect them in any way.
* `params` is a map containing specific options for the driver. You should check documentation of the chosen database system before modifying it. By default, following parameters are set:
```yaml
params:
useSSL: false # change this to true if your database server requires SSL or runs on a different machine and has SSL enabled
serverTimezone: Europe/Prague # default value is based on your system
autoReconnect: true
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
```
!!! warning "Driver version"
If you use an ancient Minecraft version like 1.8.8, but you have new version of MySQL/MariaDB, the driver bundled in Spigot 1.8.8 may be incompatible. Get a new version of MySQL Connector J [here](https://dev.mysql.com/downloads/connector/j/): select Platform Independent, download the archive and extract the mysql-connector-j-8.x.x.jar file from it (other files from the archive are not relevant). Put the JAR file in `plugins/BedWars` folder, and change `driver` from `default` to the name of the file, eg. `mysql-connector-j-8.4.0.jar`.
!!! info "stats_players table structure"
In specific cases, the automatic creation of the database table may fail. In that case you may need to create it manually, using the following code or its variation.
```sql
CREATE TABLE IF NOT EXISTS `bw_stats_players` (
`kills` int(11) NOT NULL DEFAULT '0',
`wins` int(11) NOT NULL DEFAULT '0',
`score` int(11) NOT NULL DEFAULT '0',
`loses` int(11) NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL,
`destroyedBeds` int(11) NOT NULL DEFAULT '0',
`uuid` varchar(255) NOT NULL,
`deaths` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`uuid`)
);
```
## Game effects
In config.yml you can find section called `game-effects`. Here you can set some visual effects that will enhance your game experiences.
In config.yml you can find a section called `game-effects`. Here you can set some visual effects that will enhance your game experiences.
### Events
* `end` - This effect is called when game ends.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ScreamingBedWars

Flexible BedWars plugin, formerly coded as a replacement for BedwarsRel.
Supported versions: \[1.8.8 - 1.20.2\], recommended versions: \[1.19.4/1.20.1\].
Supported versions: \[1.8.8 - 1.20.6\], recommended versions: \[1.20.4\].

## Support

Expand Down

0 comments on commit 5522efc

Please sign in to comment.