Project

General

Profile

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

Marko Lindqvist, 07/04/2025 11:44 PM

View differences:

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;
}
(1-1/2)