|
المشاركات 1,993 |
+التقييم 1.00 |
تاريخ التسجيل Jun 2019 |
الاقامة |
نظام التشغيل ويندوز 0 |
رقم العضوية 279 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mr_Panda.Game
{
public static class Weather
{
public static DateTime NextChange = new DateTime();
public static Network.GamePackets.Weather CurrentWeatherBase = new Mr_Panda.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);
}
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mr_Panda.Network.GamePackets
{
public class Weather : Writer, Interfaces.IPacket
{
public const uint Nothing = 1,
Rain = 2,
Snow = 3,
RainWind = 4,
AutumnLeaves = 5,
CherryBlossomPetals = 7,
CherryBlossomPetalsWind = 8,
BlowingCotten = 9,
Atoms = 10;
byte[] Buffer;
public Weather(bool Create)
{
if (Create)
{
Buffer = new byte[20 + 8];
WriteUInt16(20, 0, Buffer);
WriteUInt16(1016, 2, Buffer);
}
}
public uint WeatherType
{
get { return BitConverter.ToUInt32(Buffer, 4); }
set { WriteUInt32(value, 4, Buffer); }
}
public uint Intensity
{
get { return BitConverter.ToUInt32(Buffer, 8); }
set { WriteUInt32(value, 8, Buffer); }
}
public uint Direction
{
get { return BitConverter.ToUInt32(Buffer, 12); }
set { WriteUInt32(value, 12, Buffer); }
}
public uint Appearence
{
get { return BitConverter.ToUInt32(Buffer, 16); }
set { WriteUInt32(value, 16, Buffer); }
}
public void Send(Client.GameState client)
{
client.Send(Buffer);
}
public byte[] ToArray()
{
return Buffer;
}
public void Deserialize(byte[] buffer)
{
Buffer = buffer;
}
}
}
private void ServerFunctions(int time)
{
#region New weather
Mr_Panda.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 = Mr_Panda.Network.GamePackets.Weather.Rain;
weather = new Mr_Panda.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 = Mr_Panda.Network.GamePackets.Weather.Snow;
weather = new Mr_Panda.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 = Mr_Panda.Network.GamePackets.Weather.AutumnLeaves;
weather = new Mr_Panda.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 = Mr_Panda.Network.GamePackets.Weather.CherryBlossomPetals;
weather = new Mr_Panda.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 = Mr_Panda.Network.GamePackets.Weather.BlowingCotten;
weather = new Mr_Panda.Network.GamePackets.Weather(true)
{
WeatherType = (uint)Program.WeatherType,
Intensity = 255,
Appearence = 255,
Direction = 255
};
state.Send(weather);
}
}
#endregion CherryBlossomPetals
#endregion New weather
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
شرح التعديل على (الجيلد وير ) كامله 100% | Users | تطوير سيرفرات كونكر | 7 | 2024-02-01 02:39 PM |
سستم الطقس | Mero | تطوير سيرفرات كونكر | 3 | 2021-12-20 06:30 AM |
الاوفستات كونكر 3d كامله | محمد ياسر | تطوير سيرفرات كونكر | 2 | 2019-11-07 04:07 AM |
اضافة online point كامله | محمد ياسر | تطوير سيرفرات كونكر | 1 | 2019-06-20 07:07 PM |
كويست UniqueKiller كامله | محمد ياسر | تطوير سيرفرات كونكر | 0 | 2019-04-30 05:26 PM |