Merge pull request #11 from emirthab/master

Added GetConnectedId to Peer
This commit is contained in:
Melissa 2024-07-19 10:27:06 +02:00 committed by GitHub
commit af0e3f4fec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,6 +12,7 @@ import (
// Peer is a peer which data packets may be sent or received from
type Peer interface {
GetAddress() Address
GetConnectId() uint
Disconnect(data uint32)
DisconnectNow(data uint32)
@ -51,6 +52,10 @@ func (peer enetPeer) GetAddress() Address {
}
}
func (peer enetPeer) GetConnectId() uint {
return uint(peer.cPeer.connectID)
}
func (peer enetPeer) Disconnect(data uint32) {
C.enet_peer_disconnect(
peer.cPeer,