mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2025-01-03 06:01:23 +00:00
fix: resend CaptureInf packet on reconnect and for new players
This commit is contained in:
parent
4835692672
commit
2bef6f796e
2 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue