[Any] Force Auth
1 Attachment(s)
Force Auth v 1.0.0 This is a very simple plugin that enforces player authentication on connect by reconnecting or kicking unauthenticated players. Sometimes players are not able to properly authenticate with steam servers or the event doesn't fire at all, which can cause conflicts with other plugins, or even bypassing bans. This plugin will log reconnects/kicks to addons/sourcemod/logs/error_date.log If the reconnect method is used and the client has failed to authenticate three times, they will instead then be kicked. ConVar sm_forceauth_connect <0/1> // Hide connect message until client has authenticated sm_forceauth_time <default 10.0> // How many seconds to wait after OnClientPutInServer to verify that the client has authenticated. sm_forceauth_method <reconnect/kick> // Method of dealing with clients who have failed to authenticate (Options: reconnect, kick) . |
Re: [Any] Force Auth
Thread Connect Events Order (OnClientAuthorized), and especially Post #4 gives some insight about the different OnClient* procedures.
From OnClientPutInServer: Quote:
Quote:
The quotes from above in crystal clear English: "Use OnClientPostAdminCheck if you need to rely on a player's authentication with Steam". That one is also called automatically, so if I join your server at 10:00, but doesn't authenticate 100%, it will be called automatically on 10:05 when the Steam servers are back up (or your server's connection to the Steam servers are back up). |
Re: [Any] Force Auth
Edited: OnClientPostAdminCheck is only called if a client is authorized? If so your advice is for general use within plugins, which is useful for developers. If I were to move my check there, it would do nothing during connect if the client has not authorized, correct?
This plugin is meant as a hotfix for server owners who may not know much about plugin development and server events. For example, by moving checks to OnClientPostAdminCheck and a banned client isn't authorized, they'll be able to join the server until they are authorized. If that is the case, then this plugin will prevent that from occuring. The entire purpose is to force authentication as the title says, so I'm not certain why this has been unapproved. |
Re: [Any] Force Auth
Quote:
A previous version of the [ANY] Store by Zephyrus was loading inventories doing it's things OnClientAuthorized. Connecting while the Steam network was down, and then getting authorized later on, and quitting the server would usually lead to credit loss in this Store. Moving checks to OnClientPostAdminCheck, where the checks requiring Steam ID / "authentication" status are today, solved all those issues. Quote:
It makes no sense for my server to claim you are banned, if you are not, does it? Quote:
However, it is not your "job" to make a hotfix for other potentially "lousy" developers. It is the developer's project to fix his/her plugins (or the new person who have taken over the development, if relevant), not you. So if you find any plugins that are doing checks in an improper way, where you feel like a plugin like this is necessary, I suggest you report those plugins for review, so any bad plugins out there can be unapproved. Quote:
Quote:
The stars and the description tells it all, you are exactly doing what that post tells you not to do. Your plugin uses the two functions that may be called in a random order, for your connect it may work because the events are fired in the order you expect, however for my connect it may not - because of the "in any order". A default SourceMod configuration will only call OnClientPostAdminCheck after the autorization is approved and the Steam ID is 100% valid etc., so I would suggest setting g_bAuthorized to true in that one instead. At a regular frequency, e.g. after a (or every) minute or so, scan all players and if (!IsClientAuthorized(client)), then act on it, if g_bAuthorized hasn't yet been set to true. To print the connection message to all if set, I wouldn't care if you are triggering it in both OnClientAuthorized and OnClientPutInServer though. To avoid duplicates, you could make a new bool to see if it has already been printed. Based on my experience (as well as, ... "some" others), there is like a 9/10 chance that all your players are eventually being reconnected over and over, with your current way of doing it, since you are acting in a place where you know you aren't guaranteed to have the information you need. I don't suppose you want to introduce even more issues for server owners, with your "hotfix", am I right? That's the major point for my action with the unapproval. |
Re: [Any] Force Auth
Quote:
Quote:
I completely understand that OnClientPostAdminCheck should be used for retrieving valid client information. As stated previously, this plugin is used to guarantee that the authentication events have fired, and in a specific order, during connect. Even though I disagree with you, I will re-evaluate the plugin and look for a more appropriate method to guarantee authentication to satisfy your concerns. Edit: The original post attachment has been modified to create a timer with a default of 10 seconds to verify that the client has authenticated. |
Re: [Any] Force Auth
Quote:
I wouldn't ever act on assumptions, what I explained above, is real life experience from many years of working with game servers, including a lot of time spend fixing numerous plugins that from the authors were giving glitchy effects, such as for example, as mentioned, in the moments where the Steam network was temporary down. Quote:
Quote:
Quote:
I re-approved the plugin now. |
All times are GMT -4. The time now is 02:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.