From 70a6ee536ee3bed0806c4e5b04bb6113fbf0244a Mon Sep 17 00:00:00 2001 From: blattersturm Date: Fri, 4 Aug 2023 20:38:02 +0200 Subject: [PATCH] fix(server): DOES_PLAYER_EXIST with TempIDs After 50637e5dc48a9dd29c7dea20c30a86940454ef03, DOES_PLAYER_EXIST would return true for TempIDs belonging to an already-connected player, which would be a compatibility break. Since the other fix (TempIDs being invalidated after connection, which would've been intended behavior) was also a compatibility break, we'll check for the NetID matching instead. --- .../citizen-server-impl/src/PlayerScriptFunctions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/components/citizen-server-impl/src/PlayerScriptFunctions.cpp b/code/components/citizen-server-impl/src/PlayerScriptFunctions.cpp index 29d99a2bea..819b728fdc 100644 --- a/code/components/citizen-server-impl/src/PlayerScriptFunctions.cpp +++ b/code/components/citizen-server-impl/src/PlayerScriptFunctions.cpp @@ -32,7 +32,9 @@ static void CreatePlayerCommands() fx::ScriptEngine::RegisterNativeHandler("DOES_PLAYER_EXIST", MakeClientFunction([](fx::ScriptContext& context, const fx::ClientSharedPtr& client) { - return true; + auto matchID = atoi(context.CheckArgument(0)); + + return client->GetNetId() == matchID; })); fx::ScriptEngine::RegisterNativeHandler("GET_PLAYER_GUID", MakeClientFunction([](fx::ScriptContext& context, const fx::ClientSharedPtr& client)