Page 11 of 163 FirstFirst ... 9101112132161111 ... LastLast
Results 101 to 110 of 1630
  1. #101
    Community Contributor
    Join Date
    Nov 2011
    Posts
    3,032
    Quote Originally Posted by Cermit View Post
    Yes running both in the same DB would be the easiest solution, but using that way causes one of the 2 servers to lose all stats (collected so far) when moving it to the DB on which one of the servers is running.
    That would not be the best thing in my interest, as both servers have been full almost 24/7 since release.
    Thatīs why I asked if it could be possible to simply read 2 different databases, and maybe not be forced to move everything to 1 DB...
    EDIT: It would be REALLY hard to combine the servers together I think since not only would the server IDs need to be changed, but all the player stats IDs would have to be reconstructed because stats IDs would need to be offset depending on which server ID they are referencing.

    But if you want to edit the code in StatsMain.php instead...

    In the database connection info area, replace:

    // DATABASE INFORMATION
    $db_host = ''; // database host
    $db_port = '3306'; // database port. default is 3306
    $db_name = ''; // database name
    $db_uname = ''; // database user name
    $db_pass = ''; // database password
    With:

    // DATABASE 1 INFORMATION
    $db_host1 = ''; // database host
    $db_port1 = '3306'; // database port. default is 3306
    $db_name1 = ''; // database name
    $db_uname1 = ''; // database user name
    $db_pass1 = ''; // database password
    $db1_connect = $db_host1 . ':' . $db_port1;
    $db1 = @mysql_connect($db1_connect, $db_uname1, $db_pass1, true);

    // DATABASE 2 INFORMATION
    $db_host2 = ''; // database host
    $db_port2 = '3306'; // database port. default is 3306
    $db_name2 = ''; // database name
    $db_uname2 = ''; // database user name
    $db_pass2 = ''; // database password
    $db2_connect = $db_host2 . ':' . $db_port2;
    $db2 = @mysql_connect($db2_connect, $db_uname2, $db_pass2, true);


    $db_number = array("$db1","$db2");
    Then, on Line 107 through 109, delete this (no longer necessary):

    // connect to the database if not already done
    @mysql_connect($db_connect, $db_uname, $db_pass);
    @mysql_select_db($db_name) or die ("<b><br/><br/>Unable to access stats database. Please notify this website's administrator.</b><br/>If you are the administrator, please seek assistance <a href='http://www.phogue.net/forumvb/showthread.php?3756-BF3-Server-Stats-page-for-XpKiller-s-BF3-Chat-GUID-Stats-and-Mapstats-Logger'>here</a>.<br/><br/></center></td></tr></table></div></td></tr></table></div></body></html>");
    Then, after this (line 140):

    $battlelink = $battlelog[$step];
    Add this:

    $db = $db_number[$step];
    Finally, include the database connection link at the end of each query.

    Replace this (on line 143):

    $query = @mysql_query("SELECT `CountPlayers`, `SumScore`, `SumKills` FROM tbl_server_stats WHERE `ServerID` = '$sid'");
    With this:

    $query = @mysql_query("SELECT `CountPlayers`, `SumScore`, `SumKills` FROM tbl_server_stats WHERE `ServerID` = '$sid'", $db);
    Replace this (on line 152):

    $current_players = @mysql_query("SELECT count(`TeamID`) AS count FROM tbl_currentplayers WHERE `ServerID` = '$sid'");
    With this:

    $current_players = @mysql_query("SELECT count(`TeamID`) AS count FROM tbl_currentplayers WHERE `ServerID` = '$sid'", $db);
    Replace this (on line 161):

    $map_query = @mysql_query("SELECT `mapName` FROM tbl_server WHERE `ServerID` = '$sid'");
    With this:

    $map_query = @mysql_query("SELECT `mapName` FROM tbl_server WHERE `ServerID` = '$sid'", $db);
    Replace this (on lines 170 and 171):

    @mysql_query("DELETE FROM ses_{$sid}_tbl WHERE `timestamp` <= '$old'");
    @mysql_query("OPTIMIZE TABLE ses_{$sid}_tbl");
    With this:

    @mysql_query("DELETE FROM ses_{$sid}_tbl WHERE `timestamp` <= '$old'", $db);
    @mysql_query("OPTIMIZE TABLE ses_{$sid}_tbl", $db);
    Replace this (on line 173):

    $session_count = @mysql_query("SELECT count(`IP`) AS count FROM ses_{$sid}_tbl WHERE 1");
    With this:

    $session_count = @mysql_query("SELECT count(`IP`) AS count FROM ses_{$sid}_tbl WHERE 1", $db);



    Untested but should work.
    Last edited by ty_ger07; 25-11-2013 at 21:34.

  2. #102
    Pretty happy with the index now, heres all the files if anybody wants to use/add it.

    http://jw.servegame.org/bf4stats/index.php
    Attached Files Attached Files

  3. #103
    This looks rly great, dude. Will give it a try tomorrow

  4. #104
    I actually tuned the graphs a bit:


    It can't graph the complete date, so I only show time here, one of our servers does about 30-50 rounds in a day.

  5. #105
    Community Contributor
    Join Date
    Nov 2011
    Posts
    3,032
    Looks really good. Would this be classified as server info or map stats (will map names be added)?

    I will get this on github soon and let you guys do as you wish. I am just finishing up an update.

  6. #106
    Senior Member
    Join Date
    Nov 2013
    Location
    Green Spring, WV
    Posts
    109
    Figured it out nvm deleted post.
    Last edited by lordicon; 25-11-2013 at 23:51. Reason: dont need the help.

  7. #107
    Quote Originally Posted by ty_ger07 View Post
    Looks really good. Would this be classified as server info or map stats (will map names be added)?
    I am actually not quite sure what I'll do with it, but I plan on making more graphs. I use pChart for it btw, so I actually generate and grab the code for it. I am doing the SQL part on my own.

    I'll also think I've tweaked it enough for the looks now:
    I will get this on github soon and let you guys do as you wish. I am just finishing up an update.
    Can't wait to do some additions!
    I could add mapnames as well, but problem is, there isn't much space for text.
    Last edited by CptChaos; 25-11-2013 at 23:19.

  8. #108
    Community Contributor
    Join Date
    Nov 2011
    Posts
    3,032
    Quote Originally Posted by lordicon View Post
    A lot of the code is not showing up for me, Not sure if its because im using the latest version found here, or if it is something do do with my settings in procon. No matter what the case hoping someone can take a look at the page and help me figure out why nothing else is logging, Would love to modify the site but want to get all the queries working first. Below is a link to my site so you can see from the first page whats going on.

    On the main page it does not show the Players Logged, Total Score or Total Kills then on the next page it doesn't show Top Players, Country Stats or Map Stats

    http://stats.thedecoy.net

    help me please i'm begging on my knees... not really but sounded good.
    What are your plugin settings in PRoCon? Are you using table suffixes? Do you have a lot of logging options disabled in the plugin?

  9. #109
    Community Contributor
    Join Date
    Nov 2011
    Posts
    3,032
    New update released on first page.

    The file is considerably larger, has a new directory structure, and has popular requests posted here lately.

  10. #110
    Community Contributor
    Join Date
    Nov 2011
    Posts
    3,032
    I added this project to GitHub.

    https://github.com/tyger07/BF4-Server-Stats

    I hope that this will help the project moving forward, solve issues and poor implementations, and keep things less fragmented.

    I am new to GitHub, so please feel free to offer suggestions if I am doing something wrong or should be doing something better in a different way.

    Thanks!

 

 

Tags for this Thread

Posting Permissions

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