mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-19 12:40:56 +00:00
Merge pull request #462 from misternebula/add-kcp-back-in-lol
Add KCP support back in as an option.
This commit is contained in:
commit
d33b2439f0
BIN
Mirror/where-allocations.dll
Normal file
BIN
Mirror/where-allocations.dll
Normal file
Binary file not shown.
@ -179,7 +179,8 @@ namespace QSB.Menus
|
||||
|
||||
private void CreateCommonPopups()
|
||||
{
|
||||
IPPopup = MenuApi.MakeInputFieldPopup("Steam ID", "Steam ID", "Connect", "Cancel");
|
||||
var text = QSBCore.UseKcpTransport ? "Public IP Address" : "Steam ID";
|
||||
IPPopup = MenuApi.MakeInputFieldPopup(text, text, "Connect", "Cancel");
|
||||
IPPopup.OnPopupConfirm += Connect;
|
||||
IPPopup.OnPopupValidate += Validate;
|
||||
|
||||
@ -334,6 +335,11 @@ namespace QSB.Menus
|
||||
: "Are you sure you want to disconnect?\r\nThis will send you back to the main menu.";
|
||||
DisconnectPopup._labelText.text = popupText;
|
||||
|
||||
if (QSBCore.UseKcpTransport)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var steamId = ((FizzyFacepunch)Transport.activeTransport).GetSteamID();
|
||||
|
||||
PopupOK += () => GUIUtility.systemCopyBuffer = steamId;
|
||||
|
@ -45,6 +45,8 @@ namespace QSB
|
||||
public static IModHelper Helper { get; private set; }
|
||||
public static IModUnityEvents UnityEvents => Helper.Events.Unity;
|
||||
public static string DefaultServerIP { get; private set; }
|
||||
public static bool UseKcpTransport => DebugSettings.UseKcpTransport;
|
||||
public static int OverrideAppId => DebugSettings.OverrideAppId;
|
||||
public static bool DebugMode => DebugSettings.DebugMode;
|
||||
public static bool ShowLinesInDebug => DebugMode && DebugSettings.DrawLines;
|
||||
public static bool ShowQuantumVisibilityObjects => DebugMode && DebugSettings.ShowQuantumVisibilityObjects;
|
||||
|
@ -63,9 +63,18 @@ namespace QSB
|
||||
|
||||
gameObject.SetActive(false);
|
||||
|
||||
var fizzy = gameObject.AddComponent<FizzyFacepunch>();
|
||||
fizzy.SteamAppID = "753640";
|
||||
transport = fizzy;
|
||||
if (QSBCore.UseKcpTransport)
|
||||
{
|
||||
transport = gameObject.AddComponent<kcp2k.KcpTransport>();
|
||||
}
|
||||
else
|
||||
{
|
||||
var fizzy = gameObject.AddComponent<FizzyFacepunch>();
|
||||
fizzy.SteamAppID = QSBCore.OverrideAppId == -1
|
||||
? "753640"
|
||||
: $"{QSBCore.OverrideAppId}";
|
||||
transport = fizzy;
|
||||
}
|
||||
|
||||
gameObject.SetActive(true);
|
||||
|
||||
|
@ -4,6 +4,12 @@ namespace QSB.Utility
|
||||
{
|
||||
public class DebugSettings
|
||||
{
|
||||
[JsonProperty("useKcpTransport")]
|
||||
public bool UseKcpTransport { get; set; }
|
||||
|
||||
[JsonProperty("overrideAppId")]
|
||||
public int OverrideAppId { get; set; }
|
||||
|
||||
[JsonProperty("debugMode")]
|
||||
public bool DebugMode { get; set; }
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
{
|
||||
"debugMode": false,
|
||||
"useKcpTransport": false,
|
||||
"overrideAppId": -1,
|
||||
"debugMode": true,
|
||||
"drawLines": false,
|
||||
"showQuantumVisibilityObjects": false,
|
||||
"showDebugLabels": false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user