本文整理汇总了PHP中Protobuf\ReadContext::setLength方法的典型用法代码示例。如果您正苦于以下问题:PHP ReadContext::setLength方法的具体用法?PHP ReadContext::setLength怎么用?PHP ReadContext::setLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Protobuf\ReadContext
的用法示例。
在下文中一共展示了ReadContext::setLength方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Map\Fort\FortData();
$this->fort_data = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Gym\GymMembership();
if ($this->memberships === null) {
$this->memberships = new \Protobuf\MessageCollection();
}
$this->memberships->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->deploy_lockout = $reader->readBool($stream);
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}
示例2: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 14);
$this->result = \POGOProtos\Networking\Responses\StartGymBattleResponse\Result::valueOf($reader->readVarint($stream));
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 3);
$this->battle_start_timestamp_ms = $reader->readVarint($stream);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 3);
$this->battle_end_timestamp_ms = $reader->readVarint($stream);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->battle_id = $reader->readString($stream);
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Battle\BattleParticipant();
$this->defender = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 6) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Battle\BattleLog();
$this->battle_log = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 7) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Battle\BattleParticipant();
$this->attacker = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}
示例3: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->fort_id = $reader->readString($stream);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 14);
$this->team_color = \POGOProtos\Enums\TeamColor::valueOf($reader->readVarint($stream));
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\PokemonData();
$this->pokemon_data = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->name = $reader->readString($stream);
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 9);
if ($this->image_urls === null) {
$this->image_urls = new \Protobuf\ScalarCollection();
}
$this->image_urls->add($reader->readString($stream));
continue;
}
if ($tag === 6) {
\Protobuf\WireFormat::assertWireType($wire, 5);
$this->fp = $reader->readVarint($stream);
continue;
}
if ($tag === 7) {
\Protobuf\WireFormat::assertWireType($wire, 5);
$this->stamina = $reader->readVarint($stream);
continue;
}
if ($tag === 8) {
\Protobuf\WireFormat::assertWireType($wire, 5);
$this->max_stamina = $reader->readVarint($stream);
continue;
}
if ($tag === 9) {
\Protobuf\WireFormat::assertWireType($wire, 14);
$this->type = \POGOProtos\Map\Fort\FortType::valueOf($reader->readVarint($stream));
continue;
}
if ($tag === 10) {
\Protobuf\WireFormat::assertWireType($wire, 1);
$this->latitude = $reader->readDouble($stream);
continue;
}
if ($tag === 11) {
\Protobuf\WireFormat::assertWireType($wire, 1);
$this->longitude = $reader->readDouble($stream);
continue;
}
if ($tag === 12) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->description = $reader->readString($stream);
continue;
}
if ($tag === 13) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Map\Fort\FortModifier();
if ($this->modifiers === null) {
$this->modifiers = new \Protobuf\MessageCollection();
}
$this->modifiers->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
//.........这里部分代码省略.........
示例4: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->name = $reader->readString($stream);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \google\protobuf\FieldDescriptorProto();
if ($this->field === null) {
$this->field = new \Protobuf\MessageCollection();
}
$this->field->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 6) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \google\protobuf\FieldDescriptorProto();
if ($this->extension === null) {
$this->extension = new \Protobuf\MessageCollection();
}
$this->extension->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \google\protobuf\DescriptorProto();
if ($this->nested_type === null) {
$this->nested_type = new \Protobuf\MessageCollection();
}
$this->nested_type->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \google\protobuf\EnumDescriptorProto();
if ($this->enum_type === null) {
$this->enum_type = new \Protobuf\MessageCollection();
}
$this->enum_type->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \google\protobuf\DescriptorProto\ExtensionRange();
if ($this->extension_range === null) {
$this->extension_range = new \Protobuf\MessageCollection();
}
$this->extension_range->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 8) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \google\protobuf\OneofDescriptorProto();
if ($this->oneof_decl === null) {
$this->oneof_decl = new \Protobuf\MessageCollection();
}
$this->oneof_decl->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
//.........这里部分代码省略.........
示例5: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 6);
$this->encounter_id = $reader->readFixed64($stream);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 3);
$this->last_modified_timestamp_ms = $reader->readVarint($stream);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 1);
$this->latitude = $reader->readDouble($stream);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 1);
$this->longitude = $reader->readDouble($stream);
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->spawn_point_id = $reader->readString($stream);
continue;
}
if ($tag === 7) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\PokemonData();
$this->pokemon_data = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 11) {
\Protobuf\WireFormat::assertWireType($wire, 5);
$this->time_till_hidden_ms = $reader->readVarint($stream);
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}
示例6: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 14);
$this->result = \POGOProtos\Networking\Responses\LevelUpRewardsResponse\Result::valueOf($reader->readVarint($stream));
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Inventory\Item\ItemAward();
if ($this->items_awarded === null) {
$this->items_awarded = new \Protobuf\MessageCollection();
}
$this->items_awarded->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 4) {
$innerSize = $reader->readVarint($stream);
$innerLimit = $stream->tell() + $innerSize;
if ($this->items_unlocked === null) {
$this->items_unlocked = new \Protobuf\EnumCollection();
}
while ($stream->tell() < $innerLimit) {
$this->items_unlocked->add(\POGOProtos\Inventory\Item\ItemId::valueOf($reader->readVarint($stream)));
}
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}
示例7: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->name = $reader->readString($stream);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 5);
$this->number = $reader->readVarint($stream);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 14);
$this->label = \google\protobuf\FieldDescriptorProto\Label::valueOf($reader->readVarint($stream));
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 14);
$this->type = \google\protobuf\FieldDescriptorProto\Type::valueOf($reader->readVarint($stream));
continue;
}
if ($tag === 6) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->type_name = $reader->readString($stream);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->extendee = $reader->readString($stream);
continue;
}
if ($tag === 7) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->default_value = $reader->readString($stream);
continue;
}
if ($tag === 9) {
\Protobuf\WireFormat::assertWireType($wire, 5);
$this->oneof_index = $reader->readVarint($stream);
continue;
}
if ($tag === 10) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->json_name = $reader->readString($stream);
continue;
}
if ($tag === 8) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \google\protobuf\FieldOptions();
$this->options = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}
示例8: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\FortSettings();
$this->fort_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\MapSettings();
$this->map_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\LevelSettings();
$this->level_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\InventorySettings();
$this->inventory_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 6) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->minimum_client_version = $reader->readString($stream);
continue;
}
if ($tag === 7) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\GpsSettings();
$this->gps_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 8) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\FestivalSettings();
$this->festival_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 9) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\EventSettings();
$this->event_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 10) {
\Protobuf\WireFormat::assertWireType($wire, 5);
$this->max_pokemon_types = $reader->readVarint($stream);
continue;
}
if ($tag === 11) {
//.........这里部分代码省略.........
示例9: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\PokemonData();
$this->pokemon_data = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Inventory\Item\ItemData();
$this->item = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\PokedexEntry();
$this->pokedex_entry = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Player\PlayerStats();
$this->player_stats = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Player\PlayerCurrency();
$this->player_currency = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 6) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Player\PlayerCamera();
$this->player_camera = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 7) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Inventory\InventoryUpgrades();
$this->inventory_upgrades = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 8) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Inventory\AppliedItems();
$this->applied_items = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 9) {
//.........这里部分代码省略.........
示例10: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 3);
$this->modified_timestamp_ms = $reader->readVarint($stream);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Inventory\InventoryItem\DeletedItem();
$this->deleted_item = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Inventory\InventoryItemData();
$this->inventory_item_data = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}
示例11: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Gym\GymState();
$this->gym_state = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->name = $reader->readString($stream);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 9);
if ($this->urls === null) {
$this->urls = new \Protobuf\ScalarCollection();
}
$this->urls->add($reader->readString($stream));
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 14);
$this->result = \POGOProtos\Networking\Responses\GetGymDetailsResponse\Result::valueOf($reader->readVarint($stream));
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->description = $reader->readString($stream);
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}
示例12: readFrom
//.........这里部分代码省略.........
$this->java_package = $reader->readString($stream);
continue;
}
if ($tag === 8) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->java_outer_classname = $reader->readString($stream);
continue;
}
if ($tag === 10) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->java_multiple_files = $reader->readBool($stream);
continue;
}
if ($tag === 20) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->java_generate_equals_and_hash = $reader->readBool($stream);
continue;
}
if ($tag === 27) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->java_string_check_utf8 = $reader->readBool($stream);
continue;
}
if ($tag === 9) {
\Protobuf\WireFormat::assertWireType($wire, 14);
$this->optimize_for = \google\protobuf\FileOptions\OptimizeMode::valueOf($reader->readVarint($stream));
continue;
}
if ($tag === 11) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->go_package = $reader->readString($stream);
continue;
}
if ($tag === 16) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->cc_generic_services = $reader->readBool($stream);
continue;
}
if ($tag === 17) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->java_generic_services = $reader->readBool($stream);
continue;
}
if ($tag === 18) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->py_generic_services = $reader->readBool($stream);
continue;
}
if ($tag === 23) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->deprecated = $reader->readBool($stream);
continue;
}
if ($tag === 31) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->cc_enable_arenas = $reader->readBool($stream);
continue;
}
if ($tag === 36) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->objc_class_prefix = $reader->readString($stream);
continue;
}
if ($tag === 37) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->csharp_namespace = $reader->readString($stream);
continue;
}
if ($tag === 38) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->javanano_use_deprecated_package = $reader->readBool($stream);
continue;
}
if ($tag === 999) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \google\protobuf\UninterpretedOption();
if ($this->uninterpreted_option === null) {
$this->uninterpreted_option = new \Protobuf\MessageCollection();
}
$this->uninterpreted_option->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}
示例13: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->template_id = $reader->readString($stream);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\Master\PokemonSettings();
$this->pokemon_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\Master\ItemSettings();
$this->item_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\Master\MoveSettings();
$this->move_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\Master\MoveSequenceSettings();
$this->move_sequence_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 8) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\Master\TypeEffectiveSettings();
$this->type_effective = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 10) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\Master\BadgeSettings();
$this->badge_settings = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 11) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\Master\CameraSettings();
$this->camera = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 12) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Settings\Master\PlayerLevelSettings();
$this->player_level = $innerMessage;
$context->setLength($innerSize);
//.........这里部分代码省略.........
示例14: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 3);
$this->timestamp_ms = $reader->readVarint($stream);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->sfida = $reader->readBool($stream);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Logs\CatchPokemonLogEntry();
$this->catch_pokemon = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Logs\FortSearchLogEntry();
$this->fort_search = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Logs\BuddyPokemonLogEntry();
$this->buddy_pokemon = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}
示例15: readFrom
/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->item_id = $reader->readString($stream);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 8);
$this->is_iap = $reader->readBool($stream);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Player\Currency();
$this->currency_to_buy = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Data\Player\Currency();
$this->yields_currency = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Inventory\Item\ItemData();
$this->yields_item = $innerMessage;
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 6) {
\Protobuf\WireFormat::assertWireType($wire, 11);
$innerSize = $reader->readVarint($stream);
$innerMessage = new \POGOProtos\Networking\Platform\Responses\GetStoreItemsResponse\StoreItem\TagsEntry();
if ($this->tags === null) {
$this->tags = new \Protobuf\MessageCollection();
}
$this->tags->add($innerMessage);
$context->setLength($innerSize);
$innerMessage->readFrom($context);
$context->setLength($length);
continue;
}
if ($tag === 7) {
\Protobuf\WireFormat::assertWireType($wire, 5);
$this->unknown7 = $reader->readVarint($stream);
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}