0% found this document useful (0 votes)
12 views5 pages

Account Authorization Process in NeptuneEvo

The document outlines the implementation of an account authorization system for a gaming platform, detailing the process of user login and error handling. It includes methods for checking user credentials, managing session data, and handling various authorization states. The code also integrates database interactions and user notifications based on the authorization results.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

Account Authorization Process in NeptuneEvo

The document outlines the implementation of an account authorization system for a gaming platform, detailing the process of user login and error handling. It includes methods for checking user credentials, managing session data, and handling various authorization states. The code also integrates database interactions and user notifications based on the authorization results.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

using Database;

using GTANetworkAPI;
using [Link];
using LinqToDB;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using System;
using [Link];
using [Link];
using [Link];
using Localization;

namespace [Link]
{
public class Repository
{
private static readonly nLog Log = new
nLog("[Link]");

public static async Task AutorizationAccount(ExtPlayer player, string


loginOrEmail, string password)
{
/*Ban ban = Ban.Get1(player, login);
if (ban != null)
{
if ([Link] && [Link]())
{
[Link](player, ban);
return;
}
}*/
var testSpeedLoad = [Link];
AutorizationEnum result = await InitAccount(player, loginOrEmail,
password);
if (result == [Link])
[Link](player, testSpeedLoad);
else if (result == [Link]) [Link](player,
[Link], [Link], [Link]([Link],
[Link]), 3000);
else if (result == [Link]) [Link](player,
[Link], [Link], [Link]([Link],
[Link]), 3000);
else if (result == [Link]) [Link](player,
[Link], [Link], [Link]([Link],
[Link]), 3000);
else if (result == [Link]) [Link](player,
[Link], [Link], [Link]([Link],
[Link]), 3000);
else if (result == [Link]) [Link](player,
[Link], [Link], [Link]([Link],
[Link]), 3000);
//else if (result == [Link]) [Link](player,
[Link], [Link], "", 3000);
//[Link]($"{[Link]} ({[Link]} |
{[Link]}) tryed to signin.");
}

public static async Task<AutorizationEnum> InitAccount(ExtPlayer player,


string loginOrEmail, string password)
{
try
{
var sessionData = [Link]();
if (sessionData == null)
return [Link];
if ([Link]("NONE") ||
[Link]("NONE"))
return [Link];
if ([Link]())
return [Link];
if ([Link](player))
return [Link];

var auntificationData = [Link];

if ([Link] != 0 && ![Link])


return [Link];

loginOrEmail = [Link]();

if (loginOrEmail == [Link]())
{
if ([Link] != password)
return [Link];
}

await using var db = new ServerBD("MainDB");//В отдельном потоке

// Получаем модель пользователя по логину


var account = await [Link]
.Where(v => ([Link]() == loginOrEmail ||
[Link]() == loginOrEmail) && [Link] == password)
.FirstOrDefaultAsync();

// Если база не вернула значение, то отправляем сброс


if (account == null)
return [Link];

if ([Link] != 0 && !
[Link]([Link]) && !
[Link]([Link]))
return [Link];

var target = [Link]([Link]);


if ([Link] && target != null)
return [Link];

if ([Link](player))
return [Link];

/*if ([Link]().Any(p =>


[Link]()?.Login == [Link]))
return [Link];*/
//Удаляем таймер на авторизацию
if ([Link] != null)
{
[Link]([Link]);
[Link] = null;
}

var accountData = new AccountData


{
Login = [Link],
Email = [Link],
Password = [Link],
HWID = [Link],
IP = [Link],
SocialClub = [Link],
RedBucks = [Link],
VipLvl = [Link],
VipDate = [Link],

PresentGet = [Link]([Link]),
RefPresentGet = [Link]([Link]),

RefferalId = [Link],

isSubscribe = [Link],
SubscribeEndTime = [Link],
SubscribeTime = [Link],

ReceivedAwardWeek = [Link],
ReceivedAwardDonate = [Link],

Unique = [Link]([Link]),

LastSelectCharUUID = [Link],

Ga = [Link],
};

//
try
{
[Link] =
[Link]<List<string>>([Link]);
}
catch
{
[Link] = new List<string>();
}
//
try
{
[Link] =
[Link]<List<string>>([Link]);
}
catch
{
[Link] = new List<string>();
}
//
List<int> Chars = new List<int>();
try
{
Chars =
[Link]<List<int>>([Link]);
}
catch
{
Chars = new List<int>() { -2, -2, -2, -2, -2, -2 };
}

[Link] = new List<int>()


{
account.Character1,
account.Character2,
account.Character3,
};

if ([Link])
{
foreach (int i in Chars)
{
[Link](i);
}
}

//
try
{
[Link] =
[Link]<int[]>(account.@case);
}
catch
{
[Link] = new int[3] { 0, 0, 0 };
}
//
try
{
[Link] =
[Link]<List<int>>([Link]);
}
catch
{
[Link] = new List<int>();
}

try
{
[Link] =
[Link]<List<int>>([Link]);
if ([Link] < 9)
[Link](0);
if ([Link] < 10)
[Link](0);
if ([Link] < 11)
[Link](0);
if ([Link] < 12)
[Link](0);
if ([Link] < 13)
[Link](0);
if ([Link] < 14)
[Link](0);
}
catch
{
[Link] = new List<int>() { 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0 };
}
//
if ([Link] > [Link])
{
[Link] = false;
[Link] = [Link];
[Link] = [Link];
}

[Link](accountData);

if (![Link]([Link]))
[Link]([Link]);

[Link](player);//TODO

//

var ticks = Convert.ToInt64([Link] -


[Link]);

if (ticks >= 1)
{
var date = new DateTime(ticks);

if ([Link] > 20)

[Link]("login_returned_user", [Link],
[Link]);
else
[Link]("login_current_user",
[Link], [Link]);
}
//

return [Link];
}
catch (Exception e)
{
[Link]($"AutorizationAccount Exception: {[Link]()}");
return [Link];
}
}
}
}

Common questions

Powered by AI

During the 'InitAccount' method, player account data is updated or initialized by creating an 'AccountData' object with information from the database, including login details and subscription status. Errors might occur during data deserialization, handled by using try-catch blocks to assign default values when exceptions are raised during the process .

In the 'InitAccount' method, linkage is validated by checking if the player's session data is null, verifying hardware and social club information, ensuring the account isn't already linked to another session, and validating social club matches. The system further confirms the account is not blocked by analyzing server settings and queue limitations .

The 'AutorizationAccount' method will return an 'Already' status if the player is already logged in or if another session is already using the account's login credentials. This status is communicated to the player via an error notification at the bottom center of the screen, letting them know they are already authorized .

A discrepancy in HWID checks occurs if the 'RealHWID' of a player is 'NONE', which triggers a loading error, halting the process. Ensuring HWID validity is crucial for security, but when incorrectly managed, potentially blocks legitimate access attempts, necessitating rigorous data validation and system coherence .

When a 'LoadingError' result is returned during account authorization, the system notifies the player with an error message positioned at the bottom center of their screen, indicating that they must wait to retry the authorization .

If 'AutorizationEnum.SclubError' is encountered, it implies a breach of social club verification either by mismatched socials club credentials or failed account creation verification. This results in sending an error notification to the player indicating incorrect social club information, and the process is halted without authorizing the player .

The 'AutorizationAccount' method initially checks if a player is banned by attempting to retrieve a 'Ban' object. If the player is banned and the ban is a hard ban that is still in effect, the method formats and sends a ban message to the player before exiting the authorization process .

The 'AccountData' class manages extended functionalities by storing data for promotions and collections, leveraging JSON deserialization to load or initialize lists of promo codes and gift collections. Defaults are specified for failed deserializations, with default lists assigned to avoid errors and ensure system stability .

The system uses the 'JsonConvert.DeserializeObject' method to convert JSON strings into specific data types for account-related information such as promo codes and bonus codes. If deserialization fails, either due to format errors or invalid data, default values like an empty list are assigned to handle exceptions gracefully .

The 'Main.SetUpEverything' function finalizes the setup of the player's session, preparing the environment for gameplay. It checks account engagement timelines for analytics, determining a user's return or current status, thereby integrating this data into analytic events for further user behavior analysis .

You might also like