[Commits] [wesnoth/wesnoth] 2ef633: fix bug #21758

GitHub noreply at github.com
Tue Mar 18 00:44:57 UTC 2014


  Branch: refs/heads/1.12
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 2ef633204fa1bc564c366f8de7f99814a9dfed6d
      https://github.com/wesnoth/wesnoth/commit/2ef633204fa1bc564c366f8de7f99814a9dfed6d
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-03-17 (Mon, 17 Mar 2014)

  Changed paths:
    M changelog
    M src/flg_manager.cpp
    M src/flg_manager.hpp
    M src/multiplayer_connect_engine.cpp
    M src/multiplayer_connect_engine.hpp
    M src/team.cpp
    M src/team.hpp

  Log Message:
  -----------
  fix bug #21758

in the refactor of mp_connect, one behavior from 1.10 that was
lost was that the host may not start a game until all sides have
chosen faction. we restore this, adding fields to the side engine
to fix in a robust manner, some debugging capabilities left over.

Conflicts:
	changelog


  Commit: 72632ff03b3c2698a3f4883e752cacb53ed47dfe
      https://github.com/wesnoth/wesnoth/commit/72632ff03b3c2698a3f4883e752cacb53ed47dfe
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-03-17 (Mon, 17 Mar 2014)

  Changed paths:
    M src/multiplayer_connect.cpp
    M src/multiplayer_connect_engine.cpp

  Log Message:
  -----------
  fixup party full bell

after fix of bug #21578, the behavior from 1.10, in which game may not
start until all sides have chosen factions as needed, was restored.
we move the party full bell appropriately.


  Commit: b1892c3bf4af685523791b4cb4f96d443166f912
      https://github.com/wesnoth/wesnoth/commit/b1892c3bf4af685523791b4cb4f96d443166f912
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-03-17 (Mon, 17 Mar 2014)

  Changed paths:
    M src/playturn.cpp

  Log Message:
  -----------
  recognize server messages to set a side to idle


  Commit: a0008233f52079346457a90f89384e918fbbf9f7
      https://github.com/wesnoth/wesnoth/commit/a0008233f52079346457a90f89384e918fbbf9f7
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-03-17 (Mon, 17 Mar 2014)

  Changed paths:
    M changelog
    M src/multiplayer.cpp
    M src/playcampaign.cpp
    M src/playcampaign.hpp
    M src/playturn.cpp
    M src/server/game.cpp

  Log Message:
  -----------
  fix bug #18829

it turns out that when the "network_ai" controller type was introduced,
it was implemented on the server in the following way:

https://github.com/wesnoth/wesnoth/blob/a4f47a63c7b2c55fd7d8d3cd425ede256b39acdd/src/server/game.cpp#L464

change_controller requests to the type "ai" are always transformed
by the server into either "human_ai" for host or "network_ai" for client,
and in thunderstruck's refactor of the mp_connect dialogs, ai sides are
always set to "ai" in the WML sent to the server (and set this way on
the host).

however, because of code in play_campaign.cpp which long predated this
refactor, all sides on an mp client are either set to human (if that
player controls them) or "network", or "null".

this causes problems because if that player saves the game, the savegame
will record these sides at human controlled rather than ai controlled...
if the game is reloaded oos can occur, although I won't detail it here.

we update the play_campaign.cpp code to ensure that "ai" controller types
always resolve to human_ai or network_ai as appropriate. additionally,
we make sure that on the host, sides always resolve to human_ai rather
than ai. so the type "ai" should never be observed during an mp game,
and only during scenario configuration, and perhaps during replays.

additionally, we ensure in playturn.cpp that if the client gets a message
from the server to set a side to "ai" during the game, it will in fact
set it to "human_ai" or "network_ai", to preserve the invariant.

finally we also switch over observers to follow this behavior --
previously there was a hack here in the server which would make sure
that any observers which join see all sides as controlled by "human"

https://github.com/wesnoth/wesnoth/blob/a4f47a63c7b2c55fd7d8d3cd425ede256b39acdd/src/server/game.cpp#L197

in order that they do not attempt to substitute themselves for a player.

we change this by removing the hack, and programming the client to remember
if the player is an observer, and if so not attempting to substitute themself
at game start.


  Commit: c7a4e637d6fbb7ff8eaa2e5810c7308300fe466c
      https://github.com/wesnoth/wesnoth/commit/c7a4e637d6fbb7ff8eaa2e5810c7308300fe466c
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-03-17 (Mon, 17 Mar 2014)

  Changed paths:
    M src/playturn.cpp

  Log Message:
  -----------
  don't display network_ai sides as replacements for dropped sides

after 18829 fix, don't display "network_ai" sides as possible
controllers for a dropped side, as all ai sides now have this value.


  Commit: d49276937ce4a8771f4f673aaca9e53587158394
      https://github.com/wesnoth/wesnoth/commit/d49276937ce4a8771f4f673aaca9e53587158394
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-03-17 (Mon, 17 Mar 2014)

  Changed paths:
    M src/gui/dialogs/mp_change_control.cpp

  Log Message:
  -----------
  don't show network_ai controllers in :give_control dialog


  Commit: a43264ab0d11af491a47c64c5b1cc35d91073343
      https://github.com/wesnoth/wesnoth/commit/a43264ab0d11af491a47c64c5b1cc35d91073343
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-03-17 (Mon, 17 Mar 2014)

  Changed paths:
    M src/server/server.cpp

  Log Message:
  -----------
  add debugging output to server


  Commit: 7cba29a438de39ca9921d881d2e0f35c61acfb6c
      https://github.com/wesnoth/wesnoth/commit/7cba29a438de39ca9921d881d2e0f35c61acfb6c
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-03-17 (Mon, 17 Mar 2014)

  Changed paths:
    M src/game_display.cpp

  Log Message:
  -----------
  implement "last 5 chats" notification properly

(fixup 6d460b98271312f806fadfa037b7ea082e862a24)

proper code to find 5'th \n is:

		int endl_pos = -1;
		for (int ctr = 0; ctr < 5; ctr++)
			endl_pos = i->message.find('\n', endl_pos+1);

and not

		int endl_pos = 0;
		for (int ctr = 0; ctr < 5; ctr++)
			endl_pos = i->message.find('\n', endl_pos);


Compare: https://github.com/wesnoth/wesnoth/compare/f6d38a75c6e8...7cba29a438de


More information about the Commits mailing list