/// <summary> /// Validate the network config to ensure nothing /// was messed with. /// </summary> /// <param name="engineType">The engine type to check parameters for.</param> /// <returns>True if everything is good.</returns> public bool Validate(GameEngineType engineType) { switch (engineType) { case GameEngineType.Client: return(Port == 0 && ConnectionCapacity == 1); case GameEngineType.Server: return(Port > 0 && ConnectionCapacity >= 4 && ConnectionCapacity <= 32); } return(false); }
/// <summary> /// Reset the network configs back their default /// settings based on the engine type. /// </summary> /// <param name="engineType">The type of engine running.</param> public void ResetToDefault(GameEngineType engineType) { switch (engineType) { case GameEngineType.Client: Port = 0; ConnectionCapacity = 1; break; case GameEngineType.Server: Port = 9550; ConnectionCapacity = 32; break; } }
/// <summary> /// Nothing to really validate. /// </summary> /// <param name="engineType">The currently running game engine type.</param> /// <returns>True if the config is valid.</returns> public bool Validate(GameEngineType gameEngineType) { return(true); }
/// <summary> /// Reset the login config back to defaults. /// </summary> /// <param name="engineType">The currently running game engine type.</param> public void ResetToDefault(GameEngineType engineType) { Username = null; Token = null; RememberMe = false; }
public Base VariantOptions; // 0x160 #region IStreamable Members public void Read(BlamLib.IO.EndianReader s) { GameEngineIndex = (GameEngineType)s.ReadInt32(); _vtable = s.ReadUInt32(); Unknown008 = s.ReadInt32(); Header.Read(s); switch(GameEngineIndex) { case GameEngineType.Ctf: VariantOptions = new Ctf(); break; case GameEngineType.Slayer: VariantOptions = new Slayer(); break; case GameEngineType.Oddball: VariantOptions = new Oddball(); break; case GameEngineType.King: VariantOptions = new King(); break; case GameEngineType.Sandbox: VariantOptions = new Sandbox(); break; case GameEngineType.Vip: VariantOptions = new Vip(); break; case GameEngineType.Juggernaut: VariantOptions = new Juggernaut(); break; case GameEngineType.Territories: VariantOptions = new Teritories(); break; case GameEngineType.Assault: VariantOptions = new Assault(); break; case GameEngineType.Infection: VariantOptions = new Infection(); break; default: throw new Debug.Exceptions.UnreachableException(); } VariantOptions.Read(s); s.Seek(0x160 - VariantOptions.Sizeof, System.IO.SeekOrigin.Current); }
public GameEngineVariant(Engine.EngineBuildHandle gameBuild, GameEngineType type) { mGameBuild = gameBuild; mType = type; InitializeVariant(); }