? tileageing.diff Index: client/packhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v retrieving revision 1.150 diff -u -r1.150 packhand.c --- packhand.c 2000/08/27 06:57:21 1.150 +++ packhand.c 2000/08/30 21:29:56 @@ -1334,6 +1334,7 @@ ptile->special = packet->special; } ptile->known = packet->known; + ptile->last_updated = packet->last_updated; /* fog of war remove units */ if (ptile->known <= TILE_KNOWN_FOGGED && old_known == TILE_KNOWN) { Index: client/gui-gtk/mapctrl.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapctrl.c,v retrieving revision 1.36 diff -u -r1.36 mapctrl.c --- mapctrl.c 2000/07/30 13:35:06 1.36 +++ mapctrl.c 2000/08/30 21:29:58 @@ -117,6 +117,15 @@ p=gtk_window_new(GTK_WINDOW_POPUP); b=gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(p), b); + if (ptile->known == TILE_KNOWN_FOGGED && (ptile->last_updated >= GAME_START_YEAR)) { + my_snprintf(s, sizeof(s), _("Last Surveyed: %s"), + textyear(ptile->last_updated)); + gtk_widget_new(GTK_TYPE_LABEL, "GtkWidget::parent", b, + "GtkLabel::label", s, + NULL); + count++; + } + my_snprintf(s, sizeof(s), _("Terrain: %s"), map_get_tile_info_text(xtile, ytile)); gtk_widget_new(GTK_TYPE_LABEL, "GtkWidget::parent", b, Index: client/gui-xaw/mapctrl.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapctrl.c,v retrieving revision 1.35 diff -u -r1.35 mapctrl.c --- mapctrl.c 2000/07/30 13:35:06 1.35 +++ mapctrl.c 2000/08/30 21:29:59 @@ -127,6 +127,12 @@ if(ptile->known>=TILE_KNOWN_FOGGED) { Widget p=XtCreatePopupShell("popupinfo", simpleMenuWidgetClass, map_canvas, NULL, 0); + if (ptile->known == TILE_KNOWN_FOGGED && (ptile->last_updated >= GAME_START_YEAR)) { + my_snprintf(s, sizeof(s), _("Last Surveyed: %s"), + textyear(ptile->last_updated)); + XtCreateManagedWidget(s, smeBSBObjectClass, p, NULL, 0); + } + my_snprintf(s, sizeof(s), _("Terrain: %s"), map_get_tile_info_text(xtile, ytile)); XtCreateManagedWidget(s, smeBSBObjectClass, p, NULL, 0); Index: common/capstr.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/capstr.c,v retrieving revision 1.71 diff -u -r1.71 capstr.c --- capstr.c 2000/08/27 06:57:22 1.71 +++ capstr.c 2000/08/30 21:30:00 @@ -72,7 +72,8 @@ #define CAPABILITY "+1.11 diplomat_investigate_fix production_change_fix" \ " game_ruleset nuclear_fallout land_channel_requirement event_wonder_obsolete" \ -" event00_fix conn_info gen_impr_oversights diplo_move_city packet_short_city" +" event00_fix conn_info gen_impr_oversights diplo_move_city packet_short_city" \ +" tile_ageing" /* "+1.11" is protocol for 1.11.0 stable release. @@ -113,6 +114,9 @@ "packet_short_city" is smaller packet often sent instead of packet_city_info. + + "tile_ageing" allows the client to know how old it's information + on a tile is, so it can present this to the user. */ void init_our_capability(void) Index: common/map.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/map.h,v retrieving revision 1.65 diff -u -r1.65 map.h --- map.h 2000/08/21 17:54:07 1.65 +++ map.h 2000/08/30 21:30:02 @@ -37,6 +37,7 @@ unsigned int sent; /* Indicates if the client know the tile as TILE_KNOWN_NODRAW. A bitvector like known. Not used on the client side. */ + int last_updated; /* used on client side to keep track of tileinfo age */ int assigned; /* these can save a lot of CPU usage -- Syela */ struct city *worked; /* city working tile, or NULL if none */ signed short continent; Index: common/packets.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/packets.c,v retrieving revision 1.136 diff -u -r1.136 packets.c --- packets.c 2000/08/27 06:57:22 1.136 +++ packets.c 2000/08/30 21:30:09 @@ -1929,7 +1929,11 @@ iget_uint8(&iter, &packet->type); iget_uint16(&iter, &packet->special); iget_uint8(&iter, &packet->known); - + if (has_capability("tile_ageing", pc->capability)) { + iget_sint16(&iter, &packet->last_updated); + } else { + packet->last_updated = GAME_START_YEAR - 1; + } pack_iter_end(&iter, pc); remove_packet_from_buffer(pc->buffer); return packet; @@ -1976,6 +1980,9 @@ cptr=put_uint16(cptr, pinfo->special); } cptr=put_uint8(cptr, pinfo->known); + if (has_capability("tile_ageing", pc->capability)) { + cptr=put_sint16(cptr, pinfo->last_updated); + } put_uint16(buffer, cptr-buffer); return send_connection_data(pc, buffer, cptr-buffer); Index: common/packets.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/packets.h,v retrieving revision 1.78 diff -u -r1.78 packets.h --- packets.h 2000/08/27 06:57:23 1.78 +++ packets.h 2000/08/30 21:30:11 @@ -249,7 +249,7 @@ tile info *********************************************************/ struct packet_tile_info { - int x, y, type, special, known; + int x, y, type, special, known, last_updated; }; Index: server/maphand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/maphand.c,v retrieving revision 1.61 diff -u -r1.61 maphand.c --- maphand.c 2000/08/25 20:15:29 1.61 +++ maphand.c 2000/08/30 21:30:15 @@ -281,6 +281,7 @@ info.known = TILE_KNOWN; info.type = ptile->terrain; info.special = ptile->special; + info.last_updated = game.year; if (pplayer) { update_tile_knowledge(pplayer,x,y); } @@ -314,6 +315,7 @@ info.known=TILE_KNOWN; info.type = ptile->terrain; info.special = ptile->special; + info.last_updated = game.year; } else if (map_get_known(x, y, pplayer)) { if (map_get_seen(x, y, pplayer->player_no)) { /* known and seen */ @@ -325,10 +327,12 @@ plrtile = map_get_player_tile(x, y, pplayer->player_no); info.type = plrtile->terrain; info.special = plrtile->special; + info.last_updated = plrtile->last_updated; } else { /* unknown (the client needs these sometimes to draw correctly) */ info.known = TILE_UNKNOWN; info.type = ptile->terrain; info.special = ptile->special; + info.last_updated = GAME_START_YEAR - 1; } lsend_packet_tile_info(dest, &info); }