From 6a0fed127031824674402a50ae444c6023f930d6 Mon Sep 17 00:00:00 2001 From: godotg Date: Thu, 11 Jul 2024 18:30:01 +0800 Subject: [PATCH] chore[php]: rename booleanArray --- .../zfoo/protocol/serializer/CutDownArraySerializer.java | 8 ++++---- .../zfoo/protocol/serializer/CutDownListSerializer.java | 4 ++-- .../zfoo/protocol/serializer/CutDownSetSerializer.java | 4 ++-- protocol/src/main/resources/php/ByteBuffer.php | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownArraySerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownArraySerializer.java index 75f9db065..0355551ba 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownArraySerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownArraySerializer.java @@ -57,7 +57,7 @@ public boolean writeObject(StringBuilder builder, String objectStr, Field field, builder.append(StringUtils.format("buffer:writeBooleanArray({})", objectStr)).append(LS); break; case Php: - builder.append(StringUtils.format("$buffer->writeBooleanArray({});", objectStr)).append(LS); + builder.append(StringUtils.format("$buffer->writeBoolArray({});", objectStr)).append(LS); break; case CSharp: builder.append(StringUtils.format("buffer.WriteBooleanArray({});", objectStr)).append(LS); @@ -84,7 +84,7 @@ public boolean writeObject(StringBuilder builder, String objectStr, Field field, builder.append(StringUtils.format("buffer:writeBooleanArray({})", objectStr)).append(LS); break; case Php: - builder.append(StringUtils.format("$buffer->writeBooleanArray({});", objectStr)).append(LS); + builder.append(StringUtils.format("$buffer->writeBoolArray({});", objectStr)).append(LS); break; case CSharp: builder.append(StringUtils.format("buffer.WriteBooleanArray({});", objectStr)).append(LS); @@ -514,7 +514,7 @@ public String readObject(StringBuilder builder, Field field, IFieldRegistration break; case Php: array = "$" + array; - builder.append(StringUtils.format("{} = $buffer->readBooleanArray();", array)).append(LS); + builder.append(StringUtils.format("{} = $buffer->readBoolArray();", array)).append(LS); break; case CSharp: builder.append(StringUtils.format("var {} = buffer.ReadBooleanArray();", array)).append(LS); @@ -557,7 +557,7 @@ public String readObject(StringBuilder builder, Field field, IFieldRegistration break; case Php: array = "$" + array; - builder.append(StringUtils.format("{} = $buffer->readBooleanArray();", array)).append(LS); + builder.append(StringUtils.format("{} = $buffer->readBoolArray();", array)).append(LS); break; case CSharp: builder.append(StringUtils.format("var {} = buffer.ReadBooleanArray();", array)).append(LS); diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownListSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownListSerializer.java index 8da3aec14..16c052f17 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownListSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownListSerializer.java @@ -56,7 +56,7 @@ public boolean writeObject(StringBuilder builder, String objectStr, Field field, builder.append(StringUtils.format("buffer:writeBooleanArray({})", objectStr)).append(LS); break; case Php: - builder.append(StringUtils.format("$buffer->writeBooleanArray({});", objectStr)).append(LS); + builder.append(StringUtils.format("$buffer->writeBoolArray({});", objectStr)).append(LS); break; case CSharp: builder.append(StringUtils.format("buffer.WriteBooleanList({});", objectStr)).append(LS); @@ -353,7 +353,7 @@ public String readObject(StringBuilder builder, Field field, IFieldRegistration break; case Php: list = "$" + list; - builder.append(StringUtils.format("{} = buffer->readBooleanArray();", list)).append(LS); + builder.append(StringUtils.format("{} = buffer->readBoolArray();", list)).append(LS); break; case CSharp: builder.append(StringUtils.format("var {} = buffer.ReadBooleanList();", list)).append(LS); diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownSetSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownSetSerializer.java index 8c8d9f0e5..5d2ec9311 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownSetSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/CutDownSetSerializer.java @@ -60,7 +60,7 @@ public boolean writeObject(StringBuilder builder, String objectStr, Field field, builder.append(StringUtils.format("buffer:writeBooleanArray({})", objectStr)).append(LS); break; case Php: - builder.append(StringUtils.format("$buffer->writeBooleanArray({});", objectStr)).append(LS); + builder.append(StringUtils.format("$buffer->writeBoolArray({});", objectStr)).append(LS); break; case CSharp: builder.append(StringUtils.format("buffer.WriteBooleanSet({});", objectStr)).append(LS); @@ -350,7 +350,7 @@ public String readObject(StringBuilder builder, Field field, IFieldRegistration break; case Php: set = "$" + set; - builder.append(StringUtils.format("{} = $buffer->readBooleanArray();", set)).append(LS); + builder.append(StringUtils.format("{} = $buffer->readBoolArray();", set)).append(LS); break; case CSharp: builder.append(StringUtils.format("var {} = buffer.ReadBooleanSet();", set)).append(LS); diff --git a/protocol/src/main/resources/php/ByteBuffer.php b/protocol/src/main/resources/php/ByteBuffer.php index a161eb473..01875dea7 100644 --- a/protocol/src/main/resources/php/ByteBuffer.php +++ b/protocol/src/main/resources/php/ByteBuffer.php @@ -394,7 +394,7 @@ public function readPacket(int $protocolId): mixed return $protocolRegistration->read($this); } - public function writeBooleanArray(array $array): void + public function writeBoolArray(array $array): void { if (empty($array)) { $this->writeInt(0); @@ -407,7 +407,7 @@ public function writeBooleanArray(array $array): void } } - public function readBooleanArray(): array + public function readBoolArray(): array { $size = $this->readInt(); $array = array();