mirror of
https://github.com/codecat/go-enet.git
synced 2025-12-08 05:59:47 +00:00
Merge pull request #11 from emirthab/master
Added GetConnectedId to Peer
This commit is contained in:
commit
af0e3f4fec
1 changed files with 5 additions and 0 deletions
5
peer.go
5
peer.go
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue