|
@@ -6,6 +6,7 @@ use App\WebSocketClient;
|
|
|
use Common_pack\EnterHall;
|
|
|
use Common_pack\ReqLogin;
|
|
|
use Common_pack\ResEnterHall;
|
|
|
+use Common_pack\ResHeartBeat;
|
|
|
use Common_pack\ResLogin;
|
|
|
use Google\Protobuf\Internal\Message;
|
|
|
|
|
@@ -97,6 +98,12 @@ class GameClient {
|
|
|
|
|
|
echo "成功进入大厅!\n";
|
|
|
});
|
|
|
+
|
|
|
+ $this->client->on(MsgID::RESHEARTBEAT, function($binaryData) {
|
|
|
+ $response = new ResHeartBeat();
|
|
|
+ $response->mergeFromString($binaryData);
|
|
|
+ echo "心跳:\n".$response->getMsg();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private function startListening() {
|