Mr.Sheko
10-11-2014, 03:42 AM
بسم الله الرحمن الرحيم
انهاردة انا جيبلكوا سيستم الطقس الى هو بيخلى الجو يمطر فى الميه وينزل ثلج وكدة
نيجى بقى للمهم علشان مش اطول عليكم
هاتعمل ملف جديد باسم
Weather.cs
وتحط فيه الكود دة
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Conquer_Online_Server.Game
{
public static class Weather
{
public static DateTime NextChange = new DateTime();
public static Network.GamePackets.Weather CurrentWeatherBase = new Conquer_Online_Server.Network.GamePackets.Weather( true);
public static uint Intensity
{
get
{
return CurrentWeatherBase.Intensity;
}
set
{
CurrentWeatherBase.Intensity = value;
}
}
public static uint Appearence
{
get
{
return CurrentWeatherBase.Appearence;
}
set
{
CurrentWeatherBase.Appearence = value;
}
}
public static uint Direction
{
get
{
return CurrentWeatherBase.Direction;
}
set
{
CurrentWeatherBase.Direction = value;
}
}
public static uint CurrentWeather
{
get
{
return CurrentWeatherBase.WeatherType;
}
set
{
CurrentWeatherBase.WeatherType = value;
foreach (Client.GameState client in Program.Values)
{
CurrentWeatherBase.Send(client);
}
}
}
}
} وبعدين تروح ملف
World.cs
وتبحث عن الكود دة
private void ServerFunctions(int time)
{ وتحط دة تحت القوص علطول
#region New weather
Conquer_Online_Server.Network.GamePackets.Weather weather;
#region Rain System
if (DateTime.Now.Minute == 10 && DateTime.Now.Second == 0 || DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
foreach (GameState state in Kernel.GamePool.Values)
{
Program.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather. Rain;
weather = new Conquer_Online_Server.Network.GamePackets.Weather( true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion Rain System
#region Snow System
if (DateTime.Now.Minute == 20 && DateTime.Now.Second == 0 || DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
foreach (GameState state in Kernel.GamePool.Values)
{
Program.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather. Snow;
weather = new Conquer_Online_Server.Network.GamePackets.Weather( true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion Snow System
#region AutumnLeaves
if (DateTime.Now.Minute == 30 && DateTime.Now.Second == 0 || DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
foreach (GameState state in Kernel.GamePool.Values)
{
Program.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather. AutumnLeaves;
weather = new Conquer_Online_Server.Network.GamePackets.Weather( true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion AutumnLeaves
#region CherryBlossomPetals
if (DateTime.Now.Minute == 40 && DateTime.Now.Second == 0 || DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
foreach (GameState state in Kernel.GamePool.Values)
{
Program.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather. CherryBlossomPetals;
weather = new Conquer_Online_Server.Network.GamePackets.Weather( true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion CherryBlossomPetals
#region BlowingCotten
if (DateTime.Now.Minute == 60 && DateTime.Now.Second == 0 || DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
foreach (GameState state in Kernel.GamePool.Values)
{
Program.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather. BlowingCotten;
weather = new Conquer_Online_Server.Network.GamePackets.Weather( true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion CherryBlossomPetals
#endregion New weather وكدة هيبقى كلوا تمام تمام انشاء الله اشوفكم بخير
[/CENTER]
انهاردة انا جيبلكوا سيستم الطقس الى هو بيخلى الجو يمطر فى الميه وينزل ثلج وكدة
نيجى بقى للمهم علشان مش اطول عليكم
هاتعمل ملف جديد باسم
Weather.cs
وتحط فيه الكود دة
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Conquer_Online_Server.Game
{
public static class Weather
{
public static DateTime NextChange = new DateTime();
public static Network.GamePackets.Weather CurrentWeatherBase = new Conquer_Online_Server.Network.GamePackets.Weather( true);
public static uint Intensity
{
get
{
return CurrentWeatherBase.Intensity;
}
set
{
CurrentWeatherBase.Intensity = value;
}
}
public static uint Appearence
{
get
{
return CurrentWeatherBase.Appearence;
}
set
{
CurrentWeatherBase.Appearence = value;
}
}
public static uint Direction
{
get
{
return CurrentWeatherBase.Direction;
}
set
{
CurrentWeatherBase.Direction = value;
}
}
public static uint CurrentWeather
{
get
{
return CurrentWeatherBase.WeatherType;
}
set
{
CurrentWeatherBase.WeatherType = value;
foreach (Client.GameState client in Program.Values)
{
CurrentWeatherBase.Send(client);
}
}
}
}
} وبعدين تروح ملف
World.cs
وتبحث عن الكود دة
private void ServerFunctions(int time)
{ وتحط دة تحت القوص علطول
#region New weather
Conquer_Online_Server.Network.GamePackets.Weather weather;
#region Rain System
if (DateTime.Now.Minute == 10 && DateTime.Now.Second == 0 || DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
foreach (GameState state in Kernel.GamePool.Values)
{
Program.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather. Rain;
weather = new Conquer_Online_Server.Network.GamePackets.Weather( true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion Rain System
#region Snow System
if (DateTime.Now.Minute == 20 && DateTime.Now.Second == 0 || DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
foreach (GameState state in Kernel.GamePool.Values)
{
Program.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather. Snow;
weather = new Conquer_Online_Server.Network.GamePackets.Weather( true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion Snow System
#region AutumnLeaves
if (DateTime.Now.Minute == 30 && DateTime.Now.Second == 0 || DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
foreach (GameState state in Kernel.GamePool.Values)
{
Program.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather. AutumnLeaves;
weather = new Conquer_Online_Server.Network.GamePackets.Weather( true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion AutumnLeaves
#region CherryBlossomPetals
if (DateTime.Now.Minute == 40 && DateTime.Now.Second == 0 || DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
foreach (GameState state in Kernel.GamePool.Values)
{
Program.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather. CherryBlossomPetals;
weather = new Conquer_Online_Server.Network.GamePackets.Weather( true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion CherryBlossomPetals
#region BlowingCotten
if (DateTime.Now.Minute == 60 && DateTime.Now.Second == 0 || DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
foreach (GameState state in Kernel.GamePool.Values)
{
Program.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather. BlowingCotten;
weather = new Conquer_Online_Server.Network.GamePackets.Weather( true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion CherryBlossomPetals
#endregion New weather وكدة هيبقى كلوا تمام تمام انشاء الله اشوفكم بخير
[/CENTER]