[Net] ENet non-relaying server now process broadcasts.
Setting `server_relay = false` prevents the server from letting clients
communicate with each other, but without this fix, the server would also
ignore broadcast packets.
With this change, the server still does not relay messages to other
clients, but will correctly process broadcast messages (and "exclusive"
messages) as if they were directed to just the server.
(cherry picked from commit fc255bde29
)
This commit is contained in:
parent
37fdd656c0
commit
e05a7a4a4b
1 changed files with 4 additions and 1 deletions
|
@ -369,7 +369,10 @@ void NetworkedMultiplayerENet::poll() {
|
||||||
// To myself and only myself
|
// To myself and only myself
|
||||||
incoming_packets.push_back(packet);
|
incoming_packets.push_back(packet);
|
||||||
} else if (!server_relay) {
|
} else if (!server_relay) {
|
||||||
// No other destination is allowed when server is not relaying
|
// When relaying is disabled, other destinations will only be processed by the server.
|
||||||
|
if (target == 0 || target < -1) {
|
||||||
|
incoming_packets.push_back(packet);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
} else if (target == 0) {
|
} else if (target == 0) {
|
||||||
// Re-send to everyone but sender :|
|
// Re-send to everyone but sender :|
|
||||||
|
|
Loading…
Reference in a new issue