C# KV Parser / Writer for .NET

Discussion in 'Coding' started by recon, Sep 7, 2009.

  1. recon

    recon SM Support Dev

    Messages:
    2,348
    Likes Received:
    0
    Trophy Points:
    0
    In the process of creating a GUI for the SM admin and group config files (link), I wrote a C# KV parser and writer for .NET.

    You can download binaries or source code from the project's tracker.

    Thanks to Kylegar messaging me, the parser has been vastly improved since 1.0.x, and now supports more relaxed KV syntax.
     
  2. MOOtant

    MOOtant Member

    Messages:
    4,047
    Likes Received:
    0
    Trophy Points:
    0
    Long, long time ago I wrote some weapon damage calculator which had script parser with it. It was written in C# and there may be a link to it still on forums.
     
  3. recon

    recon SM Support Dev

    Messages:
    2,348
    Likes Received:
    0
    Trophy Points:
    0
    Long ago, in a far away forum... Oh wait, here it is.

    I take it you don't believe in commenting your code?
     
    Last edited: Sep 8, 2009
  4. Kylegar

    Kylegar Specstax Rule

    Messages:
    2,170
    Likes Received:
    0
    Trophy Points:
    0
    well, you over comment your code :P
    Code:
     if(blahblah)
    {
    
    
    }//end if(blahblah)
    
     
  5. recon

    recon SM Support Dev

    Messages:
    2,348
    Likes Received:
    0
    Trophy Points:
    0
    The sentence was "I take it you don't believe in commenting your code", not "I take it you don't believe in commenting your code."
     
  6. MOOtant

    MOOtant Member

    Messages:
    4,047
    Likes Received:
    0
    Trophy Points:
    0
    "grammar" file explains everything.

    I guess that you know how to make simple tokenizers and LL parsers. If not, grab a book.
     
  7. Kane

    Kane Member

    Messages:
    1,337
    Likes Received:
    0
    Trophy Points:
    0
    Or just use the tier1 KV parser with a simple filesystem (or just take it from leaked hl2 sourcecode). As I do.
     
  8. Kane

    Kane Member

    Messages:
    1,337
    Likes Received:
    0
    Trophy Points:
    0
    Or just use the tier1 KV parser with a simple filesystem class (or just take it from leaked hl2 sourcecode). As I do.
     
  9. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    I'm hidin in ur code comments.

    True story.
     
  10. Kane

    Kane Member

    Messages:
    1,337
    Likes Received:
    0
    Trophy Points:
    0
    We know. Something like
    Code:
    // Fuck you trickster.
     
  11. Kylegar

    Kylegar Specstax Rule

    Messages:
    2,170
    Likes Received:
    0
    Trophy Points:
    0
    Rage bugfixing the best bugfixing
     
  12. recon

    recon SM Support Dev

    Messages:
    2,348
    Likes Received:
    0
    Trophy Points:
    0
    /facepalm
     
  13. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    Would you like to make a lua implementation of a KV parser? I guess that it could be handy soon. A native version might be handy for debugging in addition to the source c++ kv parser binding thing.
     
  14. Kylegar

    Kylegar Specstax Rule

    Messages:
    2,170
    Likes Received:
    0
    Trophy Points:
    0
    we can just bind the script parsers to lua in empires.
     
  15. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    I know but I think that a native lua parser would be handy too.
     
  16. recon

    recon SM Support Dev

    Messages:
    2,348
    Likes Received:
    0
    Trophy Points:
    0
    No thanks. I don't think anyone is using LUA.

    Side note: SourceMod supports KV parsing and writing out of the box.
     
  17. Kane

    Kane Member

    Messages:
    1,337
    Likes Received:
    0
    Trophy Points:
    0
    You're completely and absolutely wrong.
    See GMod, see Fortress Forever.
    Regarding side note: SourceMod is for plugins and beside that, SourcePawn sucks.
     
  18. recon

    recon SM Support Dev

    Messages:
    2,348
    Likes Received:
    0
    Trophy Points:
    0
    I mean LUA in Empires, not the language in general.

    The only use for LUA in Empires that I can think of is for "plugins".

    You can write SourceMod extensions with C++.
     
  19. Kane

    Kane Member

    Messages:
    1,337
    Likes Received:
    0
    Trophy Points:
    0
    Doing custom skills for specific maps, all that kind of stuff.
     
  20. recon

    recon SM Support Dev

    Messages:
    2,348
    Likes Received:
    0
    Trophy Points:
    0
    Those APIs are exposed to Empires LUA? Where's the documentation?
     

Share This Page