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

Ultimate Bans v1.9 [12 Jan 2014]


Post New Thread Reply   
 
Thread Tools Display Modes
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 10-12-2013 , 01:46   Re: Ultimate Bans v1.0 [Alpha Test]
Reply With Quote #11

Make it More Organised and Readable.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-12-2013 , 02:11   Re: Ultimate Bans v1.0 [Alpha Test]
Reply With Quote #12

No use of Tries is a red flag for efficiency. Looping through all ban entries is not an efficient way to do it.
__________________
fysiks is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 10-12-2013 , 22:18   Re: Ultimate Bans v1.0 [Alpha Test]
Reply With Quote #13

@fysiks - can you suggest a better option?
@Shooting King - I will be doing all that in the final release.

People, it would be helpful if some1 could create a suitable regex code for this time format : "hh:mm dd/mm/yyyy" where 0 is counted for singular hour/min/date/month/time. eg. "01:30 01/01/2014" and days are synchronised with maximum days per month per year. eg. February has 28 days in non leap year and 29 days in a leap year. Plus, I don't know if there needs to be set some end line and paragraph delimiters for ip and steam id regex.

Last edited by souvikdas95; 10-12-2013 at 22:22.
souvikdas95 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-12-2013 , 23:38   Re: Ultimate Bans v1.0 [Alpha Test]
Reply With Quote #14

Quote:
Originally Posted by souvikdas95 View Post
@fysiks - can you suggest a better option?
@Shooting King - I will be doing all that in the final release.

People, it would be helpful if some1 could create a suitable regex code for this time format : "hh:mm dd/mm/yyyy" where 0 is counted for singular hour/min/date/month/time. eg. "010 01/01/2014" and days are synchronised with maximum days per month per year. eg. February has 28 days in non leap year and 29 days in a leap year. Plus, I don't know if there needs to be set some end line and paragraph delimiters for ip and steam id regex.
Use Tries. Use them with SteamIDs, IPs, and names as the keys to get the index to all the other information stored in the dynamic arrays. No looping will be required to find the correct SteamID, IP, or name. You can look at other plugins. Since your plugin is basically Advanced Bans, you can look at that one for ideas (which is basically exactly as I said it).

Time and Date Regex
__________________
fysiks is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 10-13-2013 , 01:57   Re: Ultimate Bans v1.1 [Alpha Test]
Reply With Quote #15

oh now I get your point. hmm... u mean to use TrieGet***** function to look for the Entries right? hmm... that's a good idea but I am a little confused on its usage. if you are there on steam, can you add me? My SteamID is madworld777.
This should be the function where the main change should come... Right?

PHP Code:
CheckBan (const input[],const input_type[])
{
 static 
DATA[BanInfo],pos,Found,bool:tmp;
 
tmp=true,Found=0;
 for (new 
i=0;i<TotalBans;i++)
 {
  
ArrayGetArray(banlist_array,i,DATA);
  if (!
equali(DATA[bantype],input_type))
   continue;
  if (
equali(input_type,"STEAMID",7))
  {
   if (
equali(DATA[target_authid],input))
    
Found++;
  }
  else if (
equali(input_type,"IP",2))
  {
   if (
MODE_UNBAN||MODE_LOADBAN)
   {
    if (
equal(DATA[target_ip],input))
     
Found++
   }
   else
   {
    if (
CheckIP(DATA[target_ip],input))
     
Found++;
   }
  }
  else if (
equali(input_type,"NAME",4))
  {
   if (
MODE_UNBAN||MODE_LOADBAN)
   {
    if (
equali(DATA[target_name],input))
     
Found++;  
   }
   else
   {
    if (
equali(DATA[target_name],input,charsmax(DATA[target_name])))
     
Found++;
   }
  }
  if ((
Found==1)&&(tmp))
  {
   
pos i;
   
tmp false;
  }
  if (
Found>1)
   return -
1;
 }
 if (
Found==1)
  return 
pos;
 return -
2;

By the ways, that time and date regex... EPIC!! XD

Last edited by souvikdas95; 10-13-2013 at 02:02.
souvikdas95 is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 10-13-2013 , 10:12   Re: Ultimate Bans v1.1 [Alpha Test]
Reply With Quote #16

@fysiks - But since there is rangeIP and rangeNAME check, will that really help? I would have to anyway go through the entire banlist to check for the range. Trie will return only singular values and check itself for ("equal") function. but I want to use relational operators as well. in way it can be useful since I would have to through the entire list for only 3 values : SteamID, IP and Name and ignore the rest of the ban parameters if I use CellTrie.

Last edited by souvikdas95; 10-13-2013 at 10:15.
souvikdas95 is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 10-14-2013 , 01:49   Re: Ultimate Bans v1.1 [Alpha Test]
Reply With Quote #17

I have a question to ask : which is faster? SQL or Array?
souvikdas95 is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 10-14-2013 , 03:16   Re: Ultimate Bans v1.1 [Alpha Test]
Reply With Quote #18

Ofc Array.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 10-15-2013 , 15:35   Re: Ultimate Bans v1.5b [Beta Test]
Reply With Quote #19

Beta Version Released..... No SQL support yet... probably in the next version

Last edited by souvikdas95; 10-15-2013 at 15:42.
souvikdas95 is offline
akash_guptacosmos
Senior Member
Join Date: May 2013
Location: India,Kolkata
Old 10-16-2013 , 13:45   Re: Ultimate Bans v1.5b [Beta Test]
Reply With Quote #20

add a cvar to unban all in one command >.<
__________________
Quote:
Originally Posted by joropito View Post
I use orpheu to cook pizza
Like my page Please

https://www.facebook.com/LolXdTRolled
akash_guptacosmos is offline
Reply


Thread Tools
Display Modes

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 07:27.


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