예제 #1
0
        private void ServerOnReceivedRequest(object sender, ReceivedRequestEventArgs e)
        {
            Log.Information("[PATCHERIPC] IPC: " + e.Request);

            var msg = JsonConvert.DeserializeObject <PatcherIpcEnvelope>(PatcherMain.Base64Decode(e.Request), XIVLauncher.PatchInstaller.PatcherMain.JsonSettings);

            switch (msg.OpCode)
            {
            case PatcherIpcOpCode.Hello:
                _client.Initialize(XIVLauncher.PatchInstaller.PatcherMain.IPC_CLIENT_PORT);
                Log.Information("[PATCHERIPC] GOT HELLO");
                State = InstallerState.Ready;
                break;

            case PatcherIpcOpCode.InstallOk:
                Log.Information("[PATCHERIPC] INSTALL OK");
                State = InstallerState.Ready;
                break;

            case PatcherIpcOpCode.InstallFailed:
                State = InstallerState.Failed;
                MessageBox.Show(
                    "The patch installer ran into an error.\nPlease report this error.\nPlease use the official launcher.");
                Stop();
                Environment.Exit(0);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
예제 #2
0
 private void SendIpcMessage(PatcherIpcEnvelope envelope)
 {
     try
     {
         _client.Send(PatcherMain.Base64Encode(JsonConvert.SerializeObject(envelope, Formatting.Indented, XIVLauncher.PatchInstaller.PatcherMain.JsonSettings)));
     }
     catch (Exception e)
     {
         Log.Error(e, "[PATCHERIPC] Failed to send message.");
     }
 }