private void cmbListenerInterface_SelectedIndexChanged(object sender, EventArgs e) { if (cmbListenerInterface.SelectedIndex == -1) { return; } _targetDeviceIndex = cmbListenerInterface.SelectedIndex; SetStatus("Starting device listener .."); _deviceListener.SwitchDevice(_devices[_targetDeviceIndex]); _deviceListener.OnPacket += delegate(HttpPacket packet) { if (RequestBuilder.Instance.IsInitialized || !(packet is HttpRequestPacket)) { var debug = HttpPacket.HttpEncoding.GetString(packet.RawCapture.Data); return; } var requestPacket = packet as HttpRequestPacket; var validServerMethods = new[] { "GetMap", "GetAlliance", "AutoRefresh", "Alliance.Refresh", "GetUserNotesList" }; if (validServerMethods.Any(m => m == requestPacket.HeaderServerMethod) == false) { return; } var requestBuilder = RequestBuilder.Instance; requestBuilder.Initialize(requestPacket); SetStatus("Request data sniffed successfully"); }; _deviceListener.Start(); SetStatus("Device listener started. Please start the game now"); }