Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 00:34

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

Advertisement



[Release] server maintenance in 5165 source

Discussion on [Release] server maintenance in 5165 source within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
gulpi_de_gulat's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 71
Received Thanks: 40
[Release] server maintenance in 5165 source

i post this in 4botters months ago so i decided to here too.
to let your players know that you have a server maintenance or something to to fix your server.
put in your program.cs
Code:
if (Cmd[0] == "/sm")
                    {
                        Game.World.SendMsgToAll("SYSTEM", "Server Maintanience in 5 minutes! Please log off to avoid data lost!", 2011, 0);
                        new Thread(new ThreadStart(
                        delegate()
                        {
                            Console.WriteLine("Server Maintenance Command Activated (via Console).");
                            Thread.Sleep(30000);
                            Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 4 minutes and 30 Seconds! Please Log off to prevent data loss!", 2011, 0);
                            Console.WriteLine("4 Minutes 30 seconds Left");
                            Thread.Sleep(30000);
                            Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 4 minutes! Please Log off to prevent data loss!", 2011, 0);
                            Console.WriteLine("4 Minutes Left");
                            Thread.Sleep(30000);
                            Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 3 minutes and 30 Seconds! Please Log off to prevent data loss!", 2011, 0);
                            Console.WriteLine("3 Minutes 30 seconds Left");
                            Thread.Sleep(30000);
                            Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 3 minutes! Please Log off to prevent data loss!", 2011, 0);
                            Console.WriteLine("3 Minutes Left");
                            Thread.Sleep(30000);
                            Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 2 minutes and 30 Seconds! Please Log off to prevent data loss!", 2011, 0);
                            Console.WriteLine("2 Minutes 30 seconds Left");
                            Thread.Sleep(30000);
                            Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 2 minutes! Please Log off to prevent data loss!", 2011, 0);
                            Console.WriteLine("2 Minutes Left");
                            Thread.Sleep(30000);
                            Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 1 minute and 30 Seconds! Please Log off to prevent data loss!", 2011, 0);
                            Console.WriteLine("1 Minutes 30 seconds Left");
                            Thread.Sleep(30000);
                            Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 1 minute! Please Log off to prevent data loss!", 2011, 0);
                            Console.WriteLine("1 Minute Left");
                            Thread.Sleep(30000);
                            Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 30 Seconds! Please Log off to prevent data loss!", 2011, 0);
                            Console.WriteLine("30 Seconds Left");
                            Thread.Sleep(30000);
                            Console.WriteLine("Server is now shutting down...");
                            Game.Character[] BaseCharacters = new Character[World.H_Chars.Count];
                            World.H_Chars.Values.CopyTo(BaseCharacters, 0);
                            NewestCOServer.Main.AuthWorker.Listener.Close();
                            NewestCOServer.Main.GameWorker.Listener.Close();
                            EndSession = true;
                            try
                            {
                                foreach (Game.Character C in BaseCharacters)
                                {
                                    Character Char = (Character)C.Value;
                                    C.MyClient.Disconnect();
                                    Console.WriteLine(C.Name + " is hard headed has force to logged off by the system.");
                                }
                            }
                            catch { }
                            Database.SaveKOs();
                            Console.WriteLine("KOs saved.");
                            Database.SaveEmpire();
                            Console.WriteLine("Empire saved.");
                            Features.Guilds.SaveGuilds();
                            Console.WriteLine("Guilds saved.");
                            DMaps.Save();
                            Features.SkillsClass.Save();
                            Console.WriteLine("Skills saved.");
                            DMaps.Save();
                            HouseItem.Save();

                            Console.WriteLine("Dynamic Maps Saved.");

                            MobThread.Close();
                            ServerStuff.Close();
                            CompanionThread.Close();
                            Database.Dispose();
                            Console.WriteLine("Database disposed.");
                            Console.WriteLine("Click X to close the window.");
                            Console.WriteLine("GOODBYE :D");
                        }
                    )).Start();
                    }
just type the console /sm
gulpi_de_gulat is offline  
Thanks
7 Users
Old 03/14/2010, 12:22   #2
 
arab4life's Avatar
 
elite*gold: 0
Join Date: Jan 2006
Posts: 430
Received Thanks: 286
Good Job.
arab4life is offline  
Thanks
1 User
Old 03/14/2010, 12:23   #3
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
nice work keep it up
coreymills is offline  
Old 03/14/2010, 23:41   #4
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
Why have so many Thread.Sleeps? Why not create a timer that sends a message every 30 seconds?
walmartboi is offline  
Old 03/14/2010, 23:55   #5
 
gulpi_de_gulat's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 71
Received Thanks: 40
Quote:
Originally Posted by walmartboi View Post
Why have so many Thread.Sleeps? Why not create a timer that sends a message every 30 seconds?
i have message every 12 mins just wait i post it
gulpi_de_gulat is offline  
Old 08/31/2010, 19:39   #6
 
elite*gold: 0
Join Date: Mar 2010
Posts: 4
Received Thanks: 0
where is program.cs
koshergreat is offline  
Old 08/31/2010, 22:31   #7
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by koshergreat View Post
where is program.cs
this definitely made my weekend...

killersub is offline  
Thanks
1 User
Old 09/01/2010, 00:20   #8
 
ImFlamedCOD's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 378
Received Thanks: 141
Quote:
Console.WriteLine("Click X to close the window.");
Console.WriteLine("GOODBYE ");
Environment.Exit(1);//Automatically Will Close The Console Out
Instead of having to click (X)
ImFlamedCOD is offline  
Old 09/01/2010, 13:47   #9
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
uhm
Code:
[COLOR="Magenta"]
NewestCOServer.Main.AuthWorker.Listener.Close();
NewestCOServer.Main.GameWorker.Listener.Close();[/COLOR]
try
                            {
                                foreach (Game.Character C in BaseCharacters)
                                {
                                    Character Char = (Character)C.Value;
                                    C.MyClient.Disconnect();
                                    Console.WriteLine(C.Name + " is hard headed has force to logged off by the system.");
                                }
                            }
                            catch { }
The code in purple disconnects everyone anyway? Why re-disconnect nobody? oo I might be wrong but by the looks...

Do the try then the code in purple.
_DreadNought_ is offline  
Old 09/01/2010, 22:24   #10
 
FrontBoy's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 275
Received Thanks: 142
Thanksssss man! This realy helped ^^
FrontBoy is offline  
Old 09/02/2010, 03:34   #11
 
elite*gold: 0
Join Date: Oct 2008
Posts: 342
Received Thanks: 66
are you ******* serious with that release?
µ~Xero~µ is offline  
Reply


Similar Threads Similar Threads
[Release]5165 Source
01/20/2012 - CO2 PServer Guides & Releases - 25 Replies
Stuff in the source Fixed Fb/Ss System QuizShow Fixed Some Bugs GM, PMS Can Pk Most NPC Fixed Rates(Can Be Changed) FrozenGrotto(works but the mobs do to high dmg) lab npc and spawns guildwar
Server Maintenance... (HELP!) 5165
05/15/2010 - CO2 Private Server - 2 Replies
Hi there, i have set up my own server, i have checked all my ip address and everything is in the right place, i have run the server, done the /newacc test 1234 thing and then loaded a 5165 client i KNOW works, then went to log in, i entered my details EXACTLY as i had put them in the server console and the screen goes black with the 2 dragon things at the side but no loading bar in the middle. EVENTUALLY it looks like it is going to load for a second, then comes up with server maintenance or...
[PROBLEM] 5165 Server Maintenance Error
04/17/2010 - CO2 Private Server - 8 Replies
I have my 5165 Source set up correctly. I have the Config File edited 100% correctly and the OldCODb folder in my C: where its supposed to be. I can login to the server, but no one else can. Btw, they have the correct ip in Server.dat as well. :/
[Release]5165 Source
11/23/2009 - CO2 PServer Guides & Releases - 31 Replies
#Edit There removed it now leave me alone But its not gonna matter that i removed it cause its alll on 4BOTTERS and stickied lmao #requesclose Pleas and Thank You



All times are GMT +1. The time now is 00:36.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.