So i am working on a project to bring Grand Theft Auto 5 online again on ps3. I got everything setup corectly at the moment i just have 1 problem… Ticket creation, somehow it’s not working correctly and without my auth doing what it needs to do i can’t go online and test my stuff. Can anyone help?
I asked all of my friends that knew something about coding in c# i even asked ChatGPT no one could help me. The thing is i don’t know anything about c# so i am hoping that u guys can help me and maybe tell me what i need to change.
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Linq;
using RSG.Base.Configuration.ROS;
namespace RSG.ROS
{
public abstract class auth : ROSService
{
public AuthenticationService(IROSConfig config)
: base(config)
{
}
public XElement CreateTicketNp2(string username, string password, string title, string npOnlineId)
{
XElement result = null;
try
{
// Construct the POST data
string postData = $"username={username}&password={password}&titleName={title}&platformName={ROSPlatform.PS3}&version={Version}&npOnlineId={npOnlineId}";
// Create the HTTP request
HttpWebRequest request = (HttpWebRequest)WebRequest.Create($"{ServiceUri.ToString()}/CreateTicketNp2");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = postData.Length;
// Write POST data to the request stream
using (Stream dataStream = request.GetRequestStream())
{
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
dataStream.Write(byteArray, 0, byteArray.Length);
}
// Get the HTTP response
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream responseStream = response.GetResponseStream())
{
if (responseStream != null)
{
XDocument xDoc = XDocument.Load(responseStream);
result = xDoc.Root;
}
}
}
catch (Exception ex)
{
// Handle or log the exception if needed
Console.WriteLine($"An error occurred while creating ticket: {ex.Message}");
}
return result;
}
}
}
Kiaro Dhondt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.