kRPC: Control the game using C#, C++, Java, Lua, Python...

kRPC: Control the game using C#, C++, Java, Lua, Python...

7.8k Downloads

KRPCDefaultValueAttribute for parameters

djungelorm opened this issue ยท 0 comments

commented

KRPCDefaultValueAttribute is an attribute applied to a method, to set the default value of a parameter to a non-const value by name. For example:

[KRPCMethod]
[KRPCDefaultValue("param", typeof(ObjectConstructor))]
publid void MyMethod(Object param)

Instead this attribute should be applied to the parameter directly as follows:

[KRPCMethod]
publid void MyMethod([KRPCDefaultValue(typeof(ObjectConstructor)))] Object param)

This is more concise and less error prone. This is a breaking change, but AFAIK no one is using this feature outside of the kRPC repository.