Raised This Month: $153 Target: $400
 38% 

[L4D2] ConnectHook


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spumer
Senior Member
Join Date: Aug 2011
Old 12-12-2015 , 09:59   [L4D2] ConnectHook
Reply With Quote #1

This extension provides a OnClientPreConnect forward (similar to CBaseServer's, and Connect).

Unlike the Connect extension this version supports Left 4 Dead 2 game, but no SteamID validation (engine restrictions).

Unlike the CBaseServer extension this version provides more clear interface to reject clients.

PHP Code:
/**
 * @brief Called very early in the client connect process
 *
 * @param name          Client's name.
 * @param password      Connection password (or the most recently used one).
 * @param ip            Client's IP address.
 * @param steamID       Client's SteamId.  (This is before authentication so it is not guaranteed.)
 * @param rejectReason  Client's connection reject reason. Will be used only if returned action is Plugin_Handled or above.
 */
forward Action:OnClientPreConnect(const String:name[], const String:password[], const String:ip[], const String:steamID[], String:rejectReason[255]); 
You also can use standard "presets" of kick reasons. For example, restrict any connections to the server:

PHP Code:
public Action:OnClientPreConnect(const String:name[], const String:password[], const String:ip[], const String:steamID[], String:rejectReason[255])
{
        
PrintToServer("Name=%s, password=%s, IP=%s, steamID=%s"namepasswordipsteamID);
        
FormatEx(rejectReasonsizeof(rejectReason), "%s""#Valve_Reject_Server_Full");
        return 
Plugin_Stop;

Full example you can see in scripting/test_onclientpreconnect.sp
Attached Files
File Type: gz ConnectHook.tar.gz (15.5 KB, 528 views)
File Type: so connecthook.ext.2.l4d2.so (56.0 KB, 199 views)
__________________

Last edited by spumer; 12-12-2015 at 10:00.
spumer is offline
yurikon
Junior Member
Join Date: Jul 2013
Location: china
Old 01-18-2016 , 05:29   Re: [L4D2] ConnectHook
Reply With Quote #2

can you please make a windows Version
yurikon is offline
spumer
Senior Member
Join Date: Aug 2011
Old 01-28-2016 , 15:08   Re: [L4D2] ConnectHook
Reply With Quote #3

Windows version in attachment. I have no enviroment for test this. I need report from someone.
Attached Files
File Type: dll connecthook.ext.2.l4d2.dll (71.5 KB, 319 views)
File Type: txt connecthook.txt (654 Bytes, 136 views)
__________________

Last edited by spumer; 03-06-2016 at 11:15.
spumer is offline
sheo
SourceMod Donor
Join Date: Jul 2013
Location: Russia, Moscow
Old 03-04-2016 , 06:23   Re: [L4D2] ConnectHook
Reply With Quote #4

Great! Thank you!
__________________
sheo is offline
yurikon
Junior Member
Join Date: Jul 2013
Location: china
Old 03-05-2016 , 11:02   Re: [L4D2] ConnectHook
Reply With Quote #5

Quote:
Originally Posted by spumer View Post
Windows version in attachment. I have no enviroment for test this. I need report from someone.
L 03/05/2016 - 22:56:44: [ConnectHook] Sigscan for CBaseServer_ConnectClient failed - Disabling detour to prevent crashes
L 03/05/2016 - 22:56:44: [ConnectHook] Failed to setup ConnectClient detour
L 03/05/2016 - 22:56:58: Error log file session closed.
yurikon is offline
spumer
Senior Member
Join Date: Aug 2011
Old 03-06-2016 , 11:17   Re: [L4D2] ConnectHook
Reply With Quote #6

Thanks! Windows gamedata in previous post updated!

Who already download, you can manually strip old gamedata:

OLD:
PHP Code:
"windows"    "\x55\x8B\xEC\x83\xEC\x10\x56\x68\x8C\xAB\x37\x10" 
NEW:
PHP Code:
"windows"    "\x55\x8B\xEC\x83\xEC\x10\x56\x68" 
__________________

Last edited by spumer; 03-06-2016 at 11:19.
spumer is offline
yurikon
Junior Member
Join Date: Jul 2013
Location: china
Old 03-07-2016 , 21:29   Re: [L4D2] ConnectHook
Reply With Quote #7

it works,Thank you.
yurikon is offline
spumer
Senior Member
Join Date: Aug 2011
Old 09-28-2016 , 02:24   Re: [L4D2] ConnectHook
Reply With Quote #8

Quote:
I changed the admin autentication by ip and didn't workout either.

I compiled the test_onclientpreconnect.sp file to a plugin, put it in plugins folder of server and still not working.

Still receiving "server is full" message.
If you permanently received "server is full" message, then extension works properly. This is logic of test plugin - restrict any connection.

You can write your own plugin with callback OnClientPreConnect forward and apply any filters. Test plugin just explain how does it works.

Please post command output: "sm exts list"
__________________

Last edited by spumer; 09-28-2016 at 02:26.
spumer is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 09-28-2016 , 19:23   Re: [L4D2] ConnectHook
Reply With Quote #9

I just don't see any use for this extension. Can't we already use l4dtoolz or Downtown to extend server slots? Am I missing something here?
__________________
Spirit_12 is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Black Hole
Old 09-28-2016 , 22:41   Re: [L4D2] ConnectHook
Reply With Quote #10

Quote:
Originally Posted by Spirit_12 View Post
I just don't see any use for this extension. Can't we already use l4dtoolz or Downtown to extend server slots? Am I missing something here?
Spirit, this extension checks connected players' SteamIDs. Also helps the servers prevent them from impersonating admins if they have the same as or maybe stolen theirs. Really useful since I'm still using it now and lots of other servers are using it too.
cravenge is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:32.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode