All Projects → shravan2x → Gameloop.Vdf

shravan2x / Gameloop.Vdf

Licence: MIT license
A fast, easy-to-use Valve Data Format parser for .NET

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Gameloop.Vdf

vdf
📜 Package for working with Valve's text and binary KeyValue format
Stars: ✭ 146 (+143.33%)
Mutual labels:  steam, vdf, keyvalue
vdf
A Lexer and Parser for Valves Data Format (known as vdf) written in Go
Stars: ✭ 30 (-50%)
Mutual labels:  steam, vdf
vdf-parser
📜 Libraries to (de)serialize Valve's KeyValue format (VDF) in various languages
Stars: ✭ 70 (+16.67%)
Mutual labels:  vdf, keyvalue
Steam-Apps-Management-API
A basic Steam Application Management API and Valve Data Format (VDF) reader/writer.
Stars: ✭ 24 (-60%)
Mutual labels:  steam, vdf
Server-Creation-Tool
A Tool to easily create Server via SteamCMD
Stars: ✭ 33 (-45%)
Mutual labels:  steam
protonup
Install and Update Proton-GE
Stars: ✭ 436 (+626.67%)
Mutual labels:  steam
Steam-Tiles
Pin Tiles of your games from Steam to the Windows 10 Start Menu
Stars: ✭ 20 (-66.67%)
Mutual labels:  steam
SteamPS
Module that utilizes PowerShell as a wrapper for SteamCMD and engages with several Steam APIs.
Stars: ✭ 39 (-35%)
Mutual labels:  steam
plumeria
🤖 A Discord chat bot with rich data piping between commands
Stars: ✭ 35 (-41.67%)
Mutual labels:  steam
scam-links
Collection of phishing and malicious links that focuses on Steam and Discord scams.
Stars: ✭ 118 (+96.67%)
Mutual labels:  steam
Achievement-Watcher
A sexy achievement file parser with real-time notification, automatic screenshot and playtime tracking. View every achievements earned on your PC whether it's coming from Steam, a Steam emulator, and more.
Stars: ✭ 331 (+451.67%)
Mutual labels:  steam
Facepunch.Steamworks-MonoGame-Integration
Facepunch.Steamworks + MonoGame.Framework = the easiest SteamAPI Integration for your app!
Stars: ✭ 18 (-70%)
Mutual labels:  steam
Steamworks.Net-MonoGame-Integration
This repo is for everyone who is about to integrate the Steamworks.Net.dll into a MonoGame project. It shows some Steamworks.Net features and how easy it is to integrate it into a MonoGame project.
Stars: ✭ 30 (-50%)
Mutual labels:  steam
Fixator10-Cogs
Cogs for Red-DiscordBot. Including port of Stevy's V2 leveler.
Stars: ✭ 66 (+10%)
Mutual labels:  steam
steampak
Nicely packed tools to work with Steam APIs
Stars: ✭ 21 (-65%)
Mutual labels:  steam
pyXSteam
Python library for calculating properties of Steam and Water
Stars: ✭ 32 (-46.67%)
Mutual labels:  steam
steam.py
An async python wrapper to interact with the Steam API and its CMs
Stars: ✭ 74 (+23.33%)
Mutual labels:  steam
steamworks
Steamworks implementation in Go that doesn't require CGo
Stars: ✭ 21 (-65%)
Mutual labels:  steam
csgo-trader-extension
CSGO Trader Browser Extension to help with CS:GO item trading, marketing and much more
Stars: ✭ 86 (+43.33%)
Mutual labels:  steam
SteamTradeOffersBot
SteamBot fork that provides an easy-to-use Trade Offer library and a true generic inventory interface.
Stars: ✭ 45 (-25%)
Mutual labels:  steam

Vdf.NET

NuGet AppVeyor

A fast, easy-to-use Valve Data Format parser for .NET

Getting Binaries

Vdf.NET is available as a NuGet package. Binaries can also be found on the releases page.

Performance

Vdf.NET was originally written as an experiment in deserialization performance. It is significantly faster than alternatives like SteamKit's KeyValue and even Json.NET (though I admit Json.NET is far more feature rich).

The test source file is VdfNetBenchmark.cs. I used version Vdf.NET 0.4.1 and the TF2 schema, which is available both in JSON and VDF formats (you'll need an API key to obtain them).

The following are the times taken for 10 iterations of deserializing the schema on an Intel i7-4790k processor.

Vdf.NET (VDF)	    : 129ms, 501871ticks average
Json.NET (JSON)	    : 270ms, 1022480ticks average
SK2 KeyValue (VDF)  : 340ms, 1255055ticks average

Documentation

To deserialize a file importantInfo.vdf,

"Steam"
{
	"SSAVersion"		"3"
	"PrivacyPolicyVersion"		"2"
	"SteamDefaultDialog"		"#app_store"
	"DesktopShortcutCheck"		"0"
	"StartMenuShortcutCheck"		"0"
}

do

dynamic volvo = VdfConvert.Deserialize(File.ReadAllText("importantInfo.vdf"));
// 'volvo' is a VProperty, analogous to Json.NET's JProperty

// Now do whatever with this
Console.WriteLine(volvo.Value.SSAVersion); // Prints 3

Note the need to use .Value and skip the enclosing property name Steam. This is because root types in VDF are properties, as opposed to objects in traditional JSON.

Deserialization using models

Vdf.NET does not natively support deserializing to models, but this can be achieved indirectly using the Gameloop.Vdf.JsonConverter extension such as:

VProperty volvo = VdfConvert.Deserialize(File.ReadAllText("importantInfo.vdf"));
SteamModel sm = volvo.ToJson().ToObject<SteamModel>();

where SteamModel is something like

class SteamModel
{
	public int SSAVersion { get; set; } // Json.NET automatically converts strings to target types
	public int PrivacyPolicyVersion { get; set; }
	public string SteamDefaultDialog { get; set; }
	...
}

Extensions

Gameloop.Vdf.JsonConverter: VDF-JSON converters for Vdf.NET.

License

Vdf.NET is released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].