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 19:00

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

Advertisement



[Release]Console Commands with a bit of color [CoEmu V2]

Discussion on [Release]Console Commands with a bit of color [CoEmu V2] within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
[Release]Console Commands with a bit of color [CoEmu V2]

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
Code:
using System.Diagnostics;


Then add
Code:
using System.Windows.Forms;

After That add Preferably at the bottom but it is your choice
Code:
public static void ServerRestart()
        {
            Process nServ = new Process();
            nServ.StartInfo.FileName = Application.StartupPath + @"\CoEmu v2 GameServer";
            nServ.Start();
            Environment.Exit(0);
        }
Then Search for public static void ConsoleCommands() Replace it with this
Code:
public static void ConsoleCommands()
        {
            //Console.WriteLine("Ready for commands.");
            bool unkowncommand = false;
            Console.ForegroundColor = ConsoleColor.Green;
            {
                Console.WriteLine("Type #Help For Console commands!");
            }
            string command = Console.ReadLine();
            Console.ForegroundColor = ConsoleColor.Red;
            {
                if (command == "#Help")
                {
                    Console.WriteLine("************Welcome To The Help Page**********");//Credits To hunterman01
                    Console.WriteLine("Type #Commands For a List of the commands");
                }
            }
            Console.ForegroundColor = ConsoleColor.Blue;
            {
                if (command == "#Commands")
                {
                    Console.WriteLine("Commands Are As Follows");
                    Console.WriteLine("#restart--Which restarts the server");
                    Console.WriteLine("#Server Maitnence--which closes the server in 5 mintues");
                    Console.WriteLine("#message--Which sends a message to the server");
                    Console.WriteLine("#close--Which Closes the server");
                }
            }

            if (command == "#message")
            {
                //CoEmu_v2_GameServer.Packets.ConquerPacket.ToServer(CoEmu_v2_GameServer.Packets.ConquerPacket.Chat(0, CSocket.Client.Name, "ALLUSERS", CoEmu_v2_GameServer.Structs.Struct.ChatType.NewBroadcast), 0);
                //TO-DO ADD A DEFINITION FOR CSocket
            }
            if (command == "#restart")//partial credits to Andrea
            {
                Console.WriteLine("Server Being restarted Now");
                ServerRestart();
            }
            if (command == "#close")
            {
                CoEmu_v2_GameServer.Packets.ConquerPacket.ToServer(CoEmu_v2_GameServer.Packets.ConquerPacket.Chat(0, "OWNER", "ALLUSERS", "[GameServer] Shutting down for a restart now!", CoEmu_v2_GameServer.Structs.Struct.ChatType.NewBroadcast), 0);
                Console.Write("Server being shutdown Now!");
                System.Environment.Exit(1);
            }
            if (command == "#Server Maitnence")
            {
                
                Shutdown = new System.Timers.Timer();

                Shutdown.Interval = 180000;
                Shutdown.AutoReset = false;
                Shutdown.Elapsed += delegate { Kill(); };
                Shutdown.Start();
                CoEmu_v2_GameServer.Packets.ConquerPacket.ToServer(CoEmu_v2_GameServer.Packets.ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "[GameServer] Shutting down in 3 minutes.", CoEmu_v2_GameServer.Structs.Struct.ChatType.Talk), 0);
                unkowncommand = true;
            }
            else
            {
                if (unkowncommand == true)
                {
                    //Console.WriteLine("Unknown command.");
                }
                ConsoleCommands();
            }
        }

If There is Any Problem let me know and i will update

And you can pretty much do the same thing if you want for the login server its up to you
hunterman01 is offline  
Old 07/19/2009, 08:41   #2
 
elite*gold: 0
Join Date: May 2009
Posts: 874
Received Thanks: 174
how har dis it to make a CP for a server?
Arcotemple:) is offline  
Old 07/19/2009, 10:53   #3
 
elite*gold: 0
Join Date: Jun 2009
Posts: 140
Received Thanks: 12
Quote:
Originally Posted by Arcotemple:) View Post
how har dis it to make a CP for a server?
I don't see how that has anything to do with Lotf
JustChillin is offline  
Old 07/19/2009, 16:55   #4
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Quote:
Originally Posted by Arcotemple:) View Post
how har dis it to make a CP for a server?
Its not like its hard but i dont like using control panels

And to Just Chillin or w.e this has nothing to do with lotf 0.0
hunterman01 is offline  
Old 07/19/2009, 17:03   #5
 
elite*gold: 0
Join Date: Jul 2009
Posts: 548
Received Thanks: 52
It wont work correctly you made it so its an unknown command = false. it should be true.
f0am is offline  
Old 07/19/2009, 17:12   #6
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Thanks
hunterman01 is offline  
Old 07/19/2009, 17:30   #7
 
elite*gold: 0
Join Date: Jul 2009
Posts: 548
Received Thanks: 52
Actually take out the unknown command thing and make the first

if

then the rest else if and at last else.
f0am is offline  
Old 07/19/2009, 17:52   #8
 
elite*gold: 0
Join Date: May 2008
Posts: 103
Received Thanks: 3
THERE IS ONE error ( Shutdown.Elapsed += delegate { Kill(); } but i fix it

generate method
m7med is offline  
Old 07/19/2009, 17:55   #9
 
AndreaCo's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 510
Received Thanks: 104
lol fail that was me who did that.. sorry filer i was really tired last night 0.o
AndreaCo is offline  
Old 07/19/2009, 20:08   #10
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Yeah andrea did that its not hard to fix i am just to lazy and ill let whoever wants to use this fix it themselves
hunterman01 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?
[RELEASE] Console Commands for Lame Console Look
12/07/2011 - CO2 PServer Guides & Releases - 12 Replies
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. public static void DoStuff() { bool flag = true; Console.Clear(); Console.ForegroundColor = ConsoleColor.Red; ...
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]Full Commands of CoEmu v2
12/06/2009 - CO2 PServer Guides & Releases - 36 Replies
This Commands i have take some of them from andy so Thanks andy and i have add some commands and fix commands to new source :D



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


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.