33 Commits

Author SHA1 Message Date
pentarctagon
8a377e58b2 add database setup commands as well 2024-07-26 20:04:40 -05:00
Pentarctagon
c1a18e489b Fix comments. 2023-04-21 12:59:53 -05:00
Pentarctagon
a22da2291b
Store side leader information in the database
Fixes #7267
Add new query for getting leader data.
2023-04-21 13:58:17 +02:00
Pentarctagon
3f279ba87b Missed updating the comments a while ago apparently. 2023-03-03 14:31:33 -06:00
Pentarctagon
50afb6ead9 column typo. 2023-02-21 13:51:57 -06:00
Pentarctagon
3d7d5dbdbf
Add ability to allow secondary authors to upload an add-on. (#7268)
* Add ability to allow secondary authors to upload an add-on.

The secondary_authors attribute is a comma-delimited list of forum accounts that can also upload updates to an add-on. Secondary authors can't change the primary/secondary authors and can't delete the add-on.

The primary author can also make someone else the primary author by:
* Putting their username in the secondary_authors attribute
* Putting someone else's username in the author attribute
* Uploading the add-on while selecting themselves
This works since they are still (until the upload is done) the primary author in the database, so they are allowed to change the authors list, including in this case.
2023-01-11 10:21:55 -06:00
Pentarctagon
fbeae32002 Rename database column SOURCE to ADDON_ID.
Also rename VERSION to ADDON_VERSION.
2023-01-06 19:59:26 -06:00
Pentarctagon
18d1f235ca Noticed I changed the wrong column but forgot to save the file after... 2023-01-06 10:48:42 -06:00
Pentarctagon
859a56f4c2 Shrink max column length.
Required for the updated primary key - the max allowed primary key length is 3072 bytes which isn't enough when there are three VARCHAR(255) columns and each character uses 4 bytes. The max length of the data in these columns so far is also well under 100 characters.
2023-01-06 10:42:21 -06:00
Pentarctagon
e5023e40db Skip inserting rows that would cause a duplicate primary key error.
The cause is that somehow, during regular play, MP campaigns can end up with duplicate values in the [content] data for each [addon]. A very similar issue was fixed in 6c980d12dcd56ccd16ff8b7150cd15ef19f0a821, but there's apparently some other way to trigger it that I haven't been able to reproduce. Since the error itself is harmless, it'll just be avoided server-side to avoid the spurious errors in the server log file.
2023-01-06 10:22:04 -06:00
Pentarctagon
337894ac7b Store add-on download count in the database.
The idea being that this could then also be included as a sheet in the multiplayer activity report, which would then be an easy way to view add-on downloads over time. This would of course not be especially useful until 1.18, since for 1.17 the database count would be starting at 0 even though existing add-ons would have a non-zero download count.
2022-06-04 11:21:00 -05:00
Pentarctagon
ed92ba75fe Add version to connection_history. 2021-04-22 14:56:16 -05:00
Pentarctagon
14107b3ae6 Use the database to store and retrieve login history for the searchlog command.
This allows the history to be persisted across restarts, whereas right now it's lost.
2021-04-16 12:42:35 -05:00
Pentarctagon
edef0c5f33 Add database insert for addon information. 2021-03-12 16:12:09 -06:00
Pentarctagon
9b2429c393 Add validation for the feedback topic id. 2021-03-12 16:12:09 -06:00
Pentarctagon
5ee08c80fb Add support for asynchronously querying a player's game history for display on the client. 2021-01-16 12:48:07 -06:00
Pentarctagon
0697f31cd3
Apparently I forgot to remove the column comment after ending up not using it. 2021-01-04 18:49:31 -06:00
Pentarctagon
96243ad778 Store content names for game history viewer. 2021-01-02 23:45:45 -06:00
Pentarctagon
d741365325 Move the game content info (scenario/era/modifications) into their own table.
Fixes #5066
2020-10-26 09:51:21 -05:00
pentarctagon
ba296898d7 Store additional information in the database:
* mp_scenario_addon_id
* mp_scenario_addon_version (host's version)
* mp_era_addon_id
* mp_era_addon_version (host's version)
* active_mod_addon_ids
* active_mod_versions (host's versions)

Forward-port of #4958
2020-07-30 13:17:22 -05:00
Pentarctagon
113a4e0913 Use mariadbpp rather than the mysql C connector.
Reasoning being:
* The result_set and other APIs are nicer to use.
* We use mariadb on our server rather than mysql, so this would minimize the chance of any incompatibilities.
* The mysql C++ connector 1.1 isn't compatible with with c++17 (https://stackoverflow.com/q/47284705).
2020-07-30 13:17:22 -05:00
Pentarctagon
95dc6b5f45 Only store game information once the game starts. 2020-01-21 18:02:28 -06:00
pentarctagon
81e2cae74f Store additional fields in the database.
* Whether the game allows observers.
* Whether the game's replay should be publicly available (currently the same as whether observers are allowed pending the second part of #3909).
* Whether the game had a password set.
* The side's name - this differs from what can be retrieved from USER_ID since it will have the name of any AI used.
2019-10-28 00:40:24 -05:00
pentarctagon
ea90383f1d
Make additional changes to client source handling based on discussion.
Add a "BSD Repository" option.
Add data/dist to .gitignore.
Delete data/dist from git.
Error conditions reading data/dist just set the value to Default.
Remove a leftover TODO comment.
Add description comments for the two new database columns.
2019-10-22 01:14:45 -05:00
pentarctagon
21f9b19120 Also store where the client came from. 2019-10-20 13:57:45 -05:00
pentarctagon
c04ecaa8fb Store the client version in the database.
This will now store the version of the client playing a side in `game_player_info`.
2019-10-20 13:57:45 -05:00
pentarctagon
6d60cc550e
Use consistent formatting in table_definitions.sql. 2019-09-28 21:42:53 -05:00
pentarctagon
f1d48a0947
Fixup user_is_moderator default. 2019-09-28 12:32:54 -05:00
pentarctagon
2cd4273192 Use BIT(1) for fields with only 2 possible non-NULL values. 2019-09-28 09:27:20 +02:00
pentarctagon
7cb6482b32 Store in the database whether the game is a reload or not. 2019-09-28 09:27:20 +02:00
Pentarctagon
b9246dc6b4 Add a flag to record if the game encountered an OOS error. 2019-08-17 14:42:35 +02:00
Pentarctagon
9470eea825 People who have MP mod authority for testing or other reasons can continue to use the existing user_is_moderator column check, but for people who are supposed to moderate the server, now the forum group will be used.
This will make it easier to add/remove people to/from the group, and also ensure that the list of actual moderators matches up with the list available to users.

New config attributes added for this are:
* db_group_table - should be, based on the phpbb documentation I found, phpbb_user_group
* mp_mod_group - should be set to Multiplayer Moderators group ID
2019-08-15 14:36:16 +02:00
Pentarctagon
59e9f9a138 Add support for storing game information in wesnoth's mysql database.
This requires three more tables to be added to any database with the forum user handler enabled, the structures of which are defined in the wesnothd man page:
* `db_game_info_table` - stores information about each game.
* `db_game_player_info_table` - stores information about each player in the game.
* `db_game_modification_info_table` - stores information about any modifications that are enabled for the game.
2019-08-12 13:04:26 +02:00