|
|
@@ -38,54 +38,35 @@ namespace ENet
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
public struct ENetAddress
|
|
|
{
|
|
|
- public uint host;
|
|
|
- public ushort port;
|
|
|
+ public uint Host;
|
|
|
+ public ushort Port;
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
public struct ENetCallbacks
|
|
|
{
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
- public delegate IntPtr malloc_cb(IntPtr size);
|
|
|
+ public delegate IntPtr MallocCb(IntPtr size);
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
- public delegate void free_cb(IntPtr memory);
|
|
|
+ public delegate void FreeCb(IntPtr memory);
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
- public delegate void no_memory_cb();
|
|
|
+ public delegate void NoMemoryCb();
|
|
|
|
|
|
private readonly IntPtr malloc;
|
|
|
private readonly IntPtr free;
|
|
|
private readonly IntPtr no_memory;
|
|
|
}
|
|
|
|
|
|
- [StructLayout(LayoutKind.Sequential)]
|
|
|
- public struct ENetCompressor
|
|
|
- {
|
|
|
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
- public delegate void compress_cb(
|
|
|
- IntPtr context, IntPtr inBuffers, IntPtr inBufferCount, IntPtr inLimit,
|
|
|
- IntPtr outData, IntPtr outLimit);
|
|
|
-
|
|
|
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
- public delegate void decompress_cb(
|
|
|
- IntPtr context, IntPtr inData, IntPtr inLimit, IntPtr outData, IntPtr outLimit);
|
|
|
-
|
|
|
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
- public delegate void destroy_cb(IntPtr context);
|
|
|
-
|
|
|
- public IntPtr context;
|
|
|
- public IntPtr compress, decompress, destroy;
|
|
|
- }
|
|
|
-
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
public class ENetEvent
|
|
|
{
|
|
|
- public EventType type;
|
|
|
- public IntPtr peer;
|
|
|
- public byte channelID;
|
|
|
- public uint data;
|
|
|
- public IntPtr packet;
|
|
|
+ public EventType Type;
|
|
|
+ public IntPtr Peer;
|
|
|
+ public byte ChannelID;
|
|
|
+ public uint Data;
|
|
|
+ public IntPtr Packet;
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
@@ -96,8 +77,8 @@ namespace ENet
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
public class ENetListNode
|
|
|
{
|
|
|
- public ENetListNode next;
|
|
|
- public ENetListNode previous;
|
|
|
+ public ENetListNode Next;
|
|
|
+ public ENetListNode Previous;
|
|
|
}
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
@@ -106,25 +87,26 @@ namespace ENet
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
public struct ENetPacket
|
|
|
{
|
|
|
- public uint referenceCount;
|
|
|
- public uint flags;
|
|
|
- public IntPtr data;
|
|
|
- public uint dataLength;
|
|
|
- public ENetPacketFreeCallback freeCallback;
|
|
|
+ public uint ReferenceCount;
|
|
|
+ public uint Flags;
|
|
|
+ public IntPtr Data;
|
|
|
+ public uint DataLength;
|
|
|
+ public ENetPacketFreeCallback FreeCallback;
|
|
|
+ public IntPtr UserData;
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
public struct ENetPeer
|
|
|
{
|
|
|
- public ENetListNode dispatchList;
|
|
|
- public readonly IntPtr host;
|
|
|
- public readonly ushort outgoingPeerID;
|
|
|
- public readonly ushort incomingPeerID;
|
|
|
- public readonly uint connectID;
|
|
|
- public readonly byte outgoingSessionID;
|
|
|
- public readonly byte incomingSessionID;
|
|
|
- public ENetAddress address;
|
|
|
- public IntPtr data;
|
|
|
- public readonly PeerState state;
|
|
|
+ public ENetListNode DispatchList;
|
|
|
+ public readonly IntPtr Host;
|
|
|
+ public readonly ushort OutgoingPeerID;
|
|
|
+ public readonly ushort IncomingPeerID;
|
|
|
+ public readonly uint ConnectID;
|
|
|
+ public readonly byte OutgoingSessionID;
|
|
|
+ public readonly byte IncomingSessionID;
|
|
|
+ public ENetAddress Address;
|
|
|
+ public IntPtr Data;
|
|
|
+ public readonly PeerState State;
|
|
|
}
|
|
|
}
|