Raised This Month: $ Target: $400
 0% 

[06/04/10] Map Bans


Post New Thread Reply   
 
Thread Tools Display Modes
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 12-22-2009 , 14:00   Re: [21/12/09] Map Bans
Reply With Quote #31

Ik vind unbannen een English woord ^^
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-01-2010 , 00:22   Re: [21/12/09] Map Bans
Reply With Quote #32

1. You should really use Tries to check bans instead of always reading file.

2. load_mapbans() will remove all permanent bans after map change.
In fact, since you are always looking in the file for bans, there is no need for that function.
It actually breaks your plugin.

3. Don't make every function "public".
You only need to make public functions for hooks/forwards/handlers.

Approval pending on changes.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 02-01-2010 , 12:39   Re: [21/12/09] Map Bans
Reply With Quote #33

Ok I will fix this after the new cmd adders.

I was relooking this plugin yesterday or something and I also tought there was something wrong with it lol :p

Edit :

I fixed point 2. and 3.
But now I have learned about Trie (because of my New Command Adder plugin) I dont see the use of using Trie instead of an array.

So for now current version 1.6 Released without Trie ( When I know why it would be usefull here I will add it )
__________________
I am out of order!

Last edited by grimvh2; 02-01-2010 at 15:03.
grimvh2 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-01-2010 , 15:30   Re: [21/12/09] Map Bans
Reply With Quote #34

Trie is perfect place here.
When map starts/admin bans player, it adds banned players steamid into the trie, then in loadban you simply do this:
Code:
do_loadban( const id ) {     new szAuthid[32];     get_user_authid(id, szAuthid, sizeof(szAuthid)-1);         if( TrieKeyExists( Bans, szAuthid ) )         server_cmd("kick ^"#%i^"", get_user_userid(id)); }
The point is, you dont need to loop trough the file when anyone connects.

Btw. store mapname in globalvariable, it would be even better to generate path in plugin_init and save it to global var.
__________________
xPaw is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 02-01-2010 , 15:36   Re: [21/12/09] Map Bans
Reply With Quote #35

Yes I tought about the most stuff to,
About Trie I dont know every detail about what trie can do so thats why I wasn't sure but I will add it now.

Edit :

New version BETA releaded
Note : Not tested version yet, I will try to test it as soon as possible.
__________________
I am out of order!

Last edited by grimvh2; 02-01-2010 at 15:49.
grimvh2 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-02-2010 , 07:38   Re: [21/12/09] Map Bans
Reply With Quote #36

use file_exists in do_removemapbans

You actually never check if ban time expiried when player connects, you just check if player exists in trie
__________________
xPaw is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 02-02-2010 , 11:21   Re: [21/12/09] Map Bans
Reply With Quote #37

Quote:
Originally Posted by xPaw View Post
use file_exists in do_removemapbans
I already did that, I guess you need to dl the new version.

Quote:
Originally Posted by xPaw View Post
You actually never check if ban time expiried when player connects, you just check if player exists in trie
It doesnt work on time, it works on counts. Evrey time that map where a player is banned gets played by the server, we remove a count untill all counts are gone. Or do you mean something else?
__________________
I am out of order!
grimvh2 is offline
krzyzak333
Junior Member
Join Date: Mar 2009
Location: Poland
Old 02-04-2010 , 14:45   Re: [01/02/10] Map Bans
Reply With Quote #38

Polish
Quote:
[pl]
CMD_BAN = %s Zostal zbanowany na ta mape przez %s.
SUC_UNBAN = %s Zostal odbanowany z %s.
FAIL_UNBAN = Wystapil problem z odbanowaniem %s z %s.
DIR_NTFOUND = Folder %s nie zostal odnaleziony.
krzyzak333 is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 02-04-2010 , 16:28   Re: [01/02/10] Map Bans
Reply With Quote #39

thx
__________________
I am out of order!
grimvh2 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-31-2010 , 19:02   Re: [01/02/10] Map Bans
Reply With Quote #40

There are a few mistakes and optimizations that can be made, however it is acceptable.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 01:34.


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