Merge pull request #661 from qsb-dev/kcp-timeout-setting

Add debug setting for timeout
This commit is contained in:
xen-42 2024-02-23 01:13:01 -05:00 committed by GitHub
commit e993f457e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View File

@ -76,6 +76,7 @@ The template for this file is this :
"autoStart": false,
"kickEveryone": false,
"disableLoopDeath": false,
"timeout": 25,
"debugMode": false,
"drawGui": false,
"drawLines": false,
@ -91,6 +92,7 @@ The template for this file is this :
- autoStart - Host/connect automatically for faster testing.
- kickEveryone - Kick anyone who joins a game.
- disableLoopDeath - Make it so the loop doesn't end when everyone is dead.
- timeout - How many seconds for your connection to timeout, in seconds.
- debugMode - Enables debug mode. If this is set to `false`, none of the following settings do anything.
- drawGui - Draws a GUI at the top of the screen that gives information on many things.
- drawLines - Draws gizmo-esque lines around things. Indicates reference sectors/transforms, triggers, etc. LAGGY.

View File

@ -78,10 +78,14 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart
{
_kcpTransport = gameObject.AddComponent<kcp2k.KcpTransport>();
// KCP uses milliseconds
_kcpTransport.Timeout = QSBCore.DebugSettings.Timeout * 1000;
}
{
_steamTransport = gameObject.AddComponent<FizzySteamworks>();
// Steam uses seconds
_steamTransport.Timeout = QSBCore.DebugSettings.Timeout;
}
{

View File

@ -32,6 +32,12 @@ public class DebugSettings
[JsonProperty("randomizeSkins")]
public bool RandomizeSkins;
/// <summary>
/// Timeout in seconds
/// </summary>
[JsonProperty("timeout")]
public int Timeout = 25;
[JsonProperty("debugMode")]
public bool DebugMode;