Exemple #1
0
        public static bool Initialize()
        {
            if (Native.enet_linked_version() != version)
            {
                throw new InvalidOperationException("Incompatatible version");
            }

            return(Native.enet_initialize() == 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);
        }
Exemple #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);
        }
Exemple #4
0
        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);
        }
Exemple #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);
        }
        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);
        }