account managment

housello

Member
hi,
I'm trying the server, and it works fine.
I'd like to ask if there is a way to manage created accounts, like editing password, modifiyng player privileges etc.
I remember that there was an utility to manage account.dat, but it was a few years ago, and I cannot find it on the internet anymore
 

No One

Member
If you're using SQL, it should be present within the SQL tables under account data.

If not, then you need to get out a hex editor and have some fun. From what I'm seeing (you'll want to look at login_server.c), it just writes the struct as binary to a file, to which extent you'll need to modify the following datatype and block out accounts based on the size of the account. If you're using something like HxD, or can vary with number of characters that appear horizontally before it goes to the next line, you can set the width to be 386 and each account should be on a separate line.

typedef struct st_account
{
  • char username[18];
    char password[33]; //Not in Plaintext. Change it and you'll likely forever lock yourself out of your account.
    char email[255];
    unsigned regtime;
    char lastip[16];
    long long lasthwinfo;
    unsigned guildcard;
    int isgm;
    int isbanned;
    int islogged;
    int isactive;
    int teamid;
    int privlevel;
    unsigned char lastchar[24]; //Presumably uses multibyte character sets, so if you have a pure English / Ascii name, then there should be lot's of null-separated letters.
} L_ACCOUNT_DATA;

Visually, each variable should fit in the spaces as follows (chars are 1 byte each, unsigneds and ints are 4, long long is 8):

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 33 33 33 33 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 55 55 55 55 55 55 55 55 66 66 66 66 77 77 77 77 88 88 88 88 99 99 99 99 AA AA AA AA BB BB BB BB CC CC CC CC DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD

I'm not aware of any tool that does this, but this should provide some information if nobody posts one or if you want to look at it in the meanwhile.
 

Chuk

Member
To allow people to change their own password, you can easily write a webpage that updates the database with a new password. Like No One mentioned, it's easy to change several values inside the SQL DB. As for the .DAT format, trying some things out is still the best way to learn working with it =P
From what I see it looks almost identical to the SQL version.
 

tofuman

Administrator
Staff member
The DAT management util was a util made be Lee at Schtserv. You may find it there. If not I'm pretty sure I have it somewhere and will upload it.

FYI we're likely to replace the DAT version with a SQLite (or similar) version instead in the future. That will provide you with the ease of setup that the DAT version provides but the power of SQL based queries.
 

tofuman

Administrator
Staff member
Yes its possible with SQL. The code for setting a password is in the signup.php page that comes with the binaries. You can use that as a starting point for creating a reset password process.
 

Sodaboy

Administrator
Staff member
Pretty much anything is possible with any version, but the SQL one makes it easier. Just look at the code the sign up.php uses to create an account and how it actually generates/salts the password then write another script to UPDATE an existing record's password entry using the same method.
 

kida

Member
Does anybody still have the old signup.php file? It's not included with the current binaries or source.

I'm looking to write my own but would like to see the operations performed before the md5 hash.
 

Sodaboy

Administrator
Staff member
kida said:
Does anybody still have the old signup.php file? It's not included with the current binaries or source.

I'm looking to write my own but would like to see the operations performed before the md5 hash.
You can find the same operations in account_add.c
 
Top