Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

got EOF or empty keyname While Reading csgo_english.txt (KeyValues) #258

Open
Alamer99 opened this issue Mar 25, 2016 · 8 comments
Open

Comments

@Alamer99
Copy link

Heres My Code:
static void Main(string[] args) { KeyValue csgo_english = new KeyValue(); csgo_english.ReadFileAsText(@"C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\resource\csgo_english.txt"); }

It Ends Up With An Error

System.Exception was unhandled
HResult=-2146233088
Message=RecursiveLoadFromBuffer: got EOF or empty keyname
Source=SteamKit2
StackTrace:
at SteamKit2.KeyValue.RecursiveLoadFromBuffer(KVTextReader kvr)
at SteamKit2.KeyValue.RecursiveLoadFromBuffer(KVTextReader kvr)
at SteamKit2.KVTextReader..ctor(KeyValue kv, Stream input)
at SteamKit2.KeyValue.ReadAsText(Stream input)
at SteamKit2.KeyValue.ReadFileAsText(String filename)
at Parse_CSGO_Language_File.Program.Main(String[] args) in c:\users------\documents\visual studio 2015\Projects\Parse CSGO Language File\Parse CSGO Language File\Program.cs:line 16
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

@Netshroud Netshroud added the bug label Mar 25, 2016
@Netshroud
Copy link

This is a known issue with how we handle conditionals - see #232.

@Alamer99
Copy link
Author

I Dont Want To Sound Like a Stupid But

Have You Ever Checked Valve's KeyValues.h And KeyValues.cpp

I Know Its C++ But Maybe You Could Find Something

@Netshroud
Copy link

Yes. This code is almost a 1:1 port of that.

Interestingly, it's conditional handling is virtually hardcoded, and looks to be somewhat out of date with the latest conditional options (e.g. $PS3).

@Alamer99
Copy link
Author

in my opinion hardcoded conditional is better
you dont expect someone to be using SteamKit2 on Xbox/PS3 Right?

@Netshroud
Copy link

No, but somebody using SteamKit might want to extract Xbox/PS3 data, or even Linux data when running on Windows, etc.

@Alamer99
Copy link
Author

good point however (not a c++ expert :P)
i noticed by reading valve's keyvalues they hardcoded it as _WIN32 so if we change it to _PS3 or _X360 that means it will extract the data we want right? if that works then maybe you can do it that way, make it hardcoded but the user can select which one he wants? (again i'm not a c++ expert that's just what came into my mind :) )

@yaakov-h yaakov-h modified the milestone: 2.next Sep 3, 2017
@xPaw
Copy link
Member

xPaw commented Sep 17, 2020

For anyone looking, this is supported in https://github.com/SteamDatabase/ValveKeyValue

@yaakov-h
Copy link
Member

And poorly in #684 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants