LogError() public static method

public static LogError ( string error, bool local = false, bool debug = false ) : void
error string
local bool
debug bool
return void
Exemplo n.º 1
0
        public void Load(PlayerClass playerClass)
        {
            var       windowFile = Path.Combine(_basicData.ResourceDirectory, "config/events/events-" + playerClass.ToString().ToLowerInvariant() + ".xml");
            XDocument xml;

            try
            {
                var filestreamClass = new FileStream(windowFile, FileMode.Open, FileAccess.Read);
                xml = XDocument.Load(filestreamClass);
            }
            catch (Exception ex) when(ex is XmlException || ex is InvalidOperationException)
            {
                BasicTeraData.LogError(ex.Message, true, true);
                Save();
                return;
            }
            catch (Exception ex)
            {
                BasicTeraData.LogError(ex.Message, true, true);
                return;
            }
            EventsClass               = new Dictionary <Event, List <Action> >();
            MissingAbnormalities      = new Dictionary <Event, List <Action> >();
            AddedRemovedAbnormalities = new Dictionary <Event, List <Action> >();
            Cooldown = new Dictionary <Event, List <Action> >();
            Events   = new Dictionary <Event, List <Action> >();
            AFK      = null;
            ParseAbnormalities(EventsClass, xml);
            ParseCooldown(EventsClass, xml);
            AssociateEvent(EventsCommon);
            AssociateEvent(EventsClass);
        }
Exemplo n.º 2
0
        public static void DownloadIfNotExist(uint version, String directory)
        {
            var res = DownloadOpcode(version, directory);

            if (res)
            {
                BasicTeraData.LogError("Updated opcodes: " + version);
            }
        }
Exemplo n.º 3
0
        public EventsData(BasicTeraData basicData)
        {
            _basicData   = basicData;
            EventsCommon = new Dictionary <Event, List <Action> >();
            var eventsdir = Path.Combine(_basicData.ResourceDirectory, "config/events");

            try
            {
                Directory.CreateDirectory(eventsdir);
                foreach (var pclass in Enum.GetNames(typeof(PlayerClass)))
                {
                    var fname = Path.Combine(_basicData.ResourceDirectory, "config/events/events-" + pclass.ToLowerInvariant() + ".xml");
                    if (!File.Exists(fname))
                    {
                        File.WriteAllText(fname, LP.ResourceManager.GetString("events_" + pclass.ToLowerInvariant()), Encoding.UTF8);
                    }
                }
            }
            catch (Exception ex) { BasicTeraData.LogError(ex.Message, true); }
            var       windowFile = Path.Combine(_basicData.ResourceDirectory, "config/events/events-common.xml");
            XDocument xml;

            try
            {
                var filestreamCommon = new FileStream(windowFile, FileMode.Open, FileAccess.Read);
                xml = XDocument.Load(filestreamCommon);
            }
            catch (Exception ex) when(ex is XmlException || ex is InvalidOperationException)
            {
                BasicTeraData.LogError(ex.Message, true, true);
                Save();
                return;
            }
            catch (Exception ex)
            {
                BasicTeraData.LogError(ex.Message, true, true);
                return;
            }
            EventsClass               = new Dictionary <Event, List <Action> >();
            MissingAbnormalities      = new Dictionary <Event, List <Action> >();
            AddedRemovedAbnormalities = new Dictionary <Event, List <Action> >();
            Cooldown = new Dictionary <Event, List <Action> >();
            Events   = new Dictionary <Event, List <Action> >();
            AFK      = null;
            ParseAbnormalities(EventsCommon, xml);
            ParseCooldown(EventsCommon, xml);
            ParseCommonAFK(EventsCommon, xml);
            AssociateEvent(EventsCommon);
        }