-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
How to parse protocol #393
Comments
hi, |
Hi, thanks! That seems like it's going to be very helpful. In terms of code, what I can see at a glance is that the "base" format is |
Bit of a follow-up question, and I didn't want to make yet another issue.
what exactly is allowed there? I've seen constructs which use |
@rom1504 The problem is that ProtoDef is not documented properly. While the link you provided answers the headline of the question in the general sense, it fails to address the root problem and the specific description of it, which is related to the nebulous "variable system" that is not documented anywhere in the ProtoDef spec. While I understand this isn't the proper place to discuss it, the same issue has been open for nearly 6 years without being addressed, so it doesn't appear to be a focus there. This project is pretty much the reference implementation for ProtoDef, and practically-speaking, more useful than its actual sparse and very lacking documentation, Both projects would benefit greatly from a few additions to the ProtoDef docs, and save the headache of digging through schemas and trying to discern whats going on in a large example file, and how it should be properly handled. This is especially important for statically typed languages and parsers only capable of forward-reading (i.e. "particleData" is referenced in "particle", but defined after it). |
ProtoDef-io/ProtoDef#20 yes would be great to document the variable system Are you interested in helping out? |
I would be happy to clarify and expand the ProtoDef wiki, it was actually already on my todo list once I get it figured out completely (I am creating a C# implementation of it). Though I still need to understand how the variables work myself before I attempt to document it. I have been searching around both projects and checking issues for clarification, but nothing answers it. Even a general explanation on the "rules" regarding them would be helpful to figuring it out. As it stands, it is basically "this is what to expect, except sometimes there is just a word with a $ prefix" with no explicit explanation on what it means. I can make some educated guessed and surmise how it works. That might work well enough when using a fixed example (i.e. minecraft-data) if I just want to get it to work, but that is not helpful for implementing a specification with unknowns. I had assumed that, while closely linked, ProtoDef was a separate entity from this one, and could have other uses outside of it, hence my reluctance to just base it off what I see in minecraft-data. |
Here is the reference implementation
https://github.com/ProtoDef-io/node-protodef/blob/master/src/protodef.js#L25
Documentation / the general spec should follow that.
…On Fri, Dec 9, 2022, 23:50 ForeverZer0 ***@***.***> wrote:
I would be happy to clarify and expand the ProtoDef wiki, it was actually
already on my todo list once I get it figured out completely (I am creating
a C# implementation of it). Though I still need to understand how the
variables work myself before I attempt to document it. I have been
searching around both projects and checking issues for clarification, but
nothing answers it.
Even a general explanation on the "rules" regarding them would be helpful
to figuring it out. As it stands, it is basically "this is what to expect,
except sometimes there is just a word with a $ prefix" with no explicit
explanation on what it means. I can make some educated guessed and surmise
how it works. That might work well enough when using a fixed example (i.e.
minecraft-data) if I just want to get it to work, but that is not helpful
for implementing a specification with unknowns. I had assumed that, while
closely linked, ProtoDef was a separate entity from this one, and could
have other uses outside of it, hence my reluctance to just base it off what
I see in minecraft-data.
—
Reply to this email directly, view it on GitHub
<#393 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR437T4MSBS4ACPLRMLJITWMOZSDANCNFSM42TXHHXA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I've been trying to parse the protocol.json files for two weeks now, and I can't get it to work for all the types. I can get some good approaches, but then I fail to parse things like particleDatas
"compareTo": "$compareTo",
orcompareTo
s with..
What's the intended way to parse the protocol files? There has to be some model they are produced from, how is that structured?
(I'm super confused about why the types are represented with arrays in the first place, shouldn't that be an object normally?)
The text was updated successfully, but these errors were encountered: