miwarnec / uMMORPG_CE

4 stars 0 forks source link

isClient is false in OnDestroy for summonable entities #32

Closed Ghetaldus closed 3 years ago

Ghetaldus commented 4 years ago

Versions (please complete the following information)

Describe the bug isClient is false in OnDestroy for summoned entities, like mounts and pets.

To Reproduce Steps to reproduce the behavior, please explain every single click that is needed:

  1. Add Debug.Log("isClient " + isClient); to Mount.cs or Pet.cs OnDestroy() method.
  2. Open Unity Editor '...'
  3. Build for Windows '....'
  4. Run Build as server
  5. Run Editor as client
  6. Start server only
  7. Start client, create account and login
  8. Create character and enter the game
  9. Buy item for summoning mount or pet
  10. Use item to to summon any of these and then unsummon them.
  11. Look at clients debug log and see that isClient is false

Expected behavior isClient should be true in OnDestroy() for these.

System (please complete the following information): Windows 10

Additional context This have been working fine prior to 2.20 update, where we even got Mirror updated to v16.10.4. So I guess it has to do with something that have changed in Mirror. Also isClient works fine for Player.cs OnDestroy(). Issue is only for entities that are summoned by player.

Ghetaldus commented 4 years ago

NetworkClient.active is true in OnDestroy, so I am using that as workaround until isClient is fixed.

miwarnec commented 3 years ago

sorry for late reply @Ghetaldus we fixed this a few weeks ago in mirror and added a test to make sure it never happens again.