Open jannislehmann opened 2 years ago
Hi! That seems to be a serious problem, thanks for reporting. Since there are actually multiple declarations of e.g. CMsgProtoBufHeader
in the .proto
files, I fear it may be very fiddly to update the generator to handle these. For underworlds
, there is even a different declaration with the same name (we don't generate for underworlds
yet, but still).
It might be easier to pass different package names to the generator (https://developers.google.com/protocol-buffers/docs/reference/go-generated#package). This may have some side-effects which I'm not sure I understand completely, but it should fix the naming conflict. What do you think?
First of all, thanks for the quick follow-up. I haven't had the time to look at the generator thoroughly, but I agree that it seems rather difficult to implement a way of merging duplicate protobufs.
Changing the package names should at least work and would definitely be worth a try. I don't even think that there will be many or even any side-effects, but I am not too familiar with the code base, yet.
Just a quick update. I have tested my application with the GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn go run main.go
env var. This worked for both logging into the Steam network and working with the CSGO GameCoordinator.
This might not be the best solution, but works as a workaround at least.
From that experiment, I think, changing the package names, should not result in side-effects actually. So this should be worth a try.
Hey!
I really enjoy working with your library. However, with the new protobuf library from Google, I am running into the following issue:
This seems to be caused by the default
init
in the protobuf packages. Since both thecsgo/protocol/protobuf
and theprotocol/protobuf
package declare the same base protobufs, there seems to be a conflict.I am only importing
github.com/Philipp15b/go-steam/v3/csgo/protocol/protobuf
in my code. But I would guess that the other package is being imported automatically by a package in the background.Does anyone have a idea how to fix that issue? Merging the protobufs into one directory would be a solution, but not the prettiest solution.
Update: I guess that a fix could be implemented in this projects generator. We should try to use the same base protobufs and not duplicate the definitions.