void LoadWeather()
{
//Wrap our function inside a catcher
try
{
//NOTE: Must be defined per zone and random information
//Load info from ini for now
Ini ini = new Ini();
ini = new Framework.Ini(Environment.CurrentDirectory + @"\Settings\Settings.ini");
string Enabled = ini.GetValue("Custom", "WeatherEnabled", "true").ToString();
string Type = ini.GetValue("Custom", "WeatherType", "1").ToString();
string Info = ini.GetValue("Custom", "WeatherInfo", "10").ToString();
//If the user has defined to enable custom weather type
if (Enabled == "1")
{
//We send the information they chosen
client.Send(Packet.Weather(Convert.ToByte(Type), Convert.ToInt32(Info)));
}
//If disabled
else
{
//Send static weather
client.Send(Packet.Weather(0, 1));
}
}
catch (Exception ex)
{
Console.WriteLine("Load weather error {0}", ex);
Systems.Debugger.Write(ex);
}
}