diff --git a/include/server/Client.hpp b/include/server/Client.hpp index 5a0b4a3..4ced2aa 100644 --- a/include/server/Client.hpp +++ b/include/server/Client.hpp @@ -230,6 +230,7 @@ class Client { GameInf emptyGameInfPacket = GameInf(); CostumeInf lastCostumeInfPacket = CostumeInf(); TagInf lastTagInfPacket = TagInf(); + CaptureInf lastCaptureInfPacket = CaptureInf(); Keyboard* mKeyboard = nullptr; // keyboard for setting server IP diff --git a/source/server/Client.cpp b/source/server/Client.cpp index cb59fe2..ccc81b2 100644 --- a/source/server/Client.cpp +++ b/source/server/Client.cpp @@ -363,6 +363,8 @@ void Client::readFunc() { mSocket->send(&lastCostumeInfPacket); if (lastTagInfPacket.mUserID == mUserID) mSocket->send(&lastTagInfPacket); + if (lastCaptureInfPacket.mUserID == mUserID) + mSocket->send(&lastCaptureInfPacket); break; case PacketType::COSTUMEINF: @@ -677,12 +679,14 @@ void Client::sendCaptureInfPacket(const PlayerActorHakoniwa* player) { packet->mUserID = sInstance->mUserID; strcpy(packet->hackName, tryConvertName(player->mHackKeeper->getCurrentHackName())); sInstance->mSocket->queuePacket(packet); + sInstance->lastCaptureInfPacket = *packet; sInstance->isSentCaptureInf = true; } else if (!sInstance->isClientCaptured && sInstance->isSentCaptureInf) { CaptureInf *packet = new CaptureInf(); packet->mUserID = sInstance->mUserID; strcpy(packet->hackName, ""); sInstance->mSocket->queuePacket(packet); + sInstance->lastCaptureInfPacket = *packet; sInstance->isSentCaptureInf = false; } } @@ -705,6 +709,11 @@ void Client::resendInitPackets() { if (lastTagInfPacket.mUserID == mUserID) { mSocket->queuePacket(&lastTagInfPacket); } + + // CaptureInfPacket + if (lastCaptureInfPacket.mUserID == mUserID) { + mSocket->queuePacket(&lastCaptureInfPacket); + } } /**