예제 #1
0
        public static void export_prefabs(ConsoleSystem.Arg arg)
        {
            PrefabPoolCollection prefabPoolCollection = GameManager.server.pool;

            if (prefabPoolCollection.storage.Count == 0)
            {
                arg.ReplyWith("Prefab pool is empty.");
                return;
            }
            string        str           = arg.GetString(0, string.Empty);
            StringBuilder stringBuilder = new StringBuilder();

            foreach (KeyValuePair <uint, PrefabPool> keyValuePair in prefabPoolCollection.storage)
            {
                string str1 = keyValuePair.Key.ToString();
                string str2 = StringPool.Get(keyValuePair.Key);
                string str3 = keyValuePair.Value.Count.ToString();
                if (!string.IsNullOrEmpty(str) && !str2.Contains(str, CompareOptions.IgnoreCase))
                {
                    continue;
                }
                stringBuilder.AppendLine(string.Format("{0},{1},{2}", str1, Path.GetFileNameWithoutExtension(str2), str3));
            }
            File.WriteAllText("prefabs.csv", stringBuilder.ToString());
        }
예제 #2
0
 public GameManager(bool clientside, bool serverside)
 {
     Clientside   = clientside;
     Serverside   = serverside;
     preProcessed = new PrefabPreProcess(clientside, serverside);
     pool         = new PrefabPoolCollection();
 }
예제 #3
0
        public static void print_prefabs(ConsoleSystem.Arg arg)
        {
            PrefabPoolCollection prefabPoolCollection = GameManager.server.pool;

            if (prefabPoolCollection.storage.Count == 0)
            {
                arg.ReplyWith("Prefab pool is empty.");
                return;
            }
            string    str       = arg.GetString(0, string.Empty);
            TextTable textTable = new TextTable();

            textTable.AddColumn("id");
            textTable.AddColumn("name");
            textTable.AddColumn("count");
            foreach (KeyValuePair <uint, PrefabPool> keyValuePair in prefabPoolCollection.storage)
            {
                string str1 = keyValuePair.Key.ToString();
                string str2 = StringPool.Get(keyValuePair.Key);
                string str3 = keyValuePair.Value.Count.ToString();
                if (!string.IsNullOrEmpty(str) && !str2.Contains(str, CompareOptions.IgnoreCase))
                {
                    continue;
                }
                textTable.AddRow(new string[] { str1, Path.GetFileNameWithoutExtension(str2), str3 });
            }
            arg.ReplyWith(textTable.ToString());
        }
예제 #4
0
 public GameManager(bool clientside, bool serverside)
 {
     this.Clientside   = clientside;
     this.Serverside   = serverside;
     this.preProcessed = new PrefabPreProcess(clientside, serverside, false);
     this.pool         = new PrefabPoolCollection();
 }
예제 #5
0
        public static void print_prefabs(Arg arg)
        {
            PrefabPoolCollection pool = GameManager.server.pool;

            if (pool.storage.Count == 0)
            {
                arg.ReplyWith("Prefab pool is empty.");
                return;
            }
            string    @string   = arg.GetString(0, string.Empty);
            TextTable textTable = new TextTable();

            textTable.AddColumn("id");
            textTable.AddColumn("name");
            textTable.AddColumn("count");
            foreach (KeyValuePair <uint, PrefabPool> item in pool.storage)
            {
                string text  = item.Key.ToString();
                string text2 = StringPool.Get(item.Key);
                string text3 = item.Value.Count.ToString();
                if (string.IsNullOrEmpty(@string) || text2.Contains(@string, CompareOptions.IgnoreCase))
                {
                    textTable.AddRow(text, Path.GetFileNameWithoutExtension(text2), text3);
                }
            }
            arg.ReplyWith(textTable.ToString());
        }
예제 #6
0
        public static void print_prefabs(ConsoleSystem.Arg arg)
        {
            PrefabPoolCollection pool = GameManager.server.pool;

            if (pool.storage.Count == 0)
            {
                arg.ReplyWith("Prefab pool is empty.");
            }
            else
            {
                string    str1      = arg.GetString(0, string.Empty);
                TextTable textTable = new TextTable();
                textTable.AddColumn("id");
                textTable.AddColumn("name");
                textTable.AddColumn("count");
                foreach (KeyValuePair <uint, PrefabPool> keyValuePair in pool.storage)
                {
                    string str2 = keyValuePair.Key.ToString();
                    string path = StringPool.Get(keyValuePair.Key);
                    string str3 = keyValuePair.Value.Count.ToString();
                    if (string.IsNullOrEmpty(str1) || StringEx.Contains(path, str1, CompareOptions.IgnoreCase))
                    {
                        textTable.AddRow(new string[3]
                        {
                            str2,
                            Path.GetFileNameWithoutExtension(path),
                            str3
                        });
                    }
                }
                arg.ReplyWith(((object)textTable).ToString());
            }
        }
예제 #7
0
        public static void export_prefabs(ConsoleSystem.Arg arg)
        {
            PrefabPoolCollection pool = GameManager.server.pool;

            if (pool.storage.Count == 0)
            {
                arg.ReplyWith("Prefab pool is empty.");
            }
            else
            {
                string        str1          = arg.GetString(0, string.Empty);
                StringBuilder stringBuilder = new StringBuilder();
                foreach (KeyValuePair <uint, PrefabPool> keyValuePair in pool.storage)
                {
                    string str2 = keyValuePair.Key.ToString();
                    string path = StringPool.Get(keyValuePair.Key);
                    string str3 = keyValuePair.Value.Count.ToString();
                    if (string.IsNullOrEmpty(str1) || StringEx.Contains(path, str1, CompareOptions.IgnoreCase))
                    {
                        stringBuilder.AppendLine(string.Format("{0},{1},{2}", (object)str2, (object)Path.GetFileNameWithoutExtension(path), (object)str3));
                    }
                }
                File.WriteAllText("prefabs.csv", stringBuilder.ToString());
            }
        }
예제 #8
0
        public static void export_prefabs(Arg arg)
        {
            PrefabPoolCollection pool = GameManager.server.pool;

            if (pool.storage.Count == 0)
            {
                arg.ReplyWith("Prefab pool is empty.");
                return;
            }
            string        @string       = arg.GetString(0, string.Empty);
            StringBuilder stringBuilder = new StringBuilder();

            foreach (KeyValuePair <uint, PrefabPool> item in pool.storage)
            {
                string arg2 = item.Key.ToString();
                string text = StringPool.Get(item.Key);
                string arg3 = item.Value.Count.ToString();
                if (string.IsNullOrEmpty(@string) || text.Contains(@string, CompareOptions.IgnoreCase))
                {
                    stringBuilder.AppendLine($"{arg2},{Path.GetFileNameWithoutExtension(text)},{arg3}");
                }
            }
            File.WriteAllText("prefabs.csv", stringBuilder.ToString());
        }