[Help] Weather Packet (My First Packet)

05/11/2010 16:37 Kiyono#76
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 Korvacs#77
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 _Emme_#78
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 Korvacs#79
Quote:
Originally Posted by EmmeTheCoder View Post
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 MonstersAbroad#80
He just cannot take it that other people will get the weather too.
05/11/2010 22:48 -impulse-#81
Quote:
Originally Posted by MonstersAbroad View Post
He just cannot take it that other people will get the weather too.
Too much selfishness? :facepalm:

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 MonstersAbroad#82
Agreed 100%
06/07/2014 03:55 mejo33#83
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 InsomniacPro#84
Quote:
Originally Posted by mejo33 View Post
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 mejo33#85
Quote:
Originally Posted by InsomniacPro View Post
The weather packet is publicly available. Find it, structure it in your source, then use it.
I using this source: [Only registered and activated users can see links. Click Here To Register...]
06/07/2014 13:27 turk55#86
Quote:
Originally Posted by mejo33 View Post
I using this source: [Only registered and activated users can see links. Click Here To Register...]
And how is that relevant to the post InsomniacPro posted?
06/07/2014 14:02 mejo33#87
Quote:
Originally Posted by turk55 View Post
And how is that relevant to the post InsomniacPro posted?
There is no structure for weather system...
06/07/2014 14:08 Korvacs#88
Quote:
Originally Posted by mejo33 View Post
There is no structure for weather system...
Make one, chances are this structure is unchanged - [Only registered and activated users can see links. Click Here To Register...]
06/07/2014 14:08 abdoumatrix#89
Quote:
Originally Posted by mejo33 View Post
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
            {
                
MsgInfopMsg stackalloc MsgInfo[1];
                
pMsg->Header.Length = (Int16)sizeof(MsgInfo);
                
pMsg->Header.Type Id;

                
pMsg->Type Map.Weather;
                
pMsg->Intensity MyMath.Generate(125150);
                
pMsg->Direction MyMath.Generate(4585);
                
pMsg->Color 0;

                
Byte[] Out = new Byte[pMsg->Header.Length];
                
Marshal.Copy((IntPtr)pMsgOut0Out.Length);

                return 
Out;
            }
            catch (
Exception Exc) { Program.WriteLine(Exc); return null; }
        }
    }

check this
06/07/2014 15:01 SteveRambo#90
Quote:
Originally Posted by abdoumatrix View Post
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
            {
                
MsgInfopMsg stackalloc MsgInfo[1];
                
pMsg->Header.Length = (Int16)sizeof(MsgInfo);
                
pMsg->Header.Type Id;

                
pMsg->Type Map.Weather;
                
pMsg->Intensity MyMath.Generate(125150);
                
pMsg->Direction MyMath.Generate(4585);
                
pMsg->Color 0;

                
Byte[] Out = new Byte[pMsg->Header.Length];
                
Marshal.Copy((IntPtr)pMsgOut0Out.Length);

                return 
Out;
            }
            catch (
Exception Exc) { Program.WriteLine(Exc); return null; }
        }
    }

check this
Quote:
Code:
// * Created by CptSky
// * Copyright © 2011
// * COPS v6 Emulator - Project
...