GlobalState values set to nil client side on reconnect

  1. Client (production/canary) and FXServer version –
  • Both canary and production

  • 3457 FXServer version, tried older versions, same issue occurs

  1. What you expected to happen

GlobalStates values should be synced when user both quits from the game and only does quick disconnect/reconnect

  1. What actually happens

If user enters server for the first time after launching client, GlobalState value is replicated and synced from the server just fine, but if user do Disconnect and then connects back without closing client, GlobalState values will be set as nil and will not sync no matter what, until user quits from the game and enters back in then connects to server.

  1. Category of bug (eg. client, server, weapons, peds, native)

client category. GlobalState is synced just fine across resources server-side

  1. Reproducible steps, preferably with example script(s)
  1. Add simple resource to your server with following functions:
-- server side
if IsDuplicityVersion() then
    --server side
      GlobalState.mode = 'open'
      print(GlobalState.mode) -- prints open just fine
else
    --client side
    RegisterCommand("test", function()
        print( GlobalState.mode )
    end)
end
  1. Start resource, launch FiveM an join server
  2. Upon spawning type /test and it will print “open” in the console
  3. Open f8 type disconnect and then reconnect to server WITHOUT closing FiveM
  4. Upon spawning again, type /test and it will print nil
  5. Quit - close whole game and relaunch it
  6. Connect to the same server and type /test - “open” will be printed in console

Fixed.