AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   TOGs File Cleaner (https://forums.alliedmods.net/showthread.php?t=236027)

ThatOneGuy 02-26-2014 03:11

TOGs File Cleaner
 
Description
This plugin allows users to create as many setups as desired for managing servers files. When each setup is run, the plugin searches in the path set and determines if each file within the path matches the criteria set by the user in the .txt file. The .txt file can contain as few or as many setups as desired. For matching files, the specified action is then taken (either delete, move, or copy...there are plans for more in the future).

Download Package
Github Repository (Source Code)


See Github repository for plugin details and instructions.

ThatOneGuy 02-26-2014 03:18

Re: File Cleaner (v2.0)
 
-reserved-

ddhoward 02-26-2014 03:54

Re: File Cleaner (v2.0)
 
Perhaps an optional key that specifies the starting location of the desired string. For example, the logs start with a capitol L, right?

Code:

"SM Main Logs"
        {
                "enabled"                "0"
                "filepath"                "logs"
                "days"                        "3"
                "string"                "L"
                "start"                        "0"
                "case"                        "1"
                "extension"                ".log"
                "exclude"                "Chat"
        }

You'd just need to compare the return of the StrContains on line 177 with this value here. This will help to ensure that the wrong files aren't accidentally deleted (like if you accidentally made it case insensitive, for example.)

To clarify, if the string that StrContains was looking for is found at the VERY beginning of the bigger string, then the function will return 0. If it begins at the second character, it will return 1. Third character will return 2. Etc.

ThatOneGuy 03-30-2014 01:57

Re: File Cleaner (v2.0)
 
Quote:

Originally Posted by ddhoward (Post 2104427)
Perhaps an optional key that specifies the starting location of the desired string. For example, the logs start with a capitol L, right?

Code:

"SM Main Logs"
        {
                "enabled"                "0"
                "filepath"                "logs"
                "days"                        "3"
                "string"                "L"
                "start"                        "0"
                "case"                        "1"
                "extension"                ".log"
                "exclude"                "Chat"
        }

You'd just need to compare the return of the StrContains on line 177 with this value here. This will help to ensure that the wrong files aren't accidentally deleted (like if you accidentally made it case insensitive, for example.)

To clarify, if the string that StrContains was looking for is found at the VERY beginning of the bigger string, then the function will return 0. If it begins at the second character, it will return 1. Third character will return 2. Etc.

I may implement this in a future version. However, I will adjust the numbers so first char is 1, second=2, etc., blank=anywhere

ThatOneGuy 05-28-2014 18:38

Re: TOGs File Cleaner (v3.0)
 
Plugin updated to version 3.0.

Now supports searching within root directory.

ThatOneGuy 08-29-2015 02:00

Re: TOGs File Cleaner
 
Updated upon request to version 4.2. See changelog for changes.

itiap 12-17-2015 09:43

Re: TOGs File Cleaner
 
I have an SM error log.
I used the smx attached on your first post.
Code:

L 12/17/2015 - 15:42:11: [SM] Displaying call stack trace for plugin "togfilecleaner.smx":
L 12/17/2015 - 15:42:11: [SM]  [0]  Line 451, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::RunSetups()
L 12/17/2015 - 15:42:11: [SM]  [1]  Line 55, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::OnMapStart()


ThatOneGuy 12-17-2015 12:31

Re: TOGs File Cleaner
 
Quote:

Originally Posted by itiap (Post 2373259)
I have an SM error log.
I used the smx attached on your first post.
Code:

L 12/17/2015 - 15:42:11: [SM] Displaying call stack trace for plugin "togfilecleaner.smx":
L 12/17/2015 - 15:42:11: [SM]  [0]  Line 451, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::RunSetups()
L 12/17/2015 - 15:42:11: [SM]  [1]  Line 55, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::OnMapStart()


Is there more to the log? Can you paste your config somewhere? I'm seeing line 451 as:
Code:

if(DirExists(sRootFilePath) || StrEqual(sRootFilePath, "", false))
I dont see this line erroring out, so I'm guessing the lines arent the same (likely due to deleting comments at the top). My guess is that there is an error in your config. Upload it and i'll take a look. Also, paste in the error log around the above...it seems like there may be a line missing (perhaps not).

itiap 12-17-2015 18:23

Re: TOGs File Cleaner
 
1 Attachment(s)
I use the default one. I just disable what i dont need.

Code:

L 12/17/2015 - 15:42:11: [SM] Native "DirExists" reported: Invalid path. An empty path string is not valid, use "." to refer to the current working directory.
L 12/17/2015 - 15:42:11: [SM] Displaying call stack trace for plugin "togfilecleaner.smx":
L 12/17/2015 - 15:42:11: [SM]  [0]  Line 451, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::RunSetups()
L 12/17/2015 - 15:42:11: [SM]  [1]  Line 55, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::OnMapStart()

I don't know if you use a code like that. Franciso make a reply about that.
https://forums.alliedmods.net/showthread.php?p=2330328
Attachment 150577

ThatOneGuy 12-18-2015 00:08

Re: TOGs File Cleaner
 
Quote:

Originally Posted by itiap (Post 2373381)
I use the default one. I just disable what i dont need.

Code:

L 12/17/2015 - 15:42:11: [SM] Native "DirExists" reported: Invalid path. An empty path string is not valid, use "." to refer to the current working directory.
L 12/17/2015 - 15:42:11: [SM] Displaying call stack trace for plugin "togfilecleaner.smx":
L 12/17/2015 - 15:42:11: [SM]  [0]  Line 451, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::RunSetups()
L 12/17/2015 - 15:42:11: [SM]  [1]  Line 55, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::OnMapStart()

I don't know if you use a code like that. Franciso make a reply about that.
https://forums.alliedmods.net/showthread.php?p=2330328

Weird, it always worked perfect on my CSS servers. Just read on that other thread that some guy said the same and that it is a csgo file system issue. Either way, I'll make some edits.

EDIT: Have you tried putting a . in for filepath? Perhaps that is a simple fix on the config side that users can do...my worry is that i add the "." when it is detected blank and that that might cause it not to work properly for other games. I dont have much of a way to test from the computer I'm at right now, though I may just end up coding in csgo detection and doing it in that case for the root setups.


All times are GMT -4. The time now is 12:50.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.