Project

General

Profile

Bug #1562 » 0025-Accept-PACKET_SYNC_SERIAL-from-non-player-connection.patch

Marko Lindqvist, 07/05/2025 12:06 AM

View differences:

fc_version
# - No new mandatory capabilities can be added to the release branch; doing
# so would break network capability of supposedly "compatible" releases.
#
NETWORK_CAPSTRING="+Freeciv-3.2-network ownernull16"
NETWORK_CAPSTRING="+Freeciv-3.2-network ownernull16 unignoresync"
FREECIV_DISTRIBUTOR=""
if test "x$FREECIV_LABEL_FORCE" != "x" ; then
server/srv_main.c
{
struct player *pplayer;
/* a NULL packet can be returned from receive_packet_goto_route() */
/* A NULL packet can be returned from receive_packet_goto_route() */
if (!packet) {
return TRUE;
}
......
return TRUE;
}
/* valid packets from established connections but non-players */
/* Valid packets from established connections but non-players */
if (type == PACKET_CHAT_MSG_REQ
|| type == PACKET_SINGLE_WANT_HACK_REQ
|| type == PACKET_NATION_SELECT_REQ
......
|| type == PACKET_CONN_PONG
|| type == PACKET_CLIENT_HEARTBEAT
|| type == PACKET_SAVE_SCENARIO
|| type == PACKET_SYNC_SERIAL
|| is_client_edit_packet(type)) {
/* Except for PACKET_EDIT_MODE (used to set edit mode), check
......
handle_observer_ready(pconn);
return TRUE;
}
/* don't support these yet */
/* Don't support these yet */
log_error("Received packet %s(%d) from non-player connection %s.",
packet_name(type), type, conn_description(pconn));
return TRUE;
......
&& type != PACKET_NATION_SELECT_REQ
&& type != PACKET_PLAYER_READY
&& type != PACKET_VOTE_SUBMIT
&& type != PACKET_RULESET_SELECT
&& type != PACKET_SYNC_SERIAL) {
&& type != PACKET_RULESET_SELECT) {
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(). */
......
}
pplayer->current_conn = NULL;
return TRUE;
}
(2-2/2)