Follow-up Comment #3, bug #24226 (project wesnoth):
As best as I can tell, the game is picking up the multi-player (or log-in)
name from the preferences file from line 1049 onwards in
side_engine::new_config() of game_initialization/connect_engine.cpp
// Side's "current_player" is the player which is currently taken that side
// or the one which is reserved to it.
// "player_id" is the id of the client who controls that side,
// that always the host for Local players and AIs
// any always empty for free/reserved sides or null controlled sides.
// especially you can use !res["player_id"].empty() to check whether a side is
already taken.
assert(!preferences::login().empty());
if(controller_ == CNTR_LOCAL) {
res["player_id"] = preferences::login();
res["current_player"] = preferences::login();
} else if(controller_ == CNTR_RESERVED) {
res.remove_attribute("player_id");
res["current_player"] = reserved_for_;
} else if(controller_ == CNTR_COMPUTER) {
//TODO what is the content of player_id_ here ?
res["current_player"] = desc;
res["player_id"] = preferences::login();
} else if(!player_id_.empty()) {
res["player_id"] = player_id_;
res["current_player"] = player_id_;
}
I had a look a the history of this file but it doesn't look like this bit has
changed recently. I also tried looking at the stack trace when
preferences::login() is called but I don't know how all the pieces work
together. I can only guess that this multi-player 'connect' engine was re-used
for single-player, but something is not working as intended for the
player_id/current_player fields.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?24226>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs