[domistream] ENet: take VERIFY_CONNECT's session ids as stock ENet does (incoming = verify.incoming)

The client stored them the other way round (out_session from verify.incoming_session_id). Against a fresh stock slot both are 0, so it never showed; after a reconnect stock ENet answers with two different ids and the client would send with the host's outgoing id and drop every host datagram. Found by the ENet host engineer; facts from stock ENet v1.3.18 as logged in S-17/S-34 (PROTOCOL.md 3.1), no new source read.
This commit is contained in:
2026-12-04 12:56:44 +01:00
parent 3dd7a8fe94
commit fa08511804
+4 -2
View File
@@ -333,8 +333,10 @@ impl EnetClient {
} }
if self.state == EnetState::Connecting && p.connect_id == self.connect_id { if self.state == EnetState::Connecting && p.connect_id == self.connect_id {
self.host_peer_id = p.outgoing_peer_id & protocol::MAX_PEER_ID; self.host_peer_id = p.outgoing_peer_id & protocol::MAX_PEER_ID;
self.out_session = p.incoming_session_id & 0x3; // Both ids are given from the client's point of view (PROTOCOL.md 3.1 [E]): the incoming one is
self.in_session = p.outgoing_session_id & 0x3; // what the host sends with, the outgoing one what we send with.
self.in_session = p.incoming_session_id & 0x3;
self.out_session = p.outgoing_session_id & 0x3;
let count = u8::try_from(p.channel_count.clamp(1, 255)).unwrap_or(1); let count = u8::try_from(p.channel_count.clamp(1, 255)).unwrap_or(1);
self.channel_count = self.channel_count.min(count); self.channel_count = self.channel_count.min(count);
let mtu = usize::try_from(p.mtu).unwrap_or(MAX_DATAGRAM_BYTES); let mtu = usize::try_from(p.mtu).unwrap_or(MAX_DATAGRAM_BYTES);