PDA

View Full Version : Logging all logins for /aka


Richie©
02/03/2012, 11:04 AM
I have this system working already, with file writing (dini). But problem is after time this file grows very big and it takes long time to save name/ip on login and on /aka. Is there another way to make this work better? At the moment i have IP stored in playerinfo in mysql db, but its only last known IP but i want to be able to trace everything.
I was thinking of doing a new rows with 'Playername', 'IP'. But im afraid this will grow to big and lag server.

Can any of you guys give me a better idea on how to make this work in an awesome way? :cool:

Additional info:
plugin: BlueG mysql plugin, R6. (cuz R6-2 refuse to work on my VPS :X)
host: domvps.

Another question:
While checking sql debug log i found alot of this:

"Data is getting passed to OnQueryFinish() - (Threadsafe: No)"

What does that mean?


Thanks in advance.

Gamer_Z
02/03/2012, 12:12 PM
MySQL can easily handle large databases if they are correctly setup (includes indexing).
If you make a table for example "logins" with the colum PlayerID, PlayerIP, LoginDate then you can store all the info easily there.

As to dini I suggest you to stop using it, it's like 'depreciated' in the sa-mp community, Y_Ini is a good one to still have ini support.

"Data is getting passed to OnQueryFinish() - (Threadsafe: No)"

Means the result of your query and other information (the 'data') is 'put' into the OnQueryFinish callback and it's called, so you can manipulate the results there (actually it's used for threaded queries - they won't stop / lag your server).

The threadsafe: Means(probably, i'm not sure) that the result of your was not handled in a fail-proof weay and a race condition may occur OR it can mean thet your query is not threaded. - but still, I'm not sure, just some tips.

Richie©
04/03/2012, 11:07 PM
I ran into another problem with this though. When i do /aka it displays my name multiply times. Since i connected many times it do that. How can i fix that?
Here is how it check;
SELECT PlayerName FROM PlayersAKA WHERE IP = '%s'.

Gamer_Z
05/03/2012, 05:43 AM
I ran into another problem with this though. When i do /aka it displays my name multiply times. Since i connected many times it do that. How can i fix that?
Here is how it check;
SELECT PlayerName FROM PlayersAKA WHERE IP = '%s'.

you can use
GROUP by PlayerName
or
LIMIT 1
at the end of the statement

Richie©
05/03/2012, 11:47 AM
Limit 1 will limit results to 1 only, wont it? I will check out how GROUP works. Thanks for your response gamerz:)

Gamer_Z
05/03/2012, 02:38 PM
If you do not want duplicate rows use SELECT DISTINCT statement