public static void createInt(string locID) { string loc = locID; Console.WriteLine("Creating intercepter w/ loc:"); Console.WriteLine(loc); idPost(); InterceptorJSON json = new InterceptorJSON(int.Parse(TestGlobals.locIdCreated), TestGlobals.intSerialCreated, "wappisk", "AYYYYLMAO"); Interceptor newInt = new Interceptor(TestGlobals.adminServer, TestGlobals.intIdCreated, json); Test mTest = new Test(newInt); HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Authorization = AuthenticateTest.getSessionToken(); Console.WriteLine(newInt.getJson().ToString()); AsyncContext.Run(async () => await new HTTPSCalls().runTest(mTest, HTTPOperation.POST, client)); Console.WriteLine(HTTPSCalls.result.Value.ToString()); }
public MyInterceptor(Form1 form1) : base() { this.form = form1; this.radar = this.form.radar; this.settings = this.form.radarSettings.settings; Interceptor.AddPacketsToFilter(Packet.Rust.ConsoleCommand, Packet.Rust.ConsoleMessage); // Filter packets, you will only receive the packets defined in this function, remove this line to receive all packets Interceptor.ClientPackets = true; // Receive client packets, in this example you would receive both Server and Client Packets Interceptor.CommandPrefix = "RI."; // Command Prefix for "sv" command, in this example you could send a command to this program with "sv RI.randomValue 24" and receive OnCommand("randomValue 24") Interceptor.Start(); }
//[Test()] public static void invalidLocID() { string loc = "000"; Console.WriteLine("Creating intercepter w/ loc:"); Console.WriteLine(loc); idPost (); InterceptorJSON json = new InterceptorJSON (int.Parse (loc), TestGlobals.intSerialCreated, "wappisk", "HEYYYYYYY"); Interceptor newInt = new Interceptor (TestGlobals.adminServer, TestGlobals.intIdCreated, json); Test mTest = new Test (newInt); HttpClient client = new HttpClient (); client.DefaultRequestHeaders.Authorization = AuthenticateTest.getSessionToken (); Console.WriteLine(newInt.getJson().ToString()); AsyncContext.Run (async () => await new HTTPSCalls().runTest(mTest, HTTPOperation.POST, client)); string statusCode = HTTPSCalls.result.Key.Property ("StatusCode").Value.ToString (); Assert.AreEqual ("412", statusCode); Console.WriteLine(HTTPSCalls.result.Value.ToString()); intStore = HTTPSCalls.result; }