using System; using System.Runtime.InteropServices; using BestHTTP.Futures; using BestHTTP.SignalRCore; using BestHTTP.SignalRCore.Encoders; using BestHTTP.SignalRCore.Messages; using Cpp2IlInjected; using UnityEngine; namespace BestHTTP.Examples { // Token: 0x020012CA RID: 4810 [Token(Token = "0x20012CA")] [StructLayout(3)] public sealed class HubWithAuthorizationSample : MonoBehaviour { // Token: 0x0600787B RID: 30843 RVA: 0x00190810 File Offset: 0x0018EA10 [Token(Token = "0x600787B")] [Address(RVA = "0x1E651F0", Offset = "0x1E63BF0", VA = "0x181E651F0")] private void Start() { Uri uri = this.URI; JsonProtocol jsonProtocol = new JsonProtocol(new LitJsonEncoder()); HubConnection hubConnection = new HubConnection(uri, jsonProtocol); this.hub = hubConnection; Action action = new Action(this.Hub_OnConnected); hubConnection.OnConnected += action; HubConnection hubConnection2 = this.hub; Action action2 = new Action(this.Hub_OnError); hubConnection2.OnError += action2; HubConnection hubConnection3 = this.hub; Action action3 = new Action(this.Hub_OnClosed); hubConnection3.OnClosed += action3; HubConnection hubConnection4 = this.hub; Func func = new Func(this.Hub_OnMessage); hubConnection4.OnMessage += func; this.hub.StartConnect(); this.uiText = "StartConnect called\n"; } // Token: 0x0600787C RID: 30844 RVA: 0x001908CC File Offset: 0x0018EACC [Token(Token = "0x600787C")] [Address(RVA = "0x1E65120", Offset = "0x1E63B20", VA = "0x181E65120")] private void OnDestroy() { HubConnection hubConnection = this.hub; if (hubConnection != 0) { hubConnection.StartClose(); return; } } // Token: 0x0600787D RID: 30845 RVA: 0x001908EC File Offset: 0x0018EAEC [Token(Token = "0x600787D")] [Address(RVA = "0x1E65140", Offset = "0x1E63B40", VA = "0x181E65140")] private void OnGUI() { Rect clientArea = GUIHelper.ClientArea; Action action = delegate { GUILayoutOption[] array = Array.Empty(); Vector2 vector; this.scrollPos = vector; this.scrollPos.y = (float)0; GUILayout.BeginVertical(Array.Empty()); string text = this.uiText; GUILayoutOption[] array2 = Array.Empty(); GUILayout.Label(text, array2); GUILayout.EndVertical(); GUILayout.EndScrollView(); }; GUIHelper.DrawArea(clientArea, true, action); } // Token: 0x0600787E RID: 30846 RVA: 0x00190914 File Offset: 0x0018EB14 [Token(Token = "0x600787E")] [Address(RVA = "0x1E64F80", Offset = "0x1E63980", VA = "0x181E64F80")] private void Hub_OnConnected(HubConnection hub) { string text = this.uiText + "Hub Connected\n"; this.uiText = text; object[] array = new object[1]; if ("Message from the client" != 0) { } array[0] = "Message from the client"; IFuture future = hub.Invoke("Echo", array); FutureValueCallback futureValueCallback = delegate(string ret) { string text2 = this.uiText; string text3 = string.Format(" 'Echo' returned: '{0}'\n", ret); string text4 = text2 + text3; this.uiText = text4; }; throw new NullReferenceException(); } // Token: 0x0600787F RID: 30847 RVA: 0x00190974 File Offset: 0x0018EB74 [Token(Token = "0x600787F")] [Address(RVA = "0x4405A0", Offset = "0x43EFA0", VA = "0x1804405A0")] private bool Hub_OnMessage(HubConnection hub, Message message) { return true; } // Token: 0x06007880 RID: 30848 RVA: 0x00190984 File Offset: 0x0018EB84 [Token(Token = "0x6007880")] [Address(RVA = "0x1E64F30", Offset = "0x1E63930", VA = "0x181E64F30")] private void Hub_OnClosed(HubConnection hub) { string text = this.uiText + "Hub Closed\n"; this.uiText = text; } // Token: 0x06007881 RID: 30849 RVA: 0x001909AC File Offset: 0x0018EBAC [Token(Token = "0x6007881")] [Address(RVA = "0x1E650C0", Offset = "0x1E63AC0", VA = "0x181E650C0")] private void Hub_OnError(HubConnection hub, string error) { string text = this.uiText + "Hub Error: " + error + "\n"; this.uiText = text; } // Token: 0x06007882 RID: 30850 RVA: 0x001909D8 File Offset: 0x0018EBD8 [Token(Token = "0x6007882")] [Address(RVA = "0x1E65510", Offset = "0x1E63F10", VA = "0x181E65510")] public HubWithAuthorizationSample() { Uri uri = new Uri(GUIHelper.BaseURL + "/redirect"); this.URI = uri; base..ctor(); } // Token: 0x040056F8 RID: 22264 [global::Cpp2IlInjected.FieldOffset(Offset = "0x18")] [Token(Token = "0x40056F8")] private readonly Uri URI; // Token: 0x040056F9 RID: 22265 [global::Cpp2IlInjected.FieldOffset(Offset = "0x20")] [Token(Token = "0x40056F9")] private HubConnection hub; // Token: 0x040056FA RID: 22266 [global::Cpp2IlInjected.FieldOffset(Offset = "0x28")] [Token(Token = "0x40056FA")] private Vector2 scrollPos; // Token: 0x040056FB RID: 22267 [global::Cpp2IlInjected.FieldOffset(Offset = "0x30")] [Token(Token = "0x40056FB")] private string uiText; } }