Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] Enforce Gametypes [v1.4 (26-Jun-2023)]


Post New Thread Reply   
 
Thread Tools Display Modes
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 06-18-2023 , 23:13   Re: [L4D & L4D2] Enforce Gametypes [v1.2 (18-May-2023)]
Reply With Quote #11

Quote:
Originally Posted by Mika Misori View Post
I write the server address with this config and your plugin in mm_dedicated_force_servers, then create a lobby with survival mode and run the game. I end up on my server, which loads the map in survival mode, but the players appear in an empty saferoom as in a coop campaign and if you look at the TAB, the game mode is realism.
I edited the autoexec.cfg file and set:

sv_gametypes = "realism"

I do not have this variable in my server.cfg.
Restarted the server and verified the new value on the server console:

sm_cvar sv_gametypes
sm plugins list

On my client, I created a survival lobby, set mm_dedicated_force_servers to my server address and port in the client console, and attempted to connect.

The connection was rejected (Server does not support this gamemode). I am not able to duplicate the issue you reported. My testing was done on Windows 11 with SourceMod 1.11 and Metamod version 1.11.

Are you sure you are running version 1.2 of the plugin? What you describe sounds like something that might happen on version 1.1.
Mystik Spiral is offline
Mika Misori
Senior Member
Join Date: Sep 2022
Old 06-19-2023 , 07:36   Re: [L4D & L4D2] Enforce Gametypes [v1.2 (18-May-2023)]
Reply With Quote #12

Thanks for the quick response.

Quote:
Originally Posted by Mystik Spiral View Post
Are you sure you are running version 1.2 of the plugin?
Sure, the latest version of the plugin:
Code:
sm plugins list
006 "[L4D & L4D2] Enforce Gametypes" (1.2) by Mystik Spiral

And...

sm_cvar sv_gametypes
[SM] Value of cvar "sv_gametypes": "realism"
Anyway, I found what the problem is. The problem in the sm_cvar mp_gamemode realism, if I remove this variable and leave only sv_gametypes realism in server.cfg, the plugin works and does not allow to run survival mode from the lobby on the server:
"Server does not support this gamemode."

But if I put both variables in server.cfg:
sv_gametypes realism
sm_cvar mp_gamemode realism

Than I can bypass the restriction of the plugin and run the game on the server with a different mode and it breaks:
The map is running in survival mode, but the players appear on it as a normal campaign without the ability to pass it or run survival.

It seems that mp_gamemode realism overwrites the game mode launched from the lobby at the last moment and thus bypasses the plugin restriction.
Any idea how to fix this, please? Because it's important to me to limit the server mode to expert realism only, without the ability to change it. That's why I have set in server.cfg sm_cvar mp_gamemode realism
Mika Misori is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 06-19-2023 , 14:03   Re: [L4D & L4D2] Enforce Gametypes [v1.2 (18-May-2023)]
Reply With Quote #13

Quote:
Originally Posted by Mika Misori View Post
But if I put both variables in server.cfg:
sv_gametypes realism
sm_cvar mp_gamemode realism

Than I can bypass the restriction of the plugin and run the game on the server with a different mode
I believe I know the cause and I was able to duplicate the issue when I add mp_gamemode to server.cfg. I also have some ideas on how to fix it. I will work on it and post back.
Mystik Spiral is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 06-19-2023 , 15:37   Re: [L4D & L4D2] Enforce Gametypes [v1.2 (18-May-2023)]
Reply With Quote #14

@Mika Misori
I believe the issue is resolved in the latest version. Please install the 1.3 version and let me know. Thanks for reporting!

Last edited by Mystik Spiral; 06-19-2023 at 15:37.
Mystik Spiral is offline
Mika Misori
Senior Member
Join Date: Sep 2022
Old 06-21-2023 , 16:31   Re: [L4D & L4D2] Enforce Gametypes [v1.2 (18-May-2023)]
Reply With Quote #15

Quote:
Originally Posted by Mystik Spiral View Post
@Mika Misori
I believe the issue is resolved in the latest version. Please install the 1.3 version and let me know. Thanks for reporting!
Thank you so much, works like clockwork! Now no one can bypass the limitation of the plugin with mp_gamemode in server.cfg.

Suggestion:
Is it possible to make the same restriction for the difficulty? Example, I have a cvar z_difficulty impossible (Expert difficulty) in the server config. Now players can run the game from the lobby on easy difficulty.

Is it possible to give them a message about restriction if the lobby difficulty is not the same as the config cvar z_difficulty, please? Like "Server does not support this difficulty".
Mika Misori is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 06-21-2023 , 18:58   Re: [L4D & L4D2] Enforce Gametypes [v1.2 (18-May-2023)]
Reply With Quote #16

Quote:
Originally Posted by Mika Misori View Post
Thank you so much, works like clockwork! Now no one can bypass the limitation of the plugin with mp_gamemode in server.cfg.

Suggestion:
Is it possible to make the same restriction for the difficulty? Example, I have a cvar z_difficulty impossible (Expert difficulty) in the server config. Now players can run the game from the lobby on easy difficulty.

Is it possible to give them a message about restriction if the lobby difficulty is not the same as the config cvar z_difficulty, please? Like "Server does not support this difficulty".
I am glad to hear the latest version resolved the issue! Thanks again for reporting that.

Difficulty level is beyond the scope of this plugin. However, if you have z_difficulty impossible in the server.cfg file, your server should always be locked to expert mode no matter what difficulty was set in the lobby. I used to run this same setting, but I eventually changed it to allow the difficulty to be modified. Now I set z_difficulty impossible in the autoexec.cfg file and do not include it in the server.cfg... this sets the default difficulty when the server starts but allows for it to be changed. If you want to lock in the difficulty, in addition to having z_difficulty impossible in the server.cfg you will also need some type of Vote Blocker that prevents players from voting to change the difficulty. I think there are a number of "welcome" plugins too where you could post a message for all newly connected players that difficulty is locked to expert (and anything else you want them to know). You probably already know this, but locking to expert mode will lead to a lot of players leaving your server, which is fine if that is what you want. Your server, your rules.
Mystik Spiral is offline
Ja-Forces
Senior Member
Join Date: Jul 2009
Location: Leningrad
Old 06-21-2023 , 20:44   Re: [L4D & L4D2] Enforce Gametypes [v1.3 (19-Jun-2023)]
Reply With Quote #17

I did a similar thing for my servers based on your plugin

https://github.com/Dosergen/Stuff/bl...y_gametypes.sp
__________________
Ja-Forces is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 06-26-2023 , 06:49   Re: [L4D & L4D2] Enforce Gametypes [v1.4 (26-Jun-2023)]
Reply With Quote #18

Released version 1.4.

- Fixed compatibility issue with L4D1 map name
- Minor tweaks to changelevel regarding hibernation
- Additional credits
Mystik Spiral is offline
alliedfront
Junior Member
Join Date: Jan 2024
Location: Germany
Old 01-05-2024 , 15:30   Re: [L4D & L4D2] Enforce Gametypes [v1.4 (26-Jun-2023)]
Reply With Quote #19

Hello, I installed this plugin on my L4D 1 server because I wanted it exclusively for Versus games. It works. As coded in the plugin, my server is not hibernating and appears to be running even without human players. I'm wondering if these two settings are required for the script to work?

Update:
I updated these two variables in my server.cfg:

sm_cvar sv_hibernate_when_empty 1
sm_cvar sb_all_bot_game 0

At first, I forgot the "sm_cvar". Now the first variable is recognized at server start and the server is hibernating shortly after start, if no human players are connected. The second variable is not recogniced: "[SM] Unable to find cvar: sb_all_bot_game".

Last edited by alliedfront; 01-05-2024 at 15:46.
alliedfront is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 01-05-2024 , 19:05   Re: [L4D & L4D2] Enforce Gametypes [v1.4 (26-Jun-2023)]
Reply With Quote #20

Hi @alliedfront!

I believe L4D1 uses "sb_all_bot_team" (instead of "sb_all_bot_game"). Thank you pointing this out, and I updated the original post to note this.
__________________
Mystik Spiral is offline
Reply



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 00:20.


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