docs: sync control protocol transfer flow and infra public relay port range; fix coord and relay test suites

This commit is contained in:
Дмитрий committed 2026-10-09 14:45:56 +05:00
1 parent 65ace578f7
commit ad39bd2020
6 files changed
+41 -30

No files matched your search

+1 -1
View File
@@ -356,7 +356,7 @@ dependencies = [
[[package]]
name = "coa-core"
version = "0.6.6"
version = "0.6.7"
dependencies = [
"base64 0.22.1",
"chrono",
+2 -2
View File
@@ -108,8 +108,8 @@ fn routes_both_ways_by_connection_number_and_never_interprets() {
let mut h = host(&s, realm, &hk);
let mut p1 = player(&s, realm, &key(10));
let mut p2 = player(&s, realm, &key(11));
let Frame::Open { conn: c1 } = text(&mut h) else { panic!("open 1") };
let Frame::Open { conn: c2 } = text(&mut h) else { panic!("open 2") };
let Frame::Open { conn: c1, .. } = text(&mut h) else { panic!("open 1") };
let Frame::Open { conn: c2, .. } = text(&mut h) else { panic!("open 2") };
assert_ne!(c1, c2);
assert!(matches!(text(&mut p1), Frame::PlayerReady { conn, .. } if conn == c1));
assert!(matches!(text(&mut p2), Frame::PlayerReady { conn, .. } if conn == c2));
+4 -4
View File
@@ -179,12 +179,12 @@ async fn test_relay_host_auth_and_allocation_and_game_traffic() {
resp
});
// Host receives Connect for WORLD (skipping any Close from stream 1)
// Host receives Connect for WORLD (skipping any Close/Reset from stream 1)
let (world_sid, world_target) = loop {
let msg = ws_src.next().await.unwrap().unwrap();
match serde_json::from_str::<TunnelMsg>(msg.to_text().unwrap()).unwrap() {
TunnelMsg::Connect { stream_id, target, .. } => break (stream_id, target),
TunnelMsg::Close { .. } => continue,
TunnelMsg::Close { .. } | TunnelMsg::Reset { .. } => continue,
other => panic!("unexpected msg awaiting Connect: {other:?}"),
}
};
@@ -193,12 +193,12 @@ async fn test_relay_host_auth_and_allocation_and_game_traffic() {
// Host acknowledges
ws_sink.send(Message::Text(serde_json::to_string(&TunnelMsg::ConnectOk { stream_id: world_sid }).unwrap().into())).await.unwrap();
// Host receives world data (skipping any Close from stream 1)
// Host receives world data (skipping any Close/Reset from stream 1)
let world_chunk = loop {
let msg = ws_src.next().await.unwrap().unwrap();
match serde_json::from_str::<TunnelMsg>(msg.to_text().unwrap()).unwrap() {
TunnelMsg::Data { stream_id, chunk } if stream_id == world_sid => break chunk,
TunnelMsg::Close { .. } => continue,
TunnelMsg::Close { .. } | TunnelMsg::Reset { .. } => continue,
other => panic!("unexpected msg awaiting Data: {other:?}"),
}
};