Skip to content
Merged
Changes from all commits
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: 12 additions & 0 deletions code/components/citizen-server-impl/src/state/ServerGameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3545,6 +3545,18 @@ bool ServerGameState::ProcessClonePacket(const fx::ClientSharedPtr& client, rl::
std::unique_lock _lock(data->playerEntityMutex);
sync::SyncEntityPtr playerEntity = data->playerEntity.lock();

// Prevent clients from creating multiple CNetObjPlayer entities
if (createdHere && playerEntity)
{
GS_LOG("%s: client %d %s tried to create duplicate player entity %d, but already has player entity %d. Rejecting!\n",
__func__,
client->GetNetId(),
client->GetName(),
objectId,
playerEntity->handle & 0xFFFF);
return false;
}

if (!playerEntity)
{
SendWorldGrid(nullptr, client);
Expand Down
Loading