Project

General

Profile

Bug #2131 ยป 0069-Send-access-area-info-to-client-connecting-midturn.patch

Marko Lindqvist, 09/14/2026 10:17 PM

View differences:

server/aahand.c
unit_virtual_destroy(access_unit);
}
}
/*********************************************************************//**
Just send existing access area info.
@param pconn Connection to send the information for and to
*************************************************************************/
void send_access_area_info(struct connection *pconn)
{
if (pconn->playing != nullptr
&& access_info_access_unit() != nullptr) {
struct aarea_list *alist = area_list_for_player(pconn->playing);
struct packet_access_area aarea_packet;
aarea_packet.player = player_number(pconn->playing);
aarea_list_iterate(alist, aarea) {
BV_CLR_ALL(aarea_packet.tiledefs);
tiledef_iterate(td) {
int tn = tiledef_number(td);
if (BV_ISSET(aarea->tiledefs, tn)) {
BV_SET(aarea_packet.tiledefs, tn);
}
} tiledef_iterate_end;
aarea_packet.index = aarea->index;
aarea_packet.capital = aarea->capital;
send_packet_access_area(pconn, &aarea_packet);
} aarea_list_iterate_end;
city_list_iterate(pconn->playing->cities, pcity) {
struct packet_city_access_area caarea_packet;
caarea_packet.city = pcity->id;
caarea_packet.aarea = pcity->aarea->index;
send_packet_city_access_area(pconn, &caarea_packet);
} city_list_iterate_end;
}
}
server/aahand.h
#define FC__AAHAND_H
void access_areas_refresh(struct civ_map *nmap, struct player *plr);
void send_access_area_info(struct connection *pconn);
#endif /* FC__AAHAND_H */
server/connecthand.c
#include "version.h"
/* server */
#include "aahand.h"
#include "aiiface.h"
#include "auth.h"
#include "diplhand.h"
......
freeciv_name_version(), srvarg.port);
}
/* FIXME: this (getting messages about others logging on) should be
/* FIXME: This (getting messages about others logging on) should be
* a message option for the client with event */
/* Notify the console that you're here. */
......
send_conn_info(pconn->self, game.est_connections); /* Client side. */
conn_reset_delta_state(pconn); /* Server side. */
/* Initial packets don't need to be resent. See comment for
/* Initial packets don't need to be resent. See comment for
* connecthand.c::establish_new_connection(). */
switch (server_state()) {
case S_S_INITIAL:
......
send_diplomatic_meetings(pconn);
send_pending_events(pconn, connecting);
send_running_votes(pconn, !connecting);
send_access_area_info(pconn);
break;
case S_S_OVER:
    (1-1/1)