You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll post my code, the main flow. I don't know what's going on, but I assume the token is being retrieved correctly. However, when it tries to authenticate with DBD, it fails. Could someone help me?
using SteamKit2;
using SteamKit2.Internal;
using System;
using System.IO;
using System.Threading.Tasks;
using System.Net.Http;
using System.Text;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Threading;
namespace SteamTokenCreator
{
class Program
{
// Definimos la AppID de Dead by Daylight
const uint DBD_APPID = 381210;
static HttpClient httpClient = new HttpClient();
static async Task Main(string[] args)
{
Console.WriteLine("Iniciando creador de tokens de SteamKit...");
var authenticator = new SteamAuthenticator();
try
{
await authenticator.AuthenticateAsync();
// Si la autenticación fue exitosa y tenemos un ticket
if (authenticator.AuthTicket != null)
{
Console.WriteLine("Autenticación completa. Ticket de sesión de Steam obtenido.");
string authTicketString = ByteSessionTokenToString(authenticator.AuthTicket);
Console.WriteLine($"Steam Ticket (String): {authTicketString.Substring(0, Math.Min(authTicketString.Length, 30))}...");
// Intentar autenticar con el servidor de Dead by Daylight
await AuthenticateWithDeadByDaylight(authTicketString);
}
else
{
Console.WriteLine("Fallo en la autenticación: No se obtuvo un ticket de sesión.");
}
}
catch (Exception ex)
{
Console.WriteLine($"Un error ocurrió durante la autenticación: {ex.Message}");
}
Console.WriteLine("Creador de tokens finalizado.");
Console.ReadLine();
}
// Hacer este metodo estatico si es necesario
private static string ByteSessionTokenToString(byte[] buffer)
{
var token = BitConverter.ToString(buffer, 0, (int)buffer.Length);
return token.Replace("-", string.Empty);
}
static async Task AuthenticateWithDeadByDaylight(string steamTicketString)
{
Console.WriteLine("Intentando autenticar con el servidor de Dead by Daylight...");
string requestUrl = "https://steam.live.bhvrdbd.com/api/v1/auth/provider/steam/login";
string requestBody = $"{{ \"token\": \"{steamTicketString}\" }}";
// Asegúrate de que estas claves y versiones estén actualizadas para DBD
const string currentContentVersion = "9.0.0_2512407live";
const string currentAccessSecretKey = "E51mMIAWTMaYSx+xJc8PROpkmoyK35FtpAa3fcrhCAg=";
var headers = new Dictionary<string, string>
{
{ "User-Agent", "DeadByDaylight/DBD_Ketchup_REL_Steam_Shipping_9_2497668 Windows/10.0.26100.1.256.64bit" },
{ "x-kraken-content-secret-key", currentAccessSecretKey },
{ "x-kraken-content-version", $"{{ \"contentVersionId\": \"{currentContentVersion}\" }}" },
{ "x-kraken-client-resolution", "1920x1080" },
{ "x-kraken-client-platform", "steam" },
{ "x-kraken-client-provider", "steam" }
};
httpClient.DefaultRequestHeaders.Clear();
foreach (var header in headers)
{
httpClient.DefaultRequestHeaders.TryAddWithoutValidation(header.Key, header.Value);
}
try
{
var content = new StringContent(requestBody, Encoding.UTF8, new MediaTypeHeaderValue("application/json"));
Console.WriteLine($"Realizando solicitud POST a: {requestUrl}");
Console.WriteLine($"Cuerpo de la solicitud: {requestBody}");
HttpResponseMessage response = await httpClient.PostAsync(requestUrl, content);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine("Respuesta del servidor de Dead by Daylight:");
Console.WriteLine(responseBody);
Console.WriteLine("Autenticación con Dead by Daylight exitosa!");
}
catch (HttpRequestException ex)
{
Console.WriteLine($"Ocurrió un error al autenticar con Dead by Daylight: {ex.Message}");
if (ex.StatusCode.HasValue)
{
Console.WriteLine($"Código de estado HTTP: {(int)ex.StatusCode.Value} {ex.StatusCode.Value}");
}
Console.WriteLine("Detalles adicionales de la respuesta HTTP no disponibles en este contexto de error.");
}
catch (Exception ex)
{
Console.WriteLine($"Ocurrió un error inesperado durante la solicitud a DBD: {ex.Message}");
}
}
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'll post my code, the main flow. I don't know what's going on, but I assume the token is being retrieved correctly. However, when it tries to authenticate with DBD, it fails. Could someone help me?
Beta Was this translation helpful? Give feedback.
All reactions