Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[TF2] Http Replay Cleaner Redux


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7 490
  • Lokalizacja:AMXX.PL
Offline

Napisano 09.01.2015 22:50

[TF2] Replay Cleaner Redux
Version 2.0.0

Original by DarthNinja : https://forums.allie...ad.php?t=157867


Description:
Replays taking up way too much space on your HTTP server? You need this!

With this plugin, replay files older then a set number of days are automatically deleted when the replay folder exceeds a set disk usage quota.

This version was posted with permission by Darth, it has been redesigned to use a Curl post rather than forcing a quiet MOTD on clients, it sends everything via post and now has a security key cvar in order to keep things secure.

Commands:

  • None
Cvars:
  • sm_replaycleanup_version
    • Plugin version.
  • sm_replaycleanup_enable
    • Enable/Disable the plugin.
    • Default: 1
  • sm_replaycleanup_cachesize
    • The amount of space in MB that replays must be using before any will be deleted.
    • Default: 1024 (aka, 1 GB)
  • sm_replaycleanup_days
    • Files older than this many days will be deleted.
    • Default: 4
  • sm_replaycleanup_link
  • sm_replaycleanup_localpath
    • Location of your replay files relative to the php script.
    • Eg, tf/2/
  • sm_replaycleanup_save_logfile
    • Should a log file be saved to CleaningSessions.log on the webserver?
    • Default: 1
  • sm_replaycleanup_autoprune
    • The time in hours to attempt to auto-prune replays (for servers that don't have rounds).
    • Default: 0 (Disabled)
  • sm_replaycleanup_secretkey
    • Your secret key to keep people from posting to your page.

Install Instructions:

  • Upload the php script to a folder above where the replay files are stored.
  • Chmod the folder with php script and the folders that have the replay files to 777.
  • Edit the replaycleaner.php file to add in your secret key. You only need to edit the top line.
  • Code: //EDIT THIS ONLY

    $secret_key = ";

    //DO NOT EDIT ANYTHING ELSE
  • Install the plugin
  • When loaded, the plugin will create a config file at tf/cfg/sourcemod/HTTPReplayCleanup.cfg
    Set the above cvars in the config file.
  • Restart the server or change maps to reload the config.
Example Setup:

  • Your replay files are saved to http://yoursite.com/...eplays/server1/.
  • You could drop the php file in the /tf2/ folder and name it "cleanup.php".
  • You would then set sm_replaycleanup_link to "www.yoursite.com/tf2/cleanup.php".
  • You would then set sm_replaycleanup_localpath to "replays/server1/"

Notes:
  • Files are deleted at the end of each round.
  • Example Logfile:


    Code: Session started - Fri, 27 May 2011 19:14:44 CDT
    The total filesize of "teamfortress/server1/" is: 500.89 MB. Maximum 500 MB allowed
    Deleting files from more than 1 days ago:
    ---------------------
    Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_15.block - 83.79KB - Thu, 26 May 2011 19:14:08 CDT
    Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_11.block - 97.25KB - Thu, 26 May 2011 19:13:08 CDT
    Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_10.block - 84.62KB - Thu, 26 May 2011 19:12:53 CDT
    Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_12.block - 83KB - Thu, 26 May 2011 19:13:22 CDT
    -Snip-
    Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_13.block - 90.48KB - Thu, 26 May 2011 19:13:38 CDT
    Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_17.block - 84.61KB - Thu, 26 May 2011 19:14:37 CDT
    Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_16.block - 85.87KB - Thu, 26 May 2011 19:14:23 CDT
    Deleting teamfortress/server1/20110526-201000-ctf_2fort_part_14.block - 98.27KB - Thu, 26 May 2011 19:13:53 CDT
    ---------------------
    Total files deleted: 788 - The NEW total filesize of "teamfortress/server1/" is: 300.2MB.
Version History:
  • V1.0.0
    • Initial Release
  • V1.1.1
    • Fixed a potential infinite loop if the round ends and there are no human players.
    • Added a cvar to make the plugin prune replays via a timer
  • V2.0.0
    • Resigned to use a Curl post rather than an Motd open
    • Added the cvar sm_replaycleanup_secretkey which needs to be set on both ends in order to maintain security



Attached Files Dołączona grafikaReplayCleanup.smx (5.0 KB) Dołączona grafikaGet Plugin or Get Source (ReplayCleanup.sp - 3.5 KB) Dołączona grafikaHTTP Replay Cleaner.zip (9.3 KB)

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych