<commit_before>//	@file Version: 1.0
//	@file Name: loadAccount.sqf
//	@file Author: AgentRev
//	@file Created: 25/02/2014 22:21

if (!isServer) exitWith {};

private ["_player_uid", "_data", "_playerSaveValid", "_getValue"];

_player = _this;
_player_uid = getPlayerUID _player;

_data = [];

_result = [format["existPlayerInfo:%1", _player_uid],2] call extDB_Database_async;

if (_result select 0) then {

	_result = [format["getPlayerSaveData:%1:%2", call(A3W_extDB_ServerID), _player_uid],2] call extDB_Database_async;

	if ((count _result) == 0) then
	{
		[format["insertPlayerSaveData:%1:%2", call(A3W_extDB_ServerID), _player_uid],2] call extDB_Database_async; //ASYNC METHOD 2 to prevent any possible race condition of INSERT / UPDATE
	}
	else
	{
		_pos = _result select 2;
		_playerSaveValid = false;
		if (count _pos > 0) then
		{
			_playerSaveValid = true;
		};

		_bank = 0;
		_money = 0;
		if (["A3W_moneySaving"] call isConfigOn) then
		{
			_money = _result select 6;
			_bank = [format["getPlayerInfoBank:%1", _player_uid],2] call extDB_Database_async;
		};

		_data = [["Damage",    		_result select 0],
				["HitPoints", 		_result select 1],
				["Position",  		_pos],
				["Direction",  		_result select 3],
				["Hunger", 	  		_result select 4],
				["Thirst", 	  		_result select 5],
				["Money", 	  		_money],
				["CurrentWeapon",  	_result select 7],
				["Stance",  		_result select 8],
				["Headgear",  		_result select 9],
				["Goggles",  		_result select 10],
				["Uniform",  		_result select 11],
				["Vest",  			_result select 12],
				["Backpack",  			_result select 13],
				["UniformWeapons",  	_result select 14],
				["UniformItems",  		_result select 15],
				["UniformMagazines",  	_result select 16],
				["VestWeapons",  		_result select 17],
				["VestItems",  			_result select 18],
				["VestMagazines",  		_result select 19],
				["BackpackWeapons",  	_result select 20],
				["BackpackItems",  		_result select 21],
				["BackpackMagazines",  	_result select 22],
				["PrimaryWeapon",  			_result select 23],
				["SecondaryWeapon",  		_result select 24],
				["HandgunWeapon",  			_result select 25],
				["PrimaryWeaponItems",  	_result select 26],
				["SecondaryWeaponItems",	_result select 27],
				["HandgunItems",  			_result select 28],
				["AssignedItems",  			_result select 29],
				["PartialMagazines",  		_result select 30],
				["LoadedMagazines",  		_result select 31],
				["WastelandItems",  		_result select 32],
				["BankMoney",		  		_bank],
				["PlayerSaveValid", 		_playerSaveValid]];
	}

}
else
{
	_player_guid = getPlayerUID _player;
	_player_name = name _player;
	[format["insertPlayerInfo:%1:%2", _player_guid, _player_name], 2] call extDB_Database_async; //ASYNC METHOD 2 to prevent any possible race condition of INSERT / UPDATE
	[format["insertPlayerSaveData:%1:%2", call(A3W_extDB_ServerID), _player_guid], 2] call extDB_Database_async; //ASYNC METHOD 2 to prevent any possible race condition of INSERT / UPDATE
};

_data<commit_msg>Remove bankmoney from array<commit_after>//	@file Version: 1.0
//	@file Name: loadAccount.sqf
//	@file Author: AgentRev
//	@file Created: 25/02/2014 22:21

if (!isServer) exitWith {};

private ["_player_uid", "_data", "_playerSaveValid", "_getValue"];

_player = _this;
_player_uid = getPlayerUID _player;

_data = [];

_result = [format["existPlayerInfo:%1", _player_uid],2] call extDB_Database_async;

if (_result select 0) then {

	_result = [format["getPlayerSaveData:%1:%2", call(A3W_extDB_ServerID), _player_uid],2] call extDB_Database_async;

	if ((count _result) == 0) then
	{
		[format["insertPlayerSaveData:%1:%2", call(A3W_extDB_ServerID), _player_uid],2] call extDB_Database_async; //ASYNC METHOD 2 to prevent any possible race condition of INSERT / UPDATE
	}
	else
	{
		_pos = _result select 2;
		_playerSaveValid = false;
		if (count _pos > 0) then
		{
			_playerSaveValid = true;
		};

		_bank = 0;
		_money = 0;
		if (["A3W_moneySaving"] call isConfigOn) then
		{
			_money = _result select 6;
			_bank = [format["getPlayerInfoBank:%1", _player_uid],2] call extDB_Database_async;
		};

		_data = [["Damage",    		_result select 0],
				["HitPoints", 		_result select 1],
				["Position",  		_pos],
				["Direction",  		_result select 3],
				["Hunger", 	  		_result select 4],
				["Thirst", 	  		_result select 5],
				["Money", 	  		_money],
				["CurrentWeapon",  	_result select 7],
				["Stance",  		_result select 8],
				["Headgear",  		_result select 9],
				["Goggles",  		_result select 10],
				["Uniform",  		_result select 11],
				["Vest",  			_result select 12],
				["Backpack",  			_result select 13],
				["UniformWeapons",  	_result select 14],
				["UniformItems",  		_result select 15],
				["UniformMagazines",  	_result select 16],
				["VestWeapons",  		_result select 17],
				["VestItems",  			_result select 18],
				["VestMagazines",  		_result select 19],
				["BackpackWeapons",  	_result select 20],
				["BackpackItems",  		_result select 21],
				["BackpackMagazines",  	_result select 22],
				["PrimaryWeapon",  			_result select 23],
				["SecondaryWeapon",  		_result select 24],
				["HandgunWeapon",  			_result select 25],
				["PrimaryWeaponItems",  	_result select 26],
				["SecondaryWeaponItems",	_result select 27],
				["HandgunItems",  			_result select 28],
				["AssignedItems",  			_result select 29],
				["PartialMagazines",  		_result select 30],
				["LoadedMagazines",  		_result select 31],
				["WastelandItems",  		_result select 32],
				["BankMoney",		  		_bank select 0],
				["PlayerSaveValid", 		_playerSaveValid]];
	}

}
else
{
	_player_guid = getPlayerUID _player;
	_player_name = name _player;
	[format["insertPlayerInfo:%1:%2", _player_guid, _player_name], 2] call extDB_Database_async; //ASYNC METHOD 2 to prevent any possible race condition of INSERT / UPDATE
	[format["insertPlayerSaveData:%1:%2", call(A3W_extDB_ServerID), _player_guid], 2] call extDB_Database_async; //ASYNC METHOD 2 to prevent any possible race condition of INSERT / UPDATE
};

_data
{'fraction_non_alphanumeric': 0.13509496284062758, 'fraction_numerical': 0.03253509496284063, 'mean_word_length': 3.7460815047021945, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5254', 'n_tokens_mistral': 2609, 'n_tokens_neox': 2108, 'n_words': 554}