Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check before sending to prevent crash because of #3866 #3883

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10862,14 +10862,16 @@ bool CStaticFunctionDefinitions::SendSyncIntervals(CPlayer* pPlayer)
BitStream.pBitStream->Write(g_TickRateSettings.iKeySyncRotation);
BitStream.pBitStream->Write(g_TickRateSettings.iKeySyncAnalogMove);

if (pPlayer->CanBitStream(eBitStreamVersion::FixSyncerDistance))
if (pPlayer)
{
BitStream.pBitStream->Write(g_TickRateSettings.iPedSyncerDistance);
BitStream.pBitStream->Write(g_TickRateSettings.iUnoccupiedVehicleSyncerDistance);
}
Comment on lines -10865 to -10869
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need min client version check here.
The new client always expects all data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, thanks for reporting the issue, but could you please elaborate on it and how exactly it should be solved?

if (pPlayer->CanBitStream(eBitStreamVersion::FixSyncerDistance))
{
BitStream.pBitStream->Write(g_TickRateSettings.iPedSyncerDistance);
BitStream.pBitStream->Write(g_TickRateSettings.iUnoccupiedVehicleSyncerDistance);
}

if (pPlayer)
pPlayer->Send(CLuaPacket(SET_SYNC_INTERVALS, *BitStream.pBitStream));
}
else
m_pPlayerManager->BroadcastOnlyJoined(CLuaPacket(SET_SYNC_INTERVALS, *BitStream.pBitStream));

Expand Down
Loading