fix for bug #21758
fixup party full bell
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/master/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.
insert debugging output
fixup debugging output
fixup controller tweak
fixup debugging output
fixup debugging output
squash with 18829 fix
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.
don't show network_ai controllers in :give_control dialog
fixup mp connect engine
fixup mp connect engine
add debugging output to server
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);