evandrocoan / MultiModServer

It is a Multi-Mod plugin's configurations for Amx Mod X - https://forums.alliedmods.net/showthread.php?t=273018
GNU General Public License v3.0
17 stars 17 forks source link

People voted for the map X, but at change level, the server changed to the map Y #3

Closed evandrocoan closed 7 years ago

evandrocoan commented 7 years ago

[QUOTE=damnyourefine;2457110]Hello, I need some help with this plugin!

I have it successfully installed and configured in near entirety on my CS 1.6 server for a month now; however, we have noticed one issue..

In some instances, the server will forcibly change the map to a map in the defined mapcycle file while we are in the process of a RTV vote or after the RTV has concluded.

For example, when the RTV is triggered by enough player votes or gal_startvote, the vote will be in progress with people actively voting OR the vote will have concluded with a "The next map will be X", and then the server halts the players and changes the map to a map in the mapcycle.

I cannot find a cvar in the plugin config to control this behavior. What am I missing?

Yes, I have verified the default (and any other) map manager plugins are disabled. :)[/QUOTE]

Summary: At a vote map by RTV or gal_startvote, people voted for the map X, but at change level, the server changed to the map Y.

The issue occurs either while voting is still in progress OR after the voting has concluded and decided map X. The server will then trigger end of map and switch to map Y.

evandrocoan commented 7 years ago

Hello,

thanks for your help so far. Per your request, I enabled debug mod and uploaded the log file.

My admins saw the issue occur at least twice today.

The first instance was when the vote was decided for "17_8space" but the server changed to de_rats.

The second instance was when the vote was decided for "awp_space_dick" but the server changed to awp_map.

evandrocoan commented 7 years ago

The bug is happening because this function is being called at the wrong time:

public map_change()

The point here is that as the function is public, all your other plugins running on the server may call it, so some bad intended plugin may be doing it. But I doubt someone would do it, but it is a possibility. For now I will study/investigate my code more.

On the log, we may see it was called right after someone say ´wtf´:

L 09/28/2016 - 19:48:02: {274.8399} ( cmd_say ) equali(wtf, 'nom', 3)? 0, strlen(wtf) > 5? 0
L 09/28/2016 - 19:48:02: {274.8399}     ( cmd_say ) Just Returning PLUGIN_CONTINUE, as reached the handler end.
L 09/28/2016 - 19:48:02: {274.8399} I AM ENTERING ON map_change(0)
evandrocoan commented 7 years ago

The issue is fixed on version 3.2.3

To reproduce it, is just to end the round when the RTV is going on. To fix it was just to add this:

galileo.sma
1977:     if( !( g_voteStatus & VOTE_IS_IN_PROGRESS ) )
1978:     {
1979:         // If this is called when the voting is going on, it will cause the voting to be cut
1980:         // and will force the map to immediately change to the next map on the map cycle.
1981:         endRoundWatchdog();
1982:     }