Commit 78cad42
authored
fix: Don't accept invalid connections in UnityTransport.Send (#3382)
This avoids the error message reported in
[MTTB-1143](https://jira.unity3d.com/browse/MTTB-1143).
The `UnityTransport.Send` method would happily accept invalid or stale
connections, which would lead to the allocation of a `BatchedSendQueue`
structure and to an error message when the batched sends are passed on
to the driver.
In MTTB-1143 we'd get a send on client ID 0, but that's not a valid
client ID in `UnityTransport`. My guess is that there's something
somewhere (possibly in Boss Room) triggering a send to the server after
the connection has closed (which reverts `UnityTransport.ServerClientId`
to its default value of 0). Of course, ideally there'd never be such a
send-after-disconnect and that's what should be ultimately addressed.
But the bug is quite hard to reproduce, so as a stopgap until we have
something better I'm making a fix that only avoids the last and more
user-visible consequences of the issue.1 parent 53b94ca commit 78cad42
File tree
3 files changed
+24
-1
lines changed- com.unity.netcode.gameobjects
- Runtime/Transports/UTP
- Tests/Runtime/Transports
3 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1347 | 1347 | | |
1348 | 1348 | | |
1349 | 1349 | | |
1350 | | - | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1351 | 1355 | | |
| 1356 | + | |
1352 | 1357 | | |
1353 | 1358 | | |
1354 | 1359 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
486 | 503 | | |
487 | 504 | | |
0 commit comments