Page MenuHomeWildfire Games

Unique disconnect reasons
Needs ReviewPublic

Authored by elexis on Jun 4 2018, 5:20 PM.
This revision needs review, but there are no reviewers specified.



Often the screen says that one was discnnected for an unknown reason.
Since the disconnect reason is sent as an int from C++ to JS, a timeout will end up as the state NDR_UNKNOWN = 0.
But that disconnect reason is also sent in case of some serverside errors.
It were preferable to debugging developers but also players to distinguish a network timeout from errors.
As a rule we can deduce to keep one separate disconnect reason per call to the disconnect function.

(Notice the disconnect reason is not transmitted reliably, so we can't have reason 0 to point to network timeouts even if we replace all NDR_UNKNOWN disconnects.
See the enet_peer_disconnect_now call in ~CNetClientSession, see
(Was also thinking about moving the strings from JS to C++ right near the enum, maybe in a macro creating the enum and stringmap, as discussed in D1517. But meh, JS is nicer to modify, especially for mods.)

Test Plan

The alternative to not keep introducing new verbose translated error strings is to have one error string and use that everywhere. It's translation work, but not that much.
If there is an error message, it should preferably say more than "Error: Unknown Error".

Diff Detail

rP 0 A.D. Public Repository
Lint OK
No Unit Test Coverage
Build Status
Buildable 6214
Build 10320: Vulcan BuildJenkins
Build 10319: arc lint + arc unit

Event Timeline

elexis created this revision.Jun 4 2018, 5:20 PM
Vulcan added a subscriber: Vulcan.Jun 4 2018, 5:27 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: