-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please support List<IPacket>( Map<IPacket,IPacket>,...) in zfoo protocol #59
Comments
I think zfoo protocol already have it. And I've used it for months. This is a simple example using existed IPacket children in tests - ObjectA, ObjectB, ObjectC: // ObjectD.java - this is the file contains List<IPacket> and Map<IPacket, IPacket>
@Protocol(id = 122)
public class ObjectD implements IPacket {
public List<ObjectA> list = List.of(new ObjectA(), new ObjectA());
public Map<ObjectB, ObjectC> map = Map.of(new ObjectB(), new ObjectC());
} // GenerateGdTest.java - this is the test file to generate protocols
public class GenerateGdTest extends TestCase {
@Test
public void testGenerateGd() {
var op = GenerateOperation.NO_OPERATION;
op.getGenerateLanguages().add(CodeLanguage.GdScript);
op.setProtocolPath("out");
ProtocolManager.initProtocol(Set.of(ObjectA.class, ObjectB.class, ObjectC.class, ObjectD.class), op);
}
} And run it using junit, it works fine. |
It is not my problem, I want to use |
Gocha! Sorry for my misunderstanding. Your topic is very interesting. I'll try to implement it later. |
if you use kotlin as language for server-side, please take a look at this MSerialization, it use ksp for code generation and of course it support JS and Gdscipt |
Custom generic class such as |
I think he wanted to say list of abstract class. |
It is easy to support |
I think if we implement this feature, it will be interesting. However, as @godotg said, it's very difficult to implement in golang and cpp. I think I can implement it in other languages as java, c#, js and godot. Can we support it for these languages, if |
Custom generic classes are prone to performance and parsing problems in many frameworks, and are not supported in all languages. According to the current protocol format,this feature can not be supported. Keep it simple and stupid. |
No description provided.
The text was updated successfully, but these errors were encountered: