Пример #1
0
 public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
 {
     //Logging.DisablePrimaryWriting(true);
     if (Session.GetHabbo().Rank > 7)
     {
         QuasarEnvironment.PerformShutDown();
     }
     else
     {
         Session.SendWhisper("Oeps! Je hebt niet de bevoegdheid om deze actie uit te voeren.", 34);
     }
 }
Пример #2
0
        public static void InvokeCommand(string inputData)
        {
            if (string.IsNullOrEmpty(inputData))
            {
                return;
            }

            try
            {
                #region Command parsing
                string   CurrentTime = DateTime.Now.ToString("HH:mm:ss" + " | ");
                string[] parameters  = inputData.Split(' ');

                switch (parameters[0].ToLower())
                {
                    #region stop
                case "stop":
                case "shutdown":
                {
                    Logging.DisablePrimaryWriting(true);
                    Logging.WriteLine("The server is saving users furniture, rooms, etc. WAIT FOR THE SERVER TO CLOSE, DO NOT EXIT THE PROCESS IN TASK MANAGER!!", ConsoleColor.Yellow);
                    QuasarEnvironment.PerformShutDown();
                    break;
                }
                    #endregion

                    #region alert
                case "alert":
                {
                    string Notice = inputData.Substring(6);

                    QuasarEnvironment.GetGame().GetClientManager().SendMessage(new BroadcastMessageAlertComposer(Notice));

                    Console.WriteLine(CurrentTime + "» Alert met succes verzonden");
                    break;
                }
                    #endregion

                default:
                {
                    Console.WriteLine(CurrentTime + "» " + parameters[0].ToLower() + " is een niet bestaande functie - toets :help in voor meer informatie.");
                    break;
                }
                }
                #endregion
            }
            catch (Exception e)
            {
                string CurrentTime1 = DateTime.Now.ToString("HH:mm:ss" + " | ");
                Console.WriteLine(CurrentTime1 + "» Fout in command [" + inputData + "]: " + e);
            }
        }