Installation
  • 24 Jul 2022
  • 2 Minutes to read

    Installation


      Article Summary

      Installation is amazingly simple. In case you are using the Outpost Website Template, it is even easier.

      Installation (Database)

      1. Setup a MySQL/MariaDB with your hosting provider and get the credentials for it.
      2. Log into PHPMyAdmin or any other SQL browser and upload the ruststats.sql file (it is in the root directory of the zip file). This will setup your database.

      Installation (Web)

      1. Add the database credentials from the database installation to the config file
      2. Set a random secret key in the config and get your Steam API key from here
      3. Set ID's for each server you have available in the config file
      4. Upload the files to the webserver of your choice
        1. Outpost Template: Create a new folder called stats on your webspace (in the root directory of the outpost template). Move the files (located in /web in the zip file) into the stats folder of your webspace. If you did it right, there should be a Stats navigation element showing up.
        2. Own Website: Move the contents of the web folder in the zip file somewhere to your website where you want to have it available. We recommend using a folder instead of uploading it to the root directory.

      Installation (Rust)

      1. Edit the config file and add the corresponding server id and secret key for each server
      2. Add the API url to your Rust config: The API link is your website URL plus /stats/api.php attached to it. If you have uploaded it to your root directory, this would be as example: https://website.com/stats/api.php.
      3. If you want to exclude certain steam id's from being tracked, add them to your config
      4. Move the SimpleStats.cs file (in /rust folder in the .zip) into the oxide/plugins folder, and the SimpleStats.json file into the oxide/config folder.
      5. You're good to go, stats should now be tracked! Please keep in mind that due to the batching of events in can take some time until the first stats come up.

      Integration (Custom Website)

      The outpost template has automatic integration, this step is not needed if you are using it!

      If you are using a custom website, and not the Outpost template, you will need to include the statistics table somewhere on your website. To do so, you can use the following iframe code:

      <iframe src="stats/stats.php" style="width:100%;" onload="this.style.height=(this.contentWindow.document.body.scrollHeight+60)+'px';this.style.minHeight='650px';" title="Statistics"></iframe>
      

      The src attribute includes the link to your stats folder, including the stats.php file located in it. The iframe is set to a minimum height of 650px to be able to handle a default of 10 players per page. If you want to display more players on your table, you might need to increase this value.


      Was this article helpful?