Raised This Month: $ Target: $400
 0% 

Is it possible read .vpk as a directory?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LinLinLin
Senior Member
Join Date: Sep 2021
Old 01-16-2024 , 14:58   Is it possible read .vpk as a directory?
Reply With Quote #1

So we can get the folder and read the txt file in vpk.
LinLinLin is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 01-16-2024 , 15:03   Re: Is it possible read .vpk as a directory?
Reply With Quote #2

VPK_API (Reader and Writer) or you could try using OpenDirectory() and OpenFile() with the "use_valve_fs" option set to "true"
__________________

Last edited by Silvers; 01-16-2024 at 15:04.
Silvers is offline
LinLinLin
Senior Member
Join Date: Sep 2021
Old 01-16-2024 , 15:31   Re: Is it possible read .vpk as a directory?
Reply With Quote #3

i want to use vpk name as a key to store the mission, so it can show the vpk name instead the value of "Name" when showing the map list on menu.

Last edited by LinLinLin; 01-16-2024 at 15:32.
LinLinLin is offline
Forgetest
Member
Join Date: Aug 2020
Old 01-17-2024 , 15:55   Re: Is it possible read .vpk as a directory?
Reply With Quote #4

Likely impossible to do it in your way, but it's possible to get a list of all VPK names.
Try saving the output of command show_addon_metadata with ServerCommandEx (make sure the buffer is big enough), or just use the attached plugin and the gamedata.
Attached Files
File Type: sp Get Plugin or Get Source (t.sp - 63 views - 2.3 KB)
File Type: txt s_vecAddonMetadata.txt (719 Bytes, 43 views)
Forgetest is offline
LinLinLin
Senior Member
Join Date: Sep 2021
Old 01-19-2024 , 14:47   Re: Is it possible read .vpk as a directory?
Reply With Quote #5

i have made a plugin by myself, you can check it in this
only read vecAddonMetadata in address is suitable since we don't know how big the buffer of command "show_addon_metadata" will return.

the data struct is path[128], mission_name[128] and int( 8 ) type, so the offset is 264 after one of that.

There is still a problem when get all of the vpk, since dword_38EAB0 is not easy to get.
I use addonlist.txt to sum of addon list, but if a map is Multi-packet of vpk, it is not correct.

Last edited by LinLinLin; 01-19-2024 at 14:57.
LinLinLin is offline
Reply



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 19:56.


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