Exemplo n.º 1
0
        private IEnumerator Parse()
        {
            if (!working)
            {
                working = true;
                PreloadDebug.Clear();

                Task.Run(() =>
                {
                    debugInformation.TickAction(() =>
                    {
                        try
                        {
                            var memory = GameController.Memory;
                            FilesFromMemory filesFromMemory = new FilesFromMemory(memory);
                            var AllFiles        = filesFromMemory.GetAllFilesSync();
                            int areaChangeCount = GameController.Game.AreaChangeCount;
                            foreach (var file in AllFiles)
                            {
                                if (file.Value.ChangeCount == areaChangeCount)
                                {
                                    var text = file.Key;
                                    if (text.Contains('@'))
                                    {
                                        text = text.Split('@')[0];
                                    }

                                    lock (_locker)
                                    {
                                        PreloadDebug.Add(text);
                                    }

                                    CheckForPreload(text);
                                }
                            }
                        }
                        catch (Exception e)
                        {
                            DebugWindow.LogError($"{nameof(PreloadAlert)} -> {e}");
                        }

                        lock (_locker)
                        {
                            DrawAlerts = alerts.OrderBy(x => x.Value.Text).Select(x => x.Value).ToList();
                        }
                    });

                    working = false;
                });
            }

            yield return(null);
        }
Exemplo n.º 2
0
 public void LoadFiles() => AllFiles = FilesFromMemory.GetAllFilesSync();