Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: CoD4 - MySQL problem

  1. #11
    Private
    Join Date
    Feb 2013
    Location
    Poland
    Posts
    32
    Thanks
    33
    Thanked 27 Times in 8 Posts
    Set it to:

    Code:
    export LD_LIBRARY_PATH="/home/cod4/server/libs:/home/cod4/server/libs/mysql"
    export LD_PRELOAD="/home/cod4/server/libs/libcod4_1_7.so"
    
    cd /home/cod4/server
    ./cod4_lnxded-bin +set dedicated "2" +set net_port "28961" +set fs_basepath "/home/cod4/server" +set fs_homepath "/home/cod4/server" +set fs_game "mods/nl_zom" +exec zom.cfg +map_rotate
    Still nothing...

  2. #12
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Any LD warning? Post the output
    timescale 0.01

  3. #13
    Private
    Join Date
    Feb 2013
    Location
    Poland
    Posts
    32
    Thanks
    33
    Thanked 27 Times in 8 Posts

  4. #14
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    There is nothing in the log file, I need the Putty output ala:

    Code:
    k_deathrun@Debian-70-wheezy-64-LAMP:~$ ./server_zombots.sh
    > [WARNING] Compiled for: 210
    Compiled: Sep 17 2013 23:08:19
    > [INFO] value of closer=08111d32
    > [PLUGIN LOADED]
    CoD2 MP 1.0 build linux-i386 Oct 24 2005
    ----- FS_Startup -----
    Current search path:
    /home/k_deathrun/zombots
    /home/k_deathrun/main/iw_14.iwd (4038 files)
    /home/k_deathrun/main/iw_13.iwd (22624 files)
    /home/k_deathrun/main/iw_12.iwd (1016 files)
    /home/k_deathrun/main/iw_11.iwd (1462 files)
    /home/k_deathrun/main/iw_10.iwd (1936 files)
    /home/k_deathrun/main/iw_09.iwd (2142 files)
    /home/k_deathrun/main/iw_08.iwd (2723 files)
    /home/k_deathrun/main/iw_07.iwd (3384 files)
    /home/k_deathrun/main/iw_06.iwd (990 files)
    /home/k_deathrun/main/iw_05.iwd (928 files)
    timescale 0.01

  5. #15
    Private
    Join Date
    Feb 2013
    Location
    Poland
    Posts
    32
    Thanks
    33
    Thanked 27 Times in 8 Posts
    Code:
    root@mynl.pl:~# /home/cod4.sh
    > [WARNING] Compiled for: COD_VERSION
    > [INFO] value of closer=080c206e
    CoD4 MP 1.7 build linux-i386 Jun 28 2008
    begin $init
    ----- FS_Startup -----
    Current language: english
    Current search path:
    /home/cod4/server/mods/nl_zom
    /home/cod4/server/main/iw_13.iwd (265 files)
    /home/cod4/server/main/iw_12.iwd (33 files)
    /home/cod4/server/main/iw_11.iwd (448 files)
    /home/cod4/server/main/iw_10.iwd (230 files)
    /home/cod4/server/main/iw_09.iwd (447 files)
    /home/cod4/server/main/iw_08.iwd (66 files)
    /home/cod4/server/main/iw_07.iwd (34 files)
    /home/cod4/server/main/iw_06.iwd (416 files)

  6. #16
    Private
    Join Date
    Feb 2013
    Location
    Poland
    Posts
    32
    Thanks
    33
    Thanked 27 Times in 8 Posts
    console_mp.log
    Code:
    scriptengine> wrongs args for mysql_real_connect(...);
    _config.gsc
    PHP Code:

        level
    .mysqlUser "user";
        
    level.mysqlAdress "mynl.pl";
        
    level.mysqlPort "3306";
        
    level.mysqlDb "cod4_zom";
        
    level.mysqlPass "pass"
    mysql.gsc
    PHP Code:
        host level.mysqlAdress;
        
    user level.mysqlUser;
        
    pass level.mysqlPass;
        
    db level.mysqlDb;
        
    port level.mysqlPort;
        
        
        
    mysql mysql_init();
        
        if ( ! 
    isDefined(mysql))
        {
            
    std\io::println("mysql not defined!");
            return;    
        }

        
    std\io::println("mysql=" + ("2"+2) + "\n");
        
        
    ret mysql_real_connect(mysqlhostuserpassdbport);

        ... 

  7. #17
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    port is int (a number), you would be better off just re-using the data/code-separation with cvar's
    timescale 0.01

  8. The Following User Says Thank You to kung foo man For This Useful Post:

    BlancO (23rd September 2013)

  9. #18
    Private
    Join Date
    Feb 2013
    Location
    Poland
    Posts
    32
    Thanks
    33
    Thanked 27 Times in 8 Posts
    Thanks, for replay. After dealing with a few problems with mysql I get error:

    Code:
    /home/cod4.sh: line 2:  3922 Naruszenie ochrony pamięci  LD_LIBRARY_PATH="/home/cod4/server/libs:/home/cod4/server/libs/mysql" LD_PRELOAD="/home/cod4/server/libs/libcod4_1_7.so" ./cod4_lnxded +set dedicated "2" +set net_port "41" +set fs_basepath "/home/cod4/server" +set fs_homepath "/home/cod4/server" +set fs_game "mods/nl_zom" +exec zom.cfg +map_rotate
    English
    "Naruszenie ochrony pamięci" = "Segfault" or "Segmentation fault"

    After calling to MySQL query:
    PHP Code:
    theQuery "SELECT * FROM players"

  10. #19
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Most likely the result of a null pointer given to mysql_query(). You need to save the return value of mysql_init() in level.mysql e.g. and reuse it for every query.

    You can just print the pointer (an int), to see its value: std\io::println("mysql pointer: " + mysql);
    timescale 0.01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •