Crash on playerJoining

Description:
Calling DropPlayer inside the playerJoining event causes a crash.
This crash might happen on FiveM, although i haven’t tried it.

Server artifact version:
Windows, FXServer 4170

Expected behavior:
To no crash.

Current behavior:
Client crashes with the drop reason being displayed.

Error screenshot:

.dmp/crash files:

Files/Code to reproduce bug:

on('playerJoining', () =>
{
    const playerId = global.source;

    DropPlayer(playerId, 'bye bye');

    return;
});

Extra information:

?

While counterintuitive, this is 100% expected behavior, it’s not possible to interrupt connection once you’ve already told the game to load without breaking e.g. streaming content load and running a high risk at corrupting game state.

If you want to disconnect a player before they’ve joined, do so during playerConnecting in the documented way, or if conditions change, do so after they load.

Random real-world analogy for no reason: compare it with a slide down a hill: you can opt to not let one start to slide down, you can tell someone to stop when they’re at the bottom, but stopping someone midway is extremely complicated and risky.

Sure, i understand the behaviour, still thought it’d be good to atleast mention it here on the forum, hoping it’s somewhat ‘fixable’ or that you’re able to atleast change the crash description to match what you’ve just told me :slight_smile:, should help more clueless people to figure out whats going on in the future.

Also i didn’t provide the crash dump because it’s so easily reproable, still, if you need me to, i can send you one.

The ‘crash description’ already says exactly that: only the actual error message you’re disconnected for. None of the other crash boilerplate. Evidently it’s not a crash. Do you really think users would understand a whole book written about ‘why did it crash’?

On FiveM, this looks a bit as follows (on RedM it probably lacks the ‘because game unloading failed’):

image

A normal crash looks more like this:

image

… and DropPlayer usually looks like this:

image

The only thing I can imagine changing about the disconnection-case crash dialog at least until the crash dialog rewrite is the following:

  • Collapse the details and make ‘save information’ into a small button, not a command link.
  • Remove the ‘this is a fatal error because’ part, I don’t think this has been actioned upon ever at all.
  • Change the UAC error task dialog type to a more plain warning/error icon.
  • Audit early-disconnection flow and see if there’s any easy wins here.

By the way, with this supposed ‘repro’ the client doesn’t even crash when unmodified: It just gets stuck at ‘Connecting to server…’ because what you’re doing is complete nonsense.

2 Likes