What is a "cfxTicket" and how do I generate one or access R* id directly?

Lately I’ve been trying to build my own server from source to make it somewhat work with clients run on Linux with WINE.

At first I tried simply removing the ticket check (in fivem/code/components/citizen-server-impl/src/InitConnectMethod.cpp → “initConnect” handler) to allow logging in without setting sv_lan 1, but that still does not go around GetPlayerIndentifiers returning empty value set.

It looks to me like something should be handing out tickets that the clients are supposed to have.
Since I was not able to find where this initConnect handler is actually called to look where the arguments come from, my guess is that’s the disabled anti-cheat part which is not open source and that the identifiers also come from this *ticketData.extraJson value.

Is there any API that can be used to access player’s R* id and other identifiers (accessible in the server’s source code), so it could be packed inside whatever part of this .json it’s supposed to be? Or maybe I’m completely wrong and this ticket data has nothing to do with identifiers?

Maybe this “cfxTicket” is documented somewhere or there’s a function that can be used to generate a valid one?

I really hope it’s not a case where insecure mode clients don’t even send their indentifier information to the server.

I’m looking for some way to “hack” this, so player identifiers are available in insecure mode.

Correct, at this time ticket requests for ‘other’ 3PIDs are tied closely to the anticheat handshake and changing this would require some complex steps to ensure servers can opt to accept ‘empty’ tickets.

However, if you set up Steam auth you’ll get that as an identifier instead of an empty array.

I tried adding set steam_webApiKey with my api key to server.cfg and opening steam client before launching FiveM. Is that not enough to setup steam auth?

I also removed sv_lan 1 and removed the ticket check from the source code, I can log in, but the array is still empty.

Update:

I’ve done some more testing on this and I did not manage to get steam identifier to be returned from GetPlayerIndentifiers, on playerConnecting or playerJoining events.

I’ve noticed that unlike on playerConnecting, when invoked on playerJoining event the identifiers array contains a single entry - the ip address. I would still not call this workable, but it’s something.

Ah, so that’s why people have been mentioning empty arrays - somehow the IP isn’t added that early in. It might be this happened when proxy support was added, but that’s indeed a little silly when there’s nothing else set.