View Single Post
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 11-12-2009 , 04:38   Re: TF2 Stats With Web Ranking and Item Logger
Reply With Quote #2

When Updating:
  1. Back up your database (optional but recommended)
  2. Upload new .smx
  3. Configure your cfg with the new cvars as desired
  4. Restart server or reload the plugin.
  5. Run rank_debug_resetallcpcaps and rank_debug_resetallctfcaps commands to reset all CTF and CP cap records in the database.
    This is to clean out old tracking data that really wasn't correct at all.
    Note: These commands will not change any other stored values (eg, point totals).
-------------------------------------------------------------------------

To edit the database:
  1. Open your database in phpMyAdmin (Or with This App if you use SQLite) (Example).
  2. Browse to the "Players" table for player ranking data.
  3. Find the record you're looking for and edit it.
Note: The server will have to be stopped to re-upload the edited sqlite file. MySQL edits can be done live.
If deleting a player record, that player's record will not be recreated until they connect again.


FAQ:

I'm going to start a FAQ here for questions that get asked far too often.
These are mostly going to be for MySQL setups since SQLite is more or less foolproof.
Please read before posting!

Always make sure you are running the latest versions before reporting problems.
They may have already been fixed!

  • Q: I'm getting "mysql_fetch_array():" errors and my site doesn't work!
    A: Some of your database tables are missing. Most likely your Players table.

  • Q: I seem to be missing my "Players" database table, help!
    A: The plugin creates the players table the first time it is run. Install and run the plugin to create the table.

  • Q: Other database tables are missing!
    A: Run the SQL scripts included with the site version you happen to be using.

  • Q: How do I run the scripts?
    A: Using phpMyAdmin or another tool like it.

  • Q: I installed and ran the plugin, but it's not creating the "Players" table.
    A: Your databases.cfg file isn't configured correctly and the plugin has fallen back to using SQLite.

  • Q: I configured my databases.cfg file, but the plugin won't work.
    A: Ether your file is misconfigured, has incorrect information, or your MySQL server isn't allowing your MySQL user to connect from your gameserver's ip.

  • Q:How can I allow my gameserver to access my database?
    A: When you create a database user you will most likely be able to set access restrictions based on IP. You'll need to allow your gameserver's IP access. For more help, contact your web host.

  • Q:I gave my gameserver's IP access, but it's still being blocked.
    A: You have to use your gameserver box's physical IP, not the IP that srcds listens on. The correct IP should be provided in the error TF2Stats will generate.

Moving to MySQL from SQLite:
I do not support doing this any more, but you are welcome to try on your own.
  1. Grab your SQLite DB file located at /sourcemod/data/sqlite/tf2stats.sq3
  2. Use this program to open the file export the data from it.
  3. Setup the TF2 stats plugin with MySQL and let it create the table structures.
  4. Import the data *only the data* from the SQLite database.
If you directly copy the SQLite database to MySQL you will be missing a few columns which will cause plugin errors.

Note: Due to structure differences in the SQLite and MySQL database versions, you will have to do an INSERT INTO VALUES statement. You may be able to generate the required SQL by first importing in to intermediary database, exporting, and re-importing.

Last edited by DarthNinja; 12-20-2011 at 23:24.
DarthNinja is offline