Proposal: Namespace methods according to respective Proto file #127
Replies: 2 comments
-
Generally I would go with the simplest thing and just prefix like However in this particular case I wonder if we shouldn't instead change the API names to be a bit more specifically accurate. However, especially in light of the conflict above, I wonder if we should rename this to |
Beta Was this translation helpful? Give feedback.
-
Good observation. I will integrate that in a PR to come shortly. This morning, I thought of a lightweight solution to detect conflicts in registration. What if we had functional registrations such as GRPC.registerMethod('theMethodName', function(params)
end) If there is already another method, deregister both methods. That way the person who is writing a new function would be forced to acknowledge the duplication. The only other alternative is to perform a full regression test suite, which is very heavy given for full confidence, we need to launch DCS on a CI build (ouch!) |
Beta Was this translation helpful? Give feedback.
-
In browsing the source code, I may have generated a conflict without realizing it at the time. Here are two functions which both define
getPlayers
:rust-server/lua/DCS-gRPC/methods/coalitions.lua
Lines 153 to 160 in b1d3906
rust-server/lua/DCS-gRPC/methods/net.lua
Lines 24 to 43 in c437fb4
I would like to propose to avoid naming conflicting, let's prefix the method name with some annotation of the proto file as a namespace.
E.g.
and
An alternative is setup a localized Lua table with the following pseudo:
and the Rust code would perform a function call similar to:
Beta Was this translation helpful? Give feedback.
All reactions