Register for your free account! | Forgot your password?

You last visited: Today at 14:20

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Re][Release]Day And Night.

Discussion on [Re][Release]Day And Night. within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Closed Thread
 
Old   #1
 
vortexsoul's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 45
Received Thanks: 7
Smile [Re][Release]Day And Night.

I do not take any credit for this guide.
All i did was change how u searched because not all lotf sources are the same.

Oringinal Released Post.


Ok Now Open General.cs And Search For.
Code:
Quote:
public static System.IO.StreamWriter sw = new System.IO.StreamWriter(Application.StartupPath + @"\ServerLog.txt", true)
Ok Now Under Add.

Code:
Quote:
public bool DayTime = true;
Now Search for.

Code:

Quote:
public static System.Timers.Timer Thetimer;
Now Add Below.

Code:

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

Code:

Quote:
Thetimer = new System.Timers.Timer();
Thetimer.Interval = 5000;//5 seconds
Thetimer.Elapsed += new ElapsedEventHandler(Thetimer_Elapsed);
Thetimer.Start();
And Add Below.

Code:

Quote:
//Day And Night
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();
Now Search For.

Code:

Quote:
public static void RestartTimer_Elapsed(object sender, ElapsedEventArgs e)
{
World.SaveAllChars();
General.ServerRestart();
}
Now Add Above.

Code:

Quote:
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();
}
Now Open Client.cs Search for.

Code:

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

Code:

Quote:
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;
}
Now Open Packets.cs Search for.

Code:

Quote:
public byte[] GuildInfo(Guild TheGuild, Character Player)
And Add Under.

Code:

Quote:
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;
}
Now Open Client.cs And Search For.

Code:

Quote:
if (Splitter[0] == "/skill")
And Add Under.

Code:

Quote:
if (Splitter[0] == "/night")
{
Night();
}
if (Splitter[0] == "/day")
{
Day();
}
Well i hope this helped solveing some peoples problems
with adding day&night into there private servers.
vortexsoul is offline  
Thanks
6 Users
Old 10/26/2008, 12:37   #2

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
If you just used common sence you would have figured out...
Kiyono is offline  
Old 10/26/2008, 12:44   #3
 
elite*gold: 0
Join Date: Jun 2007
Posts: 323
Received Thanks: 30
The original release was pretty straight forward if you're not egy o_o
Zanzibar is offline  
Old 10/26/2008, 13:19   #4
 
elite*gold: 0
Join Date: Apr 2008
Posts: 470
Received Thanks: 264
added to my all-in-1 thread
XxArcherMasterxX is offline  
Old 10/26/2008, 13:22   #5

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
Quote:
Originally Posted by XxArcherMasterxX View Post
added to my all-in-1 thread
... why ?
Kiyono is offline  
Old 10/26/2008, 13:24   #6
 
elite*gold: 0
Join Date: Apr 2008
Posts: 470
Received Thanks: 264
Quote:
Originally Posted by Djago160 View Post
... why ?
because its a release
XxArcherMasterxX is offline  
Old 10/26/2008, 13:28   #7
 
elite*gold: 0
Join Date: Dec 2006
Posts: 196
Received Thanks: 35
Quote:
Originally Posted by XxArcherMasterxX View Post
because its a release
you really are an idiot, right?
randomnoob is offline  
Old 10/26/2008, 13:29   #8
 
elite*gold: 0
Join Date: Apr 2008
Posts: 470
Received Thanks: 264
Quote:
Originally Posted by randomnoob View Post
you really are an idiot, right?
i give him a reason why i added it to my all in 1 thread and then you say that im a idiot LOL! you are the idiot here not me so please STFU!
XxArcherMasterxX is offline  
Old 10/26/2008, 13:34   #9
 
elite*gold: 0
Join Date: Dec 2006
Posts: 196
Received Thanks: 35
Quote:
Originally Posted by XxArcherMasterxX View Post
i give him a reason why i added it to my all in 1 thread and then you say that im a idiot LOL! you are the idiot here not me so please STFU!
maybe you should use your brain (if you have anu, seems not), why would you even bother adding this?
its excact the same as the other one except the things you need to search for.
randomnoob is offline  
Old 10/26/2008, 13:35   #10
 
$HaDoW's Avatar
 
elite*gold: 0
Join Date: Sep 2007
Posts: 285
Received Thanks: 78
I dont understand why ppl use this **** its so useless -_- I see no point adding this to my server !
$HaDoW is offline  
Old 10/26/2008, 23:40   #11
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
XxArcherMasterxX and randomnoob... leave it to the pms please...
taguro is offline  
Old 10/26/2008, 23:44   #12
 
elite*gold: 0
Join Date: Apr 2008
Posts: 470
Received Thanks: 264
Quote:
Originally Posted by taguro View Post
XxArcherMasterxX and randomnoob... leave it to the pms please...
dont worry the fight is over
XxArcherMasterxX is offline  
Old 10/26/2008, 23:47   #13
 
lolex's Avatar
 
elite*gold: 0
Join Date: May 2007
Posts: 46
Received Thanks: 0
Exclamation

XxArcherMasterxX <-------- is a true noob, He wants to give the code to noobs so easy, I just contribulle to the noobs are more stupid and not to seek capable threads ...

XxArcherMasterxX <--- delete the thread that has, as well as the noobs think you've done all the work.

On the ethics you should not do this. This insulting of all the intellectual encoders.
lolex is offline  
Old 10/26/2008, 23:50   #14
 
elite*gold: 0
Join Date: Apr 2008
Posts: 470
Received Thanks: 264
Quote:
Originally Posted by lolex View Post
XxArcherMasterxX <-------- is a true noob, He wants to give the code to noobs so easy, I just contribulle to the noobs are more stupid and not to seek capases threads ...

XxArcherMasterxX <--- delete the thread that has, as well as the noobs think you've done all the work.

On the ethics you should not do this. This insulting of all the intellectual encoders.
shutup lolmaster what do you want? all your posts are useless on epvp and why making a new account and not using your old account? (lolmaster123)

Quote:
Originally Posted by lolex View Post
/Delete
delete what?
XxArcherMasterxX is offline  
Old 02/03/2009, 14:56   #15
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 491
here i made my own command its a bit neater =]

to use it do...

/time day
/time night


Code:
if (Splitter[0] == "/time")
                                            {
                                                if (Splitter[1] == "day")
                                                {
                                                    Day();
                                                }
                                                if (Splitter[1] == "night")
                                                {
                                                    Night();
                                                }
                                            }
PeTe Ninja is offline  
Closed Thread


Similar Threads Similar Threads
[Release] Night Devil and Dance Skill books
07/15/2009 - CO2 PServer Guides & Releases - 10 Replies
I think its nothing all the important right now. but i wanted to contribute in some way. Side Notes:Not sure if the Night Devil skill even work, Since the XP skill isnt coded. Dance 4 gives you dance 7 =/ Not to sure why either. Since. The Skill ID and Item ID is for dance 4. but if anyone knows why and can fix it. please do. :p Credits: scottdavey for the skill book structural idea Go into Handler/Useitem.cs case 725016: //Night Devil { ...
[Release] Day & Night!!
04/20/2009 - CO2 PServer Guides & Releases - 23 Replies
Open Genera.cs search For public static System.IO.StreamWriter sw = new System.IO.StreamWriter(Application.StartupPath + @"\ServerLog.ini", true); Add Under public bool DayTime = true;



All times are GMT +2. The time now is 14:20.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.