<?php

/**
 * 心跳请求数据
 */

namespace Tool\MakeLocustRequestFile\Model;

use Game\Protobuf\CGHeartBeat;
use Game\Protobuf\PacketId;
use Tool\MakeLocustRequestFile\Util\PacketUtil;

class HeartBeat extends BaseModel
{
    public function getRequestData(array &$data)
    {
        $data[] = $this->getHeartBeatData();
    }

    private function getHeartBeatData():string
    {
        $packet = new CGHeartBeat();
        $packet->setClientTime(time());
        return PacketUtil::getInstance()->getRequestPacket(
            $packet,
            PacketId::CG_HeartBeat
        );
    }
}
