Sign in to follow this  
DanielProGames

Easy-to-use IP Ban atcommands [Suggestion-Type]

Recommended Posts

Posted (edited)

Dear rAthena Developers, we as Server Owners need often to ban IP Addresses or IP Ranges. As such I created this suggestion, with full details in such regard. Enjoy.

New commands:

Spoiler
@ipban / @banip 
usage: @ipban <time> <player_name> {<reason>}
ex   : @ipban 1d "test player" Stole gears.

Similar to @ban, this command does both a regular @ban and an IP ban. Other accounts using such banned IP address will be unable to connect to the server (they'll get kicked out the server and unable to connect to it if their IP Address matches the one banned). If the account ban's time is greater than the one given by the command, it will keep the longest one (for the account ban only).

When a player's name contains spaces, you must use quotes, otherwise it's not needed.

<mandatory> | {<optional>}

@ipunban / @unbanip
usage: @ipunban <player_name> 
ex   : @ipunban "test player"

This command removes the IP ban of a player as well as removing the account ban of the player mentioned.

Spoiler
@ipblock / @blockip
usage: @ipblock <player_name> {<reason>}
ex   : @ipblock "test player" Stole gears.

Similar to @block, this command does both a regular @block and an IP block. Other accounts using such blocked IP address will be unable to connect to the server (they'll get kicked out the server and unable to connect to it if their IP Address matches the one blocked). 

When a player's name contains spaces, you must use quotes, otherwise it's not needed.

<mandatory> | {<optional>}

@ipunblock / @unblockip
usage: @ipunblock <player_name>
ex   : @ipunblock "test player"

This command removes the IP block of a player as well as removing the account block of the player mentioned.

Spoiler
@showipban
usage: @showipban

Shows the current IP addresses banned.

Spoiler
@showipblock
usage: @showipblock

Shows the current IP addresses blocked.

The default CIDR range used in IP bans/blocks will have to be defined somewhere in rAthena's configuration.

The "ipbanlist" SQL Table will be used to store such IP bans/blocks.

The effectiveness of those commands mostly depends on the Group ID of the Executor. Players cannot IP ban/block other players with higher Group IDs than their's [Admins (group 99) can never be banned nor blocked].

The main concept of this Suggestion was taken from RagnaShield's features. If you're interested in battling cheating for an overall better Ragnarok Online server, you should seriously consider RagnaShield as your main option 😉.

Edited by DanielProGames
Links removed

Share this post


Link to post
Share on other sites

doesn't rAthena already have ip ban system /hmm ? from like 10 years ago xD

ip ban is useless i think you should consider getting gepard

 

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)
5 hours ago, sader1992 said:

doesn't rAthena already have ip ban system /hmm ? from like 10 years ago xD

ip ban is useless i think you should consider getting gepard

 

Hello sader1992, thank you for your Feedback!

I thought rAthena do have an IP Banning system (https://github.com/rathena/rathena/wiki/Ipbanlist), however, it's easier to do using commands 🙂.

Edited by DanielProGames
Clarification.

Share this post


Link to post
Share on other sites
3 hours ago, DanielProGames said:

Hello sader1992, thank you for your Feedback!

I thought rAthena do have an IP Banning system (https://github.com/rathena/rathena/wiki/Ipbanlist), however, it's easier to do using commands 🙂.

Why not use a NPC? Link or Use purchase a Gepard Shield 3.0 which allows you to Block a certain Unique ID

  • MVP 1

Share this post


Link to post
Share on other sites
7 minutes ago, Gerzzie said:

Why not use a NPC?

Because you have to warp yourself to the NPC each time you've to ban IP Addresses, plus other users (non-GMs) would be able to use it.

8 minutes ago, Gerzzie said:

Use purchase a Gepard Shield 3.0 which allows you to Block a certain Unique ID

Good point, however, my Suggestion do aim at people wanting to ban or block IP Addresses, it doesn't aim at banning Unique IDs 🙂.

Share this post


Link to post
Share on other sites
Posted (edited)
23 minutes ago, DanielProGames said:

Because you have to warp yourself to the NPC each time you've to ban IP Addresses, plus other users (non-GMs) would be able to use it.

you can create an npc with custom command (with id -1 = invisible and no one will see it bindatcmd("something",strnpcinfo(3)+"::OnSomthing",99,99); = only group 99 and above can access it)

you type the command , and what you want will happen

my point is blocking the ip it self is pointless
if i got blocked by the ip , i will just restart my router ,login and laugh in the public chat xD

Edited by sader1992
  • MVP 1

Share this post


Link to post
Share on other sites
Posted (edited)
11 minutes ago, sader1992 said:

you can create an npc with custom command

you type the command , and what you want will happen

my point is blocking the ip it self is pointless
if i got blocked by the ip , i will just restart my router ,login and laugh in the public chat xD

In general, IP Banning NPCs allows its user to execute arbitrary SQL Queries, which is pretty dangerous..

Xd 😂 good joke hahaha. To be honest, the IP Ban command will also ban your account, which means you'll have to create another one and restart your Router in order to laugh in public chat xd.

Edited by DanielProGames

Share this post


Link to post
Share on other sites
Posted (edited)
4 minutes ago, DanielProGames said:

In general, IP Banning NPCs allows its user to execute arbitrary SQL Queries, which is pretty dangerous..

not with


---------------------------------------

*escape_sql(<value>)

Converts the value to a string and escapes special characters so that it is safe to
use in query_sql(). Returns the escaped form of the given value.

Example:
	[email protected]$ = "John's Laptop";
	[email protected]_str$ = escape_sql([email protected]$); // Escaped string: John\'s Laptop

---------------------------------------

 

Edited by sader1992

Share this post


Link to post
Share on other sites
5 minutes ago, sader1992 said:

not with


---------------------------------------

*escape_sql(<value>)

Converts the value to a string and escapes special characters so that it is safe to
use in query_sql(). Returns the escaped form of the given value.

Example:
	[email protected]$ = "John's Laptop";
	[email protected]_str$ = escape_sql([email protected]$); // Escaped string: John\'s Laptop

---------------------------------------

 

You're right, however, server owners do love to use commands.

Share this post


Link to post
Share on other sites
Posted (edited)
39 minutes ago, DanielProGames said:

You're right, however, server owners do love to use commands.

i think this would work

didn't test it , and i think it can use some improvement , but this should be what you want.

-	script	IPBan_Script	-1,{
OnBan:
	if(.@atcmd_numparameters != 2){
        mes "Usage: @IPBan <IP> <time by days>";
        end;
    }
    .@ip$ = escape_sql(.@atcmd_parameters$[0]);
    .@days = atoi(.@atcmd_parameters$[1]);
    if(.@days < 1){
        mes "Error in the time";
        mes "days is less than 1";
        end;
    }
    mes "please input the reason.";
    input .@input$;
    .@in$ = escape_sql(.@input$);
    mes "are you sure you want to IP Ban " + .@ip$;
    mes "reason : " + .@in$;
    mes "for " + .@days + " Days ?";
    if(select("no:yes") == 1)
        end;
    .@from_time$ = gettimestr("%Y-%m-%d %H:%M:%S",21);
    .@time = gettimetick(2) + (86400 * .@days);
    .@to_time$ = gettimestr("%Y-%m-%d %H:%M:%S",21,.@time);
    query_sql("INSERT INTO `ipbanlist` (`list`, `btime`, `rtime`, `reason`) VALUES ('" + .@ip$ + "', '" + .@from_time$ + "', '" + .@to_time$ + "', '" + .@in$ + "');");
end;
OnInit:
	bindatcmd("IPBan",strnpcinfo(3)+"::OnBan",99,99);
end;
}

all you need to do is to use the command @ipban

 

also

you can use FluxCP

image.thumb.png.d885da30e0b8e3994306303a9a589ccc.png

Edited by sader1992

Share this post


Link to post
Share on other sites
4 hours ago, sader1992 said:

i think this would work

didn't test it , and i think it can use some improvement , but this should be what you want.

-	script	IPBan_Script	-1,{
OnBan:
	if(.@atcmd_numparameters != 2){
        mes "Usage: @IPBan <IP> <time by days>";
        end;
    }
    .@ip$ = escape_sql(.@atcmd_parameters$[0]);
    .@days = atoi(.@atcmd_parameters$[1]);
    if(.@days < 1){
        mes "Error in the time";
        mes "days is less than 1";
        end;
    }
    mes "please input the reason.";
    input .@input$;
    .@in$ = escape_sql(.@input$);
    mes "are you sure you want to IP Ban " + .@ip$;
    mes "reason : " + .@in$;
    mes "for " + .@days + " Days ?";
    if(select("no:yes") == 1)
        end;
    .@from_time$ = gettimestr("%Y-%m-%d %H:%M:%S",21);
    .@time = gettimetick(2) + (86400 * .@days);
    .@to_time$ = gettimestr("%Y-%m-%d %H:%M:%S",21,.@time);
    query_sql("INSERT INTO `ipbanlist` (`list`, `btime`, `rtime`, `reason`) VALUES ('" + .@ip$ + "', '" + .@from_time$ + "', '" + .@to_time$ + "', '" + .@in$ + "');");
end;
OnInit:
	bindatcmd("IPBan",strnpcinfo(3)+"::OnBan",99,99);
end;
}

all you need to do is to use the command @ipban

 

also

you can use FluxCP

image.thumb.png.d885da30e0b8e3994306303a9a589ccc.png

That isn't exactly what I want, however, thank you for providing that to me 😉.

I honestly want an official statement from the Development Team.

Thanks.

Share this post


Link to post
Share on other sites

If you feel your changes could as well be a part of rAthena, you're welcome to open a pull request.

Share this post


Link to post
Share on other sites
Posted (edited)

I am no longer interested in this Suggestion anymore. I request Content Moderators to archive this Topic. In addition, I'd also recommend anybody getting Gepard, it's the best Anti-Cheat out-there... 

However, rAthena Developers should consider implementing such a form of Banishing (Banning) IP Addresses, because it's really stupid the fact we had no IP Ban command since the Foundation of rAthena.. Logic guys, logic...

Edited by DanielProGames

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this