mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2024-12-22 08:20:18 +00:00
fix: resend TagInf packet on reconnect and for new players
This commit is contained in:
parent
4339847da5
commit
4835692672
2 changed files with 10 additions and 0 deletions
|
@ -229,6 +229,7 @@ class Client {
|
|||
GameInf lastGameInfPacket = GameInf();
|
||||
GameInf emptyGameInfPacket = GameInf();
|
||||
CostumeInf lastCostumeInfPacket = CostumeInf();
|
||||
TagInf lastTagInfPacket = TagInf();
|
||||
|
||||
Keyboard* mKeyboard = nullptr; // keyboard for setting server IP
|
||||
|
||||
|
|
|
@ -361,6 +361,8 @@ void Client::readFunc() {
|
|||
mSocket->send(&lastPlayerInfPacket);
|
||||
if (lastCostumeInfPacket.mUserID == mUserID)
|
||||
mSocket->send(&lastCostumeInfPacket);
|
||||
if (lastTagInfPacket.mUserID == mUserID)
|
||||
mSocket->send(&lastTagInfPacket);
|
||||
|
||||
break;
|
||||
case PacketType::COSTUMEINF:
|
||||
|
@ -629,6 +631,8 @@ void Client::sendTagInfPacket() {
|
|||
packet->updateType = static_cast<TagUpdateType>(TagUpdateType::STATE | TagUpdateType::TIME);
|
||||
|
||||
sInstance->mSocket->queuePacket(packet);
|
||||
|
||||
sInstance->lastTagInfPacket = *packet;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -696,6 +700,11 @@ void Client::resendInitPackets() {
|
|||
if (lastGameInfPacket != emptyGameInfPacket) {
|
||||
mSocket->queuePacket(&lastGameInfPacket);
|
||||
}
|
||||
|
||||
// TagInfPacket
|
||||
if (lastTagInfPacket.mUserID == mUserID) {
|
||||
mSocket->queuePacket(&lastTagInfPacket);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue