1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

My sql database does not feeds from server

Discussion in 'BF2Statistics discussion' started by GooglieS, Apr 22, 2006.

  1. GooglieS

    GooglieS New Member

    The problem is that bu database "bf2statistics" is empty... In ASP/logs I have some files. The new file appears there after each round. But sql database does not contain any player data. Whats wrong?

    I have apache logd from my server:
    [client 192.168.100.4] PHP Notice: Undefined offset: 2693 in /home/www/html/bf2/ASP/bf2statistics.php on line 71
    [client 192.168.100.4] PHP Notice: Undefined index: import in /home/www/html/bf2/ASP/bf2statistics.php on line 77
    [client 192.168.100.4] PHP Notice: Undefined offset: 2669 in /home/www/html/bf2/ASP/bf2statistics.php on line 71
    [client 192.168.100.4] PHP Notice: Undefined index: import in /home/www/html/bf2/ASP/bf2statistics.php on line 77

    PS My game server and web/mysql server runs on a different PC
     
  2. GooglieS

    GooglieS New Member

    Both computers use linux. And one more question - how run bf2 server with "+dedicated 1 +ranked 1" under linux?
     
  3. D_Lusted

    D_Lusted New Member

    Sounds like there is something wrong with the lines stated in ASP/bf2statistics.php...

    Have you opened it with notepad, viewed lines 71 and 77 to see what is causing the problem?
     
  4. Mal

    Mal New Member

    you dont need the +dedicated 1 on linux.
    starting it in ranked mode: I use the bf2cc daemon and here you just add the -ranked switch when starting the daemon/server.
    So my guess is that it's similar with the original rcon. something like: ./start.sh -ranked.
     
  5. GooglieS

    GooglieS New Member

    Ok. Now i have a private rank icon when i press TAB during the game. Logs in ASP/logs still collecting. But sql base is stilll empty.. Only default data.
     
  6. GooglieS

    GooglieS New Member

    here is the line 77 from ASP/bf2statistics.php

    // Create backup file
    if ($data['import'] != 1)
    {
    $filename = '';
    if ($prefix != '') {$filename .= $prefix . '-';}
    $filename .= $mapname . '_' . date('ymd_Hi', (int)$gooddata[3]) . '.txt';
    $file = @fopen($logpath . '/' . $filename, 'wb');
    @fwrite($file, $rawdata);
    @fclose($file);
    }


    PS I set $allunlocks = 1;
    but unlocks did nop appear in game.

    Here is the path to my ASP folder - http://85.249.228.15:8080/ASP/
     
  7. MrNiceGuy

    MrNiceGuy Founder Staff Member

    here is your problem ---> 85.249.228.15:8080/ASP/
    Change it to ----> 85.249.228.15/ASP/

    And another problem ---> http://85.249.228.15:8080/ASP/getleaderboard.aspx?type=score&id=overall&pos=1&before=0&after=19

    Returns: No database selected
    [/html]
     
  8. GooglieS

    GooglieS New Member

    My web server is running on port 8080
    I cant run my web server on port 80
    Here is my settings from snapshot.py:
    HOST = '192.168.8.22' # server ip
    PORT = 8080 # server http port
    PATH = '/ASP/bf2statistics.php' # server path to script
    PREFIX = 'stat'


    192.168.8.22 is my internal IP
    I get my real ip address via DNAT.

    How fix the "Returns: No database selected" problem?
     
  9. MrNiceGuy

    MrNiceGuy Founder Staff Member

    If it is possible to redirect the server with 85.249.228.15:8080 bf2web.gamespy.com in your hosts file, then i guess it's okey...
    Have you added your database login in ASP/config.php??
     
  10. GooglieS

    GooglieS New Member

    Yes, I added my datbase name with user and password.
    Here is my hosts file from PC with web server:

    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost
    192.168.8.22 bf2web.gamespy.com
    85.249.228.15 bf2web.gamespy.com

    I tryed to use your import script. It says:
    Importing stat-gulf_of_oman_060423_0032.txt... done!
    Importing stat-gulf_of_oman_060423_1538.txt... done!
    Importing stat-kubra_dam_060424_0058.txt... done!
    .......
    Importing stat-gulf_of_oman_060423_0221.txt... done!
    Importing stat-gulf_of_oman_060423_0302.txt... done!
    Importing stat-wake_island_2007_060423_1603.txt... done!

    Total files imported: 40

    But database is stiil emty. I think that problem is in mysql. How can i check where is trouble?

    PS All unlocks option did npt works too !sad
    /*******************
    * Server Settings *
    *******************/

    $allunlocks = 1; // 0=earned, 1=all

    ?>
     
  11. MrNiceGuy

    MrNiceGuy Founder Staff Member

    Okey... Now do you see the issue i was talking about?

    You have to use port 80, there is no way to redirect via hosts file to port 8080... That is the first issue you have to fix.

    2'nd... You have imported the sql file right?

    [/html]
     
  12. GooglieS

    GooglieS New Member

    I've checked the sql permissions - web client is working fine. So the problem is not is mysql permissionss. I use port 8080 instead standart 80 - may here is the problem? But logs in ASP/logs folder still appears after each round. Ok - i'll try to use 80 port. But it is a problem, because I have a web site on it. SQL is imported.
     
  13. GooglieS

    GooglieS New Member

    Looks like that it works on 80 port! Can it run on any other port? But import script does not work :(
     
  14. GooglieS

    GooglieS New Member

    Strange, but in does not works now! I didn't anything with configs of my servers... The statistics logged only 1 round of 3...
     
  15. MrNiceGuy

    MrNiceGuy Founder Staff Member

    I dont see any problems with running the ASP backend on the same port as the site is on, as long as you dont have anything else in your ASP dir... So the best and only way to do it, is to run it on port 80.
    I can see now, that you have got some working atleast, and that is wery good...
    This is the leaderboard:
    http://85.249.228.15/ASP/getleaderboard.aspx?type=score&id=overall&pos=1&before=0&after=19
    and this is for 1 of the players:
    http://85.249.228.15/ASP/getplayerinfo.aspx?pid=63411549&info=per*,cmb*,twsc,cpcp,cacp,dfcp,kila,heal,rviv,rsup,rpar,tgte,dkas,dsab,cdsc,rank,cmsc,kick,kill,deth,suic,ospm,klpm,klpr,dtpr,bksk,wdsk,bbrs,tcdr,ban,dtpm,lbtl,osaa,vrk,tsql,tsqm,tlwf,mvks,vmks,mvn*,vmr*,fkit,fmap,fveh,fwea,wtm-,wkl-,wdt-,wac-,wkd-,vtm-,vkl-,vdt-,vkd-,vkr-,atm-,awn-,alo-,abr-,ktm-,kkl-,kdt-,kkd-
    Remember that the system might come up with errors, if the player doesnt have much data in the db at all.
    The rest is just a mather of fine tuning. :)
     
  16. GooglieS

    GooglieS New Member

    We played 3x3 now, but statistics was updated only for one player. Log from httpd server:
    [client 192.168.8.22] PHP Notice: Undefined index: pid in /home/www/html/gallery/ASP/getleaderboard.aspx on line 47
    [client 192.168.8.22] PHP Notice: Undefined index: before in /home/www/html/gallery/ASP/getleaderboard.aspx on line 51
    [client 192.168.8.22] PHP Notice: Undefined index: pos in /home/www/html/gallery/ASP/getleaderboard.aspx on line 52
     
  17. GooglieS

    GooglieS New Member

    Statistics is updating only to player with nick " ALF ---1ALF" http://192.168.8.22/bf2statistics/
     
  18. Mal

    Mal New Member

    you posted your intranet IP (192.168.8.22).
    It can't be accessed from the outside so the link won't work for us
     
  19. GooglieS

    GooglieS New Member

    Sorry! Here is my internet address: http://85.249.228.15/bf2statistics/
     
  20. MrNiceGuy

    MrNiceGuy Founder Staff Member

    That didnt work either....