Jump to content

Restart server, accounts.xml is empty?


x86

Recommended Posts

Hi,

I'm creating a login system with addAccount functions.

It works fine, but if i restart server, accounts.xml is:

  
<accounts> 
   <autologin>0</autologin> 
   <account name="Console" password=""/> 
</accounts> 
  

Thank you.

Link to comment
That is usual behaviour when you use setAccountData in DP2.x

Yes, i use that function, do you know how can fix it ?

You can temporarily fix it by using XML or SQL. But overall, it's better to use setAccountData. (if it works. If it doesn't, like in this case, use something else or nothing instead)

Link to comment
That is usual behaviour when you use setAccountData in DP2.x

Yes, i use that function, do you know how can fix it ?

You can temporarily fix it by using XML or SQL. But overall, it's better to use setAccountData. (if it works. If it doesn't, like in this case, use something else or nothing instead)

AccountData functions = xml, so whether or not it's "better" isn't really set in stone. But account data is pretty much just a one-dimensional associative array: it has a key you can use to find/read/write data. Both XML and SQL functions are easier to customize, more flexible, and SQL is IIRC faster than XML (and thus, acc data) with more data.

More than anything, I'd say it depends a lot on total player volume in the server. If you get like 5000 different registrations at some point, using XML for it all is going to be a bitch.

Link to comment
That is usual behaviour when you use setAccountData in DP2.x

Yes, i use that function, do you know how can fix it ?

You can temporarily fix it by using XML or SQL. But overall, it's better to use setAccountData. (if it works. If it doesn't, like in this case, use something else or nothing instead)

My old version of greenhood was MTA-MySQL, but sometimes it lags

Link to comment
SQLite, while not perfect, is the best way of using SQL to store data in dp2.

You can find the functions on the wiki.

http://development.mtasa.com/index.php? ... eSQLSelect

these you mean ?

EDIT:

Hm, i can better work with MySQL.. results is better with fetch_assoc..

No... you just need to think a little bit more. Looking at the examples much?

Besides, the sql functions don't regularly crash your servers, IIRC.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...