Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2003:
[Freeciv-Dev] (PR#6999) possible send_all_known_cities/send_city_info_at
Home

[Freeciv-Dev] (PR#6999) possible send_all_known_cities/send_city_info_at

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#6999) possible send_all_known_cities/send_city_info_at_tile bug
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 7 Dec 2003 23:32:03 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6999 >

> [jdorje - Mon Dec 08 07:22:10 2003]:
> 
> > [kauf - Mon Dec 01 01:09:35 2003]:
> 
> > whoa, it is very possible to have non-player connections in CVS.
> Anyone who
> > logs in at pregame is a non-player connection and anyone who logs in
> during
> > a game whose username isn't one of game.players[i].username is also a
> > non-player connection.
> 
> However, these players cannot see any tiles and so shouldn't be
> triggering this bug.

OK, this is in 1.14.1-beta2, so things are different in HEAD...

This bug is triggered when send_city_info_at_tile is given a NULL
player.  send_all_known_cities will only do this when there is an
observer with no attached player.  I thought this was impossible, but
evidently not.

  conn_list_iterate(*dest, pconn) {
    struct player *pplayer = pconn->player;
    if (!pplayer && !pconn->observer) {
      continue;
    }
    whole_map_iterate(x, y) {
      if (!pplayer || map_get_player_tile(x, y, pplayer)->city) {
        send_city_info_at_tile(pplayer, &pconn->self, NULL, x, y);
      }
    } whole_map_iterate_end;
  } conn_list_iterate_end;

obviously send_all_known_cities expects that sometimes observers will
exist and not be attached to any player.  Maybe we should rewrite
send_city_info_at_tile to conform to this?

Alternately it's easy to change the 'continue' check.

jason



[Prev in Thread] Current Thread [Next in Thread]