-
Notifications
You must be signed in to change notification settings - Fork 10
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
Protobuf definition out of date? #7
Comments
Note that this repository uses protobuf version 3 which (is / can be made) binary compatible to protobuf 2. In v3 everything is optional by default, see https://stackoverflow.com/a/42634681/1269722 See also Blizzard/s2client-proto#44 where I send the updates back but blizzard is stuck on v2 internally. We are stuck on v3 because it is easier to get it running on netstandard. |
Hi Matthias, Sorry if that was misunderstood - I wasn't referring to the fact that you use a different proto version, but rather the fact that your self-maintained proto files differ functionally from the official implementation at this point. For example look at the chat message field pasted above. The actual variable name changed. The field ID also changed. This leads to incompatibility. So if you want to keep it updated and also use proto3, then it might make sense to pull the current s2clientprotocol from Blizzard and doing a full upgrade to proto3 again. Also on a side note: C# generation of protobuf code is actually posssible with proto 2. When google released their initial v3 releases, they were able to handle both proto2 and proto3 c# generation. This works up to protoc-3.0.0-alpha-3. I've done that already and the files are here: However, this comes with other challenges, since everything is set to read-only by default, so I guess a small script could fix this. Alternatively I saw in your referenced thread that there is a python script to update the proto2 blizzard files to proto3 automatically. Maybe you could use that? Kind regards |
Hi @NikEyX So yes than they might be out of date. Yes it should not be too hard to update everything. Feel free to update and send a pull request. I can release it for you then |
I'm actually not using your lib directly, but a fork of it, so I don't know exactly what do change on your end (hence I'll defer the PR to someone more acquainted with that). However, I generated both the proto3 files as well as the C-#Sharpe files. They work on the fork. Find them attached below. I imagine they're just plug&play: s2clientprotocol PROTO3.zip Die firma dankt! |
I can get NikEyX's demo to work, but it is all C#, and I really would prefer to code in F#, so would be incredibly grateful if someone can get this one to work. Unfortunately, I lack the expertise to do it myself. I realize I can use the demo and still code in F# but I think that a library designed for F# is likely to lead to more idiomatic F# code. When I try to run the demo F# code, I get the following screen and the output window in VS says "The program '[19108] sc2test.exe' has exited with code -1073741510 (0xc000013a)." |
Never mind, it turns out you cannot run anything if you have stableid.json open in a text editor. Closed that and then the F# code ran fine. So whats all this about the protobuf definition being out of date? If it doesn't prevent me from running code, what are the implications? |
@ChechyLevas The implications are that the game sends more information than you actually receive in your types you program with. So the only question is if you need that information for your logic. If not everything is good. I just updated the proto-files with the zipfile provided by @NikEyX (thanks a lot!) and released a new version. So I guess we can close this. |
Hi,
Could it be that you're using an outdated version of the sc2 client protobuf code?
For example, this is in the current s2clientprotobuf/sc2api.proto:
Whereas you seem to have generated the C# code based on this (as per your current github commit):
This leads to chat not working at all. There might be more things broken though.
The text was updated successfully, but these errors were encountered: