Raised This Month: $51 Target: $400
 12% 

Galileo v5.9.1-925 (a feature rich map voting plugin) | Last Update: 2018-07-16


Post New Thread Reply   
 
Thread Tools Display Modes
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-10-2016 , 18:22   Re: Galileo v3.2.0-195 (a feature rich map voting plugin) | Last Update: 2016.07.09
Reply With Quote #281

Quote:
Originally Posted by fysiks View Post
Keeping a global array for menu id's, especially player specific, seems completely unnecessary. I'd say it's indicative of poorly designed code.

Using menus is simple. If you create a menu dynamically, destroy it in the menu handler. If you have a menu that is global (created in plugin_init and rarely, if ever, edited/changed) then it should be destroyed at plugin_end.

FYI, when one menu overwrites another menu, MENU_EXIT is called on the first menu (this is why, unless it's a global menu, you should always destroy it in the menu handler in the MENU_EXIT).
This is not fully working for the AMXX 182 at least. This is my test, and attached is the plugin used, so you can try also.
Code:
L 07/10/2016 - 18:47:22: World triggered "Round_Start"
I AM ENTERING ON createMenu(1) | player_id: 1
I AM EXITING ON createMenu(1)
Addons zz : mymenu
L 07/10/2016 - 18:47:26: "Addons zz<1><STEAM_ID_LAN><TERRORIST>" say "mymenu"
SV_StartSound: player/sprayer.wav not precached (0)
restart
☺[AMXX] ♦Addons zz☺  ( ♦STEAM_ID_LAN☺  -  ♦192.168.25.165:27005☺ )  has disconnected  ( ♦LAN☺ ).



I AM ENTERING ON plugin_end(0). THE END OF THE PLUGIN LIFE!
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 0
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 1
( clearMenuMapIndexForPlayers) | I am destroying the menu, g_generalUsePlayersMenuId[1]: 5
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 2
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 3
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 4
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 5
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 6
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 7
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 8
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 9
As you see, one menu was destroyed on the 'plugin_end(0)'.

What I did was to open mymenu, then opened the AMX Mod X Menu (amxmodmenu).
And closed it. And as you see, we must see the print
'( clearMenuMapIndexForPlayers) | I am destroying the menu, g_generalUsePlayersMenuId[%d]: %d'
when I opened the amxmodmenu, but it do not happened.
Then, when I restarted the server and plugin_end(0) was called, it deleted the menu, as we can see.


But on my second test, I opened the galileo nomination menu, which uses also the new menu system, and it worked.

Code:
L 07/10/2016 - 18:57:31: World triggered "Round_Start"
I AM ENTERING ON createMenu(1) | player_id: 1
I AM EXITING ON createMenu(1)
Addons zz : mymenu
L 07/10/2016 - 18:57:34: "Addons zz<2><STEAM_ID_LAN><CT>" say "mymenu"
I AM ENTERING ON menu_handler(1) | player_id: 1, menu: 5, item: -3
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 1
( clearMenuMapIndexForPlayers ) | I am destroying the menu, g_generalUsePlayersMenuId[1]: 5
    ( menu_handler ) Just Returning PLUGIN_CONTINUE.
restart
☺[AMXX] ♦Addons zz☺  ( ♦STEAM_ID_LAN☺  -  ♦192.168.25.165:27005☺ )  has disconnected  ( ♦LAN☺ ).



I AM ENTERING ON plugin_end(0). THE END OF THE PLUGIN LIFE!
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 0
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 1
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 2
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 3
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 4
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 5
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 6
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 7
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 8
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 9
Worked also, when I opened the same menu again.
Code:
L 07/10/2016 - 19:13:54: "Addons zz<2><STEAM_ID_LAN><CT>" say "mymenu"
I AM ENTERING ON createMenu(1) | player_id: 1
( createMenu ) | I am destroying the menu, g_generalUsePlayersMenuId[1]: 5
( createMenu ) | I destroyed the menu!
I AM ENTERING ON menu_handler(1) | player_id: 1, menu: 5, item: -3
I AM ENTERING ON clearMenuMapIndexForPlayers(1) | player_id: 1
( clearMenuMapIndexForPlayers ) | I am destroying the menu, g_generalUsePlayersMenuId[1]: 6
    ( menu_handler ) Just Returning PLUGIN_CONTINUE.
I AM EXITING ON createMenu(1)
Addons zz : mymenu
L 07/10/2016 - 19:13:58: "Addons zz<2><STEAM_ID_LAN><CT>" say "mymenu"
This looks like a problem between the old menu system (amxmodmenu) and the new menu system.
Attached Files
File Type: sma Get Plugin or Get Source (new.sma - 387 views - 3.3 KB)
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 07-11-2016 at 21:56. Reason: misspellings
addons_zz is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-11-2016 , 21:48   Re: Galileo v3.2.0-195 (a feature rich map voting plugin) | Last Update: 2016.07.09
Reply With Quote #282

Quote:
Originally Posted by HamletEagle View Post
Yeah, if you are going to use a cvar more than two times in a function be sure to cache it.
I cached them now. It updated on the version '3.2.0-208' at the file 'galileo.sma' on the first post.
The zip 'Galileo-3.2.0.zip' file keeps with the version '3.2.0-195':
Code:
/**  * Try to set the new game limits as specified by the cvars 'gal_srv_..._restart' feature. This  * macro requires the integer variable 'serverLimiterValue' defined before the use of this macro.  *  * @param limiterCvarPointer      the 'gal_srv_..._restart' pointer  * @param serverCvarPointer       the game cvar pointer as 'cvar_mp_timelimit'.  * @param limiterOffset           the current game limit as an integer. Example: 'map_getMinutesElapsedInteger(0)'.  */ #define CALCULATE_NEW_GAME_LIMIT(%1,%2,%3) \ do \ { \     serverLimiterValue = get_pcvar_num( %1 ); \     if( serverLimiterValue ) \     { \         new serverCvarValue = get_pcvar_num( %2 ); \         if( serverCvarValue ) \         { \             serverCvarValue = serverCvarValue - %3 + serverLimiterValue - 1; \             if( serverCvarValue > 0 ) \             { \                 saveEndGameLimits(); \                 set_pcvar_num( %2, serverCvarValue ); \             } \         } \     } \ } while( g_dummy_value ) public resetRoundsScores() {     LOGGER( 128 + 2, "I AM ENTERING ON resetRoundsScores(0)" );     LOGGER( 2, "( resetRoundsScores ) TRYING to change the cvar %15s = '%f'", "'mp_timelimit'", get_pcvar_float( cvar_mp_timelimit ) );     LOGGER( 2, "( resetRoundsScores ) TRYING to change the cvar %15s = '%d'", "'mp_fraglimit'", get_pcvar_num( cvar_mp_fraglimit ) );     LOGGER( 2, "( resetRoundsScores ) TRYING to change the cvar %15s = '%d'", "'mp_maxrounds'", get_pcvar_num( cvar_mp_maxrounds ) );     LOGGER( 2, "( resetRoundsScores ) TRYING to change the cvar %15s = '%d'", "'mp_winlimit'", get_pcvar_num( cvar_mp_winlimit ) );         new serverLimiterValue;         CALCULATE_NEW_GAME_LIMIT( cvar_serverTimeLimitRestart, cvar_mp_timelimit, map_getMinutesElapsedInteger() );     CALCULATE_NEW_GAME_LIMIT( cvar_serverWinlimitRestart, cvar_mp_winlimit, max( g_totalTerroristsWins, g_totalCtWins ) );     CALCULATE_NEW_GAME_LIMIT( cvar_serverMaxroundsRestart, cvar_mp_maxrounds, g_roundsPlayedNumber );     CALCULATE_NEW_GAME_LIMIT( cvar_serverFraglimitRestart, cvar_mp_fraglimit, g_greatestKillerFrags );         // Reset the plugin internal limiter counters.     g_totalTerroristsWins = 0;     g_totalCtWins         = 0;     g_roundsPlayedNumber  = -1;     g_greatestKillerFrags = 0;         LOGGER( 2, "( resetRoundsScores ) CHECKOUT the cvar %-23s is '%f'", "'mp_timelimit'", get_pcvar_float( cvar_mp_timelimit ) );     LOGGER( 2, "( resetRoundsScores ) CHECKOUT the cvar %-23s is '%d'", "'mp_fraglimit'", get_pcvar_num( cvar_mp_fraglimit ) );     LOGGER( 2, "( resetRoundsScores ) CHECKOUT the cvar %-23s is '%d'", "'mp_maxrounds'", get_pcvar_num( cvar_mp_maxrounds ) );     LOGGER( 2, "( resetRoundsScores ) CHECKOUT the cvar %-23s is '%d'", "'mp_winlimit'", get_pcvar_num( cvar_mp_winlimit ) );     LOGGER( 1, "I AM EXITING ON resetRoundsScores(0)" ); }
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 07-14-2016 at 18:43. Reason: misspellings
addons_zz is offline
BeNq!
Senior Member
Join Date: Mar 2009
Old 07-14-2016 , 10:39   Re: Galileo v3.2.0-195 (a feature rich map voting plugin) | Last Update: 2016.07.09
Reply With Quote #283

Where I add sound after the vote maps, so as not to play sound 3x?

Last edited by BeNq!; 07-14-2016 at 10:40.
BeNq! is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-14-2016 , 10:47   Re: Galileo v3.2.0-195 (a feature rich map voting plugin) | Last Update: 2016.07.09
Reply With Quote #284

Quote:
Originally Posted by BeNq! View Post
Where I add sound after the vote maps, so as not to play sound 3x?
Here:



Spoiler
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
BeNq!
Senior Member
Join Date: Mar 2009
Old 07-16-2016 , 12:25   Re: Galileo v3.2.0-195 (a feature rich map voting plugin) | Last Update: 2016.07.09
Reply With Quote #285

1. No, I add sound in finalizeVoting() and sounds play on start a map. Why?
2. Why vote running when timeleft = 6/7 minutes? Should be a 3 minutes before the end of the map.
3. Please change cvar gal_nom_qtyused, because when I have gal_vote_mapchoices 4 and qtyused 4 players can nominate more maps. A maximum should be "4" and notice "Error... Maksimum nominations is finally".
4. Please delete GAL_MATCHING, because when is blocked more than 6 maps, this may result in crash. Check it.
5. What do you think to add settings data hours?

Example whitelist:

Code:
[22-10]
de_dust2
de_dust
de_inferno
de_nuke
gal_banrecent 3 ( default 5 )
Thank you.

Last edited by BeNq!; 07-16-2016 at 12:26.
BeNq! is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-16-2016 , 13:04   Re: Galileo v3.2.0-195 (a feature rich map voting plugin) | Last Update: 2016.07.09
Reply With Quote #286

Quote:
Originally Posted by BeNq! View Post
1. No, I add sound in finalizeVoting() and sounds play on start a map. Why?
Add it here then:


Spoiler


Quote:
Originally Posted by BeNq! View Post
2. Why vote running when timeleft = 6/7 minutes? Should be a 3 minutes before the end of the map.
If you enable the cvar it will be:
Code:
// Indicates whether there should be created a 4 minutes range before // the last 2 minutes to detect a round start and to give time about 20 // seconds to buy weapons after the round to start and before the map // voting to start. // 0 - disabled this feature // 1 - enable this feature gal_endofmapvote_start 1
Set it to zero, to always be on the last ~2 minutes

Quote:
Originally Posted by BeNq! View Post
3. Please change cvar gal_nom_qtyused, because when I have gal_vote_mapchoices 4 and qtyused 4 players can nominate more maps. A maximum should be "4" and notice "Error... Maksimum nominations is finally".
I will check this and fix any overflow, if there are.

Quote:
Originally Posted by BeNq! View Post
4. Please delete GAL_MATCHING, because when is blocked more than 6 maps, this may result in crash. Check it.
If it may result in crash, I will fix the crash.


Quote:
Originally Posted by BeNq! View Post
5. What do you think to add settings data hours?

Example whitelist:

Code:
[22-10]
de_dust2
de_dust
de_inferno
de_nuke
gal_banrecent 3 ( default 5 )
Thank you.
It can be done.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 07-16-2016 at 13:06. Reason: misspelling
addons_zz is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-20-2016 , 14:18   Re: Galileo v3.2.1-243 (a feature rich map voting plugin) | Last Update: 2016.07.20
Reply With Quote #287

Released a new version:

2016-07-20 | v3.2.1-243
  1. Fixed possible server crash on certain circumstances as with the Whitelist and Minimum Players features.
  2. Improved over all performance completely removing the debugging tools from the final code.


Quote:
Originally Posted by BeNq! View Post
3. Please change cvar gal_nom_qtyused, because when I have gal_vote_mapchoices 4 and qtyused 4 players can nominate more maps. A maximum should be "4" and notice "Error... Maksimum nominations is finally".
I checked, there is any overflow. This function is as it is on the original Galileo by Brad. And as said on its documentation:
Code:
// Specifies how many of the nominations made will be considered for use // in the next map vote. // A value of 0 means all the nominated maps will be considered. gal_nom_qtyused 0
It does not say it will block more than 4 nominations in game, it says that when the voting starts it will consider all nominations if the cvar value is 0, or until the value specified. And it is doing that.


Quote:
Originally Posted by BeNq! View Post
4. Please delete GAL_MATCHING, because when is blocked more than 6 maps, this may result in crash. Check it.
Fixed.


Quote:
Originally Posted by BeNq! View Post
5. What do you think to add settings data hours?
It can be done. But is is out of a mapchooser plugin. You can use this plugin for hourly configurations.
The plugin Task Scheduler can do that.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
BeNq!
Senior Member
Join Date: Mar 2009
Old 07-20-2016 , 16:53   Re: Galileo v3.2.1-243 (a feature rich map voting plugin) | Last Update: 2016.07.20
Reply With Quote #288

WTF? Why runoff is not map? This is the vote:

1.
2.

0.

WTF? Galileo 3.2.1-243... Does not display the names of the map.

Last edited by BeNq!; 07-20-2016 at 16:53.
BeNq! is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-20-2016 , 18:48   Re: Galileo v3.2.2-248 (a feature rich map voting plugin) | Last Update: 2016.07.20
Reply With Quote #289

Released a new version:

2016-07-20 | v3.2.2-248
  1. Fixed run-off voting showing empty map names.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 07-21-2016 , 12:42   Re: Galileo v3.2.2-248 (a feature rich map voting plugin) | Last Update: 2016.07.20
Reply With Quote #290

Hello addons_zz

Great job on everything you have done so far.

Do you mind expanding Sven Co-op support?

You can use is_running("svencoop") to add some extra checks and to manipulate some specific cvars.

Examples:
PHP Code:
set_pcvar_stringg_cvar_amx_nextmapnextMap );
if(
is_running("svencoop"))
{
    
set_cvar_string"mp_nextmap_cycle"nextMap );

This controls the Next Map: [map name] text which appears in the scoreboard, which is tied to the mp_nextmap_cycle cvar. I know there are more references to amx_nextmap in your code but it was just an example.

Also:
PHP Code:
#include <hamsandwich> 
[plugin_init()]
PHP Code:
if(is_running("svencoop"))
{
    
RegisterHam(Ham_Use"game_end""voteNextmap");

PHP Code:
voteNextmap()
{
    [
call the vote next map methodto immediately change]

This allows the players to choose the nextmap everytime they complete the current one. I tested with server_cmd("gal_startvote") and it works (executing the command because it's a different .amxx plugin), and it would be better if you call the function directly.

Thanks in advance.
__________________

Last edited by gabuch2; 07-21-2016 at 12:43.
gabuch2 is online now
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 02:06.


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