Skip to content

Commit

Permalink
Merge pull request #81 from harochen75/main
Browse files Browse the repository at this point in the history
fix[protocol] typescript compatible
  • Loading branch information
jaysunxiao authored Nov 18, 2023
2 parents ffeeb63 + 47d7075 commit e136d39
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private static String readObject(ProtocolRegistration registration) {
var field = fields[i];
var fieldRegistration = fieldRegistrations[i];
if (field.isAnnotationPresent(Compatible.class)) {
tsBuilder.append(TAB + TAB).append("if (buffer.compatibleRead(beforeReadIndex, length)) {").append(LS);
tsBuilder.append(TAB + TAB).append("if (!buffer.compatibleRead(beforeReadIndex, length)) {").append(LS);
var compatibleReadObject = tsSerializer(fieldRegistration.serializer()).readObject(tsBuilder, 3, field, fieldRegistration);
tsBuilder.append(TAB + TAB+ TAB).append(StringUtils.format("packet.{} = {};", field.getName(), compatibleReadObject)).append(LS);
tsBuilder.append(TAB + TAB).append("}").append(LS);
Expand Down

0 comments on commit e136d39

Please sign in to comment.