Example #1
0
        public static void Initialize()
        {
            var save = Helper.GetMilFilePathRaw("iconstore.pack");

            _storeHandle = ZipFile.OpenRead(save);
            LoggingManagementService.WriteLine($"{nameof(IconManagementService)} initialized", "IcoMgmt");
        }
        public static void Dispose()
        {
            try { _server.Dispose(); } catch { /* ignored */ }

            _server      = null;
            _busRegistry = null;
            LoggingManagementService.WriteLine($"{nameof(TransmittingManagementService)} uninitialized", "TsmMgmt");
        }
 public static void Initialize()
 {
     _busRegistry            = new Dictionary <int, int>();
     _server                 = new IpcServer();
     _server.OnDataOutput   += (x, y) => OnDataOutput?.Invoke(_busRegistry[x], y);
     _server.OnSignalOutput += NotificationListener;
     LoggingManagementService.WriteLine($"{nameof(TransmittingManagementService)} initialized", "TsmMgmt");
 }
        public static void Dispose()
        {
            World          = null;
            Materia        = null;
            Retainer       = null;
            Item           = null;
            Dye            = null;
            Map            = null;
            RetainerAbbr   = null;
            LocalizedWorld = null;
            MateriaAbbr    = null;

            LoggingManagementService.WriteLine($"{nameof(DictionaryManagementService)} uninitialized", "DicMgmt");
        }
        public static void Initialize()
        {
            var path = Helper.GetMilFilePathWithVenv("dictionary.pack", -1);
            var ser  = new Serializer <Dictionary <int, Dictionary <int, string> > >(path, "");
            var tmp  = ser.Load();

            DataVersion    = tmp[DictionaryRetrieveKey.DAT_VER].First().Key;
            World          = tmp[DictionaryRetrieveKey.WORLD];
            Materia        = tmp[DictionaryRetrieveKey.MATERIA];
            Retainer       = tmp[DictionaryRetrieveKey.RET_LOC];
            Item           = tmp[DictionaryRetrieveKey.ITEM];
            Dye            = tmp[DictionaryRetrieveKey.DYE];
            Map            = tmp[DictionaryRetrieveKey.MAP];
            RetainerAbbr   = tmp[DictionaryRetrieveKey.RET_LOCL_NICK];
            LocalizedWorld = tmp[DictionaryRetrieveKey.WORLD_NICK];
            MateriaAbbr    = tmp[DictionaryRetrieveKey.MATERIA_NICK];

            LoggingManagementService.WriteLine($"{nameof(DictionaryManagementService)} initialized", "DicMgmt");
        }
Example #6
0
 public static void Dispose()
 {
     try { _storeHandle.Dispose(); } catch { /* ignored */ }
     LoggingManagementService.WriteLine($"{nameof(IconManagementService)} uninitialized", "IcoMgmt");
 }
        private static void NotificationListener(int sender, Signal sig, DateTime time, string stack, string[] args)
        {
            switch (sig)
            {
            case Signal.ClientInsuffcientPrivilege:
                if (args == null || args.Length < 1 || !int.TryParse(args[0], out _))
                {
                    return;
                }

                LoggingManagementService.WriteLine($"Privilege fail on {sender}, user action is needed", "SigMgmt");
                break;

            case Signal.ClientNetworkFail:
                if (args == null || args.Length < 1 || !int.TryParse(args[0], out _))
                {
                    return;                                                                       // we need validation
                }
                LoggingManagementService.WriteLine($"Network fail on {sender}, user action is needed", "SigMgmt");
                break;

            case Signal.ClientProcessDown:
                if (args == null || args.Length < 1 || !int.TryParse(args[0], out var pid3))
                {
                    return;
                }

                LoggingManagementService.WriteLine($"Game process {pid3} has exited", "SigMgmt");
                break;

            case Signal.ClientPacketParseFail:
                if (args == null || args.Length < 1)
                {
                    return;
                }

                LoggingManagementService.WriteLine($"Malformed packet ({args[0]}) on {sender}, data may loss", "SigMgmt");
                break;

            case Signal.MilvanethSubprocessExit:
                if (args == null || args.Length < 2)
                {
                    return;
                }

                LoggingManagementService.WriteLine($"Monitor process {sender}  has exited: {string.Join("|", args)}",
                                                   "SigMgmt");
                break;

            case Signal.MilvanethComponentExit:
                if (args == null || args.Length < 2)
                {
                    return;
                }

                SubprocessManagementService.KillSpecific(sender);
                LoggingManagementService.WriteLine($"Monitor component {sender}  has exited: {string.Join("|", args)}",
                                                   "SigMgmt");
                break;

            case Signal.MilvanethNeedUpdate:
                if (args == null || args.Length < 2)
                {
                    return;
                }

                SubprocessManagementService.KillSpecific(sender);
                LoggingManagementService.WriteLine($"Update is required by {sender}: {string.Join("|", args)}",
                                                   "SigMgmt");
                break;

            case Signal.MilvanethSubprocessReady:
                if (args == null || args.Length < 1 || !int.TryParse(args[0], out var pid4))
                {
                    return;
                }

                SubprocessManagementService.UpdateRegistryEntity(sender, pid4);
                LoggingManagementService.WriteLine($"Monitor service {sender} has started on {pid4}", "SigMgmt");
                break;

            default:
                break;
            }

            Task.Run(() => InlineLogic.PostSignalNotifyLogic(sig));
        }
Example #8
0
 public static void Initialize()
 {
     LoggingManagementService.WriteLine($"{nameof(LoggingManagementService)} initialized", "LogMgmt");
 }