[Release] Day & Night!!

10/24/2008 00:58 felipeboladao#1
Open Genera.cs search For

Code:
public static System.IO.StreamWriter sw = new System.IO.StreamWriter(Application.StartupPath + @"\ServerLog.ini", true);
Add Under

Code:
public bool DayTime = true;
Search for

Code:
public static System.Timers.Timer Thetimer;
Add Below

Code:
        public static System.Timers.Timer DayLight;
        public static System.Timers.Timer NightLight;
Search for

Code:
Auth = new System.Timers.Timer();
                Auth.Interval = 300000;
                Auth.Elapsed += new ElapsedEventHandler(Auth_Elapsed);
                Auth.Start();
add Below

Code:
                DayLight = new System.Timers.Timer();
                DayLight.Interval = 3600000;
                DayLight.Elapsed += new ElapsedEventHandler(DayLight_Elapsed);
                DayLight.Start();

                NightLight = new System.Timers.Timer();
                NightLight.Interval = 1800000;
                NightLight.Elapsed += new ElapsedEventHandler(NightLight_Elapsed);
                NightLight.Stop();
Search For

Code:
void Auth_Elapsed(object sender, ElapsedEventArgs e)
        {
            Auth.Stop();
            AuthServer.Enabled = false;
            AuthServer.Enabled = true;
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Auth Checked And Fixed");
            Console.ResetColor();
            Auth.Start();
        }
Add Below

Code:
        public void Day()
        {
            foreach (DictionaryEntry DE in World.AllChars)
            {
                Character Charrr = (Character)DE.Value;
                Charrr.MyClient.SendPacket(General.MyPackets.Color(Charrr, 0));
            }
            NightLight.Stop();
            DayLight.Start();
            World.SendMsgToAll("Day has come.", "SYSTEM", 2005);
            DayTime = true;
        }
        public void Night()
        {
            foreach (DictionaryEntry DE in World.AllChars)
            {
                Character Charrr = (Character)DE.Value;
                Charrr.MyClient.SendPacket(General.MyPackets.Color(Charrr, 5855577));
            }
            NightLight.Stop();
            DayLight.Start();
            World.SendMsgToAll("Night has come.", "SYSTEM", 2005);
            DayTime = false;
        }
        void NightLight_Elapsed(object sender, ElapsedEventArgs e)
        {
            Day();
        }

        void DayLight_Elapsed(object sender, ElapsedEventArgs e)
        {
            Night();
        }
Open Client.cs Search for

Code:
public void GetIPE()
        {
            IPE = (IPEndPoint)ListenSock.WinSock.RemoteEndPoint;
        }
Add Below

Code:
public bool DayTime = true;
        public void Day()
        {
            foreach (DictionaryEntry DE in World.AllChars)
            {
                Character Charrr = (Character)DE.Value;
                Charrr.MyClient.SendPacket(General.MyPackets.Color(Charrr, 0));
            }
            General.NightLight.Stop();
            General.DayLight.Start();
            World.SendMsgToAll("Day has come.", "SYSTEM", 2005);
            DayTime = true;
        }
        public void Night()
        {
            foreach (DictionaryEntry DE in World.AllChars)
            {
                Character Charrr = (Character)DE.Value;
                Charrr.MyClient.SendPacket(General.MyPackets.Color(Charrr, 5855577));
            }
            General.NightLight.Stop();
            General.DayLight.Start();
            World.SendMsgToAll("Night has come.", "SYSTEM", 2005);
            DayTime = false;
        }
Open Packts.cs Search for

Code:
public byte[] GuildInfo(Guild TheGuild, Character Player)
add Under

Code:
        //Color
        public byte[] Color(Character Char, uint Color)
        {
            byte[] Packet = new byte[24];
            fixed (byte* p = Packet)
            {
                *((ushort*)p) = (ushort)Packet.Length;
                *((ushort*)(p + 2)) = (ushort)1010;
                *(uint*)(p + 8) = Char.UID;
                *(uint*)(p + 12) = Color;
                *(uint*)(p + 22) = 0x68;

            }
            return Packet;
        }
open Client search for

Code:
if (Splitter[0] == "/skill")
add Under

Code:
                                        if (Splitter[0] == "/night")
                                        {
                                            Night();
                                        }
                                        if (Splitter[0] == "/day")
                                        {
                                            Day();
                                        }
10/24/2008 01:03 XxArcherMasterxX#2
Nice release added to my [All-in-1] thread
10/24/2008 01:05 felipeboladao#3
:D
10/24/2008 01:07 XxArcherMasterxX#4
Quote:
Originally Posted by felipeboladao View Post
:D
btw if you want to thank me like you did in your other release press the thanks button:p
10/24/2008 01:11 felipeboladao#5
Tranks Archer Master .. =P
10/24/2008 01:14 felipeboladao#6
archer Master, my Entities.cs error is 3 to complete the Summoner Guard, help me?
10/24/2008 01:16 tao4229#7
You should credit Haydz, I highly doubt you got that packet structure yourself.
10/24/2008 01:17 XxArcherMasterxX#8
Quote:
Originally Posted by felipeboladao View Post
archer Master, my Entities.cs error is 3 to complete the Summoner Guard, help me?
sure i pm you my msn:p
10/24/2008 01:32 lostsolder05#9
nice, prolly gonna use this

anywayz rain,snow,etc: [Only registered and activated users can see links. Click Here To Register...]
10/24/2008 01:37 felipeboladao#10
show me Code Lost Solder05...

Tranks!!
10/24/2008 01:38 tao4229#11
Quote:
Originally Posted by lostsolder05 View Post
nice, prolly gonna use this

anywayz rain,snow,etc: [Only registered and activated users can see links. Click Here To Register...]
I have that too =P
Too lazy to SS it though... I'll MSN you my packet if you don't believe me(Ultimatum told me the base of it, although i got uuuuber confused until I realized he wasn't using pointers x.x).
10/24/2008 01:38 lostsolder05#12
Quote:
Originally Posted by felipeboladao View Post
show me Code Lost Solder05...

Tranks!!
soz not mine (Y)

credits orignally go out to lostsolder, korv <--- real lostsolder got smthing off pb's i believe and went off that

Quote:
Originally Posted by tao4229 View Post
I have that too =P
Too lazy to SS it though... I'll MSN you my packet if you don't believe me(Ultimatum told me the base of it, although i got uuuuber confused until I realized he wasn't using pointers x.x).
lol cool :P

and naw i believe ya =x
10/24/2008 02:00 felipeboladao#13
Hahaha,
Also on my must, if I do not mistake me this is the packts?

Code:
        
//Weather Effects (rain, snow, leaves, confetti, etc) [probobly wrong]
        public byte[] Packet0x3f8(uint UID, uint dwParam, ushort wParam1, ushort wParam2, ushort wParam3, ushort ID)
        {
            byte[] Buffer = new byte[24];
            fixed (byte* lpBuffer = Buffer)
            {
                *((ushort*)(lpBuffer)) = 24;
                *((ushort*)(lpBuffer + 2)) = 0x3f8;
                *((uint*)(lpBuffer + 4)) = (uint)Environment.TickCount;
                *((uint*)(lpBuffer + 8)) = UID;
                *((uint*)(lpBuffer + 12)) = dwParam;
                *((ushort*)(lpBuffer + 16)) = wParam1;
                *((ushort*)(lpBuffer + 18)) = wParam2;
                *((ushort*)(lpBuffer + 20)) = wParam3;
                *((ushort*)(lpBuffer + 22)) = ID;
            }
            return Buffer;
        }

        //Color v.2
        public byte[] Packet0x3f2(uint UID, uint dwParam, ushort wParam1, ushort wParam2, ushort wParam3, ushort ID)
        {
            byte[] Buffer = new byte[24];
            fixed (byte* lpBuffer = Buffer)
            {
                *((ushort*)(lpBuffer)) = 24;
                *((ushort*)(lpBuffer + 2)) = 0x3f2;
                *((uint*)(lpBuffer + 4)) = (uint)Environment.TickCount;
                *((uint*)(lpBuffer + 8)) = UID;
                *((uint*)(lpBuffer + 12)) = dwParam;
                *((ushort*)(lpBuffer + 16)) = wParam1;
                *((ushort*)(lpBuffer + 18)) = wParam2;
                *((ushort*)(lpBuffer + 20)) = wParam3;
                *((ushort*)(lpBuffer + 22)) = ID;
            }
            return Buffer;
        }
10/24/2008 05:07 lolex#14
lol
10/24/2008 17:09 Kiyono#15
uhm about the first half of the guide...

all the things that i need to search are not in there... (i used the original LOTF source)

nvm you had it called "Auth" but it was The_TImer or something in this source