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

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

7.8k Downloads

Clientgen tool generates wrong enum names for Java and C++

Genhis opened this issue ยท 2 comments

commented

Enum in C#:

[KRPCEnum]
public enum TimeReference {COMPUTED, X_FROM_NOW, EQ_ASCENDING}

Generated enum in Java:

//there is an underscore after the first letter and other underscores are duplicated
public enum TimeReference implements RemoteEnum {C_OMPUTED, X__FROM__NOW, E_Q__ASCENDING}

Expected enum in Java:

public enum TimeReference implements RemoteEnum {COMPUTED, X_FROM_NOW, EQ_ASCENDING}

//EDIT: C++ code has simillar error: names doesn't have first underscore but other underscores are duplicated

enum struct TimeReference {computed = 0, x__from__now = 1, eq__ascending = 2}
commented

This is because the code generator expects the enum names to be in CamelCase, as is the usual convention in C#. Either you'll need to change the C# code to follow this convention, or I could modify the code generator to detect this and generate correct names.

commented

Thank you for your response. I think it would be easier for you if I changed my code, so I will do that.