It is talked about here:
http://www.eqemulator.net/forums/showthread.php?t=28285
Essentially, a lastlogin_ip field contains the last IP the user was known to have logged in as. It is useful for servers that utilize EQEMU's Login server for authentication and wish to have a way to authorize users via a web based tool at least by their IP to allow them to do modifications to their characters (or set options).
It also can be used to discover a player's IP if they try to log off quicker than you can type #iplookup in game.
I used this change, but really you can do this in a number of ways.
First create a patchfile in /utils/sql/svn/REV#_loginip.sql
Code:
ALTER TABLE `character_` ADD `lastlogin_ip` varchar(32) NOT NULL DEFAULT '';
in client.cpp, line 803:
From
Code:
database.UpdateLiveChar(char_name, GetAccountID());
To
Code:
struct in_addr in;
in.s_addr = cle->GetIP();
database.UpdateLiveChar(char_name, GetAccountID(), inet_ntoa(in));
in database.cpp, line 1805:
From
Code:
bool Database::UpdateLiveChar(char* charname,int32 lsaccount_id) {
To
Code:
bool Database::UpdateLiveChar(char* charname,int32 lsaccount_id, char* loginip) {
same file, line 808
From
Code:
if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE account SET charname='%s' WHERE id=%i;",charname, lsaccount_id), errbuf)) {
To
Code:
if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE account SET charname='%s', lastlogin_ip='%s' WHERE id=%i;",charname, loginip, lsaccount_id), errbuf)) {
In database.h line 224
from
Code:
bool UpdateLiveChar(char* charname,int32 lsaccount_id);
To
Code:
bool UpdateLiveChar(char* charname,int32 lsaccount_id, char* loginip);
That's it.. Pretty sure this would update the IP every time a character logs in, and that's it. Which technically you could update this information when you a char first selects server, but no real reason the above modification is happening even without the ip being utilized.
I may have to release the struct properly, let me know if it's needed I'd like to learn that routine if you do add it.