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
19 stars 17 forks source link

Lag every time before vote countdown starts #19

Closed evandrocoan closed 7 years ago

evandrocoan commented 8 years ago

I have the plugin on 2 servers.

On 1 there are around 10 maps and there is no lag before vote countdown starts or anything

On second i have around 900 maps in vote file and it lags every time before vote countdown starts. I have split the maps in 4 groups of 230 maps and lag reduced a bit (from what I've seen) but it still effects gameplay.

Hope that helps https://forums.alliedmods.net/showpost.php?p=2464957&postcount=362


Lag issue can be fixed if you read map file at map start and save all maps into a dynamic array. Then when votemap comes you only need to read this array which is most efficient on a middle of a round. https://forums.alliedmods.net/showpost.php?p=2464967&postcount=363

The lagging should happens when loading maps if you got the debug enabled and printing to the server console or with some very restrict configuration. May you PM your output from the amxx cvars command only within the columns from the Galileo plugin and run it on debug mode until you get one vote start and send the _galileo.log file? You may get more instructions on the Support section.


Actions to be performed:

  1. Create a function which return one valid map to fill the voting list.
  2. Move the map loading to the server start.
  3. Build a primary voting menu on server start, and on the voting start fill the permanent menu with the nominations, then later with the primary voting menu. However, if the primary voting menu maps became invalid, call the function which return one valid map to fish again.
evandrocoan commented 8 years ago

Added the log file:

_galileo.txt

evandrocoan commented 8 years ago

It seems to be true it is lagging, as we may see:

607       0} ( cmd_say ) equali(/option, 'nom', 3)? 0, strlen(/option) > 5? 1
607       0}     ( cmd_say ) Just Returning PLUGIN_CONTINUE, as reached the handler end.
867     260} I AM ENTERING ON pendingVoteCountdown(0)
1257    390} I AM ENTERING ON pendingVoteCountdown(0)
1657    400} I AM ENTERING ON pendingVoteCountdown(0)
2047    390} I AM ENTERING ON pendingVoteCountdown(0)
-1887 -3934} I AM ENTERING ON pendingVoteCountdown(0)
-1487   400} I AM ENTERING ON pendingVoteCountdown(0)
-7077    80} I AM ENTERING ON vote_handleDisplay(0)
-3373    70}   ( votedisplay ) player_id: 0, updateTimeRemaining: 1
-337      0}   ( votedisplay ) g_isToRefreshVoteStatus: 1,  g_totalVoteOptions: 4, strlen( g_voteStatusClean ): 0

Each pendingVoteCountdown call happens after 1 second and on the map files loading wee see continue tasks being performed over maximum value of 1 second (the 260, 390, 400, 390 values). Now I need to understand correctly the values 260, 390, 400, 390, and if the represent correctly something valid as time measurement.

  0} ( loadMapGroupsFeature ) MapsGroups Loaded, mapFilerFilePath: addons/amxmodx/configs/galileo/vote.txt
  0} 
 10} 
  0} I AM ENTERING ON processLoadedMapsFile(5) | groupCount: 5, announcementShowedTimes: 1
  0} I AM ENTERING ON computeNextWhiteListLoadTime(2) | seconds: 1052, isSecondsLeft: 0
  0} I AM EXITING computeNextWhiteListLoadTime(2) | g_whitelistNomBlockTime: 2706, secondsForReload: 1654
  0} I AM ENTERING ON map_populateList(4) | mapFilePath: addons/amxmodx/configs/galileo/0.ini
  0} I AM ENTERING ON TRY_TO_APPLY(2) | objectIndentifation: 0
  0} 
  0}     map_populateList(...) Loading the PASSED FILE! mapFilePath: addons/amxmodx/configs/galileo/0.ini
  0} I AM ENTERING ON loadMapFileList(3) | mapFilePath: addons/amxmodx/configs/galileo/0.ini
  0} ( loadMapFileList ) Error 19, [KZ] Could not open 'addons/amxmodx/configs/galileo/0.ini'.
  0} I AM EXITING map_populateList(4) mapCount: 0
  0} [0] groupCount:5, filersMapCount: 0,  g_totalVoteOptions: 0, g_maxVotingChoices: 6
  0}     fillersFilePaths[0]: addons/amxmodx/configs/galileo/0.ini
  0} 
  0} I AM ENTERING ON map_populateList(4) | mapFilePath: addons/amxmodx/configs/galileo/1.ini
  0} I AM ENTERING ON TRY_TO_APPLY(2) | objectIndentifation: 0
  0} 
  0}     map_populateList(...) Loading the PASSED FILE! mapFilePath: addons/amxmodx/configs/galileo/1.ini
  0} I AM ENTERING ON loadMapFileList(3) | mapFilePath: addons/amxmodx/configs/galileo/1.ini
390} 
 10} I AM EXITING map_populateList(4) mapCount: 129
  0} [1] groupCount:5, filersMapCount: 129,  g_totalVoteOptions: 0, g_maxVotingChoices: 6
  0}     fillersFilePaths[1]: addons/amxmodx/configs/galileo/1.ini
  0} 
  0} [1] allowedFilersCount: 1   maxMapsPerGroupToUse[1]: 1   MaxCount: 6
  0} 
  0} ( in ) [1] choice_index: 0, mapIndex: 56, mapName: ksz_fastmountain2
  0} ( out ) [1] choice_index: 0, mapIndex: 56, mapName: ksz_fastmountain2, unsuccessfulCount: 0, g_totalVoteOptions: 1
  0} 
  0} 
  0} I AM ENTERING ON map_populateList(4) | mapFilePath: addons/amxmodx/configs/galileo/2.ini
  0} I AM ENTERING ON TRY_TO_APPLY(2) | objectIndentifation: 0
  0} 
  0}     map_populateList(...) Loading the PASSED FILE! mapFilePath: addons/amxmodx/configs/galileo/2.ini
  0} I AM ENTERING ON loadMapFileList(3) | mapFilePath: addons/amxmodx/configs/galileo/2.ini
230} 
 10} I AM EXITING map_populateList(4) mapCount: 146
  0} [2] groupCount:5, filersMapCount: 146,  g_totalVoteOptions: 1, g_maxVotingChoices: 6
  0}     fillersFilePaths[2]: addons/amxmodx/configs/galileo/2.ini
  0} 
  0} [2] allowedFilersCount: 1   maxMapsPerGroupToUse[2]: 1   MaxCount: 5
  0} 
  0} ( in ) [2] choice_index: 0, mapIndex: 29, mapName: kzse_bhopblock
  0} ( out ) [2] choice_index: 0, mapIndex: 29, mapName: kzse_bhopblock, unsuccessfulCount: 0, g_totalVoteOptions: 2
  0} 
  0} 
  0} I AM ENTERING ON map_populateList(4) | mapFilePath: addons/amxmodx/configs/galileo/3.ini
  0} I AM ENTERING ON TRY_TO_APPLY(2) | objectIndentifation: 0
  0} 
  0}     map_populateList(...) Loading the PASSED FILE! mapFilePath: addons/amxmodx/configs/galileo/3.ini
  0} I AM ENTERING ON loadMapFileList(3) | mapFilePath: addons/amxmodx/configs/galileo/3.ini
240} 
  0} I AM EXITING map_populateList(4) mapCount: 141
 10} [3] groupCount:5, filersMapCount: 141,  g_totalVoteOptions: 2, g_maxVotingChoices: 6
  0}     fillersFilePaths[3]: addons/amxmodx/configs/galileo/3.ini
  0} 
  0} [3] allowedFilersCount: 1   maxMapsPerGroupToUse[3]: 1   MaxCount: 4
  0} 
  0} ( in ) [3] choice_index: 0, mapIndex: 26, mapName: radon_forgotten2
  0} ( out ) [3] choice_index: 0, mapIndex: 26, mapName: radon_forgotten2, unsuccessfulCount: 0, g_totalVoteOptions: 3
  0} 
  0} 
  0} I AM ENTERING ON map_populateList(4) | mapFilePath: addons/amxmodx/configs/galileo/4.ini
  0} I AM ENTERING ON TRY_TO_APPLY(2) | objectIndentifation: 0
  0} 
  0}     map_populateList(...) Loading the PASSED FILE! mapFilePath: addons/amxmodx/configs/galileo/4.ini
  0} I AM ENTERING ON loadMapFileList(3) | mapFilePath: addons/amxmodx/configs/galileo/4.ini
249} 
 10} I AM EXITING map_populateList(4) mapCount: 149
  0} [4] groupCount:5, filersMapCount: 149,  g_totalVoteOptions: 3, g_maxVotingChoices: 6
  0}     fillersFilePaths[4]: addons/amxmodx/configs/galileo/4.ini
  0} 
  0} [4] allowedFilersCount: 1   maxMapsPerGroupToUse[4]: 1   MaxCount: 3
  0} 
  0} ( in ) [4] choice_index: 0, mapIndex: 112, mapName: kz_sandblock2_ez
  0} ( out ) [4] choice_index: 0, mapIndex: 112, mapName: kz_sandblock2_ez, unsuccessfulCount: 0, g_totalVoteOptions: 4
  0} 
  0} 
  0} I AM ENTERING ON TRY_TO_APPLY(2) | objectIndentifation: 230
  0} I AM ENTERING ON flushVoteBlockedMaps(3) | announcementShowedTimes: 1, 
  0} blockedMapsBuffer: 
  0} 
  0} I AM EXITING ON loadNormalVoteChoices(0) | g_totalVoteOptions: 4
  0} I AM ENTERING ON initializeTheVoteDisplay(0)
  0} I AM ENTERING ON nomination_clearAll(0)
evandrocoan commented 7 years ago

Moved all file loading handlers to the server start.