netcode-revival: log relay sweeps + show netcode transport state in the M menu
- Relay --verbose now logs which client timed out (ip:port, session, room) instead of silently dropping, so '2 client(s) -> 1 client(s)' is explainable. - The M menu Status block shows the netcode transport state: 'Netcode: relay joined / not connected' and how many sessions are discoverable, so the RakNet pipeline is visible without grepping logs. - Pin rexglue to 3ec27d1 (transport receive timeout - the silent-client disconnect fix).
This commit is contained in:
parent
658d727aba
commit
dea4c3c5f4
3 changed files with 31 additions and 5 deletions
|
|
@ -489,10 +489,20 @@ void GhostRelay::Sweep(double now) {
|
||||||
if (now <= 0.0) {
|
if (now <= 0.0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clients_.erase(std::remove_if(clients_.begin(), clients_.end(),
|
const bool verbose = verbose_.load(std::memory_order_relaxed);
|
||||||
[now](const Client& c) {
|
clients_.erase(std::remove_if(
|
||||||
return now - c.last_seen > kClientTimeoutSec;
|
clients_.begin(), clients_.end(),
|
||||||
}),
|
[now, verbose](const Client& c) {
|
||||||
|
const bool stale = now - c.last_seen > kClientTimeoutSec;
|
||||||
|
if (stale && verbose) {
|
||||||
|
GHOST_RELAY_INFO("{} timed out ({}s silence; {} joined "
|
||||||
|
"room '{}')",
|
||||||
|
GhostAddrStr(c.addr),
|
||||||
|
int(now - c.last_seen), c.session_id,
|
||||||
|
std::string(c.room, c.room_len));
|
||||||
|
}
|
||||||
|
return stale;
|
||||||
|
}),
|
||||||
clients_.end());
|
clients_.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,13 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
|
||||||
#include <rex/cvar.h>
|
#include <rex/cvar.h>
|
||||||
#include <rex/logging.h>
|
#include <rex/logging.h>
|
||||||
|
#include <rex/system/xnet_transport.h>
|
||||||
|
|
||||||
#include "native/skate3_native_ghost.h"
|
#include "native/skate3_native_ghost.h"
|
||||||
#include "skate3_native_scene.h"
|
#include "skate3_native_scene.h"
|
||||||
|
|
@ -216,6 +218,20 @@ void GhostDialog::OnDraw(ImGuiIO& io) {
|
||||||
if (st.peer[0] != '\0') {
|
if (st.peer[0] != '\0') {
|
||||||
ImGui::Text(" Relay: %s", st.peer);
|
ImGui::Text(" Relay: %s", st.peer);
|
||||||
}
|
}
|
||||||
|
// netcode-revival: the game's own netcode transport (RakNet via the relay).
|
||||||
|
{
|
||||||
|
using rex::system::XNetTransport;
|
||||||
|
ImGui::Text(" Netcode: %s",
|
||||||
|
XNetTransport::Instance().Active()
|
||||||
|
? "relay joined"
|
||||||
|
: "not connected");
|
||||||
|
const std::vector<rex::system::XNetSession> xnet_sessions =
|
||||||
|
XNetTransport::Instance().Sessions();
|
||||||
|
if (!xnet_sessions.empty()) {
|
||||||
|
ImGui::Text(" Sessions: %zu discoverable",
|
||||||
|
xnet_sessions.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
if (st.refused) {
|
if (st.refused) {
|
||||||
ImGui::TextColored(ImVec4(1.0f, 0.5f, 0.3f, 1.0f),
|
ImGui::TextColored(ImVec4(1.0f, 0.5f, 0.3f, 1.0f),
|
||||||
" Refused by relay (protocol version mismatch)");
|
" Refused by relay (protocol version mismatch)");
|
||||||
|
|
|
||||||
2
third_party/rexglue-sdk
vendored
2
third_party/rexglue-sdk
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit 01fe706c13038c861e028b52384c3922c98e80da
|
Subproject commit 3ec27d115b0a6ff3ac20fe4486239150c3872e25
|
||||||
Loading…
Add table
Reference in a new issue