using System; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Text; using System.Threading; using BestHTTP.Extensions; using BestHTTP.Logger; using BestHTTP.WebSocket.Frames; using Cpp2IlInjected; namespace BestHTTP.WebSocket { // Token: 0x020012EB RID: 4843 [Token(Token = "0x20012EB")] [StructLayout(3)] public sealed class WebSocketResponse : HTTPResponse, IHeartbeat, IProtocol { // Token: 0x170013AE RID: 5038 // (get) Token: 0x06007938 RID: 31032 RVA: 0x001933C8 File Offset: 0x001915C8 // (set) Token: 0x06007939 RID: 31033 RVA: 0x001933DC File Offset: 0x001915DC [Token(Token = "0x170013AE")] public WebSocket WebSocket { [Token(Token = "0x6007938")] [Address(RVA = "0x408B30", Offset = "0x407530", VA = "0x180408B30")] get; [Token(Token = "0x6007939")] [Address(RVA = "0x5D5C80", Offset = "0x5D4680", VA = "0x1805D5C80")] internal set; } // Token: 0x170013AF RID: 5039 // (get) Token: 0x0600793A RID: 31034 RVA: 0x001933F0 File Offset: 0x001915F0 [Token(Token = "0x170013AF")] public bool IsClosed { [Token(Token = "0x600793A")] [Address(RVA = "0x6FC7B0", Offset = "0x6FB1B0", VA = "0x1806FC7B0", Slot = "7")] get { return this.closed; } } // Token: 0x170013B0 RID: 5040 // (get) Token: 0x0600793B RID: 31035 RVA: 0x00193404 File Offset: 0x00191604 // (set) Token: 0x0600793C RID: 31036 RVA: 0x00193418 File Offset: 0x00191618 [Token(Token = "0x170013B0")] public TimeSpan PingFrequnecy { [Token(Token = "0x600793B")] [Address(RVA = "0x3CBEE0", Offset = "0x3CA8E0", VA = "0x1803CBEE0")] get; [Token(Token = "0x600793C")] [Address(RVA = "0x6FC800", Offset = "0x6FB200", VA = "0x1806FC800")] private set; } // Token: 0x170013B1 RID: 5041 // (get) Token: 0x0600793D RID: 31037 RVA: 0x0019342C File Offset: 0x0019162C // (set) Token: 0x0600793E RID: 31038 RVA: 0x00193440 File Offset: 0x00191640 [Token(Token = "0x170013B1")] public ushort MaxFragmentSize { [Token(Token = "0x600793D")] [Address(RVA = "0x6FC7D0", Offset = "0x6FB1D0", VA = "0x1806FC7D0")] get; [Token(Token = "0x600793E")] [Address(RVA = "0x6FC7F0", Offset = "0x6FB1F0", VA = "0x1806FC7F0")] private set; } // Token: 0x170013B2 RID: 5042 // (get) Token: 0x0600793F RID: 31039 RVA: 0x00193454 File Offset: 0x00191654 [Token(Token = "0x170013B2")] public int BufferedAmount { [Token(Token = "0x600793F")] [Address(RVA = "0x3D30C0", Offset = "0x3D1AC0", VA = "0x1803D30C0")] get { return this._bufferedAmount; } } // Token: 0x170013B3 RID: 5043 // (get) Token: 0x06007940 RID: 31040 RVA: 0x00193468 File Offset: 0x00191668 // (set) Token: 0x06007941 RID: 31041 RVA: 0x0019347C File Offset: 0x0019167C [Token(Token = "0x170013B3")] public int Latency { [Token(Token = "0x6007940")] [Address(RVA = "0x50B890", Offset = "0x50A290", VA = "0x18050B890")] get; [Token(Token = "0x6007941")] [Address(RVA = "0x6FC7E0", Offset = "0x6FB1E0", VA = "0x1806FC7E0")] private set; } // Token: 0x06007942 RID: 31042 RVA: 0x00193490 File Offset: 0x00191690 [Token(Token = "0x6007942")] [Address(RVA = "0x6FC570", Offset = "0x6FAF70", VA = "0x1806FC570")] internal WebSocketResponse(HTTPRequest request, Stream stream, bool isStreamed, bool isFromCache) { List list = new List(); this.IncompleteFrames = list; List list2 = new List(); this.CompletedFrames = list2; List list3 = new List(); this.frameCache = list3; object obj = new object(); this.FrameLock = obj; object obj2 = new object(); this.SendLock = obj2; List list4 = new List(); this.unsentFrames = list4; int num; AutoResetEvent autoResetEvent = new AutoResetEvent(num != 0); num = 0; this.newFrameSignal = autoResetEvent; DateTime minValue = DateTime.MinValue; this.lastPing = minValue; DateTime minValue2 = DateTime.MinValue; this.lastMessage = minValue2; CircularBuffer circularBuffer = new CircularBuffer(WebSocketResponse.RTTBufferCapacity); this.rtts = circularBuffer; this.k__BackingField = true; this.MaxFragmentSize = (ushort)((uint)32767); this.closed = false; } // Token: 0x06007943 RID: 31043 RVA: 0x00193550 File Offset: 0x00191750 [Token(Token = "0x6007943")] [Address(RVA = "0x6FC4C0", Offset = "0x6FAEC0", VA = "0x1806FC4C0")] internal void StartReceive() { bool flag = ThreadPool.QueueUserWorkItem(new WaitCallback(this.ReceiveThreadFunc)); } // Token: 0x06007944 RID: 31044 RVA: 0x00193570 File Offset: 0x00191770 [Token(Token = "0x6007944")] [Address(RVA = "0x6F9DF0", Offset = "0x6F87F0", VA = "0x1806F9DF0")] internal void CloseStream() { ConnectionBase connectionWith = HTTPManager.GetConnectionWith(this.baseRequest); if (connectionWith != 0) { connectionWith.Abort((HTTPConnectionStates)((uint)9)); return; } } // Token: 0x06007945 RID: 31045 RVA: 0x00193598 File Offset: 0x00191798 [Token(Token = "0x6007945")] [Address(RVA = "0x6FBFF0", Offset = "0x6FA9F0", VA = "0x1806FBFF0")] public void Send(string message) { int num; WebSocketFrame webSocketFrame; do { num = 0; if (message == 0) { goto IL_A2; } object obj = Encoding.UTF8.Clone(); byte[] bytes = Encoding.UTF8.GetBytes(message); byte[] k__BackingField = webSocketFrame.k__BackingField; if (k__BackingField == 0) { break; } ushort num2 = this.k__BackingField; if (k__BackingField.Length <= (int)num2) { break; } WebSocketFrame[] array = webSocketFrame.Fragment(num2); object sendLock = this.SendLock; this.Send(webSocketFrame); if (array != 0 && num < array.Length) { WebSocketFrame webSocketFrame2 = array[num]; this.Send(webSocketFrame2); num++; } Monitor.Exit(sendLock); if (num != -1) { } } while (num != 0); this.Send(webSocketFrame); return; IL_A2: ArgumentNullException ex = new ArgumentNullException("message must not be null!"); throw new IndexOutOfRangeException(); } // Token: 0x06007946 RID: 31046 RVA: 0x00193658 File Offset: 0x00191858 [Token(Token = "0x6007946")] [Address(RVA = "0x6FB8E0", Offset = "0x6FA2E0", VA = "0x1806FB8E0")] public void Send(byte[] data) { int num; WebSocketFrame webSocketFrame; do { num = 0; if (data == 0) { goto IL_9D; } int length; ulong num2; ulong num3; webSocketFrame = new WebSocketFrame(this.k__BackingField, (WebSocketFrameTypes)((ulong)2L), data, (ulong)num, (ulong)length, num2 != 0UL, num3 != 0UL); length = data.Length; byte[] k__BackingField = webSocketFrame.k__BackingField; if (k__BackingField == 0) { break; } ushort num4 = this.k__BackingField; if (k__BackingField.Length <= (int)num4) { break; } WebSocketFrame[] array = webSocketFrame.Fragment(num4); object sendLock = this.SendLock; this.Send(webSocketFrame); if (array != 0 && num < array.Length) { WebSocketFrame webSocketFrame2 = array[num]; this.Send(webSocketFrame2); num++; } Monitor.Exit(sendLock); if (num != -1) { } } while (num != 0); this.Send(webSocketFrame); return; IL_9D: ArgumentNullException ex = new ArgumentNullException("data must not be null!"); throw new IndexOutOfRangeException(); } // Token: 0x06007947 RID: 31047 RVA: 0x00193714 File Offset: 0x00191914 [Token(Token = "0x6007947")] [Address(RVA = "0x6FBB00", Offset = "0x6FA500", VA = "0x1806FBB00")] public void Send(byte[] data, ulong offset, ulong count) { int num; WebSocketFrame webSocketFrame; do { num = 0; if (data == 0) { goto IL_85; } int length = data.Length; byte[] k__BackingField = webSocketFrame.k__BackingField; if (k__BackingField == 0) { break; } ushort num2 = this.k__BackingField; if (k__BackingField.Length <= (int)num2) { break; } WebSocketFrame[] array = webSocketFrame.Fragment(num2); object sendLock = this.SendLock; this.Send(webSocketFrame); if (array != 0 && num < array.Length) { WebSocketFrame webSocketFrame2 = array[num]; this.Send(webSocketFrame2); num++; } Monitor.Exit(sendLock); if (num != -1) { } } while (num != 0); this.Send(webSocketFrame); return; IL_85: ArgumentNullException ex = new ArgumentNullException("data must not be null!"); throw new IndexOutOfRangeException(); } // Token: 0x06007948 RID: 31048 RVA: 0x001937B8 File Offset: 0x001919B8 [Token(Token = "0x6007948")] [Address(RVA = "0x6FBD70", Offset = "0x6FA770", VA = "0x1806FBD70")] public void Send(WebSocketFrame frame) { int num; do { num = 0; if (frame == 0) { goto IL_80; } if (this.closed || this.closeSent) { return; } object sendLock = this.SendLock; this.unsentFrames.Add(frame); if (!this.sendThreadCreated) { ILogger logger = HTTPManager.Logger; bool flag = ThreadPool.QueueUserWorkItem(new WaitCallback(this.SendThreadFunc)); this.sendThreadCreated = true; } Monitor.Exit(sendLock); if (num != -1) { } } while (num != 0); if (frame.k__BackingField != (ulong)0L) { } bool flag2 = this.newFrameSignal.Set(); return; IL_80: ArgumentNullException ex = new ArgumentNullException("frame is null!"); throw new NullReferenceException(); } // Token: 0x06007949 RID: 31049 RVA: 0x0019385C File Offset: 0x00191A5C [Token(Token = "0x6007949")] [Address(RVA = "0x6FA230", Offset = "0x6F8C30", VA = "0x1806FA230")] public void Insert(WebSocketFrame frame) { int num; do { num = 0; if (frame == 0) { goto IL_8A; } if (this.closed || this.closeSent) { return; } object sendLock = this.SendLock; List list = this.unsentFrames; int num2 = 0; list.Insert(num2, frame); if (!this.sendThreadCreated) { ILogger logger = HTTPManager.Logger; bool flag = ThreadPool.QueueUserWorkItem(new WaitCallback(this.SendThreadFunc)); this.sendThreadCreated = true; } Monitor.Exit(sendLock); if (num != -1) { } } while (num != 0); if (frame.k__BackingField != (ulong)0L) { } bool flag2 = this.newFrameSignal.Set(); return; IL_8A: ArgumentNullException ex = new ArgumentNullException("frame is null!"); throw new NullReferenceException(); } // Token: 0x0600794A RID: 31050 RVA: 0x0019390C File Offset: 0x00191B0C [Token(Token = "0x600794A")] [Address(RVA = "0x6FAF30", Offset = "0x6F9930", VA = "0x1806FAF30")] public void SendNow(WebSocketFrame frame) { /* An exception occurred when decompiling this method (0600794A) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.WebSocket.WebSocketResponse::SendNow(BestHTTP.WebSocket.Frames.WebSocketFrame) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_40: stloc:ArgumentNullException(var_4_4A, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("frame is null!"))) } at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88 --- End of inner exception stack trace --- at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663 */; } // Token: 0x0600794B RID: 31051 RVA: 0x00193964 File Offset: 0x00191B64 [Token(Token = "0x600794B")] [Address(RVA = "0x6FA1F0", Offset = "0x6F8BF0", VA = "0x1806FA1F0")] public void Close() { } // Token: 0x0600794C RID: 31052 RVA: 0x00193974 File Offset: 0x00191B74 [Token(Token = "0x600794C")] [Address(RVA = "0x6FA020", Offset = "0x6F8A20", VA = "0x1806FA020")] public void Close(ushort code, string msg) { int num; do { num = 0; if (this.closed) { return; } object sendLock = this.SendLock; this.unsentFrames.Clear(); int num2 = 0; Monitor.Exit(sendLock); if (num2 != -1) { } } while (num != 0); WebSocket webSocket = this.k__BackingField; byte[] array = WebSocket.EncodeCloseData(code, msg); ulong num3; int num4; ulong num5; ulong num6; WebSocketFrame webSocketFrame = new WebSocketFrame(webSocket, (WebSocketFrameTypes)((ulong)8L), array, num3, (ulong)num4, num5 != 0UL, num6 != 0UL); if (array != 0) { } num4 = 0; this.Send(webSocketFrame); } // Token: 0x0600794D RID: 31053 RVA: 0x001939F4 File Offset: 0x00191BF4 [Token(Token = "0x600794D")] [Address(RVA = "0x6FC2F0", Offset = "0x6FACF0", VA = "0x1806FC2F0")] public void StartPinging(int frequency) { Delegate @delegate; int num; do { TimeSpan timeSpan; this.k__BackingField = timeSpan; DateTime utcNow = DateTime.UtcNow; this.lastMessage = utcNow; this.SendPing(); HTTPManager.Heartbeats.Subscribe(this); Action onApplicationForegroundStateChanged = HTTPUpdateDelegator.OnApplicationForegroundStateChanged; Action action = new Action(this.OnApplicationForegroundStateChanged); @delegate = Delegate.Combine(onApplicationForegroundStateChanged, action); num = 0; } while (@delegate != 0 && @delegate == 0); HTTPUpdateDelegator.OnApplicationForegroundStateChanged = num; } // Token: 0x0600794E RID: 31054 RVA: 0x00193A6C File Offset: 0x00191C6C [Token(Token = "0x600794E")] [Address(RVA = "0x6FB2E0", Offset = "0x6F9CE0", VA = "0x1806FB2E0")] private void SendThreadFunc(object param) { int num; do { num = 0; List list = new List(); if (!this.closed && !this.closeSent) { AutoResetEvent autoResetEvent = this.newFrameSignal; object sendLock = this.SendLock; int size = this.unsentFrames._size; List list2 = this.unsentFrames; list.Clear(); Monitor.Exit(sendLock); if ((ulong)((uint)(-1)) != (ulong)(-1L)) { } if (num == 0) { int size2 = list._size; list.RemoveAt(size2); if (this.closeSent) { goto IL_93; } int num2 = this.Stream.ReadByte(); if ((ulong)((uint)(-1)) != (ulong)(-1L)) { this.closeSent = true; goto IL_93; } IL_9B: if (num == 0) { HTTPRequest baseRequest = this.baseRequest; baseRequest.k__BackingField = (HTTPRequestStates)((ulong)5L); this.baseRequest.k__BackingField = baseRequest; this.baseRequest.k__BackingField = (HTTPRequestStates)((ulong)4L); this.closed = true; goto IL_D6; } goto IL_125; IL_93: Stream stream = this.Stream; goto IL_9B; } goto IL_11F; } IL_D6: this.sendThreadCreated = false; AutoResetEvent autoResetEvent2 = this.newFrameSignal; this.newFrameSignal = (ulong)0L; ILogger logger = HTTPManager.Logger; if ((ulong)((uint)(-1)) != (ulong)(-1L)) { } } while (num != 0); return; IL_11F: throw new NullReferenceException(); IL_125: throw new NullReferenceException(); } // Token: 0x0600794F RID: 31055 RVA: 0x00193BD4 File Offset: 0x00191DD4 [Token(Token = "0x600794F")] [Address(RVA = "0x6FA520", Offset = "0x6F8F20", VA = "0x1806FA520")] private void ReceiveThreadFunc(object param) { for (;;) { int num = 0; ReadOnlyBufferedStream readOnlyBufferedStream = new ReadOnlyBufferedStream(this.Stream); int num2 = 0; uint num3; if (!this.closed) { DateTime utcNow = DateTime.UtcNow; this.lastMessage = utcNow; if (utcNow <= (ulong)10L) { if (this.OnIncompleteFrame != (ulong)0L) { object frameLock = this.FrameLock; List completedFrames = this.CompletedFrames; num3 += (uint)1; Monitor.Exit(frameLock); if (num3 != (uint)(-1)) { } if (num != 0) { goto IL_23E; } } this.IncompleteFrames.Clear(); object frameLock2 = this.FrameLock; List completedFrames2 = this.CompletedFrames; num3 += (uint)1; Monitor.Exit(frameLock2); if (num3 != (uint)(-1)) { } if (num != 0) { goto IL_24A; } int num4; if (!this.closeSent) { num4 = 0; WebSocketFrame webSocketFrame; this.Send(webSocketFrame); } this.closed = true; if (!this.closeSent && !this.closed) { if (num4 != 0) { } WebSocketFrame webSocketFrame2; this.Send(webSocketFrame2); long num5; num5 -= num5; TimeSpan timeSpan = TimeSpan.FromTicks(num5); CircularBuffer circularBuffer = this.rtts; int num6 = 0; circularBuffer.Add(num6); int num7 = this.CalculateLatency(); this.k__BackingField = num7; } } int num8; if (this.OnIncompleteFrame != (ulong)0L) { object frameLock3 = this.FrameLock; List completedFrames3 = this.CompletedFrames; num3 += (uint)1; num8 = 0; Monitor.Exit(frameLock3); if (num3 != (uint)(-1)) { } if (num != 0) { goto IL_268; } } this.IncompleteFrames.Add(num8); uint num9; this.Close((ushort)num9, "Protocol Error: masked frame received from server!"); this.IncompleteFrames.Clear(); this.baseRequest.k__BackingField = (HTTPRequestStates)((ulong)5L); this.closed = true; HTTPRequest baseRequest; if (!this.newFrameSignal.Set()) { baseRequest = this.baseRequest; baseRequest.k__BackingField = (HTTPRequestStates)((ulong)5L); } this.baseRequest.k__BackingField = baseRequest; this.baseRequest.k__BackingField = (HTTPRequestStates)((ulong)4L); this.closed = true; AutoResetEvent autoResetEvent = this.newFrameSignal; } num3 += (uint)1; if (num2 != 0) { } if (num3 != (uint)(-1)) { } if (num == 0) { HTTPManager.Heartbeats.Unsubscribe(this); Action onApplicationForegroundStateChanged = HTTPUpdateDelegator.OnApplicationForegroundStateChanged; Action action = new Action(this.OnApplicationForegroundStateChanged); Delegate @delegate = Delegate.Remove(onApplicationForegroundStateChanged, action); if (@delegate == 0 || @delegate != 0) { HTTPUpdateDelegator.OnApplicationForegroundStateChanged = @delegate; ILogger logger = HTTPManager.Logger; if (num3 != (uint)(-1)) { } if (num == 0) { break; } } } } return; IL_23E: throw new NullReferenceException(); IL_24A: throw new NullReferenceException(); IL_268: throw new NullReferenceException(); } // Token: 0x06007950 RID: 31056 RVA: 0x0000220F File Offset: 0x0000040F [Token(Token = "0x6007950")] [Address(RVA = "0x6F97F0", Offset = "0x6F81F0", VA = "0x1806F97F0", Slot = "8")] void IProtocol.HandleEvents() { throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method."); } // Token: 0x06007951 RID: 31057 RVA: 0x00193E74 File Offset: 0x00192074 [Token(Token = "0x6007951")] [Address(RVA = "0x6F9440", Offset = "0x6F7E40", VA = "0x1806F9440", Slot = "6")] void IHeartbeat.OnHeartbeatUpdate(TimeSpan dif) { DateTime utcNow = DateTime.UtcNow; DateTime dateTime = this.lastPing; TimeSpan timeSpan = utcNow - dateTime; TimeSpan timeSpan2 = this.k__BackingField; if (timeSpan >= timeSpan2) { this.SendPing(); } DateTime dateTime2 = this.lastMessage; TimeSpan timeSpan3 = this.k__BackingField; DateTime dateTime3 = dateTime2 + timeSpan3; TimeSpan timeSpan4 = utcNow - dateTime3; TimeSpan k__BackingField = this.k__BackingField.k__BackingField; if (timeSpan4 > k__BackingField) { ILogger logger = HTTPManager.Logger; object[] array = new object[4]; DateTime dateTime4 = this.lastMessage; if (array != 0) { } array[0] = array; TimeSpan timeSpan5 = this.k__BackingField; if (timeSpan5 != 0) { } array[1] = timeSpan5; TimeSpan k__BackingField2 = this.k__BackingField.k__BackingField; if (k__BackingField2 != 0) { } array[2] = k__BackingField2; if (k__BackingField2 != 0) { } array[3] = k__BackingField2; string text = string.Format("No message received in the given time! Closing WebSocket. LastMessage: {0}, PingFrequency: {1}, Close After: {2}, Now: {3}", array); this.CloseWithError("No message received in the given time!"); } } // Token: 0x06007952 RID: 31058 RVA: 0x00193F7C File Offset: 0x0019217C [Token(Token = "0x6007952")] [Address(RVA = "0x6FA4B0", Offset = "0x6F8EB0", VA = "0x1806FA4B0")] private void OnApplicationForegroundStateChanged(bool isPaused) { if (!isPaused) { DateTime utcNow = DateTime.UtcNow; this.lastMessage = utcNow; } } // Token: 0x06007953 RID: 31059 RVA: 0x00193F9C File Offset: 0x0019219C [Token(Token = "0x6007953")] [Address(RVA = "0x6FB100", Offset = "0x6F9B00", VA = "0x1806FB100")] private void SendPing() { DateTime utcNow = DateTime.UtcNow; this.lastPing = utcNow; DateTime utcNow2 = DateTime.UtcNow; byte[] array; ulong num; int num2; ulong num3; ulong num4; WebSocketFrame webSocketFrame = new WebSocketFrame(this.k__BackingField, (WebSocketFrameTypes)((ulong)9L), array, num, (ulong)num2, num3 != 0UL, num4 != 0UL); if (array != 0) { } num2 = 0; this.Insert(webSocketFrame); ILogger logger = HTTPManager.Logger; } // Token: 0x06007954 RID: 31060 RVA: 0x00194004 File Offset: 0x00192204 [Token(Token = "0x6007954")] [Address(RVA = "0x6F9E70", Offset = "0x6F8870", VA = "0x1806F9E70")] private void CloseWithError(string message) { Delegate @delegate; int num; do { HTTPRequest baseRequest = this.baseRequest; Exception ex = new Exception(message); baseRequest.k__BackingField = ex; this.baseRequest.k__BackingField = (HTTPRequestStates)((ulong)4L); this.closed = true; HTTPManager.Heartbeats.Unsubscribe(this); Action onApplicationForegroundStateChanged = HTTPUpdateDelegator.OnApplicationForegroundStateChanged; Action action = new Action(this.OnApplicationForegroundStateChanged); @delegate = Delegate.Remove(onApplicationForegroundStateChanged, action); num = 0; } while (@delegate != 0 && @delegate == 0); HTTPUpdateDelegator.OnApplicationForegroundStateChanged = num; bool flag = this.newFrameSignal.Set(); this.CloseStream(); } // Token: 0x06007955 RID: 31061 RVA: 0x00194094 File Offset: 0x00192294 [Token(Token = "0x6007955")] [Address(RVA = "0x6F9D30", Offset = "0x6F8730", VA = "0x1806F9D30")] private int CalculateLatency() { CircularBuffer circularBuffer = this.rtts; int num = 0; int num2 = circularBuffer[num]; num += num2; num++; CircularBuffer circularBuffer2 = this.rtts; return num; } // Token: 0x0400576B RID: 22379 [Token(Token = "0x400576B")] public static int RTTBufferCapacity; // Token: 0x0400576D RID: 22381 [global::Cpp2IlInjected.FieldOffset(Offset = "0xE0")] [Token(Token = "0x400576D")] public Action OnText; // Token: 0x0400576E RID: 22382 [global::Cpp2IlInjected.FieldOffset(Offset = "0xE8")] [Token(Token = "0x400576E")] public Action OnBinary; // Token: 0x0400576F RID: 22383 [global::Cpp2IlInjected.FieldOffset(Offset = "0xF0")] [Token(Token = "0x400576F")] public Action OnIncompleteFrame; // Token: 0x04005770 RID: 22384 [global::Cpp2IlInjected.FieldOffset(Offset = "0xF8")] [Token(Token = "0x4005770")] public Action OnClosed; // Token: 0x04005773 RID: 22387 [global::Cpp2IlInjected.FieldOffset(Offset = "0x10C")] [Token(Token = "0x4005773")] private int _bufferedAmount; // Token: 0x04005775 RID: 22389 [global::Cpp2IlInjected.FieldOffset(Offset = "0x118")] [Token(Token = "0x4005775")] private List IncompleteFrames; // Token: 0x04005776 RID: 22390 [global::Cpp2IlInjected.FieldOffset(Offset = "0x120")] [Token(Token = "0x4005776")] private List CompletedFrames; // Token: 0x04005777 RID: 22391 [global::Cpp2IlInjected.FieldOffset(Offset = "0x128")] [Token(Token = "0x4005777")] private List frameCache; // Token: 0x04005778 RID: 22392 [global::Cpp2IlInjected.FieldOffset(Offset = "0x130")] [Token(Token = "0x4005778")] private WebSocketFrameReader CloseFrame; // Token: 0x04005779 RID: 22393 [global::Cpp2IlInjected.FieldOffset(Offset = "0x150")] [Token(Token = "0x4005779")] private object FrameLock; // Token: 0x0400577A RID: 22394 [global::Cpp2IlInjected.FieldOffset(Offset = "0x158")] [Token(Token = "0x400577A")] private object SendLock; // Token: 0x0400577B RID: 22395 [global::Cpp2IlInjected.FieldOffset(Offset = "0x160")] [Token(Token = "0x400577B")] private List unsentFrames; // Token: 0x0400577C RID: 22396 [global::Cpp2IlInjected.FieldOffset(Offset = "0x168")] [Token(Token = "0x400577C")] private AutoResetEvent newFrameSignal; // Token: 0x0400577D RID: 22397 [global::Cpp2IlInjected.FieldOffset(Offset = "0x170")] [Token(Token = "0x400577D")] private bool sendThreadCreated; // Token: 0x0400577E RID: 22398 [global::Cpp2IlInjected.FieldOffset(Offset = "0x171")] [Token(Token = "0x400577E")] private bool closeSent; // Token: 0x0400577F RID: 22399 [global::Cpp2IlInjected.FieldOffset(Offset = "0x172")] [Token(Token = "0x400577F")] private bool closed; // Token: 0x04005780 RID: 22400 [global::Cpp2IlInjected.FieldOffset(Offset = "0x178")] [Token(Token = "0x4005780")] private DateTime lastPing; // Token: 0x04005781 RID: 22401 [global::Cpp2IlInjected.FieldOffset(Offset = "0x180")] [Token(Token = "0x4005781")] private DateTime lastMessage; // Token: 0x04005782 RID: 22402 [global::Cpp2IlInjected.FieldOffset(Offset = "0x188")] [Token(Token = "0x4005782")] private CircularBuffer rtts; } }