From 1d4c598958a9ddeaf188c15d9e7535eb32aeb54a Mon Sep 17 00:00:00 2001 From: AmazingAlek Date: Sat, 19 Dec 2020 21:40:54 +0100 Subject: [PATCH] saving ip (#230) --- QSB/QSBNetworkManager.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/QSB/QSBNetworkManager.cs b/QSB/QSBNetworkManager.cs index 92eaba59..00861d28 100644 --- a/QSB/QSBNetworkManager.cs +++ b/QSB/QSBNetworkManager.cs @@ -161,6 +161,14 @@ namespace QSB QSBNetworkServer.SpawnWithClientAuthority(Instantiate(_probePrefab), connection); } + public override void OnStartClient(QSBNetworkClient _) + { + DebugLog.DebugWrite($"Setting defaultServerIP to {networkAddress}"); + var config = QSBCore.Helper.Config; + config.SetSettingsValue("defaultServerIP", networkAddress); + QSBCore.Helper.Storage.Save(config, Constants.ModConfigFileName); + } + public override void OnClientConnect(QSBNetworkConnection connection) // Called on the client when connecting to a server { DebugLog.DebugWrite("OnClientConnect", MessageType.Info);