Logging all logins for /aka
#1

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?

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.
Reply
#2

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.
Reply
#3

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'.
Reply
#4

Quote:
Originally Posted by Richie©
Посмотреть сообщение
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
Reply
#5

Limit 1 will limit results to 1 only, wont it? I will check out how GROUP works. Thanks for your response gamerz
Reply
#6

If you do not want duplicate rows use SELECT DISTINCT statement
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)