public static ProvideAuthToken SteamAuthTokenProvider() { const int maxTicketLength = 256; var cacheTimeOut = TimeSpan.FromMinutes(30); Maybe <AuthToken> cachedAuthToken = Maybe.Nothing <AuthToken>(); DateTime? cacheTime = null; return(() => { if (SteamAPI.IsSteamRunning() && SteamManager.Initialized) { if (!cacheTime.HasValue || (DateTime.Now - cacheTime) > cacheTimeOut) { uint ticketLength; var ticket = new byte[maxTicketLength]; SteamUser.GetAuthSessionTicket(ticket, maxTicketLength, out ticketLength); cachedAuthToken = Maybe.Just(Authentication.SteamAuthToken(ticket, ticketLength)); cacheTime = DateTime.Now; } } else { cachedAuthToken = Maybe.Nothing <AuthToken>(); } return cachedAuthToken; }); }
public void AccountLoginRequestSteamWorks() { if (!m_bInitialized) { return; } try { if (hAuthTicket != HAuthTicket.Invalid) { SteamUser.CancelAuthTicket(hAuthTicket); hAuthTicket = HAuthTicket.Invalid; return; } byte[] tokenByteArray = new byte[1024]; uint tokenLen = 0; hAuthTicket = SteamUser.GetAuthSessionTicket(tokenByteArray, tokenByteArray.Length, out tokenLen); GameClientLobby.AccountLoginSteamWorks(tokenByteArray, tokenLen, steamId.m_SteamID); } catch (Exception e) { if (LogFilter.logError) { Debug.LogErrorFormat("{0}\r\n{1}", e.Message, e.StackTrace); } AccountLogoutSteamWorks(); } }
/// <summary> /// Starts the authentication session so that we can log into the Quaver server afterwards. /// </summary> private static void StartAuthSession() { // Generate an auth session token and wait for a response from Steam // After calling this, it should call OnValidateAuthSessionTicketResponse(GetAuthSessionTicketResponse_t pCallback); // where we will then continue to authenticate the user PTicket = new byte[1024]; AuthSessionTicket = SteamUser.GetAuthSessionTicket(PTicket, PTicket.Length, out PcbTicket); }
private static string GetSteamTicket() { byte[] array = new byte[1024]; uint newSize; SteamUser.GetAuthSessionTicket(array, 1024, out newSize); return(BitConverter.ToString(array).Replace("-", string.Empty)); }
// Token: 0x06008606 RID: 34310 RVA: 0x002F019C File Offset: 0x002EE39C public void Awake() { this.LIPLGELHGAD = Callback <GetAuthSessionTicketResponse_t> .Create(new Callback <GetAuthSessionTicketResponse_t> .DispatchDelegate(this.BIIBADBPGAP)); if (SteamManager.IEHNBLNFHJI != null) { UnityEngine.Object.Destroy(base.gameObject); return; } SteamManager.IEHNBLNFHJI = this; if (SteamManager.KGJDHIHOCEI) { throw new Exception("Tried to Initialize the SteamAPI twice in one session!"); } UnityEngine.Object.DontDestroyOnLoad(base.gameObject); if (!Packsize.Test()) { Debug.LogError("[Steamworks.NET] Packsize Test returned false, the wrong version of Steamworks.NET is being run in this platform.", this); return; } if (!DllCheck.Test()) { Debug.LogError("[Steamworks.NET] DllCheck Test returned false, One or more of the Steamworks binaries seems to be the wrong version.", this); return; } try { if (SteamAPI.RestartAppIfNecessary((AppId_t)513510U)) { Application.Quit(); return; } } catch (DllNotFoundException arg) { Debug.LogError("[Steamworks.NET] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + arg, this); Application.Quit(); return; } SteamManager.connectingToServer = true; this.FMLHGNJJDEA = SteamAPI.Init(); if (!this.FMLHGNJJDEA) { Singleton <GameManager> .Instance.DieWithError("[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information."); return; } this.GEIOLGGAMKL = new byte[1024]; this.CHMKJCDEAEM = SteamUser.GetAuthSessionTicket(this.GEIOLGGAMKL, 1024, out this.KMDGBKMCCAM); Debug.Log("[SteamManager] Connecting to server"); if (Application.internetReachability == NetworkReachability.NotReachable) { base.StartCoroutine(this.LDBKGFDHKFB(1f)); } base.StartCoroutine(this.LDBKGFDHKFB(this.PJOEHKHICFH)); SteamManager.KGJDHIHOCEI = true; }
//https://partner.steamgames.com/documentation/auth /// <summary> /// Returns a one time use ticket. The ticket is normally transmitted to the server next, along with the client's Steam ID, and Steam Name. The client must revoke the ticket when done (CancelAuthTicket). /// </summary> /// <returns>A one time user ticket.</returns> public byte[] getTicket() { byte[] pTicket = new byte[1024]; int cbMaxTicket = pTicket.Length; uint pcbTicketSize; //looks like the number of bytes used? HAuthTicket tempTicket = SteamUser.GetAuthSessionTicket(pTicket, cbMaxTicket, out pcbTicketSize); return(pTicket); }
// Token: 0x06008602 RID: 34306 RVA: 0x002EFFA8 File Offset: 0x002EE1A8 public void IOMCHHBGJEC() { this.LIPLGELHGAD = Callback <GetAuthSessionTicketResponse_t> .Create(new Callback <GetAuthSessionTicketResponse_t> .DispatchDelegate(this.FBKDGBINBOO)); if (SteamManager.IEHNBLNFHJI != null) { UnityEngine.Object.Destroy(base.gameObject); return; } SteamManager.IEHNBLNFHJI = this; if (SteamManager.KGJDHIHOCEI) { throw new Exception("PS Home"); } UnityEngine.Object.DontDestroyOnLoad(base.gameObject); if (!Packsize.Test()) { Debug.LogError("settings.disablestoryboard", this); return; } if (!DllCheck.Test()) { Debug.LogError("CameraFilterPack/Distortion_Flag", this); return; } try { if (SteamAPI.RestartAppIfNecessary((AppId_t)4294967216U)) { Application.Quit(); return; } } catch (DllNotFoundException arg) { Debug.LogError("_FixDistance" + arg, this); Application.Quit(); return; } SteamManager.connectingToServer = false; this.FMLHGNJJDEA = SteamAPI.Init(); if (!this.FMLHGNJJDEA) { Singleton <GameManager> .Instance.IPNHHBFPDJK(": "); return; } this.GEIOLGGAMKL = new byte[193]; this.CHMKJCDEAEM = SteamUser.GetAuthSessionTicket(this.GEIOLGGAMKL, 130, out this.KMDGBKMCCAM); Debug.Log("_ScreenResolution"); if (Application.internetReachability == NetworkReachability.NotReachable) { base.StartCoroutine(this.LDBKGFDHKFB(1216f)); } base.StartCoroutine(this.DKNKLPLIENK(this.PJOEHKHICFH)); SteamManager.KGJDHIHOCEI = false; }
// Token: 0x0600863A RID: 34362 RVA: 0x002F0D64 File Offset: 0x002EEF64 public void GGHEPDCEHCK() { this.LIPLGELHGAD = Callback <GetAuthSessionTicketResponse_t> .Create(new Callback <GetAuthSessionTicketResponse_t> .DispatchDelegate(this.KCNAGNEENOG)); if (SteamManager.IEHNBLNFHJI != null) { UnityEngine.Object.Destroy(base.gameObject); return; } SteamManager.IEHNBLNFHJI = this; if (SteamManager.KGJDHIHOCEI) { throw new Exception("LoadingStatusText"); } UnityEngine.Object.DontDestroyOnLoad(base.gameObject); if (!Packsize.Test()) { Debug.LogError("ScrollPanel", this); return; } if (!DllCheck.Test()) { Debug.LogError("Show text at the center of the screen. Usefull for quick messages like 'Thanks for playing!'", this); return; } try { if (SteamAPI.RestartAppIfNecessary((AppId_t)21U)) { Application.Quit(); return; } } catch (DllNotFoundException arg) { Debug.LogError("CameraFilterPack/AAA_Blood_Hit" + arg, this); Application.Quit(); return; } SteamManager.connectingToServer = true; this.FMLHGNJJDEA = SteamAPI.Init(); if (!this.FMLHGNJJDEA) { Singleton <GameManager> .Instance.DieWithError(","); return; } this.GEIOLGGAMKL = new byte[99]; this.CHMKJCDEAEM = SteamUser.GetAuthSessionTicket(this.GEIOLGGAMKL, -163, out this.KMDGBKMCCAM); Debug.Log("SpawnObj"); if (Application.internetReachability == NetworkReachability.NotReachable) { base.StartCoroutine(this.DKNKLPLIENK(759f)); } base.StartCoroutine(this.JGOOHEBBDBF(this.PJOEHKHICFH)); SteamManager.KGJDHIHOCEI = true; }
// Token: 0x06008626 RID: 34342 RVA: 0x002F07B0 File Offset: 0x002EE9B0 public void HCNECNPPEKA() { this.LIPLGELHGAD = Callback <GetAuthSessionTicketResponse_t> .Create(new Callback <GetAuthSessionTicketResponse_t> .DispatchDelegate(this.GPKLHJBMMHJ)); if (SteamManager.IEHNBLNFHJI != null) { UnityEngine.Object.Destroy(base.gameObject); return; } SteamManager.IEHNBLNFHJI = this; if (SteamManager.KGJDHIHOCEI) { throw new Exception("_Value3"); } UnityEngine.Object.DontDestroyOnLoad(base.gameObject); if (!Packsize.Test()) { Debug.LogError("#tryagain", this); return; } if (!DllCheck.Test()) { Debug.LogError("[MapEditor] Exported to ", this); return; } try { if (SteamAPI.RestartAppIfNecessary((AppId_t)4294967248U)) { Application.Quit(); return; } } catch (DllNotFoundException arg) { Debug.LogError("0 - default, 1 - left, 2 - right" + arg, this); Application.Quit(); return; } SteamManager.connectingToServer = true; this.FMLHGNJJDEA = SteamAPI.Init(); if (!this.FMLHGNJJDEA) { Singleton <GameManager> .Instance.JFEOOAIGNLK("id"); return; } this.GEIOLGGAMKL = new byte[-143]; this.CHMKJCDEAEM = SteamUser.GetAuthSessionTicket(this.GEIOLGGAMKL, -200, out this.KMDGBKMCCAM); Debug.Log("_Value4"); if (Application.internetReachability == NetworkReachability.NotReachable) { base.StartCoroutine(this.IMLLNKFFNFE(1490f)); } base.StartCoroutine(this.DKNKLPLIENK(this.PJOEHKHICFH)); SteamManager.KGJDHIHOCEI = true; }
// Token: 0x06008634 RID: 34356 RVA: 0x002F0AD4 File Offset: 0x002EECD4 public void BMAGFLLGDPJ() { this.LIPLGELHGAD = Callback <GetAuthSessionTicketResponse_t> .Create(new Callback <GetAuthSessionTicketResponse_t> .DispatchDelegate(this.GPKLHJBMMHJ)); if (SteamManager.IEHNBLNFHJI != null) { UnityEngine.Object.Destroy(base.gameObject); return; } SteamManager.IEHNBLNFHJI = this; if (SteamManager.KGJDHIHOCEI) { throw new Exception("_Value2"); } UnityEngine.Object.DontDestroyOnLoad(base.gameObject); if (!Packsize.Test()) { Debug.LogError("MenuScene", this); return; } if (!DllCheck.Test()) { Debug.LogError("_BlurTexture", this); return; } try { if (SteamAPI.RestartAppIfNecessary((AppId_t)4294967222U)) { Application.Quit(); return; } } catch (DllNotFoundException arg) { Debug.LogError("#rt" + arg, this); Application.Quit(); return; } SteamManager.connectingToServer = false; this.FMLHGNJJDEA = SteamAPI.Init(); if (!this.FMLHGNJJDEA) { Singleton <GameManager> .Instance.IPNHHBFPDJK("_Saturation"); return; } this.GEIOLGGAMKL = new byte[-78]; this.CHMKJCDEAEM = SteamUser.GetAuthSessionTicket(this.GEIOLGGAMKL, -42, out this.KMDGBKMCCAM); Debug.Log("PUNCloudBestRegion"); if (Application.internetReachability == NetworkReachability.NotReachable) { base.StartCoroutine(this.DKNKLPLIENK(271f)); } base.StartCoroutine(this.JGOOHEBBDBF(this.PJOEHKHICFH)); SteamManager.KGJDHIHOCEI = true; }
//private void SteamFriends_OnGameLobbyJoinRequested(Lobby arg1, SteamId arg2) //{ // arg1.GetGameServer(); //} public void StartClient() { if (clientAuth != null) { clientAuth.Cancel(); clientAuth = null; } clientAuth = SteamUser.GetAuthSessionTicket(); clientStarted = true; }
public byte[] GetAuthSessionTicket() { CancelAuthTicket(); byte[] data = new byte[1024]; uint dataLength = 0; _authTicket = SteamUser.GetAuthSessionTicket(data, data.Length, out dataLength); return(data.Take((int)dataLength).ToArray()); }
/** * Gets a session ticket or times out. */ private IEnumerator SessionTicketCoroutine() { // Attempts to get a session ticket m_ticket = new byte[1024]; m_authTicket = SteamUser.GetAuthSessionTicket(m_ticket, 1024, out m_length); yield return(new WaitForSeconds(m_timeout)); // Times out OnFailure("Couldn't get session ticket"); }
public void RequestPlayerProof() { Proof = null; if (m_GetAuthSessionTicketResponse == null) { m_GetAuthSessionTicketResponse = Callback <GetAuthSessionTicketResponse_t> .Create(OnGetAuthSessionTicketResponse); } SteamUser.GetAuthSessionTicket(_ticketBlob, 1024, out _ticketSize); }
static AuthInfo Login() { // Unfortunately, youtube ASHes can only be submitted with a valid steam ticket // and a session ID from the AS2 server. // 1) Login with Steamworks Console.WriteLine("Getting Steam session"); if (!SteamAPI.Init()) { Console.Error.WriteLine("SteamAPI.Init() failed"); Environment.Exit(1); } byte[] ticket = new byte[1024]; uint ticketLength = 0; HAuthTicket authTicket = SteamUser.GetAuthSessionTicket(ticket, ticket.Length, out ticketLength); if (authTicket == HAuthTicket.Invalid) { Console.Error.WriteLine("Got invalid ticket"); Environment.Exit(1); } string steamTicket = BitConverter.ToString(ticket, 0, (int)ticketLength).Replace("-", "").ToLowerInvariant(); // 2) Get a session ID from the AS2 server string result = ""; using (WebClient client = new WebClient()) { try { byte[] response = client.UploadValues("http://audiosurf2.com/as/airgame_steamAuthenticate4.php", new NameValueCollection() { { "username", "yashbot" }, { "session", "" }, { "steamid", SteamUser.GetSteamID().ToString() }, { "steamticket", steamTicket }, { "steamfriends", "" }, }); result = Encoding.UTF8.GetString(response); } catch (WebException wex) { Console.Error.WriteLine("Couldn't get AS2 session ID:"); Console.Error.WriteLine(wex.ToString()); Environment.Exit(1); } } string session = Regex.Match(result, "token='(.+?)'").Groups[1].Value; // cthulhu > xml parsers return(new AuthInfo(SteamUser.GetSteamID().ToString(), steamTicket, session)); }
public byte[] GetClientAuthToken() { var buf = new byte[256]; uint ticketSize; SteamUser.GetAuthSessionTicket(buf, buf.Length, out ticketSize); var truncArray = new byte[ticketSize]; Array.Copy(buf, truncArray, truncArray.Length); return(truncArray); }
public SteamConnectToken GetConnectToken() { if (!SteamClient.IsValid) { Debug.LogError("Error, Steam is not initialized."); return(null); } SteamConnectToken token = new SteamConnectToken(SteamUser.GetAuthSessionTicket().Data, SteamClient.SteamId.Value); return(token); }
public string GetSteamSessionTicket() { uint num; byte[] numArray = new byte[1024]; SteamUser.GetAuthSessionTicket(numArray, 1024, out num); string str = BitConverter.ToString(numArray, 0, (int)num).Replace("-", string.Empty); Debug.WriteLine(string.Format("SteamLogin, steamSessionTicket={0}", str)); MessageSend messageSend = new MessageSend(GameCli.Send); int sLoginTransId = GameCli.s_loginTransId; AppId_t appID = SteamUtils.GetAppID(); }
public void GetTicket(bool goToPayment = false) { if ((Time.unscaledTime - this.lastRequestTicketTime) > this.MIN_RETRY_DELAY) { this.lastRequestTicketTime = Time.unscaledTime; this.goToPayment = goToPayment; if (SteamManager.Initialized && SteamAPI.IsSteamRunning()) { ticket = new byte[0x400]; SteamUser.GetAuthSessionTicket(ticket, 0x400, out ticketLength); } } }
public static IEnumerator GetAuthTicket() { uint num2; Plugin.Log.Debug("Getting a ticket..."); SteamAuthResult < authResult > 5__2 = new SteamAuthResult(); CSteamID steamID = SteamUser.GetSteamID(); string < authTicketHexString > 5__3 = ""; byte[] pTicket = new byte[0x400]; if (SteamUser.GetAuthSessionTicket(pTicket, 0x400, out num2) != HAuthTicket.Invalid) { if (SteamUser.BeginAuthSession(pTicket, (int)num2, steamID) != EBeginAuthSessionResult.k_EBeginAuthSessionResultOK) {
public string GetAuthSessionTicket() { if (_ticketHandle.m_HAuthTicket != 0) { return(BitConverter.ToString(_ticketBytes).Replace("-", string.Empty)); } _ticketBytes = new byte[1024]; uint ticketSize = 0; _ticketHandle = SteamUser.GetAuthSessionTicket(_ticketBytes, 1024, out ticketSize); return(BitConverter.ToString(_ticketBytes).Replace("-", string.Empty)); }
// Token: 0x06000959 RID: 2393 RVA: 0x00044EDC File Offset: 0x000430DC public byte[] RequestSessionTicket() { this.ReleaseSessionTicket(); byte[] array = new byte[1024]; uint num = 0U; this.m_authTicket = SteamUser.GetAuthSessionTicket(array, 1024, out num); if (this.m_authTicket == HAuthTicket.Invalid) { return(null); } byte[] array2 = new byte[num]; Buffer.BlockCopy(array, 0, array2, 0, (int)num); return(array2); }
public string GetSteamAuthTicket(out HAuthTicket hAuthTicket) { byte[] ticketByteArray = new byte[1024]; uint ticketSize; hAuthTicket = SteamUser.GetAuthSessionTicket(ticketByteArray, ticketByteArray.Length, out ticketSize); System.Array.Resize(ref ticketByteArray, (int)ticketSize); StringBuilder sb = new StringBuilder(); for (int i = 0; i < ticketSize; i++) { sb.AppendFormat("{0:x2}", ticketByteArray[i]); } return(sb.ToString()); }
string ISteamAuth.CreateAuthSessionTicket() { var authTicket = SteamUser.GetAuthSessionTicket(); var stringBuilder = new StringBuilder(); foreach (var item in authTicket.Data) { stringBuilder.Append(item.ToString("X2")); } var authSessionTicket = stringBuilder.ToString(); AuthTickets[authSessionTicket] = authTicket; return(authSessionTicket); }
public async Task CreateSessionTicket() { m_ticket = new byte[1024]; m_HAuthTicket = SteamUser.GetAuthSessionTicket(m_ticket, 1024, out m_pcbTicket); Console.WriteLine("SteamUser.GetAuthSessionTicket(Ticket, 1024, out pcbTicket) - " + m_HAuthTicket + " -- " + m_pcbTicket); //Wait for callback. Task t = WaitForAuthSessionTicketResponse(); if (await Task.WhenAny(t, Task.Delay(20000)) != t) { throw new Exception("Timed out!"); } Console.WriteLine("Ended."); }
string Get_SteamSessionTicket() { uint ticketLenght = 0; byte[] ticketStream = new byte[1024]; SteamUser.GetAuthSessionTicket(ticketStream, 1024, out ticketLenght); string hexEncodedSessionTicket = ""; for (int i = 0; i < ticketLenght; i++) { hexEncodedSessionTicket += string.Format("{0:X2}", ticketStream[i]); } return(hexEncodedSessionTicket); }
// Token: 0x06000C45 RID: 3141 RVA: 0x0004D188 File Offset: 0x0004B388 private string GetSteamAuthTicket(out HAuthTicket hAuthTicket) { byte[] array = new byte[1024]; uint num; hAuthTicket = SteamUser.GetAuthSessionTicket(array, array.Length, out num); Array.Resize <byte>(ref array, (int)num); StringBuilder stringBuilder = new StringBuilder(); int num2 = 0; while ((long)num2 < (long)((ulong)num)) { stringBuilder.AppendFormat("{0:x2}", array[num2]); num2++; } return(stringBuilder.ToString()); }
public virtual void GetAuthSessionTicket(AuthSessionTicketDelegate callback) { if (!Initialized) { Debug.Log("Kongregate: Ignoring GetAuthSessionTicket call, SteamManager is not initialized"); return; } sessionTicketDelegate = callback; var ticket = new byte[MAX_TICKET_SIZE]; uint length = 0; authTicketHandle = SteamUser.GetAuthSessionTicket(ticket, MAX_TICKET_SIZE, out length); pendingAuthTicket = new byte[length]; Array.Copy(ticket, 0, pendingAuthTicket, 0, length); Debug.Log("Pending AuthTicket handle: " + authTicketHandle + ", length: " + length); }
private void SendAuthTicket(CSteamID address) { if (_authTicket == HAuthTicket.Invalid) { _authTicket = SteamUser.GetAuthSessionTicket(_authData, _authData.Length, out _authDataLength); } int num = (int)(_authDataLength + 3); byte[] array = new byte[num]; array[0] = (byte)(num & 0xFF); array[1] = (byte)((num >> 8) & 0xFF); array[2] = 93; for (int i = 0; i < _authDataLength; i++) { array[i + 3] = _authData[i]; } SteamNetworking.SendP2PPacket(address, array, (uint)num, EP2PSend.k_EP2PSendReliable, 1); }
private void SendAuthTicket(CSteamID address) { if (HAuthTicket.op_Equality(this._authTicket, (HAuthTicket)HAuthTicket.Invalid)) { this._authTicket = SteamUser.GetAuthSessionTicket(this._authData, this._authData.Length, ref this._authDataLength); } int length = (int)this._authDataLength + 3; byte[] numArray = new byte[length]; numArray[0] = (byte)(length & (int)byte.MaxValue); numArray[1] = (byte)(length >> 8 & (int)byte.MaxValue); numArray[2] = (byte)93; for (int index = 0; (long)index < (long)this._authDataLength; ++index) { numArray[index + 3] = this._authData[index]; } SteamNetworking.SendP2PPacket(address, numArray, (uint)length, (EP2PSend)2, 1); }