Comments (19)
Oh WOW, i gave it the filepath, not its contents 🤦
from gameloop.vdf.
Looks like the issue is caused by the platform conditionals. Vdf.NET has intentionally not supported them so far. I'll try to work on it.
from gameloop.vdf.
Thanks
from gameloop.vdf.
@Bluscream In the off chance that you're blocked on this, you could use a regex to strip the source data of conditionals and then parse that. It would come at the cost of some performance, but probably not unusable.
from gameloop.vdf.
Uhh, is that really needed?
from gameloop.vdf.
It won't be needed once proper support for conditionals is added to the library. If you need something that works until then, using a regex is an option.
from gameloop.vdf.
Ill just wait, thank you ^^
from gameloop.vdf.
Now i've got the same error when reading the gameinfo.txt of the sourcemod "Too Many Crates!"
gameinfo.txt
"GameInfo"
{
// This is what shows up in the 'Third Party Games' area of the Steam games list.
game "Too Many Crates!"
type singleplayer_only
developer "AwesomePossumGames"
developer_url "http://classes.dma.ucla.edu/Fall07/161A/projects/kyle/portfolio/index.html"
icon "materials/icon"
FileSystem
{
SteamAppId 215 // GCF for Source SDK Base
ToolsAppId 211 // Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc.
//
// The code that loads this file automatically does a few things here:
//
// 1. For each "Game" search path, it adds a "GameBin" path, in <dir>\bin
// 2. For each "Game" search path, it adds another "Game" path in front of it with _<langage> at the end.
// For example: c:\hl2\cstrike on a french machine would get a c:\hl2\cstrike_french path added to it.
// 3. For the first "Game" search path, it adds a search path called "MOD".
// 4. For the first "Game" search path, it adds a search path called "DEFAULT_WRITE_PATH".
//
//
// Search paths are relative to the base directory, which is where hl2.exe is found.
//
// |gameinfo_path| points at the directory where gameinfo.txt is.
// We always want to mount that directory relative to gameinfo.txt, so
// people can mount stuff in c:\mymod, and the main game resources are in
// someplace like c:\program files\valve\steam\steamapps\half-life 2.
//
SearchPaths
{
Game |gameinfo_path|.
Game hl2
}
}
}
from gameloop.vdf.
"Incomplete data" is a vague error, couldn't you show at which line/column the parser shits itself?
from gameloop.vdf.
"Incomplete data" is a vague error, couldn't you show at which line/column the parser shits itself?
That would be a pretty neat feature, thanks for the suggestion. Do you mind creating a separate issue for it?
Now i've got the same error when reading the gameinfo.txt of the sourcemod "Too Many Crates!"
The file you posted seems to be missing a lot of double-quotes. Is that accurate?
from gameloop.vdf.
That's what the mod ships by default. I tried a bunch of different gameinfo.txt files from different games and mods and they all throw the same error
from gameloop.vdf.
even the ones officially from HL2 use that format
from gameloop.vdf.
I just tested with the gameinfo.txt file you provided and it seems to parse correctly. The code I used to test:
dynamic res = VdfConvert.Deserialize(File.ReadAllText("gameinfo.txt"));
Console.WriteLine(res.Value.FileSystem.SearchPaths.Game);
from gameloop.vdf.
https://github.com/Bluscream/GMod-Mount-Manager/blob/master/Classes/GameInfo.cs#L46
this is my code
from gameloop.vdf.
I just tested with the gameinfo.txt file you provided and it seems to parse correctly.
maybe it has to do with the line endings or encoding?
from gameloop.vdf.
maybe it has to do with the line endings or encoding?
No way for me to tell unless you send me the raw file. Line endings can vary from line to line so your screenshot is insufficient. However, the parser already supports all line-endings so that's unlikely to be the issue.
from gameloop.vdf.
from gameloop.vdf.
Just tried running with your file. Deserialization succeeds as expected. Try creating a new project and running:
dynamic res = VdfConvert.Deserialize(File.ReadAllText("gameinfo.txt"));
Console.WriteLine(res.Value.FileSystem.SearchPaths.Game);
from gameloop.vdf.
Support added in eb8b8b8 .
from gameloop.vdf.
Related Issues (20)
- Allow reading / writing comments HOT 13
- How to serialize again? HOT 9
- Increase Parser error accuracy HOT 1
- System.Exception: Key 'gamelogo' already exists in object. HOT 3
- Newtonsoft.Json.JsonSerializationException: Unexpected token while deserializing object HOT 8
- Support complex root structures HOT 4
- Support preserving unquoted tokens
- Support C# 8 nullable types
- Add tests HOT 1
- Deserialize error when the string contains "//" HOT 2
- Values containing '\' character are not parsed properly HOT 2
- Changing value HOT 15
- Case insensitive option for ContainsKey and getter? HOT 1
- Publish with Strong Name HOT 3
- "WebStorage" section of config.vdf causes a System.IndexOutOfRangeException HOT 6
- How would i go about deserializing libraryfolders.vdf? (Format has changed) HOT 1
- There is a problem with Deserialization after the new steam client. HOT 5
- Something wrong with conditional HOT 4
- Could be an issue, just posting my problem. HOT 1
- VdfConvert deserializing comments somehow HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gameloop.vdf.