|
You last visited: Today at 12:02
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/11/2010, 16:37
|
#76
|
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
|
Well I got it working thanks to impulse's packet.
//edit The shitty command I used:
Code:
if (Cmd[0] == "/weather")
{
foreach (Game.Character C in Game.World.H_Chars.Values)
{
switch (Cmd[1])
{
case "none": C.MyClient.AddSend(Packets.Weather(Features.WeatherType.Nothing, byte.Parse(Cmd[2]), byte.Parse(Cmd[3]))); break;
case "rain": C.MyClient.AddSend(Packets.Weather(Features.WeatherType.Rain, byte.Parse(Cmd[2]), byte.Parse(Cmd[3]))); break;
case "snow": C.MyClient.AddSend(Packets.Weather(Features.WeatherType.Snow, byte.Parse(Cmd[2]), byte.Parse(Cmd[3]))); break;
case "rain2": C.MyClient.AddSend(Packets.Weather(Features.WeatherType.RainWind, byte.Parse(Cmd[2]), byte.Parse(Cmd[3]))); break;
case "leaves": C.MyClient.AddSend(Packets.Weather(Features.WeatherType.AutumnLeaves, byte.Parse(Cmd[2]), byte.Parse(Cmd[3]))); break;
case "cherry": C.MyClient.AddSend(Packets.Weather(Features.WeatherType.CherryBlossomPetals, byte.Parse(Cmd[2]), byte.Parse(Cmd[3]))); break;
case "herry22": C.MyClient.AddSend(Packets.Weather(Features.WeatherType.CherryBlossomPetalsWind, byte.Parse(Cmd[2]), byte.Parse(Cmd[3]))); break;
case "cotten": C.MyClient.AddSend(Packets.Weather(Features.WeatherType.BlowingCotten, byte.Parse(Cmd[2]), byte.Parse(Cmd[3]))); break;
case "atoms": C.MyClient.AddSend(Packets.Weather(Features.WeatherType.Atoms, byte.Parse(Cmd[2]), byte.Parse(Cmd[3]))); break;
}
}
}
|
|
|
05/11/2010, 18:14
|
#77
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Im working on a weather system for 5165 which will randomly change the weather every now and again (the exact time varies between 5 - 30 minute intervals), with random intensity and direction. So far its working great, it just started raining.
|
|
|
05/11/2010, 18:51
|
#78
|
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
|
Well Korv, the last two pages has been an argument or discussion with you and Spirit/Arco if you had or had not the right version on the wiki, is that so important for the community, couldn't you keep that to PM?
And besides, isn't the wiki a project of yours, why is a thread not closened after request just to get more/correct information to your project, I hardly believe you would keep another thread open if it was for somebody else, not moderator.
Anyhow, what you do now is clean up this thread and only leave the important posts left, such as Alex's correct packet. Then close the thread, and everybody will be happy.
|
|
|
05/11/2010, 19:01
|
#79
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Quote:
Originally Posted by EmmeTheCoder
Well Korv, the last two pages has been an argument or discussion with you and Spirit/Arco if you had or had not the right version on the wiki, is that so important for the community, couldn't you keep that to PM?
And besides, isn't the wiki a project of yours, why is a thread not closened after request just to get more/correct information to your project, I hardly believe you would keep another thread open if it was for somebody else, not moderator.
Anyhow, what you do now is clean up this thread and only leave the important posts left, such as Alex's correct packet. Then close the thread, and everybody will be happy.
|
Actually Emme, what i do is what i choose to do, this thread is not left open for my benefit, this thread demonstrates where problems can arrise when implemented the weather system and packets, and also demonstrates the importance of getting the packet correct to begin with, in my oppinion it is a good example, and beneficial to the community if they wish to implement the weather system themselves.
Also spirits has made a formal complaint about this thread, so for the time being it will remain as it is untill the complaint is resolved.
|
|
|
05/11/2010, 21:28
|
#80
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
He just cannot take it that other people will get the weather too.
|
|
|
05/11/2010, 22:48
|
#81
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
Quote:
Originally Posted by MonstersAbroad
He just cannot take it that other people will get the weather too.
|
Too much selfishness?
Everyone who tried to help and posted some packets didn't just try to help a single person to be unique. This is a whole community so, if we'd just want all servers be unique probably we wouldn't post here packets.
And if -Spirits- really wanted his server to be unique having weather and this thread removed he surely should be banned from this community as he doesn't even try to improve the community.
|
|
|
05/12/2010, 17:11
|
#82
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
Agreed 100%
|
|
|
06/07/2014, 03:55
|
#83
|
elite*gold: 0
Join Date: Sep 2007
Posts: 370
Received Thanks: 117
|
So..... i know about this thread create at 2010 years but i need weater system in Hellmuth (albetros) source 5518+, any one can help me? Thanks..
|
|
|
06/07/2014, 04:10
|
#84
|
elite*gold: 0
Join Date: Feb 2014
Posts: 397
Received Thanks: 205
|
Quote:
Originally Posted by mejo33
So..... i know about this thread create at 2010 years but i need weater system in Hellmuth (albetros) source 5518+, any one can help me? Thanks..
|
The weather packet is publicly available. Find it, structure it in your source, then use it.
|
|
|
06/07/2014, 12:20
|
#85
|
elite*gold: 0
Join Date: Sep 2007
Posts: 370
Received Thanks: 117
|
Quote:
Originally Posted by InsomniacPro
The weather packet is publicly available. Find it, structure it in your source, then use it.
|
I using this source:
|
|
|
06/07/2014, 13:27
|
#86
|
elite*gold: 130
Join Date: Oct 2007
Posts: 1,655
Received Thanks: 706
|
Quote:
Originally Posted by mejo33
I using this source: 
|
And how is that relevant to the post InsomniacPro posted?
|
|
|
06/07/2014, 14:02
|
#87
|
elite*gold: 0
Join Date: Sep 2007
Posts: 370
Received Thanks: 117
|
Quote:
Originally Posted by turk55
And how is that relevant to the post InsomniacPro posted?
|
There is no structure for weather system...
|
|
|
06/07/2014, 14:08
|
#88
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Quote:
Originally Posted by mejo33
There is no structure for weather system...
|
Make one, chances are this structure is unchanged -
|
|
|
06/07/2014, 14:08
|
#89
|
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 239
|
Quote:
Originally Posted by mejo33
There is no structure for weather system...
|
PHP Code:
// * Created by CptSky
// * Copyright © 2011
// * COPS v6 Emulator - Project
using System;
using System.Runtime.InteropServices;
namespace COServer.Network
{
public unsafe class MsgWeather : Msg
{
public const Int16 Id = _MSG_WEATHER;
public enum Type
{
None = 1,
Rain = 2,
Snow = 3,
RainWind = 4,
AutumnLeaves = 5,
CherryBlossomPetals = 7,
CherryBlossomPetalsWind = 8,
BlowingCotten = 9,
Atoms = 10,
}
[StructLayout(LayoutKind.Sequential)]
public struct MsgInfo
{
public MsgHeader Header;
public Int32 Type;
public Int32 Intensity;
public Int32 Direction;
public Int32 Color;
};
public static Byte[] Create(Map Map)
{
try
{
MsgInfo* pMsg = stackalloc MsgInfo[1];
pMsg->Header.Length = (Int16)sizeof(MsgInfo);
pMsg->Header.Type = Id;
pMsg->Type = Map.Weather;
pMsg->Intensity = MyMath.Generate(125, 150);
pMsg->Direction = MyMath.Generate(45, 85);
pMsg->Color = 0;
Byte[] Out = new Byte[pMsg->Header.Length];
Marshal.Copy((IntPtr)pMsg, Out, 0, Out.Length);
return Out;
}
catch (Exception Exc) { Program.WriteLine(Exc); return null; }
}
}
}
check this
|
|
|
06/07/2014, 15:01
|
#90
|
elite*gold: 0
Join Date: Sep 2013
Posts: 197
Received Thanks: 141
|
Quote:
Originally Posted by abdoumatrix
PHP Code:
// * Created by CptSky
// * Copyright © 2011
// * COPS v6 Emulator - Project
using System;
using System.Runtime.InteropServices;
namespace COServer.Network
{
public unsafe class MsgWeather : Msg
{
public const Int16 Id = _MSG_WEATHER;
public enum Type
{
None = 1,
Rain = 2,
Snow = 3,
RainWind = 4,
AutumnLeaves = 5,
CherryBlossomPetals = 7,
CherryBlossomPetalsWind = 8,
BlowingCotten = 9,
Atoms = 10,
}
[StructLayout(LayoutKind.Sequential)]
public struct MsgInfo
{
public MsgHeader Header;
public Int32 Type;
public Int32 Intensity;
public Int32 Direction;
public Int32 Color;
};
public static Byte[] Create(Map Map)
{
try
{
MsgInfo* pMsg = stackalloc MsgInfo[1];
pMsg->Header.Length = (Int16)sizeof(MsgInfo);
pMsg->Header.Type = Id;
pMsg->Type = Map.Weather;
pMsg->Intensity = MyMath.Generate(125, 150);
pMsg->Direction = MyMath.Generate(45, 85);
pMsg->Color = 0;
Byte[] Out = new Byte[pMsg->Header.Length];
Marshal.Copy((IntPtr)pMsg, Out, 0, Out.Length);
return Out;
}
catch (Exception Exc) { Program.WriteLine(Exc); return null; }
}
}
}
check this
|
Quote:
Code:
// * Created by CptSky
// * Copyright © 2011
// * COPS v6 Emulator - Project
|
...
|
|
|
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 +1. The time now is 12:03.
|
|