AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Immunity Reserve Slots (2.0.8) (https://forums.alliedmods.net/showthread.php?t=93053)

Jamster 05-23-2009 18:23

Immunity Reserve Slots (2.0.8)
 
61 Attachment(s)
How to connect to a server using reserve slots
To use reserve slots when a server is full you and your users need to type into the console: connect <ip address>:<port> (port not needed if you're running on the default port for whatever server you run).


Extension requirements
This plugin requires either cbaseserver tools or connect extensions, read their threads for more info on which one you want to pick (probably down to which games they support).

Connect: http://forums.alliedmods.net/showthread.php?t=162489
CBaseServer: http://forums.alliedmods.net/showthread.php?t=72322

Optionally, you can use the donator plugin, too:
http://forums.alliedmods.net/showthread.php?t=145542

About:

Immunity Reserve Slots is an extended version of *pRED's original plugin for CBaseServer. The best way to understand the plugin is to simply show you the cvar descriptions below.

The following cvar's are auto created on run in:
cfg/sourcemod/plugin.immunityreserveslots.cfg

sm_irs_kicktype
Default: 0
Who to kick when a valid player is found (0 - random, 1 - highest ping, 2 - highest time, 3 - lowest time).

sm_irs_log
Default: 0
Enable logging (0 - disable, 1 - enable highly verbose logs, 2 - only log the disconnected and connecting users).

sm_irs_immunity
Default: 1
Enable immunity check (0 - disable, 1 - immunity check if server is full of reserves, 2 - as with 1 but also allow players with high enough immunity and no reserve flag to stay connected).

sm_irs_kickreason
Message to display when a client is kicked for a normal reserve slot ("default" - uses translation phrase, anything else uses what you enter).

sm_irs_kickreason_immunity
Message to display when a client is kicked for a reserve slot based on immunity ("default" - uses translation phrase, anything else uses what you enter).

sm_irs_kickspecfirst
Default: "1"
When enabled spectators are always kicked first before anyone else (0 - disable, all players are taken into account for kicking, 1 - enable).

sm_irs_kickspecdelay
Default: "0"
The delay, in seconds, to kick spectators (0 - instant, any other value gives spectators a grace of xx seconds until they can be kicked).

sm_irs_highimmunitylimit
Default: "0"
The maximum amount of players that can connect to the server and kick a low immunity reserve slot player (0 - no limit, more than 0 to set the max limit).

sm_irs_highimmunityvalue
Default: "0"
This value and over are players who are considered to have high immunity (0 - disable, more than 0 to set the high immunity value).

sm_irs_keepbalance
Default: "0"
This tries to kick people in such a way to prevent autobalance (0 - disable, 1 - enable).

sm_irs_rejectreason_enable
Default: "0"
Enable reject reason with the Connect extension (0 - disable, 1 - enable).

sm_irs_rejectreason
Default: "default"
Message to display when a client gets rejected for a reserve slot when they have reserve rights with the Connect extension ("default" - uses translation phrase, anything else uses what you enter).

sm_irs_autopassword
Default: "0"
Allow direct connecting reserve slot users to connect without having to type in the password on a password protected server with the Connect extension (0 - disable, 1 - enable, 2 - as with 1 but allow all connecting clients to connect).

sm_irs_kicklist_mode
Default: "0"
Enable kick list mode (0 - disable, normal reserve slot operation, 1 - only use a kick list to kick specific clients, 2 - as with 1 but allow any connecting client to kick people from the server).

sm_irs_kicklist_file
Default: "default"
Path to kick list file ("default" - uses a file in the sourcemod config folder called irs_kicklist.ini, anything else uses what you enter e.g. "cfg/kicklist.cfg").

sm_irs_donator_support
Default: "0"
When enabled along with the donators plugin, donaotrs will be allowed to connect (0 - disable, 1 - allow donators to connect).

sm_irs_donator_immunity
Default: "0"
The immunity value to give to donators, if required for immunity checks within IRS.

Server Commands:

sm_irs_kicklist_reload
Reloads the kick list.

Installing:

First you want to install the CBaseServer Tools extension or Connect extension, which are linked above. I highly recommend getting the latest snapshots of either extension.

To install my plugin simply place the file immunityreserveslots_<ext>.smx into the sourcemod plugins folder and the phrases file into the translation folder on your server.

To add users to the system add them in your admin config (default: game/addons/sourcemod/configs/admins.cfg) with the reserve flag. If you use the immunity feature of my plugin you'll also want to set their immunity to whichever levels you decide upon. Read the top of the admin config file for more info on immunity.

Support:

If you find any problems with the system you will need to provide the FULL logs the plugin creates if you enable logging. This is the only way I can figure out problems with the system. BUT it should be solid now.

Support is also only provided if you run SM 1.4+.

To compile the plugin yourself you will need to install the include files for the required extensions which can be found in their threads.

Special Thanks:

I really have to thank *pRED for his excellent CBaseServer tools extension as it spurred me into coding action for SourceMod!

Thanks goes to all the people who've helped me test the plugin.

Changelog

2.0.8
- Added cvar to control when to kick spectators (sm_irs_kickspecdelay, set to 0 instantly kicks spectators, anything else gives them a grace of x secs before being kicked).

2.0.7
- Added donator plugin support (see: http://forums.alliedmods.net/showthread.php?t=145542).

2.0.6
- Code cleanup.
- Added support for Connect 1.2.0+.

2.0.5
- Fix for non-TF2 games throwing errors on map start. Connect only.

2.0.4
- Fix for too many clients connecting in MVM games. Connect only.

2.0.3
- Fixed CloseHandle() bug.

2.0.2
- Recoded kick list mode for less disk I/O.
- Fixed a bug if kick list mode was set to 2 which could create a possible rare looping slot scenario.
- Added command to reload the kick list if users want to update the list as soon as possible (sm_irs_kicklist_reload), list now also updates automatically on map change properly.
- Cleaned up some code.

2.0.1
- Added auto password cvar so reserve clients can automatically connect to password protected servers, can also be set so any connecting client can connect e.g. for temporary purposes (sm_irs_autopassword).
- Fixed bug in keep balance code where it wouldn't kick spectators if there were any when the cvar for kick spectators first was disabled.
- Added kick list mode, this allows anyone to connect to the server (configurable) but goes through a list of steam id's for who should get kicked vs who can connect (sm_irs_kicklist_mode and sm_irs_kicklist_file).
- Removed sm_rescheck_mmunity command check thing I still had in there where it wouldn't have mattered anyway (i.e. I missed it).

2.0
- Added Connect extension support.
- Added cvars to configure the reject message on a full server (sm_irs_rejectreason_enable and sm_irs_rejectreason).

1.0.4
- Made use of GetURandomFloat for random mode.
- Improved logging code.

1.0.3
- Made the default action for detected reserve plugins to move to the disabled folder after unload rather than stopping the plugin.
- Changed translation phrase on plugin error to make more sense.

1.0.2
- Fixed incorrect statement in balance check code.
- Small optimisations.
- Added command check back in for "sm_reskick_immunity" as some servers might expect this as a valid way to grant default immunity if reading the official SM wiki.
- Added the regular SM reserve slot plugin to the plugin checks on startup.

1.0.1
- Added cvar "sm_irs_keepbalance", this will try and keep team balance best as possible when kicking players as not to trigger an autobalance.
- Drastic recoding for better performance.
- Added use of AskPluginLoad2() for improved late load detection (this makes the plugin require SM 1.3 now).
- Added detection of accidental installation of the default test plugin for CBaseServer tools to avoid any possible problems.
- New verbose logs, now create their own log files instead of spamming regular logs. Also improved verbosity.
- Fixed a small leak which happened if any logging was disabled.
- Spec check now uses a team check instead as in some games it could "incorrectly" flag users as spectating when they were dead. Also flags unassigned players now.

1.0
- Made final.
- Added full translation support.
- Changed the way the reason cvars work, no config changes needed for old users.

0.3.4
- Added a cvar option to limit the maximum amount of players with high immunity to kick low immunity players when the server is full (if more than the value are connected at the time no further connections will be allowed).
- A bit of code clean up.

0.3.3
- Added cvar to control whether or not spectators get kicked first before other players or not (defaults to enabled).

0.3.2
- Added option to only log who gets kicked.

0.3.1
- Fixed a very small bug in the logging code to do with detecting spectators.

0.3
- Fixed some logging bugs.
- Fixed a major bug in the immunity check and optimised regular check.

0.2
- Added lowest time option to kick types.
- Added cvars to control kick message for normal kick and immunity kick.
- Small optimizations.

0.1
- Initial release

12345 05-23-2009 18:29

Re: Immunity Reserve Slots
 
This plugin support l4d?

DontWannaName 05-23-2009 18:38

Re: Immunity Reserve Slots
 
cbase doesnt work with L4D so no. Missing the header?

Jamster 05-23-2009 19:00

Re: Immunity Reserve Slots
 
For supported games read pRED's thread linked above, but I don't think it does, no.

Also, where is my plugin info, submit system still bugged? ;__;

flubber 05-24-2009 14:19

Re: Immunity Reserve Slots
 
Thanks Jamster for the immunity version, i've just installed it and activate the log, i'll give you feedback asap.

Jamster 05-24-2009 14:36

Re: Immunity Reserve Slots
 
Thanks. Yeah, as long as you set the immunity cvar to 2 it'll do what you want for your server!

flubber 05-24-2009 14:54

Re: Immunity Reserve Slots
 
By the way i was thinking of something : A cvar to set the texte message explaining the kick reason.

Jamster 05-24-2009 15:30

Re: Immunity Reserve Slots
 
It's something I'll note down for a future version.

HanoverFist 05-24-2009 22:00

Re: Immunity Reserve Slots
 
do I disable the sourcemod reserve slots?

msleeper 05-25-2009 05:27

Re: Immunity Reserve Slots
 
Yeah disable the built-in reserved slots.

I can't wait to use this update when you add in a kick message. Also, can you add "lowest time" to your kick method? I'd rather kick people who just joined recently, than someone who has been on the server for a long time.

Jamster 05-25-2009 12:09

Re: Immunity Reserve Slots
 
Yeah sure, I'll add that to the list!

Though you know that does take a knock on effect with your server ranking right? Just so you know!

Kenny Loggins 05-25-2009 12:36

Re: Immunity Reserve Slots
 
Wow nice plugin thank you for you work on this!

Jamster 05-25-2009 13:40

Re: Immunity Reserve Slots
 
Thanks!

I am attaching a "testing" version of 0.2 here, it has all the features requested, much testing will be appreciated, if all goes well for a week or so I'll update the original post.

To use the lowest time option for kicking set sm_irs_kicktype to 3.

New cvar's:

sm_irs_kickreason
Default: "Slot reserved"
Message to display when a client is kicked for a normal reserve slot.

sm_irs_kickreason_immunity
Default: "Slot reserved - low immunity"
Message to display when a client is kicked for a reserve slot based on immunity.

Pacmaney 05-25-2009 16:16

Re: Immunity Reserve Slots
 
This compatible with one of the nightly 1.2 builds?

msleeper 05-25-2009 16:33

Re: Immunity Reserve Slots
 
Thanks, I'll give your testing version a try. I don't think that one or two people is going to affect my server ranking, especially when the person who is coming in is a regular and will probably be there for a few hours.

Do you know how long the maximum length on the kick string can be, if any? I'd hate to put a long message and it just get chopped off since it's pretty hard to test. Thanks.

Jamster 05-25-2009 18:05

Re: Immunity Reserve Slots
 
Maximum length is set to 255 but I am not sure what the limit is for convar strings in source (or the reason for disconnect messages).

Pacmaney: yes, and 1.3.

msleeper 05-25-2009 19:44

Re: Immunity Reserve Slots
 
Looks like the messages get truncated at 40-something characters, not sure if this is an issue with the plugin/SourceMod (doubt it) or TF2.

DontWannaName 05-25-2009 19:57

Re: Immunity Reserve Slots
 
Theres a way to use multiple lines for kick messages but I dont know how...

msleeper 05-25-2009 20:07

Re: Immunity Reserve Slots
 
Actually someone just reported that SourceBans' banning message does it too, and I know for a fact that worked.

Jamster 05-26-2009 10:37

Re: Immunity Reserve Slots
 
I'll look into it.

Jamster 05-26-2009 13:27

Re: Immunity Reserve Slots
 
I wonder if it's because I am using KickClientEx (which you have to for timing reasons). Maybe if I make it a translation phrase instead? I looked at the sourceban's code and it seems they don't do anything that different except they use KickClient of course. :|

edit: anyway, I'm going to create a test plugin to test my theories out and hopefully find out how to do it and apply it to this!
edit2: well, none of that worked, lol, you guys do mean the message box the client receives right? Damn, well, I'll keep on plodding.

msleeper 05-26-2009 17:13

Re: Immunity Reserve Slots
 
Yeah I mean the message box. I will do some testing myself on kick messages, but I wonder if something changed either in SourceMod or TF2 in general. As I said, people are reporting the SourceBans message being cut off as well and that did work. It's like the message isn't wrapped to enlarge the message box since you can see some characters cut off.

Jamster 05-26-2009 17:20

Re: Immunity Reserve Slots
 
Yeah, I have tested with kick, kickex, convar strings, translation strings. All do the same, something must have changed like you said.

I am testing with the latest 1.2 snapshots here.

Jamster 05-26-2009 18:08

Re: Immunity Reserve Slots
 
Anyway, updated OP with 0.2, been tested enough on my server that I believe it's fine. Hopefully we can get to the bottom of the wrapping problem on the disconnect message. I have a feeling it probably is an update that broke that with Source.

msleeper 05-26-2009 21:11

Re: Immunity Reserve Slots
 
Yes aside from that everything is working great.

Jamster 05-28-2009 21:15

Re: Immunity Reserve Slots
 
Just a warning, I have found a bug, it seems in the immunity check it'll only kick someone if they are a spectator, which is odd, I will try my hardest to fix this asap.

Jamster 05-28-2009 21:30

Re: Immunity Reserve Slots
 
I LIVE FOR THIS SHIT. OK, updated the original post, pretty sure I got that bug squished (also, I am retarded, apologies servers ops). At least it's fixed now, my bag.

Jamster 05-29-2009 09:45

Re: Immunity Reserve Slots
 
Done another small update (sorry) but it's only for the logging of spectators really (more accurate as it'll say who's a spec even if they are immune).

DarkFlaw 05-29-2009 16:28

Re: Immunity Reserve Slots
 
Get this error when compiling.

Code:

immunityreserveslot.sp(1) : error 010: invalid function or declaration

Jamster 05-29-2009 16:40

Re: Immunity Reserve Slots
 
Well you will, yes, you need to have pred's cbaseserver include like I said in the OP. I DID attach the plugin compiled too.

edit: oh is cbaseserver included in the forum compiler now, that owns, but still, to compile yourself locally you need the include.

DarkFlaw 05-29-2009 16:51

Re: Immunity Reserve Slots
 
Hmm I still get the error after coping the scripting folder from cbaseserver, and the auto compiler in OP says "Plugin failed to compile! Please try contacting the author." when I try to download it.

Jamster 05-29-2009 18:57

Re: Immunity Reserve Slots
 
OH, never mind, it does for me does the OP too, probably because of having the plugin already compiled cached. Anyway, I downloaded it and compiled fine, what version of the compiler are you using? It seems it's failing on line 1 for you which is WEIRD, what's your OS? Try removing the comments and see if it compiles. I can assure you that the .smx in the original post is A-OK though.

Wonder if it's because I am using np++

edit: AHA, I get the same error if I save the file as UTF-8 in np++, it needs to be ANSI, something must be going wrong when you download and save it?

disconnect81 05-30-2009 19:33

Re: Immunity Reserve Slots
 
I have this set up working on my server, at 32/33 the server is full and people with reserved slots are still able to join which is great!

I had one question / request, is it possible to make the 33rd slot hidden while maintaining the functionality? The reason I ask, it would be nice if people who dont have reserved slots could still use the "join server when a slot becomes available" feature. As long as it's full at 32/33, this is not possible.

**EDIT**

I tried setting "sv_visiblemaxplayers 32" in the server.cfg and restarting, this didnt seem to change anything.


Thanks,

Disconnect

creativemapping 05-30-2009 19:42

Re: Immunity Reserve Slots
 
Ok let me get this strait. I'm running a 33 slot server.I like the different size of the teams as in I'm a believer that one man can make difference.

I got the oil plugin installed and put the maxvisibleplayers on 33. Could I when the server is full on 33 still join?

cheers

Jamster 05-30-2009 20:57

Re: Immunity Reserve Slots
 
@disconnect81: This plugin is for the CBaseServer Tools extension so the requisite of that is you don't even need an open slot. Instead people need to manually connect when the server is full (read the original post about this). I should imagine what you want will work though just by turning off the visible maxplayers cvar and setting the server size to the size you want.

@creativemapping: yes, I think that should work fine, as long as oil makes sourcemod report the proper MaxClients and maximum possible players (which I cannot imagine it NOT).

edit: also, posted update, just enables you to "simply" log connecting and kicked players when someone is kicked for a res slot.

Billiam 06-02-2009 16:19

Re: Immunity Reserve Slots
 
Is there any chance you could add an AFK check?
I'd like to kick spectators first, then anybody that's been afk for, say, 3 minutes, and only then kick by playing time or ping.

Jamster 06-02-2009 16:44

Re: Immunity Reserve Slots
 
I cannot see a reason to really have an AFK check when other plugins will already kick players if they're idle, which is what you want on a server. The plugin already kicks spectators first anyway, that's a simple check that was in pRED's version too.

Jamster 06-03-2009 13:49

Re: Immunity Reserve Slots
 
Posted a small update, just a cvar to control whether specs get kicked first or not (default is enabled).

ddr100 06-05-2009 21:27

Re: Immunity Reserve Slots
 
I think I figured it out instead of having "donatornaehere"
{
"auth" "steam"
"identity" "STEAM_0:0:000000"
"immunity" "99" I simply change the "immunity" "99" to "flags" "a" found it in the admin_levels.cfg
Thanks after reading your response that pointed me in right direction
-----------------------------------------------------
Hi
I got this in and everything works perfect, but I am confused on 1 thing.
My admins can get in fine when the server is full, I assume this plugin draws its info from
/orangebox/tf/addons/sourcemod/configs/admins.cfg correct ?

if this is so how do i make it so I can have someone connect that is NOT an admin, but has given me a donation, so I could offer reserved slots for donators.

I added a user and set his immunity level high but it did not work, so I am not sure what to do.

Here is a sample of what I have in my admins config, I removed there real names and steam ID's and understand the name and steam id has to be exact on server.

"anadmin"
{
"auth" "steam"
"identity" "STEAM_0:0:0000000"
"flags" "z"
}
"donatornaehere"
{
"auth" "steam"
"identity" "STEAM_0:0:000000"
"immunity" "99"
}

Jamster 06-05-2009 21:53

Re: Immunity Reserve Slots
 
They need a res slot to connect and kick someone with lower immunity. If you give them high immunity and no res they can stay connected if they are on the server before it's full and if someone tries to connect with res and lower immunity than them. It's a balance thing and it depends on how you want your slots to work really. It's no sweat giving someone res though, they don't really gain any extra powers.

edit: if people really want it I can add a cvar to toggle whether people can connect or not if they DON'T have res but warning this might add to log spam with your users trying connecting all the time when the server is full


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

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