|
@@ -528,6 +528,7 @@ namespace ENet {
|
|
|
|
|
|
|
|
public struct Peer {
|
|
public struct Peer {
|
|
|
private IntPtr nativePeer;
|
|
private IntPtr nativePeer;
|
|
|
|
|
+ private uint? nativeID;
|
|
|
|
|
|
|
|
internal IntPtr NativeData {
|
|
internal IntPtr NativeData {
|
|
|
get {
|
|
get {
|
|
@@ -541,6 +542,7 @@ namespace ENet {
|
|
|
|
|
|
|
|
public Peer(IntPtr peer) {
|
|
public Peer(IntPtr peer) {
|
|
|
nativePeer = peer;
|
|
nativePeer = peer;
|
|
|
|
|
+ nativeID = nativePeer != IntPtr.Zero ? Native.enet_peer_get_id(nativePeer) : 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public bool IsSet {
|
|
public bool IsSet {
|
|
@@ -551,9 +553,7 @@ namespace ENet {
|
|
|
|
|
|
|
|
public uint ID {
|
|
public uint ID {
|
|
|
get {
|
|
get {
|
|
|
- CheckCreated();
|
|
|
|
|
-
|
|
|
|
|
- return Native.enet_peer_get_id(nativePeer);
|
|
|
|
|
|
|
+ return nativeID ?? 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|