Skip to content

Commit afce30f

Browse files
fix: disconnect event not being generated (#2113)
Co-authored-by: Simon Lemay <[email protected]>
1 parent e138a9c commit afce30f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,10 +1285,10 @@ public override void Shutdown()
12851285
SendBatchedMessages(kvp.Key, kvp.Value);
12861286
}
12871287

1288-
// The above flush only puts the message in UTP internal buffers, need the flush send
1289-
// job to execute to actually get things out on the wire. This will also ensure any
1290-
// disconnect messages are sent out.
1291-
m_Driver.ScheduleFlushSend(default).Complete();
1288+
// The above flush only puts the message in UTP internal buffers, need an update to
1289+
// actually get the messages on the wire. (Normally a flush send would be sufficient,
1290+
// but there might be disconnect messages and those require an update call.)
1291+
m_Driver.ScheduleUpdate().Complete();
12921292

12931293
DisposeInternals();
12941294

0 commit comments

Comments
 (0)