[Commits] [wesnoth/wesnoth] 5ffd7a: fix currently active side quits during action

GitHub noreply at github.com
Fri Apr 11 21:53:28 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 5ffd7aebfd36dc89c3a419c9679b2337b9810e27
      https://github.com/wesnoth/wesnoth/commit/5ffd7aebfd36dc89c3a419c9679b2337b9810e27
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-04-09 (Wed, 09 Apr 2014)

  Changed paths:
    M src/playmp_controller.cpp
    M src/playturn.cpp
    M src/playturn.hpp

  Log Message:
  -----------
  fix currently active side quits during action

this fixes a bug, that when we receive a player leave/controller change
during sync_network  called during an action the turn isn't restarted.


  Commit: a8dc92f5d67690a1837e4e1008bc19c0af1d26f4
      https://github.com/wesnoth/wesnoth/commit/a8dc92f5d67690a1837e4e1008bc19c0af1d26f4
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-04-09 (Wed, 09 Apr 2014)

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

  Log Message:
  -----------
  use events::command_disabler in synced context

During the synced context we are in a state 'during an execution of an
event/action' that the savefile format cannot cover. So we use
command_disabler to prevent saving.


  Commit: 6ce4e441a2db96950b39b9263149fb4e0e755fa3
      https://github.com/wesnoth/wesnoth/commit/6ce4e441a2db96950b39b9263149fb4e0e755fa3
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-04-09 (Wed, 09 Apr 2014)

  Changed paths:
    M src/replay.cpp
    M src/replay.hpp
    M src/synced_context.cpp

  Log Message:
  -----------
  removed unused 'do_until' argument

we don't need this parameter anymore because we have the "dependent" key
in commands.


  Commit: 22d17ba4ddd90266772d87a444de0c8b5e4a0e5a
      https://github.com/wesnoth/wesnoth/commit/22d17ba4ddd90266772d87a444de0c8b5e4a0e5a
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-04-09 (Wed, 09 Apr 2014)

  Changed paths:
    M src/playmp_controller.cpp
    M src/playturn.cpp
    M src/playturn.hpp

  Log Message:
  -----------
  remove unused argument


  Commit: d1cd2e0b171c72b59a9eb1bcb00b91a3ec175e22
      https://github.com/wesnoth/wesnoth/commit/d1cd2e0b171c72b59a9eb1bcb00b91a3ec175e22
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-04-09 (Wed, 09 Apr 2014)

  Changed paths:
    M src/playmp_controller.cpp
    M src/playsingle_controller.cpp
    M src/playturn.cpp
    M src/replay.cpp
    M src/replay.hpp
    M src/replay_controller.cpp

  Log Message:
  -----------
  give do_replays return a better name

I forgot what my real intention with this change was, but i still think this is a good change, becasue now people don't have to look up the comments to see what do_replay returns.
So i committed it.


  Commit: 847067dac72231f954072bb55ba14b219c8fed9f
      https://github.com/wesnoth/wesnoth/commit/847067dac72231f954072bb55ba14b219c8fed9f
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-04-11 (Fri, 11 Apr 2014)

  Changed paths:
    M src/CMakeLists.txt
    M src/SConscript
    M src/playmp_controller.cpp
    M src/playsingle_controller.cpp
    M src/playsingle_controller.hpp
    M src/playturn.cpp
    M src/playturn.hpp
    A src/playturn_network_adapter.cpp
    A src/playturn_network_adapter.hpp

  Log Message:
  -----------
  fix bug chat during action

when a player chats while multiple actions from another player are
executed on the local machine we before got an assertion error becasue
replay s add_command expects that there are no other commands yet to be
processed on the replay.
(this was broken at da4cdef146bf5a1b8026f12d6b1caa6c1cd20602)
we now fix this problem by ensuring that there is never more data on the
replay than needed.

for this purpose i wrote that playturn_network_adapter.cpp whose main
purpose it to split incoming [turn]s into smaller [turn]s
we also don't need the backlog anymore because now with playturn_network_adapter we only feed process_network_data with small data pieces that can always be handled at once.

I also removed the replay_ member of turn_info.
Before, we read actions from replay_srouce and wrote actions to recorder.
And after the actions in replay_source has been executed they had been pushed into recorder.
With get_user_choice this doesn't work, because we might end up pushing the 'answer' (the user choice) of a get_user_choice in the recorder while the 'question' (the invoking user action) was in replay_source and then would be pushed onto the recorder after the 'answer', leading to a wrong order in the recorder. This could maybe also have been fixed by always pushing user choices into replay_source, and syncing the replay_source somehow after we enter a user choice, but the way it was done in this commit seemed easier.

note that replay_ and backlog were already made unused in da4cdef146bf5a1b8026f12d6b1caa6c1cd20602 (that was a rather uncomplete commit)
We maybe (i didnt test, just a guess) could also fix this bug by using add_nonundoable_command instead of add_command for nonundoable commands in replay.cpp with add_nonundoable_command  defined as:
config& add_nonundoable_command()
{
	auto c = cfg_.add_child_at("command",config(), pos_);
	pos_++;
	return c;
}
One reason why i decided against it is, that i feared add_child_at to be slow (vector::insert) if there are a lot of entries in cfg_ (for example when we join game that has already run may turns).
With the playturn_network_adapter this shouldn't be an issue anymore, but it also isnt needed anymore.


  Commit: e1a5bb89dc934cc0cb81a4c7d3ac7bd051ccc40e
      https://github.com/wesnoth/wesnoth/commit/e1a5bb89dc934cc0cb81a4c7d3ac7bd051ccc40e
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-04-11 (Fri, 11 Apr 2014)

  Changed paths:
    M src/replay.cpp

  Log Message:
  -----------
  disable get_user_choice during prestart events

get_user_choice usually shows a dialog to the user. Because we shouldn't
use the screen during prestart events i disabled it there.

this commit might contain spelling corrections.


  Commit: c9552c9a33a16a57123ce1beaf087f5a997f9857
      https://github.com/wesnoth/wesnoth/commit/c9552c9a33a16a57123ce1beaf087f5a997f9857
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-04-11 (Fri, 11 Apr 2014)

  Changed paths:
    M src/persist_var.cpp
    M src/replay.cpp
    M src/replay.hpp
    M src/scripting/lua.cpp

  Log Message:
  -----------
  allow user_choice in prestart for invisible choices


  Commit: 4765b33f58947da9b35ac6dd4cb853892679979f
      https://github.com/wesnoth/wesnoth/commit/4765b33f58947da9b35ac6dd4cb853892679979f
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-04-11 (Fri, 11 Apr 2014)

  Changed paths:
    M src/actions/attack.cpp
    M src/game_events/action_wml.cpp
    M src/persist_var.cpp
    M src/replay.cpp
    M src/replay.hpp
    M src/scripting/lua.cpp
    M src/synced_context.cpp
    M src/synced_context.hpp

  Log Message:
  -----------
  add side parameter in sync_choice

when we call sync_choice with a third argument there was no way to
determine for which side we actualy made the decision.


  Commit: 9017fe82da6b62b40f6839764b023160252e0496
      https://github.com/wesnoth/wesnoth/commit/9017fe82da6b62b40f6839764b023160252e0496
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-04-11 (Fri, 11 Apr 2014)

  Changed paths:
    M src/replay_controller.cpp

  Log Message:
  -----------
  fix 21905

we have one events_disabler when starting the replay_controller and a
second when entering the synced context. Thats why we have
events::commands_disabled == 1 and >1 when we are executing an action.


  Commit: f6fbfb6879c2b9d52ce00bcf1b8d1d0a58817510
      https://github.com/wesnoth/wesnoth/commit/f6fbfb6879c2b9d52ce00bcf1b8d1d0a58817510
  Author: gfgtdf <tischpapier at gmail.com>
  Date:   2014-04-11 (Fri, 11 Apr 2014)

  Changed paths:
    M src/CMakeLists.txt
    M src/SConscript
    M src/actions/attack.cpp
    M src/game_events/action_wml.cpp
    M src/persist_var.cpp
    M src/playmp_controller.cpp
    M src/playsingle_controller.cpp
    M src/playsingle_controller.hpp
    M src/playturn.cpp
    M src/playturn.hpp
    A src/playturn_network_adapter.cpp
    A src/playturn_network_adapter.hpp
    M src/replay.cpp
    M src/replay.hpp
    M src/replay_controller.cpp
    M src/scripting/lua.cpp
    M src/synced_context.cpp
    M src/synced_context.hpp

  Log Message:
  -----------
  Merge pull request #141 from gfgtdf/sync_fix

fixes bugs intrduced in pr 121 and more


Compare: https://github.com/wesnoth/wesnoth/compare/70322185d457...f6fbfb6879c2


More information about the Commits mailing list