The following warnings occurred:
Warning [2] Trying to access array offset on null - Line: 198 - File: inc/plugins/google_seo.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo.php 198 errorHandler->error_callback
/inc/plugins/google_seo/redirect.php 131 google_seo_tid
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Undefined property: DB_MySQLi::$google_seo_query_limit - Line: 232 - File: inc/plugins/google_seo.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo.php 232 errorHandler->error_callback
/inc/plugins/google_seo/redirect.php 131 google_seo_tid
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Decrement on type null has no effect, this will change in the next major version of PHP - Line: 232 - File: inc/plugins/google_seo.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo.php 232 errorHandler->error_callback
/inc/plugins/google_seo/redirect.php 131 google_seo_tid
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Undefined array key 1 - Line: 287 - File: inc/plugins/google_seo/redirect.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/redirect.php 287 errorHandler->error_callback
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Undefined array key 1 - Line: 288 - File: inc/plugins/google_seo/redirect.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/redirect.php 288 errorHandler->error_callback
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Undefined array key "" - Line: 301 - File: inc/plugins/google_seo/redirect.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/redirect.php 301 errorHandler->error_callback
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Undefined array key "" - Line: 308 - File: inc/plugins/google_seo/redirect.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/redirect.php 308 errorHandler->error_callback
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Undefined variable $change - Line: 345 - File: inc/plugins/google_seo/redirect.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/redirect.php 345 errorHandler->error_callback
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once




Prevent 1.8 clients from joining?
#20
Oh right. I forgot that Wink Thanks.

So then does anyone see a problem here (Exept the style problems):
PLUGIN = nil

AllowedProtocols = {}
KickMessage = ""

function Initialize(Plugin)
	PLUGIN = Plugin
	Plugin:SetName("ProtLimit")
	Plugin:SetVersion(1)
	
	cPluginManager.AddHook(cPluginManager.HOOK_LOGIN, OnLogin)
	
	if not LoadSettings() then
		LOGERROR("ProtLimit: Could not load " .. PLUGIN:GetLocalFolder() .. "/Config.ini")
		return false
	end
	
	LOG("Initialized ProtLimit")
	return true
end




function OnLogin(Client, ProtocolVersion, UserName)
	for Idx, Prot in ipairs(AllowedProtocols) do
		if Prot == ProtocolVersion then
			return false
		end
	end
	
	cRoot:Get():GetDefaultWorld():ScheduleTask(1, function()
		cRoot:Get():FindAndDoWithPlayer(UserName, function(Player)
			if Player:GetName() ~= UserName then
				return false
			end
			Player:GetClientHandle():Kick(KickMessage)
		end)
	end)
	return false
end




function LoadSettings()
	local SettingsIni = cIniFile()
	SettingsIni:ReadFile(PLUGIN:GetLocalFolder() .. "/Config.ini")
	local AllowedProtString = SettingsIni:GetValueSet("General", "AllowedProtocols", 4)
	local RawAllowedProtocols = StringSplitAndTrim(AllowedProtString, ",")
	for Idx, Value in ipairs(RawAllowedProtocols) do
		if tonumber(Value) ~= nil then
			table.insert(AllowedProtocols, tonumber(Value))
		else
			LOGERROR("Protocol version \"" .. Value .. "\" isn't valid. Ignoring")
		end
	end
	
	KickMessage = SettingsIni:GetValueSet("General", "KickMessage", "You do not have the right client version.")
	SettingsIni:WriteFile(PLUGIN:GetLocalFolder() .. "/Config.ini")
	return true
end

	
	
Reply
Thanks given by:


Messages In This Thread
Prevent 1.8 clients from joining? - by Mathias - 10-05-2014, 11:43 PM
RE: Prevent 1.8 clients to join? - by Howaner - 10-05-2014, 11:58 PM
RE: Prevent 1.8 clients to join? - by xoft - 10-06-2014, 01:24 AM
RE: Prevent 1.8 clients to join? - by Howaner - 10-06-2014, 01:51 AM
RE: Prevent 1.8 clients to join? - by xoft - 10-06-2014, 03:22 AM
RE: Prevent 1.8 clients to join? - by Seadragon91 - 10-06-2014, 03:30 AM
RE: Prevent 1.8 clients to join? - by Howaner - 10-06-2014, 03:36 AM
RE: Prevent 1.8 clients to join? - by xoft - 10-06-2014, 03:48 AM
RE: Prevent 1.8 clients to join? - by Seadragon91 - 10-06-2014, 04:04 AM
RE: Prevent 1.8 clients to join? - by NiLSPACE - 10-06-2014, 04:07 AM
RE: Prevent 1.8 clients to join? - by Seadragon91 - 10-06-2014, 04:53 AM
RE: Prevent 1.8 clients to join? - by Mathias - 10-06-2014, 04:56 AM
RE: Prevent 1.8 clients to join? - by NiLSPACE - 10-06-2014, 04:59 AM
RE: Prevent 1.8 clients to join? - by Mathias - 10-06-2014, 05:12 AM
RE: Prevent 1.8 clients from joining? - by tigerw - 10-06-2014, 06:08 AM
RE: Prevent 1.8 clients from joining? - by NiLSPACE - 10-06-2014, 06:12 AM
RE: Prevent 1.8 clients from joining? - by xoft - 12-25-2014, 05:14 AM
RE: Prevent 1.8 clients from joining? - by xoft - 12-25-2014, 05:51 AM
RE: Prevent 1.8 clients from joining? - by tigerw - 12-27-2014, 05:14 AM



Users browsing this thread: 1 Guest(s)