コード例 #1
0
ファイル: ENet.cs プロジェクト: fadinglr/ENet-CSharp
        public static bool Initialize()
        {
            if (Native.enet_linked_version() != version)
            {
                throw new InvalidOperationException("Incompatatible version");
            }

            return(Native.enet_initialize() == 0);
        }
コード例 #2
0
        public static bool Initialize()
        {
            if (Native.enet_linked_version() != version)
            {
                throw new InvalidOperationException("You're trying to use an incompatible version of Enet with this Managed Library.");
            }

            return(Native.enet_initialize() == 0);
        }
コード例 #3
0
        public static bool Initialize()
        {
            if (Native.enet_linked_version() != version)
            {
                throw new InvalidOperationException("ENet native is out of date. Download the latest release from https://github.com/SoftwareGuy/ENet-CSharp/releases");
            }

            return(Native.enet_initialize() == 0);
        }
コード例 #4
0
ファイル: ENet.cs プロジェクト: fadinglr/ENet-CSharp
        public static bool Initialize(Callbacks callbacks)
        {
            if (callbacks == null)
            {
                throw new ArgumentNullException("callbacks");
            }

            if (Native.enet_linked_version() != version)
            {
                throw new InvalidOperationException("Incompatatible version");
            }

            ENetCallbacks nativeCallbacks = callbacks.NativeData;

            return(Native.enet_initialize_with_callbacks(version, ref nativeCallbacks) == 0);
        }
コード例 #5
0
        public static bool Initialize(Callbacks callbacks)
        {
            if (callbacks == null)
            {
                throw new ArgumentNullException("callbacks");
            }

            if (Native.enet_linked_version() != version)
            {
                throw new InvalidOperationException("ENet native is out of date. Download the latest release from https://github.com/SoftwareGuy/ENet-CSharp/releases");
            }

            ENetCallbacks nativeCallbacks = callbacks.NativeData;

            return(Native.enet_initialize_with_callbacks(version, ref nativeCallbacks) == 0);
        }
コード例 #6
0
        public static bool Initialize(Callbacks callbacks)
        {
            if (callbacks == null)
            {
                throw new ArgumentNullException("callbacks");
            }

            if (Native.enet_linked_version() != version)
            {
                throw new InvalidOperationException("You're trying to use an incompatible version of Enet with this Managed Library.");
            }


            ENetCallbacks nativeCallbacks = callbacks.NativeData;

            return(Native.enet_initialize_with_callbacks(version, ref nativeCallbacks) == 0);
        }