The example I will give is just for Hybrids. I would suggest make an extern application in your server project, it's not efficient to do it in the game- or authserver.
Download:
In Program.cs set IP and Port.
Commands now:
Code:
/disconnect
/restart
/close processname
The way it work is, you enter a password.
It sends the command through bytes and then it checks if password is correct serverside. It's having "ServerCMD", so the server knows it's a remote command, but you can remove that if you make an extern application for your cmdserver.
Example for Hybrids source.
Find: (In Game Processor.cs)
Code:
static unsafe void Game_ReceivePacket(NetworkClient nClient, byte[] Packet)
Right under the first { put this:
Code:
if (RemoteControl.Process(Packet))
{
nClient.Disconnect();
return;
}
Now create a new class and replace it with:
Remember to change the password to the password you want.
Code:
public class RemoteControl
{
static string Password = "12345678";
public static bool Process(byte[] Packet)
{
try
{
string Decoded = Encoding.ASCII.GetString(Packet);
string[] Cmd = Decoded.Split('~');
if (Cmd[0] == "ServerCMD")
{
if (Cmd[1] == Password)
{
switch (Cmd[2])
{
case "/restart":
{
System.Diagnostics.Process.Start("ConquerServer_v2.exe");
Environment.Exit(0);
return true;
}
case "/close":
{
foreach (System.Diagnostics.Process process in System.Diagnostics.Process.GetProcessesByName(Cmd[3]))
process.Kill();
return true;
}
}
}
else
return true;//We return true for disconnection
}
return false;
}
catch { return false; }
}
}
It can be done very different and I'm sure this is not an efficient way to do it, but this is how I would do it. You can use it to eg. Restart your server extern, manage database etc. You would have to code the functions etc. your self.