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

911 call notifications being sent to all players in the server instead of only on-duty units. #112

Closed
Legacy-TacticalGamingInteractive opened this issue Jun 12, 2024 · 20 comments
Labels
🐛 bug Something isn't working

Comments

@Legacy-TacticalGamingInteractive

Unfortunately this seems to still be broken :(

@Gameruxstudiosnz
Copy link

Damn just to check u have updated to newest version of the fivem integrations for snailycad

anything that could help us see why it doing please let us know

@Legacy-TacticalGamingInteractive
Copy link
Author

Damn just to check u have updated to newest version of the fivem integrations for snailycad

anything that could help us see why it doing please let us know

Indeed I have. Everythings updated.

[   3503985] [b3095_GTAProce]             MainThrd/ Info: Connected to SnailyCAD!
[   3503985] [b3095_GTAProce]        CrBrowserMain/ [`sna-sync-nui`][outgoing]: sna-sync-nui:connected (@sna-sync/nui/index-524ca964.js:14)
[   3598172] [b3095_GTAProce]        CrBrowserMain/ [`sna-sync-nui`][outgoing]: sna-sync-nui:create-911-call (@sna-sync/nui/index-524ca964.js:14)
[   3598656] [b3095_GTAProce]        CrBrowserMain/ [`sna-sync-nui`][incoming]: sna-sync:request-authentication-flow (@sna-sync/nui/index-524ca964.js:55)
[   3598656] [b3095_GTAProce]        CrBrowserMain/ [`sna-sync-nui`][incoming]: sna-sync:request-set-status-flow (@sna-sync/nui/index-524ca964.js:55)
[   3598656] [b3095_GTAProce]        CrBrowserMain/ [`sna-sync-nui`][incoming]: sna-sync:request-call-911-attach-flow (@sna-sync/nui/index-524ca964.js:55)

@Legacy-TacticalGamingInteractive
Copy link
Author

Its crazy.

Off duty people who have not authenticated with a personal API token yet can see all 911 call notifications.

Off duty people who did authenticate with personal API token cannot see the 911 notifications.

Some on duty people who did authenticate with personal API token can see 911 notifications. Some can't. Wtf.

@Gameruxstudiosnz
Copy link

Now I am now confused

@Legacy-TacticalGamingInteractive
Copy link
Author

By authenticated I mean they pasted their API token into the system in game. /sn-auth

@jxckUK
Copy link
Contributor

jxckUK commented Jun 13, 2024

When I tested this I was able to confirm that:

  • A user who has authenticated, but was marked as off-duty would not receive the 911 prompt.

  • A user who was authenticated, but marked as on-duty would receive the 911 prompt.

  • A user who was not receiving the prompts owing to being off duty, changes to on-duty and is then able to receive the 911 prompts.

I can't say that I personally tested if users got the prompt without being authenticated, as I presumed this was not possible - I can test this shortly but is that the outstanding problem or are you saying you don't get the behaviour above either? @Legacy-TacticalGamingInteractive

@casperiv0
Copy link
Member

Correct, a player must be authenticated (via /sn-auth) and on-duty (via web or /sn-set-status). The scenario's Jack explained are the expected ones

@Legacy-TacticalGamingInteractive Legacy-TacticalGamingInteractive changed the title fix: 911 call notifications being sent to all players in the server instead of only on-duty units. 911 call notifications being sent to all players in the server instead of only on-duty units. Jun 13, 2024
@Legacy-TacticalGamingInteractive
Copy link
Author

If a user has not set a token at all and simply is on the server they will see the 911s. Thats the biggest issue we have #1.
Which is most people. Since most people such as civilians are not even authenticating themselves using the CAD integration commands.

One step at a time.

By the way we have:

Server Artifacts 8450.
Game build 3095.
OneSync Infiniti.
100+ players on server when tested.

@casperiv0
Copy link
Member

Are you sure you're on the latest version? This is simply not possible on the latest version since it does a backend check.

@Legacy-TacticalGamingInteractive
Copy link
Author

Legacy-TacticalGamingInteractive commented Jun 13, 2024 via email

@casperiv0
Copy link
Member

I'll create a new release that prints out some debugging information in the F8 console. Will only be in about 4h from now though.

@casperiv0
Copy link
Member

@Legacy-TacticalGamingInteractive 0.14.1 is out now which has a debug print with the version. It will get logged when the sna-sync resource is initialized (on resource start/client player spawned)

@Legacy-TacticalGamingInteractive
Copy link
Author

Legacy-TacticalGamingInteractive commented Jun 13, 2024

Nothing new is really logging. Here are my findings:

911 Incoming: Player who IS authenticated in CAD with the User API connected and IS OFF DUTY in Dashboard.
(does not show 911 notification to attach to the call - works as expected now)

911 Incoming: Player who IS authenticated in CAD with the User API connected and IS ON DUTY in Dashboard.
(shows 911 notification to attach to the call - works as expected now)

911 Incoming: Player who is NOT authenticated in CAD. Meaning they have never done the User API connect.
image
(doesn't work as expected)

Solution Needed:
We need to make some logic where if someone is not authenticated in Snaily - then they will not be shown the 911 notification.
Most civilians and even new cops won't be authenticated. They are not doing the whole /sn-auth stuff.
By default it seems to be that anybody who isn't authenticated is treated as being on duty lol.

This is the notification I am referring to by the way:
image

@Georgie15
Copy link

I am getting the exact same issue. A player who isn't authenticated, off-duty, and is a cop is getting 911 calls. Now he is authenticated and he is not getting 911 calls off-duty.

@jxckUK
Copy link
Contributor

jxckUK commented Jun 14, 2024

I was able to validate this:

Screenshot 2024-06-14 102905

This also happens with panic button triggers alike.

It would seem the events ServerEvents.Incoming911Call and ServerEvents.PanicButtonOn are not hitting the clause on line 21 and 46 in validate-events.ts, is the data somehow cached or accessible without authentication?

@casperiv0
Copy link
Member

Would be very weird if any data is cached...

I'll add an explicit property that it does not cache any data. Ps @Georgie15, are you getting any additional logs?

@jxckUK
Copy link
Contributor

jxckUK commented Jun 14, 2024

Would be very weird if any data is cached...

I'll add an explicit property that it does not cache any data. Ps @Georgie15, are you getting any additional logs?

In this scenario, we'd expect even data to not return - is it possible we're not capturing for that instance? As tested, when we don't have data.unit this works as expected, its only when we would not have data at all that it seems to still send notification.

EDIT: From a logic perspective is it not easier to invert the clause, and only send the network event for the notification if data.unit is returned? Would capture all other scenarios and avoid sending notification.

@casperiv0

This comment was marked as resolved.

@casperiv0
Copy link
Member

Ah, I found the bug. Working on it!

@casperiv0
Copy link
Member

casperiv0 commented Jun 14, 2024

All should be fixed in the latest version of SnailyCAD and 0.14.2 of fivem-integrations. Closing this one now!

@casperiv0 casperiv0 added the 🐛 bug Something isn't working label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants