[bugfix] LV 3.2 & LV 3.21 banip fix
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

[bugfix] LV 3.2 & LV 3.21 banip fix

Started by Cêñoßy†ê, 27 March, 2007, 18:09:17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cêñoßy†ê

Hehe.. sry was our foult that it didnt work :'(

Anyways here is fix for it ;D

1 Open Kick_Ban_Commands.lua (in folder LV_DataBase\lua )
2. Find line Command["banip"] = function(user,data,where)  (line 166)
3. Replace

Code: lua
Command["banip"] = function(user,data,where)
	local s,e,iP,rsn = string.find(data, "%b<>%s+%S+%s+(%S+)%s*(.*)")
	if iP then
		if iP == user.sIP then
			user:SendMessage(Cfg.Bot_Name,"Cant ban your own IP")
			return 1
		end
		if iP == WSA.GetHostByName(frmHub:GetHubAddress()) then
			user:SendMessage(Cfg.Bot_Name,"You cant Ban Hub host's IP !!")
			return 1
		end
		if iP == "127.0.0.1" or iP == "localhost" then
			user:SendMessage(Cfg.Bot_Name,"I only wonder what runs in your head !!")
			return 1
		end
		if (rsn==nil or rsn == "") then
			rsn = "No reason given!"
		end
		SendMessage("*** IP: "..iP.." added to Banned IP's by "..Cvrt.P2[user.iProfile].." "..user.sName.." Because: "..rsn,SendWhere)
		Ban(iP)
	else
		user:SendMessage(Cfg.Bot_Name,"Type IP allso")
	end
	return 1
end


with this fixed one


Code: lua
Command["banip"] = function(user,data,where)
	local s,e,iP,rsn = string.find(data, "%b<>%s+%S+%s+(%S+)%s*(.*)")
	if iP then
		if iP == user.sIP then
			user:SendMessage(Cfg.Bot_Name,"Cant ban your own IP")
			return 1
		end
		if iP == WSA.GetHostByName(frmHub:GetHubAddress()) then
			user:SendMessage(Cfg.Bot_Name,"You cant Ban Hub host's IP !!")
			return 1
		end
		if string.find(iP,"127%.0%.0%.1") or iP == "localhost" then
			user:SendMessage(Cfg.Bot_Name,"I only wonder what runs in your head !!")
			return 1
		end
		if (rsn==nil or rsn == "") then
			rsn = "No reason given!"
		end
		SendMessage("*** IP: "..iP.." added to Banned IP's by "..Cvrt.P2[user.iProfile].." "..user.sName.." Because: "..rsn,SendWhere)
		Ban(iP)
	else
		user:SendMessage(Cfg.Bot_Name,"Type IP allso")
	end
	return 1
end
Powered By Leviathan™ 2nd Generation v. 1.9

SMF spam blocked by CleanTalk