public void OnInvitedToGame(string connectCommand) { try { ToolBox.ParseConnectCommand(ToolBox.SplitCommand(connectCommand), out ConnectName, out ConnectEndpoint, out ConnectLobby); } catch (IndexOutOfRangeException e) { #if DEBUG DebugConsole.ThrowError($"Failed to parse a Steam friend's connect invitation command ({connectCommand})", e); #else DebugConsole.Log($"Failed to parse a Steam friend's connect invitation command ({connectCommand})\n" + e.StackTrace.CleanupStackTrace()); #endif ConnectName = null; ConnectEndpoint = null; ConnectLobby = 0; } DebugConsole.NewMessage(ConnectName + ", " + ConnectEndpoint, Color.Yellow); }
public GameMain(string[] args) { Content.RootDirectory = "Content"; GraphicsDeviceManager = new GraphicsDeviceManager(this); GraphicsDeviceManager.IsFullScreen = false; GraphicsDeviceManager.GraphicsProfile = GfxProfile; GraphicsDeviceManager.ApplyChanges(); Window.Title = "Barotrauma"; Instance = this; Config = new GameSettings(); ConsoleArguments = args; ConnectName = null; ConnectEndpoint = null; ConnectLobby = 0; ToolBox.ParseConnectCommand(ConsoleArguments, out ConnectName, out ConnectEndpoint, out ConnectLobby); GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window); PerformanceCounter = new PerformanceCounter(); IsFixedTimeStep = false; GameMain.ResetFrameTime(); fixedTime = new GameTime(); World = new World(new Vector2(0, -9.82f)); FarseerPhysics.Settings.AllowSleep = true; FarseerPhysics.Settings.ContinuousPhysics = false; FarseerPhysics.Settings.VelocityIterations = 1; FarseerPhysics.Settings.PositionIterations = 1; MainThread = Thread.CurrentThread; }
public GameMain(string[] args) { Content.RootDirectory = "Content"; #if DEBUG && WINDOWS GraphicsAdapter.UseDebugLayers = true; #endif GraphicsDeviceManager = new GraphicsDeviceManager(this) { IsFullScreen = false, GraphicsProfile = GfxProfile }; GraphicsDeviceManager.ApplyChanges(); Window.Title = "Barotrauma"; Instance = this; if (!Directory.Exists(Content.RootDirectory)) { throw new Exception("Content folder not found. If you are trying to compile the game from the source code and own a legal copy of the game, you can copy the Content folder from the game's files to BarotraumaShared/Content."); } Config = new GameSettings(); Md5Hash.LoadCache(); ConsoleArguments = args; ConnectName = null; ConnectEndpoint = null; ConnectLobby = 0; try { ToolBox.ParseConnectCommand(ConsoleArguments, out ConnectName, out ConnectEndpoint, out ConnectLobby); } catch (IndexOutOfRangeException e) { DebugConsole.ThrowError($"Failed to parse console arguments ({string.Join(' ', ConsoleArguments)})", e); ConnectName = null; ConnectEndpoint = null; ConnectLobby = 0; } GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window); PerformanceCounter = new PerformanceCounter(); IsFixedTimeStep = false; GameMain.ResetFrameTime(); fixedTime = new GameTime(); World = new World(new Vector2(0, -9.82f)); FarseerPhysics.Settings.AllowSleep = true; FarseerPhysics.Settings.ContinuousPhysics = false; FarseerPhysics.Settings.VelocityIterations = 1; FarseerPhysics.Settings.PositionIterations = 1; MainThread = Thread.CurrentThread; Window.FileDropped += OnFileDropped; }
public void OnInvitedToGame(Facepunch.Steamworks.SteamFriend friend, string connectCommand) { ToolBox.ParseConnectCommand(connectCommand.Split(' '), out ConnectName, out ConnectEndpoint, out ConnectLobby); DebugConsole.NewMessage(ConnectName + ", " + ConnectEndpoint, Color.Yellow); }