Raised This Month: $51 Target: $400
 12% 

Hours is not saved


Post New Thread Reply   
 
Thread Tools Display Modes
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 11-06-2015 , 15:00   Re: Hours is not saved
Reply With Quote #221

But how see if is deleted from the database?If I receive warn I see, but when I receive 1 warn(maxwarns is 2), how I know if is removed that first warn after X days setted in cvar(expireday_warn)?

How I can see database dude?

Last edited by smiley92; 11-06-2015 at 15:15.
smiley92 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-06-2015 , 15:56   Re: Hours is not saved
Reply With Quote #222

I gave you a link to the database viewer tool. Or you can use the chat command which shows all info about every admin in the database. Data gets written when they disconnect, it is not real-time.
__________________

Last edited by Bugsy; 11-06-2015 at 16:08.
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-06-2015 , 18:15   Re: Hours is not saved
Reply With Quote #223

It will get removed, that aspect of it does not need testing. Here's how it works.

When a warn is issued, it is written to the warns table with a Unix time stamp. These time stamps are accurate to the exact second in time. At each map change, the database will delete all warns that are older than the number of days that you specify in the cvar. Since the time stamps are so precise, it will not get removed until the map change following the exact second that the warn turns X days old.

So if warn expire days cvar is set to 2 and I received a warn today 11/6/2015 at 3:04pm, it will get deleted at the first map change that occurs after 3:04pm on 11/8/2015.

The lower the warn time stamp, the older it is. Unix time stamps are the number of seconds that have elapsed since 1/1/1970 at 12:00am. What this query does is deletes warns that are older than now minus X days. This is probably confusing you, but just trust me it works.
Code:
DELETE FROM tblWarns WHERE WarnTime <= %d;

%d = Now - ( Warn_Expire_Days * DAY_SECONDS )
Instead of doing this back and forth demoing for you. Tell me exactly what you want the plugin to do and I'll tell you what configurations to set. Do you have any admins or something that speaks your native language and English that can possibly communicate better? I think a big problem here is the communication barrier.
__________________

Last edited by Bugsy; 11-06-2015 at 18:28.
Bugsy is offline
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 11-07-2015 , 07:43   Re: Hours is not saved
Reply With Quote #224

No, only I know to speak in english at all/any.

Btw, what you make is sophisticated because fill almost files from server.Vault.ini, AdminWarn.sq3 etc...I have from my company hosting some protection server and delete that file vault.ini because hampers server to move slow when change map.
Plugin make what I want but is not necessary all what is in it.I know sql is to complicate to make and to complicate to use.Why not try to make nVault version to work on AmXX 1.8.2?
I want just a simple system to monitor all admins on my server, which admin don't have hours at final week or final month (for example) to receive 1 warn and to 4 weeks if don't make hours to have remove in users.ini

Example: Admins from "admins.ini" if not make hours from plugin, cvars to be 7 hours in 1 week to receive remove.He must to cumulate in 1 week/month 7 hours, to play 1 hour per day but if he make another day 2 hours in that week to be ok, to not receive warn if admin make -- Monday 1 hour, Tuesday 0 hour, Wednesday 3 hours...etc and Sunday when plugin check his activity to not receive warn.Understand idea?
Now plugin I think work fine, but is too large code, complicated and sophisticated.Have approximative 20kb, is not to much just monitor activity/inform admins with message how many warns have?For that I prefer to use nVault, I have another plugin(Gag) what use nVault, and to be together database when I delete, and to not write/fill another files like data/vault.ini.

* Maybe you have another idea how to work this plugin to make the easier work for owners of servers to as not follow all admin activity.Very important to not be very large source code because use too many functions and decreases FPS server and increase ping players.

Sorry for my english, I don't know how to speak detailed to understand all words and what to do this plugin.

Last edited by smiley92; 11-07-2015 at 07:55.
smiley92 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-07-2015 , 08:56   Re: Hours is not saved
Reply With Quote #225

Quote:
Originally Posted by smiley92 View Post
No, only I know to speak in english at all/any.

Btw, what you make is sophisticated because fill almost files from server.Vault.ini, AdminWarn.sq3 etc...I have from my company hosting some protection server and delete that file vault.ini because hampers server to move slow when change map.
Plugin make what I want but is not necessary all what is in it.I know sql is to complicate to make and to complicate to use.Why not try to make nVault version to work on AmXX 1.8.2?
I want just a simple system to monitor all admins on my server, which admin don't have hours at final week or final month (for example) to receive 1 warn and to 4 weeks if don't make hours to have remove in users.ini
I don't think you understand that nVault is worse for this type of system. I am a big fan of nVault, but when you need to read all records in it, or find multiple records linked to a player, it becomes cumbersome and inefficienct. Whereas SQL is built exactly for this type of thing. What would require looping through all records and then a sort, can be accomplished in 1 simple SQL query, and be 10x more efficient. There is no massive overhead or negative aspects of this. I do not understand why you are so against SQL and for nVault.

Quote:
Originally Posted by smiley92 View Post
Example: Admins from "admins.ini" if not make hours from plugin, cvars to be 7 hours in 1 week to receive remove.He must to cumulate in 1 week/month 7 hours, to play 1 hour per day but if he make another day 2 hours in that week to be ok, to not receive warn if admin make -- Monday 1 hour, Tuesday 0 hour, Wednesday 3 hours...etc and Sunday when plugin check his activity to not receive warn.Understand idea?
Not really, you explain it in a very confusing way. I know it's not your fault that you cannot communicate well in english. Why don't you try to give me a more basic visualization of what you want.

Above you say "He must to cumulate in 1 week/month 7 hours,". 1 week and 1 month is a big difference. You need to give me specific exact criteria for when you want stuff to happen. A plugin/program is only as smart as you tell it to be.

How about this:
1. Admin must play 5 hours within 7 days to avoid warn.
2. If admin has 4 warns within 28 days, he gets removed.
3. Warns expire/delete when they reach 30 days old.

For the above:
admini.ini
Code:
"STEAM_0:0:12345" "5"
CVARs
Code:
aw_maxwarns 4
aw_checkwarnsevery 7
aw_warnexpiredays 30
Quote:
Originally Posted by smiley92 View Post
Now plugin I think work fine, but is too large code, complicated and sophisticated.Have approximative 20kb, is not to much just monitor activity/inform admins with message how many warns have?For that I prefer to use nVault, I have another plugin(Gag) what use nVault, and to be together database when I delete, and to not write/fill another files like data/vault.ini.
Again, you prefer nVault for some reason. In some cases it is perfect, but when you need to cherry pick data, SQL is much better.

Quote:
Originally Posted by smiley92 View Post
* Maybe you have another idea how to work this plugin to make the easier work for owners of servers to as not follow all admin activity.Very important to not be very large source code because use too many functions and decreases FPS server and increase ping players.
That is not true. Things that kill server performance are codes that execute on every frame. This plugin does not do that, and all queries that are called in-game are threaded so you should not feel any impact.
__________________

Last edited by Bugsy; 11-07-2015 at 09:01.
Bugsy is offline
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 11-07-2015 , 09:26   Re: Hours is not saved
Reply With Quote #226

Yes, and I think that to set cvars like how do you say.But, 7 x 4 = 28 days, and expire after 30.Some month have 28-29 days as February and 30-31 days another month.You can make something system to be exactly?If you not complicate too much code.

You say "Fixed queries that would execute on 1.8.3 but not 1.8.2", is not full/finished for 1.8.2?What must to change query/table or what to be full for 1.8.2 and to work on 1.8.3?

Last edited by smiley92; 11-07-2015 at 09:34.
smiley92 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-07-2015 , 09:35   Re: Hours is not saved
Reply With Quote #227

Quote:
Originally Posted by smiley92 View Post
Yes, and I think that to set cvars like how do you say.But, 7 x 4 = 28 days, and expire after 30.Some month have 28-29 days as February and 30-31 days another month.You can make something system to be exactly?If you not complicate too much code.
Expire at 30 days does not mean on the 30th calendar day in a month. It means after 30 days, so if on February 1 I received a warn, it would fall off March 2, or March 1 for leap year -- which is 30 days. It's not complicated, you are overthinking this way too much.

Quote:
Originally Posted by smiley92 View Post
You say "Fixed queries that would execute on 1.8.3 but not 1.8.2", is not full/finished for 1.8.2?What must to change query or what to be full for 1.8.2 and to work on 1.8.3?
When it is all said and done, it will compile with 0 warnings and work on both 1.8.2 and 1.8.3. For now I am focusing on one AMX version to get it working correctly, and I'll tweak details later.
__________________

Last edited by Bugsy; 11-07-2015 at 09:35.
Bugsy is offline
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 11-07-2015 , 16:32   Re: Hours is not saved
Reply With Quote #228

You will delete that server_print, iDay, exec server.cfg and another message useless?I think you put that just for testing, no?If give remove and warn I think is everything ok, I don't test and expireday but I go on your had/logic. if you know how I say hihi

Please give another name to that file admini.ini to be in english all, like admins.ini or warnhours.ini/txt how does get inspiration.

And after maybe you resolve and with that query or what is not complete for 1.8.2.
I'm tired now, I want to test and that cvar if work with expireday, but must to change day after 30 days to see if expire 1 warn, if appears message with 0 warn.

Last edited by smiley92; 11-07-2015 at 16:44.
smiley92 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-07-2015 , 17:08   Re: Hours is not saved
Reply With Quote #229

Quote:
Originally Posted by smiley92 View Post
You will delete that server_print, iDay, exec server.cfg and another message useless?I think you put that just for testing, no?If give remove and warn I think is everything ok, I don't test and expireday but I go on your had/logic. if you know how I say hihi

Please give another name to that file admini.ini to be in english all, like admins.ini or warnhours.ini/txt how does get inspiration.

And after maybe you resolve and with that query or what is not complete for 1.8.2.
I'm tired now, I want to test and that cvar if work with expireday, but must to change day after 30 days to see if expire 1 warn, if appears message with 0 warn.
Of course dude, that stuff is obviously there for testing.
__________________
Bugsy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode