Raised This Month: $32 Target: $400
 8% 

How to check if file is from Steam?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-13-2010 , 10:43   How to check if file is from Steam?
Reply With Quote #1

I want to detect if the file is custom or from Steam. Is it possible?
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 03-13-2010 , 11:44   Re: How to check if file is from Steam?
Reply With Quote #2

What file?

The closest thing that comes to mind is messing with FileExists and use the 2nd param to look in valve's file system...

EDIT: on second thought linux servers dont use GCF files, do they?
__________________
plop

Last edited by p3tsin; 03-13-2010 at 11:47.
p3tsin is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-13-2010 , 12:14   Re: How to check if file is from Steam?
Reply With Quote #3

I used term "Steam files" because that is how Valve called it in the pure_server_whitelist.txt. Custom files are all other files added by admins through the plugins (materials, models, etc).

Already tried FileExists (2nd param = true) but for some reason it returns "true" even for custom files.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
miniman
Senior Member
Join Date: Aug 2009
Location: Israel
Old 03-13-2010 , 13:36   Re: How to check if file is from Steam?
Reply With Quote #4

you can do so
new bool:Custom=FileExists(File,false);
new bool:Valve=FileExists(File,true);

if(Valve&&!Custom)
//the file in the GCF
else if(!Valve&&!Custom)
//file does not exist
else
//file is custom EDIT: or duplicated... (in the GCF and outside in same dirs)

not tested but may work

Last edited by miniman; 03-13-2010 at 13:41.
miniman is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-13-2010 , 13:43   Re: How to check if file is from Steam?
Reply With Quote #5

This doesn't work. Already tried.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
Darkimmortal
Senior Member
Join Date: Aug 2008
Old 03-13-2010 , 22:10   Re: How to check if file is from Steam?
Reply With Quote #6

The second parameter means it will also check the .gcf/.pak files, not only check them.

You'll probably have to go down the extension route, and looking at the source behind FileExists would probably be a good place to start.
__________________
Darkimmortal is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:58.


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