Exemplo n.º 1
0
 public static void Initialize()
 {
     KonsoleCommands.Register("Restart", new KonsoleCommandEventHandler(Restart_OnCommand));
     KonsoleCommands.Register("R", new KonsoleCommandEventHandler(Restart_OnCommand));
     KonsoleCommands.Register("SaveRestart", new KonsoleCommandEventHandler(SaveRestart_OnCommand));
     KonsoleCommands.Register("SR", new KonsoleCommandEventHandler(SaveRestart_OnCommand));
 }
Exemplo n.º 2
0
        public static void Initialize()
        {
            KonsoleCommands.Register("Save", new KonsoleCommandEventHandler(Save_OnCommand));
            KonsoleCommands.Register("S", new KonsoleCommandEventHandler(Save_OnCommand));

            // A BeforeSave() save event would have been nice to ensure Save()
            // is not called a second time before completeing or enforce this check in the World.Save() if it is not already
            World.onSave += new World.OnSaveDelegate(On_Save);
        }
Exemplo n.º 3
0
 public static void Initialize()
 {
     KonsoleCommands.Register("Test", new KonsoleCommandEventHandler(Test_OnCommand));
     KonsoleCommands.Register("tt", new KonsoleCommandEventHandler(Test_OnCommand));
 }
Exemplo n.º 4
0
 public static void Initialize()
 {
     KonsoleCommands.Register("Help", new KonsoleCommandEventHandler(Help_OnCommand));
     KonsoleCommands.Register("?", new KonsoleCommandEventHandler(Help_OnCommand));
 }
Exemplo n.º 5
0
 public static void Initialize()
 {
     KonsoleCommands.Register("Broadcast", new KonsoleCommandEventHandler(Broadcast_OnCommand));
     KonsoleCommands.Register("B", new KonsoleCommandEventHandler(Broadcast_OnCommand));
 }
Exemplo n.º 6
0
 public static void Initialize()
 {
     KonsoleCommands.Register("SaveShutdown", new KonsoleCommandEventHandler(SaveShutdown_OnCommand));
     KonsoleCommands.Register("SSD", new KonsoleCommandEventHandler(SaveShutdown_OnCommand));
 }
Exemplo n.º 7
0
        private void listener_BeginRead(object sender, TCPEventArgs e)
        {
            try
            {
                TCPClient client = ((TCPListener)sender).TCPClients[e.SocketID];

                string data         = GetData(e.Data);
                string commandValue = string.Empty;

                //Check for quit
                if (data.ToUpper() == "QUIT")
                {
                    Console.WriteLine("Goodbye");
                    client.DisconnectSocket();
                    return;
                }

                //Process the command
                if (!client.Authenticated)
                {
                    client.LoginAttempt++;

                    string[] vals = data.Split(' ');
                    if (vals == null || vals.Length < 2)
                    {
                        client.WriteLine("Send <USER> <PASS> for authentication");
                    }
                    else
                    {
                        Account acc = Konsole.Commands.HelperTools.GetAccByName(vals[0]);

                        if (acc != null && acc.Password.ToUpper() == vals[1].ToUpper())
                        {
                            if (acc.AccessLevel >= TelnetConfig.MinimumAccessLevel)
                            {
                                client.Authenticated = true;
                                client.Account       = acc;
                                client.WriteLine(string.Concat("Welcome ", acc.Username, ", you have been authenticated"));
                                Console.WriteLine("Telnet client authenticated: {0}", acc.Username);
                            }
                            else
                            {
                                client.WriteLine("Your access level is too low to use the telnet interface");
                                Console.WriteLine("Inadequite accesslevel on slot: {0} Account: {1} IP:{2}", e.SocketID, acc.Username, e.Endpoint.ToString());
                                client.DisconnectSocket();
                                return;
                            }
                        }
                        else
                        {
                            if (client.LoginAttempt == 3)
                            {
                                client.WriteLine("Login attempts exceeded. 3 strikes, you're out!");
                                client.DisconnectSocket();
                                Console.WriteLine("Telnet authentication attempts exceeded on IP: {0}", e.Endpoint.ToString());
                                return;
                            }
                            else
                            {
                                client.WriteLine("Bad credentials, try again\r\nSend <USER> <PASS> for authentication");
                            }
                        }
                    }
                }
                else
                {
                    KonsoleCommands.ProcessKonsoleInput(data);
                    Console.WriteLine("[WowwoW <? for help>]");
                }
            }
            catch (Exception ex)
            {
                SocketHelper.ShowError(this, ex);
            }
        }
Exemplo n.º 8
0
 public static void Initialize()
 {
     KonsoleCommands.Register("SetPLevel", new KonsoleCommandEventHandler(SetPLevel_OnCommand));
     KonsoleCommands.Register("SPL", new KonsoleCommandEventHandler(SetPLevel_OnCommand));
 }
Exemplo n.º 9
0
 public static void Initialize()
 {
     KonsoleCommands.Register("CreateAccount", new KonsoleCommandEventHandler(CreateAccount_OnCommand));
     KonsoleCommands.Register("CA", new KonsoleCommandEventHandler(CreateAccount_OnCommand));
 }
Exemplo n.º 10
0
 public static void Initialize()
 {
     KonsoleCommands.Register("Jail", new KonsoleCommandEventHandler(Jail_OnCommand));
     KonsoleCommands.Register("J", new KonsoleCommandEventHandler(Jail_OnCommand));
 }
Exemplo n.º 11
0
 public static void Initialize()
 {
     KonsoleCommands.Register("Info", new KonsoleCommandEventHandler(Info_OnCommand));
     KonsoleCommands.Register("I", new KonsoleCommandEventHandler(Info_OnCommand));
 }
Exemplo n.º 12
0
 public static void Initialize()
 {
     KonsoleCommands.Register("Status", new KonsoleCommandEventHandler(Status_OnCommand));
     KonsoleCommands.Register("ST", new KonsoleCommandEventHandler(Status_OnCommand));
 }
Exemplo n.º 13
0
 public static void Initialize()
 {
     KonsoleCommands.Register("AccountList", new KonsoleCommandEventHandler(AccountList_OnCommand));
     KonsoleCommands.Register("AL", new KonsoleCommandEventHandler(AccountList_OnCommand));
 }