Limit characters in 1 MAP v.2

karazu

New member
Messages
1,115
Points
0
Related topic: http://herc.ws/board/topic/4409-limit-characters-in-1-map/


Hello I have now an Idea of how to prevent them from flooding.

I was thinking of a Ticket System, but before everything else I just want to ask if this is possible.



I want an NPC that will give an item to an account. If possible its like in the freebie system but will just check the IP instead of per account,  this NPC should determine how many accounts of that IP already claimed, I want to limit at least 5 account per IP


is this possible?

 
I guess its possible, since the script has to only compare the variables of the IPs that has claimed a price (npc or global variable I guess) and the last IP of the character account calling the NPC, with a SQL querie at the login table.

Edit: but then, think about at the time a lot of people uses that NPC, I wonder how optimized would be to check all of that everytime by script

 
Last edited by a moderator:
/*create table freebie (ip varchar(16) primary key,claimed tinyint(4)) engine = innodb;drop table freebie;*/prontera,154,185,5 script kjdhfksjhf 100,{ mes "freebie ..."; mes " "; if ( #freebie_claimed ) { mes "you have already claimed the prize"; close; } query_sql "select claimed from freebie where ip = '"+ getcharip() +"'", .@claimed; if ( .@claimed >= .limit ) { mes "this ip has reached the max limit to claimed the freebies"; close; } if ( !checkweight(501,1) ) { mes "lol ... you can't even carry 1 red pot"; close; } getitem 501,1; mes "gratzzzzzzz ... zzzz...."; query_sql "insert into freebie values ( '"+ getcharip() +"', 1 ) on duplicate key update claimed = claimed +1;"; #freebie_claimed = 1; close;OnInit: .limit = 2; // how many times 'player can actually create multiple account to cheat this system'. change to 5 // oh ... and then, reset the router again to change ip then claim again !}..

.

think about at the time a lot of people uses that NPC, I wonder how optimized would be to check all of that everytime by script
if the sql query return the result within 0.1 sec, I don't think it will produce lagand this sql table has already indexed too

 
Last edited by a moderator:
Back
Top