Well firstly I would like to add that I Updated that method as I realized that... I was not garbing the first account LMAO.
// Load the accounts into the class
function Authorize::Accounts( )
local iCounter = 0; // Add the counter
local query = ::sqlite_query( g_AccountDB, "SELECT * FROM Accounts" ) // Grab the query
local string = ::sqlite_column_data(query, 0); // Stores the first name.
SQL_Accounts.push(iCounter); // Increase the array Value
SQL_Accounts[ iCounter ] = SQL_Account_Class();
SQL_Accounts[ iCounter ].Name = ::sqlite_column_data(query, 0);
SQL_Accounts[ iCounter ].Password = ::sqlite_column_data(query, 1);
SQL_Accounts[ iCounter ].IP = ::sqlite_column_data(query, 2);
SQL_Accounts[ iCounter ].Autologin = ::sqlite_column_data(query, 3);
string = sqlite_next_row(query);
sqlite_free( query );
I would also Like to say even though I do not want to I have intended to add the iCounter to the query "Accounts"
or to that Class, Not sure yet..
As Well I thought I should add the bool statement from the normal class
"I am assuming you seen my script in the PM".
The reason for adding the iCounter to the query or the class, Once I find the players accounting data I will no longer need to loop threw, Which I would like to assume would prevent data loss etc.
The reason for the bool statement is, If the player Intends to change autologin or there password I can add a check to find every account that the bool returned true, Then update the query, We will assume I will do this every hour. And if onScriptUnload() can catch it on time.
With saying this, How does that script work? I thought
SQL_Accounts.push Must be called first? As I have the array starting from 0, If the array starts from zero it is even with the number of current accounts. So with saying that wont I take a possibility of overwriting data from the last account class if it is not called first? And what is with the bool???
Sorry, I am sure it is more efficient I just really do not get it atm..