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 23:50

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

Advertisement



[RELEASE] Console Commands for Lame Console Look

Discussion on [RELEASE] Console Commands for Lame Console Look within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
[RELEASE] Console Commands for Lame Console Look

Well, to avoid any further useless posts on this subject... here are a ton of console based commands that will control the game from the server console. I will not explain what each does, it should be pretty easy to figure out, and I don't intend to answer stupid questions. If its a good question, I will answer it.

Code:
        public static void DoStuff()
        {
            bool flag = true;
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("*^* Console Command Successfully Loaded *^*");
            Console.WriteLine("");
            Console.ResetColor();
            Console.WriteLine("-- Type .help for a list of the available commands --");
            while (flag)
            {
                string str;
                str = Console.ReadLine();
                if (str == ".close")
                {
                    try
                    {
                        foreach (DictionaryEntry DE in World.AllChars)
                        {
                            Character Char = (Character)DE.Value;
                            DataBase.ChangeOnlineStatus(Char.MyClient.Account, 0);
                        }
                        World.SaveAllChars();
                        sw.Flush();
                        sw.Close();
                        DataBase.AllOffline();
                        Environment.Exit(Environment.ExitCode);
                    }
                    catch { }
                }
                if (str == ".restart")
                {
                    World.SendMsgToAll("Server Restart in 10 seconds!", "SYSTEM", 2011);
                    new Thread(new ThreadStart(
                     delegate()
                     {
                         Console.WriteLine("Server Restarting in 10 seconds!");
                         Thread.Sleep(10000);
                         General.ServerRestart();
                     }
                  )).Start();
                }
                if (str == ".clear")
                {
                    Console.Clear();
                    Console.ForegroundColor = ConsoleColor.Cyan;
                    Console.WriteLine("*^* Server Source *^*");
                    Console.WriteLine("-=-=-=-=-=-=-=-=-=-=");
                    Console.ResetColor();
                }
                if (str == ".help")
                {
                    Console.WriteLine("\nCurrent Console Commands: \n.clear - Clears Console \n.restart - Restarts Server \n.close - Closes Server (and saves characters) \n.message - Sends in-Game GM Message \n.sm - Automated 5-minute Server Maintenance Command\n.playershow - Shows who is on and how many clients are connected to the server.");
                }
                if (str == ".sm")
                {
                    World.SendMsgToAll("Server Maintanience in 5 minutes! Please log off to avord data lost!", "SYSTEM", 2011);
                    new Thread(new ThreadStart(
                    delegate()
                    {
                        Console.WriteLine("Server Maintenance Command Activated (via Console).");
                        Thread.Sleep(30000); // 30 second
                        World.SendMsgToAll("Server Maintenance in 4 minutes and 30 Seconds! Please Log off to prevent data loss!", "SYSTEM", 2011);
                        Console.WriteLine("4:30 Minutes Left");
                        Thread.Sleep(30000); // 30 second
                        World.SendMsgToAll("Server Maintenance in 4 minutes! Please Log off to prevent data loss!", "SYSTEM", 2011);
                        Console.WriteLine("4 Minutes Left");
                        Thread.Sleep(30000); // 30 second
                        World.SendMsgToAll("Server Maintenance in 3 minutes and 30 Seconds! Please Log off to prevent data loss!", "SYSTEM", 2011);
                        Console.WriteLine("3:30 Minutes Left");
                        Thread.Sleep(30000); // 30 second
                        World.SendMsgToAll("Server Maintenance in 3 minutes! Please Log off to prevent data loss!", "SYSTEM", 2011);
                        Console.WriteLine("3 Minutes Left");
                        Thread.Sleep(30000); // 30 second
                        World.SendMsgToAll("Server Maintenance in 2 minutes and 30 Seconds! Please Log off to prevent data loss!", "SYSTEM", 2011);
                        Console.WriteLine("2:30 Minutes Left");
                        Thread.Sleep(30000); // 30 second
                        World.SendMsgToAll("Server Maintenance in 2 minutes! Please Log off to prevent data loss!", "SYSTEM", 2011);
                        Console.WriteLine("2 Minutes Left");
                        Thread.Sleep(30000); // 30 second
                        World.SendMsgToAll("Server Maintenance in 1 minute and 30 Seconds! Please Log off to prevent data loss!", "SYSTEM", 2011);
                        Console.WriteLine("1:30 Minutes Left");
                        Thread.Sleep(30000); // 30 second
                        World.SendMsgToAll("Server Maintenance in 1 minute! Please Log off to prevent data loss!", "SYSTEM", 2011);
                        Console.WriteLine("1 Minute Left");
                        Thread.Sleep(30000); // 30 second
                        World.SendMsgToAll("Server Maintenance in 30 Seconds! Please Log off to prevent data loss!", "SYSTEM", 2011);
                        Console.WriteLine("0:30 Seconds Left");
                        Thread.Sleep(30000); // 30 second
                        World.SendMsgToAll("Server Maintenance for 30 minutes! Please Log off to prevent data loss!", "SYSTEM", 2011);
                        Thread.Sleep(10000); // 30 second
                        Console.WriteLine("Server is now shutting down...");
                        try
                        {
                            foreach (DictionaryEntry DE in World.AllChars)
                            {
                                Character Char = (Character)DE.Value;
                                DataBase.ChangeOnlineStatus(Char.MyClient.Account, 0);
                            }
                            World.PlayersOffLottery();
                            World.SaveAllChars();
                            sw.Flush();
                            sw.Close();
                            DataBase.AllOffline();
                            Environment.Exit(Environment.ExitCode);
                        }
                        catch { }



                    }
                 )).Start();


                }
                if (str.StartsWith(".message"))
                {
                    string msg;
                    msg = str.Substring(8);
                    World.SendMsgToAll(msg, "SYSTEM", 2011);
                    Console.WriteLine("Sent Message");
                }
                if (str.StartsWith(".playershow"))
                {
                    string BackMsg = "";
                    foreach (DictionaryEntry DE in World.AllChars)
                    {
                        Character Char = (Character)DE.Value;
                        BackMsg += Char.Name + ", ";
                    }
                    if (BackMsg.Length > 1)
                        BackMsg = BackMsg.Remove(BackMsg.Length - 2, 2);
                    Console.WriteLine("Players Online: " + World.AllChars.Count + "\n" + BackMsg);

                }
            }
        }
taguro is offline  
Thanks
5 Users
Old 11/18/2008, 14:57   #2
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
Just wondering, where'd you get these commands from?
tao4229 is offline  
Old 11/18/2008, 15:05   #3


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
You should imo modify this to work in a seperate thread, otherwise your going to see increased latency....
Korvacs is offline  
Old 11/18/2008, 15:15   #4
 
Exia13's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 256
Received Thanks: 21
LOL, i didnt think you'd release them. Well, i guess they'd come out sooner or later

Just testing the commands, but how how do you actually execute them once they're typed (tried pressing enter but i forgot that it closes the console.)
Exia13 is offline  
Old 11/18/2008, 16:29   #5


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by Exia13 View Post
LOL, i didnt think you'd release them. Well, i guess they'd come out sooner or later

Just testing the commands, but how how do you actually execute them once they're typed (tried pressing enter but i forgot that it closes the console.)
Anouther good reason to have it in a sepeare thread, but from the code posted the console wont close when you hit enter, it will just read the line and perform the commands listed
Korvacs is offline  
Old 11/18/2008, 16:31   #6
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
Quote:
Originally Posted by Exia13 View Post
LOL, i didnt think you'd release them. Well, i guess they'd come out sooner or later

Just testing the commands, but how how do you actually execute them once they're typed (tried pressing enter but i forgot that it closes the console.)
You have to actually call the method

After you load all the **** call the method.
tao4229 is offline  
Old 11/18/2008, 16:32   #7
 
Exia13's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 256
Received Thanks: 21
Well ok. But like i said, i wont be using this.
Exia13 is offline  
Old 12/23/2008, 16:31   #8
 
flamesco's Avatar
 
elite*gold: 0
Join Date: Dec 2008
Posts: 21
Received Thanks: 0
thanks for the commands, i like this console better than my other one =] i hit thanks button
flamesco is offline  
Old 07/23/2009, 22:20   #9
 
Pyro-G's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 25
Received Thanks: 10
Where do I put this code?=D
Pyro-G is offline  
Old 07/24/2009, 03:49   #10
 
© Haydz's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
Quote:
Originally Posted by Pyro-G View Post
Where do I put this code?=D
AssemblyInfo.cs
© Haydz is offline  
Old 07/24/2009, 04:45   #11
 
elite*gold: 0
Join Date: Jul 2009
Posts: 548
Received Thanks: 52
This is for lotf lol..
f0am is offline  
Old 12/07/2011, 00:51   #12
 
elite*gold: 0
Join Date: Mar 2011
Posts: 4
Received Thanks: 0
urghhh
jervz is offline  
Old 12/07/2011, 04:02   #13
 
-Sensei-'s Avatar
 
elite*gold: 0
Join Date: Oct 2011
Posts: 267
Received Thanks: 59
**** this kid
-Sensei- is offline  
Reply


Similar Threads Similar Threads
aion console commands?
08/18/2017 - Aion - 6 Replies
anyone has any command that can be used in the console?
GM commands for console
09/07/2010 - Last Chaos - 1 Replies
Hi i would like to know i there is a list with GM commans to set in a admin console and a example to write them. Because i have tried to write them in the console but never work. Thanks a lot.
[Release]User Delete (Console Commands for 5165)
04/22/2010 - CO2 PServer Guides & Releases - 14 Replies
#Fixed but not tested. If fixed, thank you 'notforme'. Okay so I came up with the idea on doing this a while back but I forgot about it. But now I remembered and I've decided to release it. Function: It deletes the Account or Character from your OldCODB. Purpose: For lazy people that do not want to go through folders to find what they are looking for to then delete it. Also, a little practice for me in C#. How can this be improved: Well, I wanted it to be able to delete the Account...
[Release]Console Commands with a bit of color [CoEmu V2]
07/19/2009 - CO2 PServer Guides & Releases - 9 Replies
Alright here it is dident take to long to make Umm there is one thing you will have to do that is not very hard and that is add a defintion for CSocket This is for the Game Server btw Ok To start off Add To Nano.cs using System.Diagnostics; Then add using System.Windows.Forms;
[Release] Lame Console Look
11/23/2008 - CO2 PServer Guides & Releases - 32 Replies
Aight,im sick today and has nothing to do,poor me. Saw a post when LetterX acted cool and showed up his console,so I'd thought I release how to do that. I wont explain since theres 1 / 100 who actually read the explonations , so yeah here it goes: Search for : ServerIP = Config.ReadValue("Server", "ServerIP"); Under, add :



All times are GMT +2. The time now is 23:50.


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.