IP based reserved slots + free reserve slots
3 Attachment(s)
Description:
This plugin can be useful for admins who have their servers working both in the internet and in some localnetwork, and they need to give local players a priority to join these servers without adding hundreds of steamids to reserved slots And there's more, admins may allow players to register reserved slots themselves... why would any admin want to do this? well, he may be lazy and he doesn't want to do it himself This plugin works by setting Admin_Reservation flag to clients who have:
Requirements: - SourceMod v1837 or higher Cvars:
Installation: place ips.smx into your sourcemod/plugins/ directory and internet.txt with lan.txt into /cstrike/ directory Configuration: you have to edit internet.txt and lan.txt to define your own networks lan.txt is used to check clients who have 10, 192 or 172 in the first byte of their IP address and internet.txt for the rest in my example it looks like this: PHP Code:
because ISP may have several network ranges, but they must have the same name, we can specify them by "CrossNet*1", "CrossNet*2" ... "CrossNet*N", you can see that in my example the last entry in this list must be 0.0.0.0 - 255.255.255.255, which will define default name (they are LAN and Internet) Changelog: Version 1.2 - now works without altering reserved slots plugins Version 1.1 - made some optimizations and cached handles - new version requires modified reserved slots plugin TODO: - make a single config for network ranges to make things easier... at first this plugin was using Event Scripts and I had to split networks list into 2 pieces to make it run faster, but there's no such need in SourceMod |
Re: IP based reserved slots + free reserve slots
mmm... there are some bugs with this version and I can't figure out how to fix them
the problem is that function AddUserFlags works quite strange when it is called from OnClientPreAdminCheck in my plugin when admin joins the game, he has his admin flags overriden to "1" by this code... at first I thought that AddUserFlags didn't add them, but set them, so I changed the code to PHP Code:
old client flags: 0 new client flags: 1 and if I check them later in the game they're still 1... if I use sm_reloadadmins command, my adminflags become 32768 again so I can't figure out what's wrong with this code... can somebody help me out? what happens to these admin flags when a player joins? |
Re: IP based reserved slots + free reserve slots
I think the reason for this is that you are using 'OnClientPreAdminCheck' meaning that you are applying the flags before SourceMod has loaded admin access for this person.
Applying the flag to the client creates them a temporary adminid and my guess is that SourceMod doesn't bother attempting to load permissions because an adminid already exists. Reloading all admins resets this (it destroys all adminid's and dumps the admin cache and rebuilds everything). As for a solution: Hm. You can use 'OnClientPostAdminCheck' which should work fine as far as assigning the flag goes (if i'm right). But. The current reserved slots plugin also uses 'OnClientPostAdminCheck' to decide if it's going to kick or not. Since theres no guaranteed order it would be completely up to luck whether this plugin manages to set the flag before the player gets kicked. I'll have a chat to BAIL about the possibility of introducing a new forward that gives third party plugins a chance to edit admin permissions before other plugins start reading them. |
Re: IP based reserved slots + free reserve slots
Quote:
I think that there's no need in new natives, it's just default user flags assigning should be changed... this is from admin-sql-threaded.sp PHP Code:
and how can you do any adminchecks if there are no user flags at that moment? it may even be considered as a bug... I think that assigning user flags BEFORE OnClientPreAdminCheck would be more appropriate and will allow plugins to change user flags |
Re: IP based reserved slots + free reserve slots
Quote:
The Admin Check is when SourceMod assigns flags. The two forwards (pre and post) occur before and after this. If you assigned admin flags beforehand it wouldn't be 'Pre' any more... OnClientPreAdminCheck can be used to override flags settings, this is what the threaded sql plugin does. But in your case you want to wait until normal flags have been assigned and add an extra one. So you have to wait until OnClientPostAdminCheck, but still guarantee to be ahead of reservedslots.smx. |
Re: IP based reserved slots + free reserve slots
ok, I see now... so OnClientPreAdminCheck has another puspose and there's really no such function that I need in this case
then I guess I have to wait for new forwards |
Re: IP based reserved slots + free reserve slots
and before that happens I'll have to edit reserved slots plugin to make checks later in the game...
|
Re: IP based reserved slots + free reserve slots
version 1.2 works with the new 1837 sourcemod without any changes to other plugins, use of KeyValues was optimized and I couldn't find any bugs...
|
Re: IP based reserved slots + free reserve slots
Hello all!
Can someone help us with this plugin, please? We need to make something like this: - when player is connecting - plugin checks his IP - if player has IP 10.*.*.* - when all is ok - he can join the server - if his IP any other (apart from 10.*.*.*) - when plugin must check: --- if this player is first from 10 players like him - he can join; --- if this player is 9-10th - he can't join. I mean, that we have local dedicated server, and we want only 9-10 players could connect from the Internet (because of bandwidth), and all other slots can be used by our local players. Can someone help me to do this with this plugin, or may be write some code, our server admin will finish it... :wink: Thank you. |
Re: IP based reserved slots + free reserve slots
I can't believe this plugin was ever approved, this is just pandering to nosteam users.
|
All times are GMT -4. The time now is 10:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.