DarkEmu_GameServer.Systems.gmCommands C# (CSharp) Метод

gmCommands() публичный Метод

public gmCommands ( string text ) : void
text string
Результат void
        void gmCommands(string text)
        {
            string proc = text.Replace(".", "");
            try
            {
                //proc = makeitem name 12
                string[] comando = proc.Split(' ');

                // comando[0] = makeitem <- comando
                // comando[1] = name     <- id_item
                // comando[2] = plus     <- plus
                switch (comando[0].ToLower())
                {
                    case "makeitem":
                        if (comando[1] != "")
                        {
                            int id = item_database.GetItem(comando[1]);
                            if (id > 0)
                            {
                                int plus = comando[2] == "" ? 1 : int.Parse(comando[2]);
                                GM_MAKEITEM(id, plus);
                            }
                        }
                        break;
                    case "loadmonster":
                        if (comando[1] != "")
                        {
                            int id = objectdata.GetItem(comando[1]);
                            if (id > 0)
                            {
                                byte type = comando[2] == "" ? (byte)1 : (byte)int.Parse(comando[2]);
                                GM_LOADMONSTER(id, type, 0);
                            }
                        }
                        break;
                    default:
                        Console.WriteLine("Command: {0} No exist",comando[0]);
                        break;
                }
            }
            catch (Exception ep)
            {

            }
        }
Systems