fix: send empty TagInf and CaptureInf on first connection

Because other players might still have old values saved in their puppet.
This commit is contained in:
Robin C. Ladiges 2023-06-24 04:09:47 +02:00
parent 2bef6f796e
commit f810e8f07d
No known key found for this signature in database
GPG Key ID: B494D3DF92661B99
1 changed files with 15 additions and 0 deletions

View File

@ -104,6 +104,21 @@ nn::Result SocketClient::init(const char* ip, u16 port) {
// on a reconnect, resend some maybe missing packets
if (initPacket.conType == ConnectionTypes::RECONNECT) {
client->resendInitPackets();
} else {
// empty TagInf
TagInf tagInf;
tagInf.mUserID = initPacket.mUserID;
tagInf.isIt = false;
tagInf.minutes = 0;
tagInf.seconds = 0;
tagInf.updateType = static_cast<TagUpdateType>(TagUpdateType::STATE | TagUpdateType::TIME);
send(&tagInf);
// empty CaptureInf
CaptureInf capInf;
capInf.mUserID = initPacket.mUserID;
strcpy(capInf.hackName, "");
send(&capInf);
}
return result;