File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
SwiftlyS2.Core/Modules/Engine
SwiftlyS2.Shared/Modules/Engine Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 55using SwiftlyS2 . Shared . Natives ;
66using SwiftlyS2 . Shared . SchemaDefinitions ;
77using SwiftlyS2 . Shared . SteamAPI ;
8+ using Spectre . Console ;
89
910namespace SwiftlyS2 . Core . Services ;
1011
@@ -17,7 +18,19 @@ public EngineService( CommandTrackerManager commandTrackedManager )
1718 this . _commandTrackedManager = commandTrackedManager ;
1819 }
1920
20- public string ServerIP => SteamGameServer . GetPublicIP ( ) . ToString ( ) ;
21+ public string ? ServerIP {
22+ get {
23+ try
24+ {
25+ return SteamGameServer . GetPublicIP ( ) . ToString ( ) ;
26+ }
27+ catch ( Exception e )
28+ {
29+ AnsiConsole . WriteException ( e ) ;
30+ return null ;
31+ }
32+ }
33+ }
2134
2235 public ref CGlobalVars GlobalVars => ref NativeEngineHelpers . GetGlobalVars ( ) . AsRef < CGlobalVars > ( ) ;
2336
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ public interface IEngineService
88 /// <summary>
99 /// The IP address of the server.
1010 /// </summary>
11- public string ServerIP { get ; }
11+ public string ? ServerIP { get ; }
1212
1313 /// <summary>
1414 /// Gets the map that the server is running
You can’t perform that action at this time.
0 commit comments