mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-11 03:13:51 +00:00
feat[protocol]: ruby compatible protocol
This commit is contained in:
1 parent
2f56836fee
commit
e2621ec08f
1 file changed
+2
-1
@@ -301,9 +301,10 @@ public class CodeGenerateRuby implements ICodeGenerate {
|
||||
var field = fields[i];
|
||||
var fieldRegistration = fieldRegistrations[i];
|
||||
if (field.isAnnotationPresent(Compatible.class)) {
|
||||
rbBuilder.append("if buffer.compatibleRead(beforeReadIndex, length):").append(LS);
|
||||
rbBuilder.append("if buffer.compatibleRead(beforeReadIndex, length)").append(LS);
|
||||
var compatibleReadObject = rbSerializer(fieldRegistration.serializer()).readObject(rbBuilder, 1, field, fieldRegistration);
|
||||
rbBuilder.append(TAB).append(StringUtils.format("packet.{} = {}", field.getName(), compatibleReadObject)).append(LS);
|
||||
rbBuilder.append("end").append(LS);
|
||||
continue;
|
||||
}
|
||||
var readObject = rbSerializer(fieldRegistration.serializer()).readObject(rbBuilder, 0, field, fieldRegistration);
|
||||
|
||||
Reference in new issue
Block a user