Project

General

Profile

Feature #976 ยป 0038-Protocol-Add-sync-serial-packets.patch

Marko Lindqvist, 10/18/2024 06:48 PM

View differences:

client/options.c
* of non-initialized datas when calling the changed callback. */
static bool options_fully_initialized = FALSE;
static int sync_serial = 0;
static const struct strvec *get_mapimg_format_list(const struct option *poption);
/****************************************************************************
......
* Do now override settings that are already saved to savegame \
* and now loaded. */ \
desired_settable_option_send(OPTION(poption)); \
dsend_packet_sync_serial(&client.conn, ++sync_serial); \
psoption->desired_sent = TRUE; \
} \
\
......
if (!settable_options_hash_lookup(settable_options_hash,
option_name(poption), &desired)) {
/* No change explicitly desired. */
/* No change explicitly desired. */
return;
}
......
if (psoption->is_visible
&& psoption->is_changeable) {
desired_settable_option_send(OPTION(poption));
dsend_packet_sync_serial(&client.conn, ++sync_serial);
}
}
}
client/packhand.c
city_report_dialog_update_city(pcity);
}
/**********************************************************************//**
Handle servers's reply to request to sync via packet serial number
**************************************************************************/
void handle_sync_serial_reply(int serial)
{
}
common/networking/packets.def
Max used id:
============
Max id: 516
Max id: 518
Packets are not ordered by their id, but by their category. New packet
with higher id may get added to existing category, and not to the end of file.
......
STRING tag[MAX_LEN_NAME];
end
/************** Sync Requests **********************/
PACKET_SYNC_SERIAL = 517; cs, handle-via-fields, handle-per-conn, dsend
UINT32 serial;
end
PACKET_SYNC_SERIAL_REPLY = 518; sc, handle-via-fields, dsend
UINT32 serial;
end
/*************** Webclient specific packets ****************/
/* Use range 256:511 for these */
server/connecthand.c
connection_delegate_restore(pconn);
connection_close(pconn, reason);
}
/**********************************************************************//**
Handle client's request to sync via packet serial number.
**************************************************************************/
void handle_sync_serial(struct connection *conn, int serial)
{
dsend_packet_sync_serial_reply(conn, serial);
}
server/srv_main.c
&& type != PACKET_NATION_SELECT_REQ
&& type != PACKET_PLAYER_READY
&& type != PACKET_VOTE_SUBMIT
&& type != PACKET_RULESET_SELECT) {
&& type != PACKET_RULESET_SELECT
&& type != PACKET_SYNC_SERIAL) {
if (S_S_OVER == server_state()) {
/* This can happen by accident, so we don't want to print
* out lots of error messages. Ie, we use log_debug(). */
    (1-1/1)