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

Using custom mapfile doesn't work #21

Closed mo0nsniper closed 8 years ago

mo0nsniper commented 8 years ago

Hi,

I'm trying to use a custom map file for voting but it doesn't work. I have used gal_vote_mapfile "*" and gal_vote_mapfile "mapcycle.txt" wich works. But using custom files for voting doesn't work. Like: gal_vote_mapfile "addons/amxmodx/configs/maps_big.ini" or gal_vote_mapfile "/addons/amxmodx/configs/maps_big.ini"

The file addons/amxmodx/configs/maps_big.ini exists.

I have compiled the plugin with DEBUG 1 and here is the output: http://pastebin.com/PB1H4rZM

Bellow is my setup: galileo.cfg

status
hostname:  CS.MIEZ.ro | STEAM Only |   NOVEMBER Update
version :  48/1.1.2.7/Stdio 921 secure  (10)
tcp/ip  :  94.176.2.150:27015
map     :  fy_cluj at: 0 x, 0 y, 0 z
players :  0 active (26 max)

#      name userid uniqueid frag time ping loss adr
0 users
    version
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 21:15:26 Oct 19 2016 (921)
ReHLDS API version 2.13
    meta list
Currently loaded plugins:
      description      stat pend  file              vers      src   load  unlod
 [ 1] SafeNameAndChat  RUN   -    SafeNameAndChat.  v1.0      ini   ANY   ANY
 [ 2] AMX Mod X        RUN   -    amxmodx_mm_i386.  v1.8.3-d  ini   Start ANY
 [ 3] Rechecker        RUN   -    rechecker_mm_i38  v2.0      ini   Chlvl ANY
 [ 4] WHBlocker        RUN   -    whblocker_mm_i38  v1.5.626  ini   Chlvl ANY
 [ 5] GeoIP            RUN   -    geoip_amxx_i386.  v1.8.3-d  pl2   ANY   ANY
 [ 6] hackdetector     RUN   -    hackdetector_amx  v0.15.30  pl2   ANY   ANY
 [ 7] CStrike          RUN   -    cstrike_amxx_i38  v1.8.3-d  pl2   ANY   ANY
 [ 8] FakeMeta         RUN   -    fakemeta_amxx_i3  v1.8.3-d  pl2   ANY   ANY
 [ 9] Ham Sandwich     RUN   -    hamsandwich_amxx  v1.8.3-d  pl2   ANY   ANY
 [10] Engine           RUN   -    engine_amxx_i386  v1.8.3-d  pl2   ANY   ANY
 [11] MySQL            RUN   -    mysql_amxx_i386.  v1.8.3-d  pl2   ANY   ANY
 [12] CSX              RUN   -    csx_amxx_i386.so  v1.8.3-d  pl2   ANY   ANY
 [13] Fun              RUN   -    fun_amxx_i386.so  v1.8.3-d  pl2   ANY   ANY
13 plugins, 13 running
    amxx list
Currently loaded plugins:
       name                    version     author            file             status
 [  1] Aliases checker         1.0.3       kanagava          alias_detector.  running
 [  2] TimePass-AC             9.0         Challenge         TP_aim.amxx      running
 [  3] Advanced Bans           0.8.1       Exolent & mo0n_s  advanced_bans.a  running
 [  4] Admin Base              1.8.3-dev+  AMXX Dev Team     admin.amxx       running
 [  5] Admin Commands          1.8.3-dev+  AMXX Dev Team     admincmd.amxx    running
 [  6] Admin Help              1.8.3-dev+  AMXX Dev Team     adminhelp.amxx   running
 [  7] Slots Reservation       1.8.3-dev+  AMXX Dev Team     adminslots.amxx  running
 [  8] Multi-Lingual System    1.8.3-dev+  AMXX Dev Team     multilingual.am  running
 [  9] Menus Front-End         1.8.3-dev+  AMXX Dev Team     menufront.amxx   running
 [ 10] Commands Menu           1.8.3-dev+  AMXX Dev Team     cmdmenu.amxx     running
 [ 11] Players Menu            1.8.2       AMXX Dev Team     plmenu.amxx      running
 [ 12] Maps Menu               1.8.3-dev+  AMXX Dev Team     mapsmenu.amxx    running
 [ 13] Plugin Menu             1.8.3-dev+  AMXX Dev Team     pluginmenu.amxx  running
 [ 14] AMXX Gag                1.5.0       xPaw & mo0n_snip  amx_gag.amxx     running
 [ 15] Admin Chat              1.8.3-dev+  AMXX Dev Team     adminchat.amxx   running
 [ 16] Anti Flood              1.8.3-dev+  AMXX Dev Team     antiflood.amxx   running
 [ 17] Scrolling Message       1.8.3-dev+  AMXX Dev Team     scrollmsg.amxx   running
 [ 18] Info. Messages          1.8.3-dev+  AMXX Dev Team     imessage.amxx    running
 [ 19] Admin Votes             1.8.2       AMXX Dev Team     adminvote.amxx   running
 [ 20] Galileo                 v3.2.4-248  Brad Jones/Addon  galileo.amxx     running
 [ 21] TimeLeft                1.8.3-dev+  AMXX Dev Team     timeleft.amxx    running
 [ 22] Pause Plugins           1.8.3-dev+  AMXX Dev Team     pausecfg.amxx    running
 [ 23] Stats Configuration     1.8.3-dev+  AMXX Dev Team     statscfg.amxx    running
 [ 24] Restrict Weapons        1.8.3-dev+  AMXX Dev Team     restmenu.amxx    running
 [ 25] StatsX                  1.8.3-dev+  AMXX Dev Team     statsx.amxx      running
 [ 26] CS Stats Logging        1.8.3-dev+  AMXX Dev Team     stats_logging.a  running
 [ 27] AMX Client Exec         0.03        v3x               amx_exec.amxx    running
 [ 28] Admin Spectator ESP     1.4_beta    KoST&mo0n_sniper  admin_spec_esp.  running
 [ 29] Autoresponder/Advertis  0.5         MaximusBrood      ad_manager.amxx  running
 [ 30] All Chat                1.1         Ian Cammarata     allchat.amxx     running
 [ 31] MIEZ - Reset Score      1.0         Silenttt&mo0n_sn  resetscore.amxx  running
 [ 32] Auto Demo Recorder      1.5         IzI&mo0n_sniper   amx_demorecorde  running
 [ 33] MIEZ - amx_ss           1.0         Askhanar & mo0n_  amx_ss.amxx      running
 [ 34] AMX Blind               1           snoopy            amx_blind.amxx   running
 [ 35] MIEZ - BHPK             2.7         Lev & mo0n_snipe  amx_hpk.amxx     running
 [ 36] MIEZ - admin_who        1.0         mo0n_sniper&eXtr  admin_who.amxx   running
 [ 37] AMX Transfer            1.2         Deviance          amx_transfer.am  running
 [ 38] Flash Remote Control    12.0        OT                flashbang_remot  running
 [ 39] c4 timer                1.1         cheap_suit        c4timer.amxx     running
 [ 40] Play or Be Kicked       1.5.243     Brad Jones & mo0  pbk.amxx         running
 [ 41] Last Maps Time          0.0.1       Exolent           last_maps_time.  running
41 plugins, 41 running
evandrocoan commented 8 years ago

Hi, thanks for the log, but do not use the level 1, it hide several information. May you use the level 16? You just need to run one time the server with it. Basically:

  1. Set the level to 16.
  2. Set your settings, which you reported it is not working.
  3. Join the server.
  4. Open your console and type gal_startvote.
  5. Wait the voting to finish.
  6. Post here the log file.
/**
 * This is to view internal program data while execution. See the function 'debugMesssageLogger(...)'
 * and the variable 'g_debug_level' for more information. Usage example, to enables several levels:
 * #define DEBUG_LEVEL 1+2+4+16
 *
 * @note when the 'DEBUG_LEVEL_FAKE_VOTES' is activated, usually the voting will be approved
 * because it creates also a fake players count. So, do not enable 'DEBUG_LEVEL_FAKE_VOTES'
 * if you do not want the map voting starting on an empty server.
 *
 * 0   - Disables this feature.
 * 
 * 1   - Normal/basic debugging/depuration.
 *
 * 2   - a) To skip the 'pendingVoteCountdown()'.
 *       b) Set the vote runoff time to 5 seconds.
 *       c) Run the NORMAL Unit Tests.
 *
 * 4   - Run the DELAYED Unit Tests.
 *
 * 8   - a) To create fake votes. See the function 'create_fakeVotes()'.
 *       b) To create fake players count. See the function 'get_realplayersnum()'.
 *
 * 16   - Enable DEBUG_LEVEL 1 and all its debugging/depuration available.
 *
 * 31  - Enable the levels 1, 2, 4, 8 and 16.
 * 
 * Default value: 0
 */
#define DEBUG_LEVEL 16
mo0nsniper commented 8 years ago

Sure, I can set DEBUG 16. But I have set it before and my server crashed so I said I'll stick to 1.

I have set DEBUG 16 and when I entered the command gal_startvote I got the message that Starting vote failed no maps found.

http://pastebin.com/YptAxr86

evandrocoan commented 8 years ago

Thank your for doing it. From the log, this are the relevant lines:

L 11/03/2016 - 07:11:11: {22.505 11684 -1230    0}     map_populateList(...) Loading the PASSED FILE! mapFilePath: addons/amxmodx/configs/maps_big.ini
L 11/03/2016 - 07:11:11: {22.505 11660 -1230    0} I AM ENTERING ON loadMapFileList(3) | mapFilePath: addons/amxmodx/configs/maps_big.ini
L 11/03/2016 - 07:11:11: {22.505 11400 -1126  104}
L 11/03/2016 - 07:11:11: {22.505 11684 -1126    0} I AM EXITING map_populateList(4) mapCount: 0

Here we may see, it really found you map file, otherwise we would see ( loadMapFileList ) Error .... Then the only possible thing is this code:

stock loadMapFileList( Array:mapArray, mapFilePath[], Trie:fillerMapTrie = Invalid_Trie )
{
    LOGGER( 128, "I AM ENTERING ON loadMapFileList(3) | mapFilePath: %s", mapFilePath )

    new mapCount;
    new mapFile = fopen( mapFilePath, "rt" );

    if( mapFile )
    {
        new loadedMapName[ MAX_MAPNAME_LENGHT ];

        while( !feof( mapFile ) )
        {
            fgets( mapFile, loadedMapName, charsmax( loadedMapName ) );
            trim( loadedMapName );

            if( loadedMapName[ 0 ]
                && !equal( loadedMapName, "//", 2 )
                && !equal( loadedMapName, ";", 1 )
                && IS_MAP_VALID( loadedMapName ) )
            {
                if( fillerMapTrie )
                {
                    TrieSetCell( fillerMapTrie, loadedMapName, 0 );
                }

                #if defined DEBUG
                    static currentIndex = 0;

                    if( currentIndex < 100 )
                    {
                        LOGGER( 4, "( loadMapFileList ) %d, loadedMapName: %s", ++currentIndex, loadedMapName )
                    }
                #endif

                ArrayPushString( mapArray, loadedMapName );
                ++mapCount;
            }
        }

        fclose( mapFile );
        LOGGER( 4, "" )
    }
    else
    {
        LOGGER( 1, "( loadMapFileList ) Error %d, %L", AMX_ERR_NOTFOUND, LANG_SERVER, "GAL_MAPS_FILEMISSING", mapFilePath )
        log_error( AMX_ERR_NOTFOUND, "%L", LANG_SERVER, "GAL_MAPS_FILEMISSING", mapFilePath );
    }

    return mapCount;
}

When it is doing fgets it is not getting anything valid. May you send your file maps_big.ini? It could be a problem on the line endings. Which one are you using? You system is Linux or Windows?

mo0nsniper commented 8 years ago

I'm using linux, and the file is unix format. I have sent you a copy at your email address.

evandrocoan commented 8 years ago

Hi, I got your email, thanks for the information.

The problem is that you cannot put .bsp on the maps' name ending, so just remove them from the maps. As:

de_dust.bsp
de_dust2.bsp

Must to be:

de_dust
de_dust2
evandrocoan commented 8 years ago

Now the new version to be released will write a warning on the server console showing the loaded maps file contents. Do you got it working?

Also, for the development, I Added support to map names ending with .bsp extension on the voting map list.

mo0nsniper commented 8 years ago

Great, It works now. Thanks. I think the .bsp extension was needed for mapchooser4