[wesnoth-commits] [wesnoth/wesnoth] 54dd48: Use an independent ID for the database's GAME_ID c...
Pentarctagon
noreply at github.com
Thu Feb 27 03:44:09 UTC 2020
Branch: refs/heads/1.14
Home: https://github.com/wesnoth/wesnoth
Commit: 54dd488d57ca09b32d91267d7a164f0817cc69b9
https://github.com/wesnoth/wesnoth/commit/54dd488d57ca09b32d91267d7a164f0817cc69b9
Author: Pentarctagon <pentarctagon at tutamail.com>
Date: 2020-02-26 (Wed, 26 Feb 2020)
Changed paths:
M src/server/game.cpp
M src/server/game.hpp
M src/server/server.cpp
Log Message:
-----------
Use an independent ID for the database's GAME_ID column.
Currently, wesnothd uses the game instance's `id_` value when inserting into the game_info, game_player_info, and game_modification_info tables. However, this value is unique only per game instance, not per scenario. This then results in problems when handling MP campaigns, which re-use the same game instance for multiple scenarios. Incrementing the game instance's `id_` was determined to not be suitable since it's used in a boost multi-index, and instead creating a brand new game instance for each scenario in an MP campaign is complex without being especially useful beyond this case.
This commit instead adds a separate `db_id_` value to each game instance, which can be incremented without causing any issues since it's used nowhere else, and is what will be inserted into the database. This means the `db_id_` is unique per scenario, and therefore resolves the below two issues.
Fixes #4281
Fixes #4341
Backport of 1a46bea02760e8ba3775828a128ecefc6c00f105
More information about the Commits
mailing list