URL:
  <http://gna.org/bugs/?14889>

                 Summary: The Slovenians have started building The
Lighthouse(w) in 000156.
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Saturday 05/12/09 at 22:56
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any
        Operating System: None
         Planned Release: None

    _______________________________________________________

Details:

A couple of times recently I've been greeted by wonders messages in the
Messages window like:

"The Slovenians have started building The Lighthouse(w) in 000156."

It looks like this is a city I don't yet know about.

I think this is an interaction between featured text and some client-side
placeholder city structure. I don't know what the right fix is.

The message comes from ai_city_choose_build(), which calls city_link() to add
featured text markup including the ID (156) and the name (looking at
savefiles, this will be "Nova Gorica").

I think the client interprets this through featured_text_to_plain_text(),
which calls text_tag_replace_text() on the link. That function tries to look
up the city name by ID in the client's notion of what cities it knows about,
and falls back to the name in the featured text ("Nova Gorica") if the city
is completely unknown.

However, it looks like the client invents placeholder cities with names of
the form %06u if it sees a tile worked by a city ID it doesn't know about. I
think this is where "000156" must have come from -- looking at the savename,
this city is close enough to land I've seen that I could plausibly have seen
a tile it works. The existence of this placeholder prevents the client
falling back to the server-supplied name, which would give a better result.

As I say, I don't know what the right fix is. The symptom could be made to go
away by having text_tag_replace_text() not attempt to look up the city -- the
server always provides the name in the featured text anyway. However, I guess
this might interact sub-optimally with renamed cities, and it feels like it's
papering over the problem -- if the client makes the link clickable, where's
it going to go if the client's placeholder city doesn't include its
location?

I think there's a theoretical (minor) information leak here -- city IDs leak
to the client through tile worked info, and the ID-to-name mapping leaks
through the wonder featured text; a clever client could put this information
together to get an approximate idea where the city with the wonder is (and
the player could focus their efforts there), which seems wrong -- from
hearing about a wonder, we should only discover the name of the city, I
think.

I suppose the server could censor featured text on a per-player basis just
before sending it, perhaps in send_packet_chat_msg().

This is with S2_2 r16461. Attached a screenshot, and the two savegames
bracketing the event. I haven't had any luck reproducing it from the
savegames, I think at least partly because the AI's behaviour wrt wonders
changes over save/load, bug #13557.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Saturday 05/12/09 at 22:56  Name: canadians-T103-Y60AD.sav.bz2  Size:
33kB   By: jtn
Numeric city name reports, S2_2 r16461
<http://gna.org/bugs/download.php?file_id=7449>
-------------------------------------------------------
Date: Saturday 05/12/09 at 22:56  Name: canadians-T104-Y80AD.sav.bz2  Size:
33kB   By: jtn
Numeric city name reports, S2_2 r16461
<http://gna.org/bugs/download.php?file_id=7450>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?14889>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to