v0.8.0
Core
- Optional disconnect reason on graceful disconnects.
CloseConnectiongains a final optionalconst BitStream *reasonDataargument whose bytes are appended right after theID_DISCONNECTION_NOTIFICATIONmessage ID, so the remote peer can learn why it was dropped (e.g. a kick/ban enum plus a custom string). The receiver reads it like any other message body —packet->data + 1forpacket->length - 1bytes. Only graceful disconnects carry a reason; locally-synthesized notifications (ID_CONNECTION_LOSTand the timeout/dead-connection path) stay payload-less, so consumers must tolerate a zero-length body. Wire-backward-compatible: peers that only inspectdata[0]are unaffected.
Bug fix
RakPeer::CloseConnectionno longer coerces an unresolved target index (-1fromGetIndexFromSystemAddress) to0and then readsremoteSystemList[0]— which targeted an unrelated peer's slot or crashed when the list was unallocated. The close socket is now resolved without assuming a valid slot index.
Testing
- Added
DisconnectReasonTestcovering reason round-trip, thenullptrdefault, and the empty-but-non-nullBitStreamguard.
Full Changelog: v0.7.0...v0.8.0