|
You last visited: Today at 14:33
Advertisement
[Help] Weather Packet (My First Packet)
Discussion on [Help] Weather Packet (My First Packet) within the CO2 Private Server forum part of the Conquer Online 2 category.
05/08/2010, 19:07
|
#16
|
elite*gold: 0
Join Date: Oct 2007
Posts: 181
Received Thanks: 68
|
Quote:
Originally Posted by CptSky
Sorry, wrong conversion The packet type is 0x3f8 in hexadecimal, but it's 1016 in decimal, not 1017. And you need the TQServer at the end for new client.
|
.
|
|
|
05/08/2010, 19:36
|
#17
|
elite*gold: 0
Join Date: Mar 2010
Posts: 126
Received Thanks: 14
|
delete this thread.
|
|
|
05/08/2010, 19:44
|
#18
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
Quote:
Originally Posted by -Spirits-
I get it now! Thanks =]
Well, at least it doesn't crash.
So what now?
I have the correct weather packet...
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;
}
and then this command:
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])));
}
Do I need to send it somehow of does it already do that with the return P?
|
Check the packet it must be 1017 not 1016
|
|
|
05/08/2010, 21:25
|
#19
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
It still will not work.
Check the packet again.
|
|
|
05/08/2010, 23:55
|
#20
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
|
Code:
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;
}
|
|
|
05/09/2010, 00:39
|
#21
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
Still will not work.
|
|
|
05/09/2010, 01:23
|
#22
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
You have to give all 3 values a number, otherwise your not going to see any change, try fiddling with the values, the packet layout is correct.
|
|
|
05/09/2010, 01:40
|
#23
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
So it is just the command that is wrong ?
|
|
|
05/09/2010, 02:05
|
#24
|
elite*gold: 0
Join Date: Mar 2010
Posts: 126
Received Thanks: 14
|
delete this thread.
|
|
|
05/09/2010, 05:23
|
#25
|
elite*gold: 0
Join Date: Jan 2008
Posts: 1,434
Received Thanks: 1,147
|
My structure works whit my correction... But as Korvacs said, you need to put a value to all. If you use a 5018+ client, you need to add the TQServer to the end, but the length in the packet should be 20.
Code:
Length -> 20
Type -> 1016
Look -> 1
Intensity -> 150
Direction -> 75
Color -> 0
Code:
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();
|
|
|
05/09/2010, 05:42
|
#26
|
elite*gold: 0
Join Date: Mar 2010
Posts: 126
Received Thanks: 14
|
delete this thread.
|
|
|
05/09/2010, 05:46
|
#27
|
elite*gold: 0
Join Date: Jan 2008
Posts: 1,434
Received Thanks: 1,147
|
Quote:
Originally Posted by -Spirits-
and still no snow =\
so what am I doing wrong?
|
The color of the snow should be 0.
|
|
|
05/09/2010, 07:46
|
#28
|
elite*gold: 0
Join Date: Mar 2010
Posts: 126
Received Thanks: 14
|
delete this thread.
|
|
|
05/09/2010, 12:37
|
#29
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
try /weather snow 1 1 1
Also:
Code:
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;
}
This packet is already in 5165 so why are you trying to remake it?
|
|
|
05/09/2010, 13:07
|
#30
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
Still will not work.
I have played around but nothing is there a chance that the command is all wrong ?
|
|
|
Similar Threads
|
[help]weather packet
11/25/2009 - CO2 Private Server - 2 Replies
staff, I need the packet of the weather, someone has?
|
All times are GMT +2. The time now is 14:33.
|
|