Check the packet it must be 1017 not 1016Quote:
I get it now! Thanks =]
Well, at least it doesn't crash.
So what now?
I have the correct weather packet...
and then this command:Code:public static COPacket Weather(byte Type, uint Intensity, uint Direction, uint Appearance) { byte[] Packet = new byte[28]; COPacket P = new COPacket(Packet); P.WriteInt16((ushort)(Packet.Length - 8)); [B]P.WriteInt16(1017);[/B] P.WriteInt16(Type); P.WriteInt32(Intensity); P.WriteInt32(Direction); P.WriteInt32(Appearance); return P; }
Do I need to send it somehow of does it already do that with the return P?Code:if (Cmd[0] == "/weather") { byte Weather = 0x1; if (Cmd[1] == "nothing") Weather = 0x1; if (Cmd[1] == "rain") Weather = 0x2; if (Cmd[1] == "snow") Weather = 0x3; if (Cmd[1] == "rainwind") Weather = 0x4; if (Cmd[1] == "autumnleaves") Weather = 0x5; if (Cmd[1] == "cherryblossompetals") Weather = 0x7; if (Cmd[1] == "cherryblossompetalsWind") Weather = 0x8; if (Cmd[1] == "blowingcotten") Weather = 0x9; if (Cmd[1] == "atoms") Weather = 0xa; GC.AddSend(Packets.Weather(Weather, uint.Parse(Cmd[2]), uint.Parse(Cmd[3]), uint.Parse(Cmd[4]))); }
public static COPacket Weather(byte Type, uint Intensity, uint Direction, uint Appearance)
{
byte[] Packet = new byte[17 + 8];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16(1016);
P.WriteByte(Type);
P.WriteInt32(Intensity);
P.WriteInt32(Direction);
P.WriteInt32(Appearance);
return P;
}
Length -> 20 Type -> 1016 Look -> 1 Intensity -> 150 Direction -> 75 Color -> 0
Data = new byte[Length]; PacketWriter Writer = new PacketWriter(Data); Writer.WriteUInt16(Length, 0); Writer.WriteUInt16(Type, 2); Writer.WriteUInt32(Look, 4); Writer.WriteUInt32(Intensity, 8); Writer.WriteUInt32(Direction, 12); Writer.WriteUInt32(Color, 16); return Writer.Flush();
public static COPacket Weather(Features.WeatherType Type, uint Intensity, uint Direction, uint Appearance)
{
byte[] Packet = new byte[8 + 17];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)0x3f8);
P.WriteByte((byte)Type);
P.WriteInt32(Intensity);
P.WriteInt32(Direction);
P.WriteInt32(Appearance);
return P;
}