miwarnec / DOTSNET

Public DOTSNET issue tracker
20 stars 0 forks source link

the NetworkClientSystem spawned dictionnary wont get cleared if the transport disconnect the client #53

Closed Nyert closed 2 years ago

Nyert commented 2 years ago

Describe the bug the NetworkClientSystem spawned dictionnary wont get cleared if the transport disconnect the client.

[IMPORTANT] How can we reproduce the issue, step by step:

  1. make a build version and run it
  2. play in the editor
  3. start the server
  4. connect with the build version as a client
  5. stop the server in the editor
  6. start the server again
  7. reconnect with the build
  8. it should crash (access violation error)

Expected behavior should not crash and connect instead

Desktop (please complete the following information):

miwarnec commented 2 years ago

tried it without issues on 2021.2.3 and latest dotsnet. are you sure the bug still exists? do you have a stack trace?

2021-12-03_14-05-57@2x
miwarnec commented 2 years ago

looks like volunatry Disconnect() clears state, but ONDisconnect doesn't though

miwarnec commented 2 years ago

ironically delta snapshots auto spawns all the previous ones which are not in first spawn message. but still need to refactor the code so that voluntary and involuntary disconnects both call OnDisconnected

miwarnec commented 2 years ago

added a test to reproduce & to avoid it in the future:

2021-12-03_14-36-26@2x
miwarnec commented 2 years ago

fixed in next version, thanks