Blizzard / s2client-proto

StarCraft II Client - protocol definitions used to communicate with StarCraft II.
MIT License
3.76k stars 431 forks source link

Update to proto3 syntax #44

Open matthid opened 6 years ago

matthid commented 6 years ago

I understand if you are not ready for update yet. Just close or leave it open until you are.

But this was the only viable option to use the officially supported Protobuf package from Google compatible with most systems.

This was required as the protobuf code-generation for C# is only working with proto3 syntax (in the official package). See https://github.com/matthid/s2client-dotnet

KevinCalderone commented 6 years ago

The ideal would be for the proto files to be compatible with both proto2 and proto3 compilers. Do you know if there is a way of doing that?

matthid commented 6 years ago

@KevinCalderone To be honest I have no idea. But I'd image it is hard to keep binary compatibility if you are only allowed to use the union of both. (But I guess it is not possible anyway).

Another option would be to keep a proto2 branch and keep it up to date for a while. Like I said it's up to you on how you want to continue with this. I'm even fine with closing the PR as keeping my own fork of this is a lot easier than maintaining/forking/building my own proto2 compiler ;)

KevinCalderone commented 6 years ago

We are stuck on proto2 internally, so it is unlikely we will want to drop support for that.

For now the easiest solution is to just keep your own modified copy of the proto files. I will have to do some research to see if it is possible to have a file that can support both. If it is working for you, then it must be binary compatible, so I assume there must be a way of doing it.

At the very least, we can try to maintain our files to make it trivial to covert to proto3. If you want to modify your PL to just add the 0 entries to all the enums, I'll accept that request. (Maybe make DebugTestProcess::Test::TEST_UNSET to be consistent)