[REQUEST]/restart command

02/12/2010 11:45 Jmenace#1
I'm using LOTF source (5065), and i know i've seen the command /restart, so that PM's can restart the server if the owner is away. My problem is i dont know how to code such a command just from looking at the other commands. Can someone post how to add it in.
*Well its been proved time and time again. No one here ever tries to really help ppl. Had to find this myself and it makes it worse that none of you couldve sent me this small simple*
if (Splitter[0] == "/restart")
{
General.ServerRestart();
}
02/12/2010 13:27 ramix#2
source 5165?
02/12/2010 13:44 renetjuuh#3
i think so now a days everyone use 5165
02/12/2010 13:48 renetjuuh#4
Code:
if (GC.AuthInfo.Status == "[PM]")
{
if (Cmd[0] == "/restart")
                            {
                                
                                NewestCOServer.Main.AuthWorker.Listener.Close();
                                NewestCOServer.Main.GameWorker.Listener.Close();
                                try
                                {
                                    foreach (Game.Character C in Game.World.H_Chars.Values)
                                    {
                                        try
                                        {
                                            C.MyClient.Disconnect();
                                            Console.WriteLine(C.Name + " has logged off successfuly.");
                                        }
                                        catch { continue; }
                                    }
                                }
                                catch { }
                                Database.SaveKOs();
                                Console.WriteLine("KOs saved.");
                                Database.SaveEmpire();
                                Console.WriteLine("Empire saved.");
                                Features.Guilds.SaveGuilds();
                                Console.WriteLine("Guilds saved.");
                                Features.SkillsClass.Save();
                                Console.WriteLine("Skills saved.");
                                Console.WriteLine("Database disposed.");
                                Console.WriteLine("Write /exit or click X to close the window.");
                                System.Diagnostics.Process.Start("NewestCOServer.exe");
                                Environment.Exit(0);
                            }
i think this works it works for me.

Soryy for dubbel post
02/12/2010 14:02 Decker_#5
5165 source already has restart command :S
02/12/2010 14:11 ramix#6
ya... ppl asking something have in there source idk why -.-
02/12/2010 15:51 ASSN9NE#7
ok take the /restart command from the gm-pm section in Chat.cs move it up to where /dc & /revivehere codes are put it between the 2 and change the command from /restart - to something no1 would figure out like /donkeyballs or w/e u want and it will restart the server with a non gm-pm account lmao.

try this put this in your Chat.cs between the /dc & /revivehere commands are

Code:
if (Cmd[0] == "/donkeyballs")
                            {
                                
                                NewestCOServer.Main.AuthWorker.Listener.Close();
                                NewestCOServer.Main.GameWorker.Listener.Close();
                                try
                                {
                                    foreach (Game.Character C in Game.World.H_Chars.Values)
                                    {
                                        try
                                        {
                                            C.MyClient.Disconnect();
                                            Console.WriteLine(C.Name + " has logged off successfuly.");
                                        }
                                        catch { continue; }
                                    }
                                }
                                catch { }
                                Database.SaveKOs();
                                Console.WriteLine("KOs saved.");
                                Database.SaveEmpire();
                                Console.WriteLine("Empire saved.");
                                Features.Guilds.SaveGuilds();
                                Console.WriteLine("Guilds saved.");
                                Features.SkillsClass.Save();
                                Console.WriteLine("Skills saved.");
                                Console.WriteLine("Database disposed.");
                                Console.WriteLine("Write /exit or click X to close the window.");
                                System.Diagnostics.Process.Start("NewestCOServer.exe");
                                Environment.Exit(0);
                            }

f5 rebuild then f6 debug<-- dont 4get 2 use those
now just type /donkeyballs whille in game and it will restart after inserting this into Chat.cs
02/12/2010 17:28 LetterX#8
You guys need to think here. When people mention the LOTF for v5165, they say "HELP - 5165 source". When someone wants help for LOTF v5017, they say "HELP - LOTF source". >_>

Not to mention that if the LOTFv5165 ALREADY has a "/restart" command, wouldn't it make sense that the person is asking for one is using the LOTFv5017 source? >_______________________>
02/12/2010 18:23 ASSN9NE#9
Quote:
Originally Posted by LetterX View Post
You guys need to think here. When people mention the LOTF for v5165, they say "HELP - 5165 source". When someone wants help for LOTF v5017, they say "HELP - LOTF source". >_>
honestly if he was more specific on what source he was asking for woulda made it 10x more easier to find his problem.
when using [HELP] it would make more sense 2 put the source your working with also
02/12/2010 23:59 Jmenace#10
Quote:
Originally Posted by ASSN9NE View Post
honestly if he was more specific on what source he was asking for woulda made it 10x more easier to find his problem.
when using [HELP] it would make more sense 2 put the source your working with also
Sorry i didn't mention it earlier, i posted it yesterday and it was forever before anyone even replied.

Quote:
Originally Posted by ramix View Post
source 5165?
5065