goddameit Posted January 27, 2013 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Share Posted January 27, 2013 (edited) Preview :[media=] [/media]This script will create a new GM command to ban or unban specify IPand also record who ban it and who unban it.After you ban some IP, those user will be kicked out server and will not be able to use it for login server. @banip <IP> <reason reason reason>... @unbanip <IP> <reason reason reason>... Preview : http://bit.ly/VqCVY1 New SQL Table :CREATE TABLE IF NOT EXISTS `ipbanlist2` ( `list` varchar(255) NOT NULL default '', `ban_reason` varchar(255) NOT NULL default '', `unban_reason` varchar(255) NOT NULL default '', `status` tinyint(1) NOT NULL default '0', `ban_id` int(11) unsigned NOT NULL default '0', `unban_id` int(11) unsigned NOT NULL default '0', KEY (`list`) ) ENGINE=MyISAM; Script :ban_ip_atcommand_3.txtban_ip_atcommand_2.txtban_ip_atcommand.txtVersion3 : http://j.mp/11HRFnn-2 : http://bit.ly/VH7uVZ-1 : http://bit.ly/XKAhHu Edited February 16, 2013 by goddameit 2 Quote Link to comment Share on other sites More sharing options...
Euphy Posted January 27, 2013 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted January 27, 2013 Nice work, as always. :> I suggest you use the format: <IP> <reason> Currently the reason can only be one word, but you have set the SQL columns to varchar(255) and no words I know of are that long. xP You can then build a multi-word reason by either: Using string commands.set .@tmp$, implode(.@atcmd_parameters$," "); set .@reason$, substr(.@tmp$,getstrlen(.@atcmd_parameters$[0]),getstrlen(.@tmp$)-1); Looping.for(set .@i,1; .@i<.@atcmd_numparameters; set .@i,.@i+1) set .@reason$, .@reason$ + " " + .@atcmd_parameters$[.@i] .@atcmd_numparameters is fixed in r17106. 1 Quote Link to comment Share on other sites More sharing options...
goddameit Posted January 27, 2013 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Author Share Posted January 27, 2013 Thanks, will try it. Quote Link to comment Share on other sites More sharing options...
Capuche Posted January 27, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted January 27, 2013 (edited) .@atcmd_numparameters is fixed in r17106. This fix still doesn't exist ! @goddameit 100 milliseconds for reading the reason... kick too fast lol Edited January 27, 2013 by Capuche Quote Link to comment Share on other sites More sharing options...
Kyo Posted January 27, 2013 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 90 Reputation: 12 Joined: 08/22/12 Last Seen: July 20, 2014 Share Posted January 27, 2013 This pretty much is a copy of my code, the only difference is, mine is source and you can use more than just a word as reason but great job, appreciate your work. Quote Link to comment Share on other sites More sharing options...
goddameit Posted January 27, 2013 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Author Share Posted January 27, 2013 (edited) If system work as I think, it will show message on your client, and if it doesn't close your client, you can read reason as video shown >> http://bit.ly/120XQ5F Edited January 27, 2013 by goddameit Quote Link to comment Share on other sites More sharing options...
Capuche Posted January 27, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted January 27, 2013 (edited) If system work as I think, it will show message on your client, and if it doesn't close your client, you can read reason as video shown >> http://bit.ly/120XQ5F True. But mine doesn't show anything (yes I have tried on my character, I'm a little masochist I guess). It depends on diff patch on launcher. Just a setting I guess Edited January 27, 2013 by Capuche Quote Link to comment Share on other sites More sharing options...
QQfoolsorellina Posted January 27, 2013 Group: Members Topic Count: 40 Topics Per Day: 0.01 Content Count: 587 Reputation: 105 Joined: 11/19/11 Last Seen: July 7, 2019 Share Posted January 27, 2013 Suggestion: @banip <reason> <IP> {<IP range>} ragne value: d.d.d.* d.d.*.* d.*.*.* 2 Quote Link to comment Share on other sites More sharing options...
goddameit Posted January 27, 2013 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Author Share Posted January 27, 2013 (edited) Nice one, I will do it. - Update to ver.2 Version 2 :Add define range IP Sample : aaa.bbb.ccc.* aaa.*.*.* *.*.*.* // ban all of people Change input type @banip <IP> <reason> @unbanip <IP> <reason> Preview : http://bit.ly/VqCVY1 Edited February 5, 2013 by goddameit Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted February 5, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted February 5, 2013 your script doesn't really work I tried to ban myself (127.0.0.1) without *, it kicks me off, but I can login back like nothing happens and your script doesn't have enough command protection ... if ( !.@atcmd_numparameters ) message strcharinfo(0), "usage: @banip <ip> <reason>"; 2 Quote Link to comment Share on other sites More sharing options...
goddameit Posted February 5, 2013 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Author Share Posted February 5, 2013 your script doesn't really work I tried to ban myself (127.0.0.1) without *, it kicks me off, but I can login back like nothing happens and your script doesn't have enough command protection ... if ( !.@atcmd_numparameters ) message strcharinfo(0), "usage: @banip <ip> <reason>"; fixed, thanks for report Quote Link to comment Share on other sites More sharing options...
Brian Posted February 6, 2013 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted February 6, 2013 OnInit: bindatcmd "banip",strnpcinfo(3)+"::OnBan"; bindatcmd "unbanip",strnpcinfo(3)+"::OnUnBan"; end; Wouldn't this make the commands usable by anyone, since you didn't set an atcommand_level or charcommand_level? and there are no GM level/group checks within the script. *bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; 1 Quote Link to comment Share on other sites More sharing options...
goddameit Posted February 6, 2013 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Author Share Posted February 6, 2013 OnInit: bindatcmd "banip",strnpcinfo(3)+"::OnBan"; bindatcmd "unbanip",strnpcinfo(3)+"::OnUnBan"; end; Wouldn't this make the commands usable by anyone, since you didn't set an atcommand_level or charcommand_level? *bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; I don't know is that need to set, so I didn't set it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.