AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [L4D2] ConnectHook (https://forums.alliedmods.net/showthread.php?t=275997)

spumer 12-12-2015 08:59

[L4D2] ConnectHook
 
2 Attachment(s)
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

yurikon 01-18-2016 04:29

Re: [L4D2] ConnectHook
 
can you please make a windows Version

spumer 01-28-2016 14:08

Re: [L4D2] ConnectHook
 
2 Attachment(s)
Windows version in attachment. I have no enviroment for test this. I need report from someone.

sheo 03-04-2016 05:23

Re: [L4D2] ConnectHook
 
Great! Thank you!

yurikon 03-05-2016 10:02

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by spumer (Post 2387664)
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.

spumer 03-06-2016 10:17

Re: [L4D2] ConnectHook
 
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" 


yurikon 03-07-2016 20:29

Re: [L4D2] ConnectHook
 
it works,Thank you.

spumer 09-28-2016 01:24

Re: [L4D2] ConnectHook
 
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"

Spirit_12 09-28-2016 18:23

Re: [L4D2] ConnectHook
 
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?

cravenge 09-28-2016 21:41

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by Spirit_12 (Post 2457760)
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.

spumer 09-29-2016 17:50

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by Spirit_12 (Post 2457760)
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?

This is not for extending slots. This is for more speed up checks. With this extension you can implement very efficient "reserved slot", name checker and more.

Spirit_12 09-29-2016 18:31

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by spumer (Post 2457995)
This is not for extending slots. This is for more speed up checks. With this extension you can implement very efficient "reserved slot", name checker and more.

What I'm trying to say is that reserve slots only comes into play when server is full, but the way l4d2 is; I'm yet to see a server that is 32/32. As for name checker, you can do that without this extension as well.

Not saying its not well done, but just thinking about its practical usage.

Electr000999 06-17-2017 04:34

Re: [L4D2] ConnectHook
 
got crash https://crash.limetech.org/zfpc7odufous, sourcemod 1.7, ubuntu 16

spumer 06-18-2017 15:28

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by Electr000999 (Post 2529285)
got crash https://crash.limetech.org/zfpc7odufous, sourcemod 1.7, ubuntu 16

When server crashed? On startup?

WildCard65 06-18-2017 20:12

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by Electr000999 (Post 2529285)
got crash https://crash.limetech.org/zfpc7odufous, sourcemod 1.7, ubuntu 16

That crash is interesting, it's suggesting that somehow handlesys (a global variable internal to SM's logic binary) or ReadHandle (a virtual method of IHandleSys) was replaced by memory inside the extension.

Electr000999 06-20-2017 12:58

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by spumer (Post 2529686)
When server crashed? On startup?

sorry not know, i fount it in crash logs after day use extension, i never see it again, but interesting why this was..

spumer 10-07-2019 03:08

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by cravenge (Post 2669045)
I can safely say that this extension is the cause of my server crashing every time someone tries to connect. It was all fine until I added the BanId Fix plugin.

Edit: I'm using Windows by the way.

Do you have crashdump on https://crash.limetech.org/?
Send me please source of the plugin which cause the crash.

cravenge 10-07-2019 23:22

Re: [L4D2] ConnectHook
 
Here's the latest crash from a test server: D4QS-R7SW-YUCM
And the plugin that relies on this extension: [ANY / CSGO] BanId Fix (v0.5, 17/07/17)

spumer 10-10-2019 03:42

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by cravenge (Post 2669145)
Here's the latest crash from a test server: D4QS-R7SW-YUCM
And the plugin that relies on this extension: [ANY / CSGO] BanId Fix (v0.5, 17/07/17)

Do you use this extension before, or you install it together with BanId Fix?

cravenge 10-10-2019 04:45

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by spumer (Post 2669371)
Do you use this extension before, or you install it together with BanId Fix?

I just installed it recently along with the plugin. Without the plugin and only the extension loaded, it became a "good luck or bad luck" situation for every client trying to connect.

midnight9 09-18-2020 05:52

Re: [L4D2] ConnectHook
 
Is this extension stable on linux?

spumer 09-18-2020 17:05

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by midnight9 (Post 2718088)
Is this extension stable on linux?

I don't know what you mean by stable, but i use it everyday

midnight9 09-18-2020 17:12

Re: [L4D2] ConnectHook
 
Quote:

Originally Posted by spumer (Post 2718129)
I don't know what you mean by stable, but i use it everyday

I meant if it casues crashes, reading some previous posts made me doubt the stability, but thanks for clarifying.

Mystik Spiral 03-31-2024 18:33

Re: [L4D2] ConnectHook
 
Hi @spumer!

Before I attempt to do this, please let me know whether you think this will work...

My objective is to have my L4D2 CoOp/campaign dedicated server always show as four slots to game trackers and server browsers (except when the server is full and I connect as a spectator), and always keep match-making active (reserved lobby). No one every gets kicked and no one ever gets a server full message when they attempt to connect from lobby.

I was thinking of using your extension in conjunction with l4dtoolz, and in OnClientPreConnect check if server is not full (less than four players) then do nothing, but if server is full then compare the name, ip, and id are a match for me and add one slot so I can connect as a spectator [ChangeClientTeam(client, 1)]. Also, if anyone disconnects and there are greater than four slots then set slots to four.

I suspect I may have problems since I want to connect a fifth player (me) and not disable the lobby reservation. I do not intend to spawn a bot or takeover a bot, just spectate on team 1.

What do you think?


All times are GMT -4. The time now is 15:14.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.