// --------------------------------------------------------------------------------------
// Server Settings
// --------------------------------------------------------------------------------------

// Setting to see if bots can be kicked by players
if ($Host::AllowBotKicks $= "")
   $Host::AllowBotKicks = true;

// Setting to let players place at least 1 large turret, regardless of how many are on
// the map already
if ($Host::AtLeastOneTurret $= "")
   $Host::AtLeastOneTurret == true

// Setting for the Period of time that players are prevented from rejoining based on
// Dynamix's Method of partial banning
if ($Host::BanTime $= "" || $Host::BanTime == 0)
   $Host::BanTime = 1800;

// Number of Bots in the game
if ($Host::BotCount $= "" || $Host::BotCount < 0)
   $Host::BotCount = 5;

// Check if Bots are enabled or not
if ($Host::BotsEnabled $= "" || $Host::BotsEnabled < 0)
   $Host::BotsEnabled = false;

// Check if the Turrets already on the map should count towards deployed amounts.
if ($Host::CountTurretsOnMap $= "" || $Host::CountTurretsOnMap < 0)
   $Host::CountTurretsOnMap = true;

// Flag to see if the Server is dedicated or not
if ($Host::Dedicated $= "" || $Host::Dedicated < 0)
   $Host::Dedicated = false;

// Flag to see if a pilot should be teleported into plane after buying
if ($Host::FadePilotIntoPlane $= "" || $Host::FadePilotIntoPlane < 0)
   $Host::FadePilotIntoPlane = false;

// Flag to see if the Server has Flood Protection Running
if ($Host::FloodProtectionEnabled $= "" || $Host::FloodProtectionEnabled < 0)
   $Host::FloodProtectionEnabled = true;

// Check to make sure the name of the first team is in
if ($Host::holoName1 $= "" || $Host::holoName1 <= 0)
   $Host::holoName1 = "Storm";

// Check to make sure the name of the second team is in
if ($Host::holoName2 $= "" || $Host::holoName2 <= 0)
   $Host::holoName2 = "Inferno";

// Check to make sure the name of the third team is in
if ($Host::holoName3 $= "" || $Host::holoName3 <= 0)
   $Host::holoName3 = "Starwolf";

// Check to make sure the name of the fourth team is in
if ($Host::holoName4 $= "" || $Host::holoName4 <= 0)
   $Host::holoName4 = "DSword";

// Check to make sure the name of the fifth team is in
if ($Host::holoName5 $= "" || $Host::holoName5 <= 0)
   $Host::holoName5 = "BloodEagle";

// Check to make sure the name of the sixth team is in
if ($Host::holoName6 $= "" || $Host::holoName6 <= 0)
   $Host::holoName6 = "Harbinger";

// Check to make sure the server has a kick time for the old kicking method
if ($Host::KickBanTime $= "" || $Host::KickBanTime <= 0)
   $Host::KickBanTime = 300;

// Check to make sure the server has an upper limit on bot skill
if ($Host::MaxBotDifficulty $= "" || $Host::MaxBotDifficulty <= 0)
   $Host::MaxBotDifficulty = "0.99";

// Check to make sure the server has a message limit
if ($Host::MaxMessageLen $= "" || $Host::MaxMessageLen <= 0)
   $Host::MaxMessageLen = 120;

// Check to make sure the server has a player limit defined
if ($Host::MaxPlayers $= "" || $Host::MaxPlayers <= 0)
   $Host::MaxPlayers = "16";

// Check to make sure the server has a lower limit on bot skill
if ($Host::MinBotDifficulty $= "" || $Host::MinBotDifficulty <= 0)
   $Host::MinBotDifficulty = "0.3";

// Check to make sure the server has a default mission type defined
if ($Host::MissionType $= "" || $Host::MissionType <= 0)
   $Host::MissionType = "CTF";

// Check to make sure the MTOD is set
if ($Host::MOTD $= "" || $Host::MOTD < 0)
   $Host::MOTD = "Welcome to Havoc 2.";

// Check to make sure the MTOD Time is set
if ($Host::MOTDTime $= "" || $Host::MOTDTime < 0)
   $Host::MOTDTime = 10;

// Check to make sure the server does or doesn't allow alias's
if ($Host::NoSmurfs $= "" || $Host::NoSmurfs <= 0)
   $Host::NoSmurfs = false;

// Check to make sure the server has a respawn Time Out value
if ($Host::PlayerRespawnTimeout $= "" || $Host::PlayerRespawnTimeout < 0)
   $Host::PlayerRespawnTimeout = 60;

// Check to make sure the server has a port defined
if ($Host::Port $= "" || $Host::Port < 0)
   $Host::Port = 28000;

$Host::PureServer = false;

// Make sure the server does or doesn't allow team damage
if ($Host::TeamDamageOn $= "" || $Host::TeamDamageOn < 0)
   $Host::TeamDamageOn = false;

// Make sure the server does or doesn't allow team friendly mines
if ($Host::TeamFriendlyMines $= "" || $Host::TeamFriendlyMines < 0)
   $Host::TeamFriendlyMines = 1;

// Make sure the server has a name for the observer team
if ($Host::TeamName0 $= "" || $Host::TeamName0 < 0)
   $Host::TeamName0 = "Unassigned";

// Make sure the server has a name for the first team
if ($Host::TeamName1 $= "" || $Host::TeamName1 < 0)
   $Host::TeamName1 = "Storm";

// Make sure the server has a name for the second team
if ($Host::TeamName2 $= "" || $Host::TeamName2 < 0)
   $Host::TeamName2 = "Inferno";

// Make sure the server has a name for the third team
if ($Host::TeamName3 $= "" || $Host::TeamName3 < 0)
   $Host::TeamName3 = "Star Wolf";

// Make sure the server has a name for the fourth team
if ($Host::TeamName4 $= "" || $Host::TeamName4 < 0)
   $Host::TeamName4 = "Diamond Sword";

// Make sure the server has a name for the fifth team
if ($Host::TeamName5 $= "" || $Host::TeamName5 < 0)
   $Host::TeamName5 = "Blood Eagle";

// Make sure the server has a name for the sixth team
if ($Host::TeamName6 $= "" || $Host::TeamName6 < 0)
   $Host::TeamName6 = "Phoenix";

// Make sure the server has a default Skin for Observers
if ($Host::TeamSkin0 $= "" || $Host::TeamSkin0 < 0)
   $Host::TeamSkin0 = "blank";

// Make sure the server has a default Skin for the First Team
if ($Host::TeamSkin1 $= "" || $Host::TeamSkin1 < 0)
   $Host::TeamSkin1 = "base";

// Make sure the server has a default Skin for the Second Team
if ($Host::TeamSkin2 $= "" || $Host::TeamSkin2 < 0)
   $Host::TeamSkin2 = "baseb";

// Make sure the server has a default Skin for the Third Team
if ($Host::TeamSkin3 $= "" || $Host::TeamSkin3 < 0)
   $Host::TeamSkin3 = "swolf";

// Make sure the server has a default Skin for the Fourth Team
if ($Host::TeamSkin4 $= "" || $Host::TeamSkin4 < 0)
   $Host::TeamSkin4 = "dsword";

// Make sure the server has a default Skin for the Fifth Team
if ($Host::TeamSkin5 $= "" || $Host::TeamSkin5 < 0)
   $Host::TeamSkin5 = "beagle";

// Make sure the server has a default Skin for the Sixth Team
if ($Host::TeamSkin6 $= "" || $Host::TeamSkin6 < 0)
   $Host::TeamSkin6 = "cotp";

// Time Increase Amount
if ($Host::TimeIncreaseFactor $= "" || $Host::TimeIncreaseFactor < 1 || $Host::TimeIncreaseFactor > 30)
   $Host::TimeIncreaseFactor = 15;

// Make sure the server has a time limit
if ($Host::TimeLimit $= "" || $Host::TimeLimit <= 0)
   $Host::TimeLimit = "45";

// Make sure the server is or isn't in TournamentMode
if ($Host::TournamentMode $= "" || $Host::TournamentMode < 0)
   $Host::TournamentMode = 0;

// Make sure the server has a vote pass percentage
if ($Host::VotePassPercent $= "" || $Host::VotePassPercent <= 0)
   $Host::VotePassPercent = 60;

// Make sure the server has a vote spread set
if ($Host::VoteSpread $= "" || $Host::VoteSpread <= 0)
   $Host::VoteSpread = 20;

// Make sure the server has a voting time
if ($Host::VoteTime $= "" || $Host::VoteTime <= 0)
   $Host::VoteTime = 20;

// Make sure the server has a mission start delay
if ($Host::warmupTime $= "" || $Host::warmupTime <= 0)
   $Host::warmupTime = 20;

// Write the Final Result to a file now incase something changed
if ($PrefSuccess == true)
   export("$Host::*", "prefs/ServerPrefs.cs", false);

// --------------------------------------------------------------------------------------
// Admin Settings
// --------------------------------------------------------------------------------------

// Set the Ability for Admin Voting Off
if ($Havoc::allowAdminPlayerVotes $= "" || $Havoc::allowAdminPlayerVotes < 0)
   $Havoc::allowAdminPlayerVotes = false;

// Set the Ability for Mission Change Voting
if ($Havoc::allowMissionChangeVotes $= "" || $Havoc::allowMissionChangeVotes < 0)
   $Havoc::allowMissionChangeVotes = true;

// Set the Ability for Team Damage Voting
if ($Havoc::allowTeamDamageVotes $= "" || $Havoc::allowTeamDamageVotes < 0)
   $Havoc::allowTeamDamageVotes = true;

// Set the Ability for Team Damage Voting
if ($Havoc::allowTimeIncreaseVotes $= "" || $Havoc::allowTimeIncreaseVotes < 0)
   $Havoc::allowTimeIncreaseVotes = true;

// Set the Ability for Tournament Mode Voting
if ($Havoc::allowTournamentVotes $= "" || $Havoc::allowTournamentVotes < 0)
   $Havoc::allowTournamentVotes = false;

// If we don't have an admin password defined, we write a blank now
if ($Havoc::AdminPassword $= "" || $Havoc::AdminPassword < 0)
   $Havoc::AdminPassword = "";

// If we don't have a super admin password defined, we write a blank now
if ($Havoc::SuperAdminPassword $= "" || $Havoc::SuperAdminPassword < 0)
   $Havoc::SuperAdminPassword = "";

// If we don't have a master admin password defined, we write a blank now
if ($Havoc::MasterAdminPassword $= "" || $Havoc::MasterAdminPassword < 0)
   $Havoc::MasterAdminPassword = "";

// Write the Final Result to a file now incase something changed
if ($HavocSuccess == true)
   export("$Havoc::*", "prefs/Havoc.cs", false);
