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
Then add
After That add Preferably at the bottom but it is your choice
Then Search for public static void ConsoleCommands() Replace it with this
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
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);
}
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