Generate CONSTRUCTOR_ID and write it upon serializing
This commit is contained in:
parent
16ab4e3863
commit
4e8cc8181c
|
@ -75,6 +75,7 @@ public class Generator {
|
|||
writer.write(extendsName);
|
||||
}
|
||||
writer.write(" {\n");
|
||||
writer.write("public static final int CONSTRUCTOR_ID = " + object.code + ";\n");
|
||||
|
||||
for (int i = 0; i < object.args.size(); ++i) {
|
||||
final TLArg arg = object.args.get(i);
|
||||
|
@ -148,6 +149,7 @@ public class Generator {
|
|||
|
||||
private static void writeSerialize(final Writer writer, final TLObject object) throws IOException {
|
||||
writer.write("public void serialize(final BinaryWriter writer) {\n");
|
||||
writer.write("writer.write(CONSTRUCTOR_ID);\n");
|
||||
for (final TLArg arg : object.args) {
|
||||
if (!arg.genericDefinition && arg.flags) {
|
||||
writer.write("int ");
|
||||
|
|
Loading…
Reference in New Issue