[Commits] [wesnoth/wesnoth] 12dec7: change saved_game & savefile format

GitHub noreply at github.com
Sun Jun 15 16:13:07 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 12dec704cfb9e91cce83e62cdca17dac3a1ba93d
      https://github.com/wesnoth/wesnoth/commit/12dec704cfb9e91cce83e62cdca17dac3a1ba93d
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/game_controller.cpp
    M src/mp_game_utils.cpp
    M src/playcampaign.cpp
    M src/playsingle_controller.cpp
    M src/saved_game.cpp
    M src/saved_game.hpp
    M src/savegame.cpp

  Log Message:
  -----------
  change saved_game & savefile format

we move code from playcampaign.cpp to saved_game.cpp
we also change the savefile format so that ingame savegames don't
contain [carryover_sides_start] anymore becaus all that was already
merged to both [snapshot] and replay_start.

This commit is likley to break something. If so that will be fixed in
later commits.


  Commit: 29f84b0d7499c5be15ad38c600711904d6f7cda4
      https://github.com/wesnoth/wesnoth/commit/29f84b0d7499c5be15ad38c600711904d6f7cda4
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/playcampaign.cpp
    M src/saved_game.cpp
    M src/saved_game.hpp

  Log Message:
  -----------
  move more code playcampaign -> saved_game

also removes some out commented code.


  Commit: 3574c44eb8b06142c4105d1b34b1ce7b73e38ebd
      https://github.com/wesnoth/wesnoth/commit/3574c44eb8b06142c4105d1b34b1ce7b73e38ebd
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/playcampaign.cpp

  Log Message:
  -----------
  small playcampaign.cpp refactor


  Commit: 5bfce15789796b7ed891482ce0e09b3cf2b15070
      https://github.com/wesnoth/wesnoth/commit/5bfce15789796b7ed891482ce0e09b3cf2b15070
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/carryover.cpp
    M src/carryover.hpp
    M src/game_board.cpp
    M src/game_end_exceptions.hpp
    M src/gamestatus.cpp
    M src/play_controller.cpp
    M src/playcampaign.cpp
    M src/playmp_controller.cpp
    M src/playsingle_controller.cpp
    M src/saved_game.cpp
    M src/saved_game.hpp
    M src/scripting/lua.cpp

  Log Message:
  -----------
  move carryover handling out of playcampaign.cpp

this also makes a small change in the savefile format: [endlevel] ->
[end_level_data] in snapshots.

we still have the "store_carryover" function in playcampaign.cpp which does the visual message.
Note that the real carryover happens after linger mode while that message happens before linger mode this simplifies linger mode saves.


  Commit: 500f03d355531520beacf676daa299acc9938999
      https://github.com/wesnoth/wesnoth/commit/500f03d355531520beacf676daa299acc9938999
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/playcampaign.cpp

  Log Message:
  -----------
  remove outcommented code


  Commit: a9fd13f56947e9f73fb81ba4e245e34fed9975c4
      https://github.com/wesnoth/wesnoth/commit/a9fd13f56947e9f73fb81ba4e245e34fed9975c4
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/playcampaign.cpp
    M src/saved_game.cpp

  Log Message:
  -----------
  move rotate_random call playcampaign ->saved_game

this also removes some set_/remove snapshot calls, which are not needed
becasue there is no snapshot after convert_to_start_save.


  Commit: 0b754ce14b227f52fb132911558e9060a37b187d
      https://github.com/wesnoth/wesnoth/commit/0b754ce14b227f52fb132911558e9060a37b187d
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/playcampaign.cpp

  Log Message:
  -----------
  make use of playsingle_controller optional


  Commit: 79797c3e4fffd594dd22aebfef8bf7c7fab26cd7
      https://github.com/wesnoth/wesnoth/commit/79797c3e4fffd594dd22aebfef8bf7c7fab26cd7
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/playcampaign.cpp

  Log Message:
  -----------
  minor playcampaign refactor


  Commit: a8983333b5c1a84454e74b0fe400f64e6606d642
      https://github.com/wesnoth/wesnoth/commit/a8983333b5c1a84454e74b0fe400f64e6606d642
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/playcampaign.cpp

  Log Message:
  -----------
  remove unneeded code

we read the replay from [replay_start] not form [carryover_sides_start]
so no need to write them there.


  Commit: 9e40b2621958e4dc00f585eefd196739b878d418
      https://github.com/wesnoth/wesnoth/commit/9e40b2621958e4dc00f585eefd196739b878d418
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/playcampaign.cpp
    M src/replay_controller.cpp
    M src/save_index.cpp
    M src/saved_game.cpp
    M src/saved_game.hpp

  Log Message:
  -----------
  load replay from [scenario] if [replay_start] is not present

the intention is to change the serverside generated replays to contain
[scenario] & [carryover_sides_start] & [replay]. [replay_start] would
be wrong because carryover isn't expanded in these servergenerated
saves.

Servergenerated saves from reloaded (non start of scenario) games will
then contain  [replay_start] & [carryover_sides] & [replay]


  Commit: 5ec441abb4f0f01b0c2558f4cf2cd2fe149e4ed0
      https://github.com/wesnoth/wesnoth/commit/5ec441abb4f0f01b0c2558f4cf2cd2fe149e4ed0
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/game_controller.cpp

  Log Message:
  -----------
  remove outdated line

we store difficulcy only in classification, not in carryover_sides_start


  Commit: 33504a7e9043d9ae29ac4b0e548826b27c533d0d
      https://github.com/wesnoth/wesnoth/commit/33504a7e9043d9ae29ac4b0e548826b27c533d0d
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/mp_game_utils.cpp

  Log Message:
  -----------
  simplyfy level_to_gamestate

most liley level_to_gamestate is currently broken since the latest
saved_game changes, but this commit doesn't change anything


  Commit: ee7ab9bc69391b0838409b5629166cbee2751dc6
      https://github.com/wesnoth/wesnoth/commit/ee7ab9bc69391b0838409b5629166cbee2751dc6
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/multiplayer_create_engine.cpp

  Log Message:
  -----------
  remove set unneeded difficuly

we don't store difficulcy in carryover_sides_start anymore


  Commit: dd7dca975d83491f7141612873f4b94e24f50d79
      https://github.com/wesnoth/wesnoth/commit/dd7dca975d83491f7141612873f4b94e24f50d79
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/saved_game.hpp
    M src/savegame.cpp
    M src/savegame.hpp

  Log Message:
  -----------
  fixup scenario advancing

the "gamestate().remove_snapshot();" is unneded and would undo the
"gamestate().set_snapshot();" in playcampaign


  Commit: 728b29dc61de885105c82350574fc3c411c18c70
      https://github.com/wesnoth/wesnoth/commit/728b29dc61de885105c82350574fc3c411c18c70
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/mp_game_utils.cpp
    M src/mp_game_utils.hpp
    M src/multiplayer.cpp
    M src/multiplayer_configure.cpp
    M src/multiplayer_configure.hpp
    M src/multiplayer_connect.cpp
    M src/multiplayer_connect_engine.cpp
    M src/multiplayer_connect_engine.hpp
    M src/multiplayer_create.cpp
    M src/multiplayer_create_engine.cpp
    M src/multiplayer_create_engine.hpp
    M src/multiplayer_wait.cpp
    M src/multiplayer_wait.hpp
    M src/playcampaign.cpp
    M src/saved_game.cpp
    M src/saved_game.hpp

  Log Message:
  -----------
  make wesnothd use savefile format for new games

This patch changes the mp wesnothd protocol.

multiplayer connect now works as following:
multiplayer_create/configure creates saved_game object which is then
loaded by mp_connect and sended to the server in the usual savefile
format, this especially implies that [side] are no longer at toplevel
but instead nested into [scenario] or [snapshot].

mp options are saved into state (the saved_game object)
(state_.mp_settings()) previously we had a separate mp_settings object
for that now we only have one mp_setting object.

This commit still not fixes mp modification/era events/options. The
reason is, that i want to move the expansion of those to saved_game.cpp
for better compatibility to Sp (Especially make era events work in mp games
reloaded in sp), but if that won't work i'll just enable them how they
were before.

There  are still some things to do. Especially the server generated
replay-saves will be completely broken. (will fix in another commit)

we don't use the [replay_start] as starting pos in mp anymore so i removed
2 lines in playcampaign that assumed that.

I also removed soem code in mo_game_utils that seemed redundant, bugged or useless

since we now send the [carryover_sides_start] over the network too there
is no reason to apply [carryover_sides_start] before getting into
mp_connect engine (when advanging the the next scenario), even more,
since the new code expects only ONE of [carryover_sides_start] or
[carryover_sides] to be present, we cannot expand carryover_sides_start
in playcampaign before going to mp_connect because we might wan to modify
[carryover_sides_start] in mp_connect

still TODO:
* rename mp::configure::get_parameters
* reimplement mp modification/era s events/options
* remove fields from the mp_game_settings object
* remove disabled/outcommented code


  Commit: 7172e43cf8acb8df9d1e104a3d764e0bd4063e2e
      https://github.com/wesnoth/wesnoth/commit/7172e43cf8acb8df9d1e104a3d764e0bd4063e2e
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/server/game.cpp
    M src/server/game.hpp
    M src/server/server.cpp

  Log Message:
  -----------
  make wesnothd use savefile format for new games

the serverside part


  Commit: f4db54b0531adc86710a6681bfb4f37c891f0e24
      https://github.com/wesnoth/wesnoth/commit/f4db54b0531adc86710a6681bfb4f37c891f0e24
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/tests/test_mp_connect.cpp

  Log Message:
  -----------
  fix test/ compilation


  Commit: ac9628e3cff7709460c702a4735e15ad933ad704
      https://github.com/wesnoth/wesnoth/commit/ac9628e3cff7709460c702a4735e15ad933ad704
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/saved_game.cpp
    M src/server/game.cpp

  Log Message:
  -----------
  fix servergenerated replays

I also removed 'mp_game_title' because if i leave it, it casues an 'attributes not in order' error since level_ contains attributes. Idk what it does so i removed it. if we want it we should write in into level_


  Commit: 7e3b5c199aebe9618b2578ea7ca46033700baaba
      https://github.com/wesnoth/wesnoth/commit/7e3b5c199aebe9618b2578ea7ca46033700baaba
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/saved_game.cpp
    M src/saved_game.hpp

  Log Message:
  -----------
  add not_corrupt() function in saved_game class

and add comments about other functions.


  Commit: 92aa66680a7c3507ddcd0382f5da67fe4567adfc
      https://github.com/wesnoth/wesnoth/commit/92aa66680a7c3507ddcd0382f5da67fe4567adfc
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/multiplayer.cpp

  Log Message:
  -----------
  fix commandline mp start


  Commit: ea6c8d475ea38768e49ad915fa501a240eb58704
      https://github.com/wesnoth/wesnoth/commit/ea6c8d475ea38768e49ad915fa501a240eb58704
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/multiplayer_wait.cpp

  Log Message:
  -----------
  ignore allow_new_game for reloaded games

this fixes a bug when reloaded games  started immideately for joining
players.


  Commit: b00a05fb0007b6a20ee4da007831f856405c0d4b
      https://github.com/wesnoth/wesnoth/commit/b00a05fb0007b6a20ee4da007831f856405c0d4b
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/saved_game.cpp

  Log Message:
  -----------
  expand save_id default value eralier

Set this default value immideately after reading the scenario is
importent because otherwise we might endup settings this value to the
multiplayer players name, which would break carryover. (doing this in at
config loading in game_config would be ok too i think.)


  Commit: b5c0ec8a0a756313e5987315eaab771feca21d16
      https://github.com/wesnoth/wesnoth/commit/b5c0ec8a0a756313e5987315eaab771feca21d16
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/multiplayer_connect_engine.cpp

  Log Message:
  -----------
  fix mp reloading

having with network/network_ai together with force_lock_settings_ cause
assertion errors because update_controller_options won't add any
possible options.

this patch restores the previous behaviour where force_lock_settings_
was ignored for reloaded games.


  Commit: d9c6d18a63fad6027a26d1790d946c46ea82f740
      https://github.com/wesnoth/wesnoth/commit/d9c6d18a63fad6027a26d1790d946c46ea82f740
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/mp_game_utils.cpp
    M src/playcampaign.cpp
    M src/saved_game.cpp
    M src/saved_game.hpp

  Log Message:
  -----------
  fix [option]s/[events]s in [modification]s and [era]

this was broken by a commite earlier by me.

We now add them to teh scenario in saved_game.cpp and not in the mp
code. The reason is that we stil want them to work if a mp campaign game
was reloaded in sp.


  Commit: 836241442815a56225fa0a9ff74abdaf249ed602
      https://github.com/wesnoth/wesnoth/commit/836241442815a56225fa0a9ff74abdaf249ed602
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/mp_game_settings.cpp
    M src/mp_game_settings.hpp

  Log Message:
  -----------
  remove mp_game_settings::scenario_data

this is not used anore since we use saved_game::starting_pos now


  Commit: 976d9908044b46f8602af9db552d41deee760076
      https://github.com/wesnoth/wesnoth/commit/976d9908044b46f8602af9db552d41deee760076
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/mp_game_utils.cpp
    M src/playcampaign.cpp
    M src/saved_game.cpp
    M src/saved_game.hpp

  Log Message:
  -----------
  fix random map generation

this was previously broken because we passed a temporary pointer to
generate_map. While fixing this i moved it to saved_game.cpp

i also added a call to expand_random_scenario in mp_game_utils so that
in a mp campaign players advance to the next scenario which is randomly
generated. they have all the same scenario.


  Commit: fba6cb5f2d7e2406cc4266357bc88afe610b9985
      https://github.com/wesnoth/wesnoth/commit/fba6cb5f2d7e2406cc4266357bc88afe610b9985
  Author: gfgtdf <tischpapier at gmail.com>
  Date:   2014-06-15 (Sun, 15 Jun 2014)

  Changed paths:
    M src/carryover.cpp
    M src/carryover.hpp
    M src/game_board.cpp
    M src/game_controller.cpp
    M src/game_end_exceptions.hpp
    M src/gamestatus.cpp
    M src/mp_game_settings.cpp
    M src/mp_game_settings.hpp
    M src/mp_game_utils.cpp
    M src/mp_game_utils.hpp
    M src/multiplayer.cpp
    M src/multiplayer_configure.cpp
    M src/multiplayer_configure.hpp
    M src/multiplayer_connect.cpp
    M src/multiplayer_connect_engine.cpp
    M src/multiplayer_connect_engine.hpp
    M src/multiplayer_create.cpp
    M src/multiplayer_create_engine.cpp
    M src/multiplayer_create_engine.hpp
    M src/multiplayer_wait.cpp
    M src/multiplayer_wait.hpp
    M src/play_controller.cpp
    M src/playcampaign.cpp
    M src/playmp_controller.cpp
    M src/playsingle_controller.cpp
    M src/replay_controller.cpp
    M src/save_index.cpp
    M src/saved_game.cpp
    M src/saved_game.hpp
    M src/savegame.cpp
    M src/savegame.hpp
    M src/scripting/lua.cpp
    M src/server/game.cpp
    M src/server/game.hpp
    M src/server/server.cpp
    M src/tests/test_mp_connect.cpp

  Log Message:
  -----------
  Merge pull request #201 from gfgtdf/gamestate_refactor

change savefile format & wesnothd protocoll

The main intentions of this patch are:
1) To remove redundant information in savefiles
2) To fix mp/sp bugs: "modification [event]s wont be reaplied if one advances from a mp game (also if it was reloaded from sp that was reloaded in sp)"
3) To fix "start-of-scenario mp saves are broken"
4) Clear up playcampaign.cpp s code

This patch changes the wesnothd server protocoll causing incompability with oder version regarding networked mutiplayer. We now use the savefile fomat when sending new games to the server.

Also between some commits in this pr some mp related things will not work.


Compare: https://github.com/wesnoth/wesnoth/compare/9645fc466b5d...fba6cb5f2d7e


More information about the Commits mailing list