public static bool Initialize(Callbacks inits)
        {
            if (!Initialized)
            {
                return(false);
            }

            Initialized = false;
            return(Native.enet_initialize_with_callbacks(version, inits.NativeData) == 0);
        }
Beispiel #2
0
        public static bool Initialize(Callbacks callbacks)
        {
            if (callbacks == null)
            {
                throw new ArgumentNullException("callbacks");
            }

            ENetCallbacks nativeCallbacks = callbacks.NativeData;

            return(Native.enet_initialize_with_callbacks(version, ref nativeCallbacks) == 0);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }
Beispiel #6
0
 public static bool Initialize(Callbacks inits)
 {
     return(Native.enet_initialize_with_callbacks(version, inits.NativeData) == 0);
 }
Beispiel #7
0
        public static bool Initialize(Callbacks inits)
        {
            var nativeCallbacks = inits.NativeData;

            return(Native.enet_initialize_with_callbacks(version, ref nativeCallbacks) == 0);
        }
Beispiel #8
0
        public static bool Initialize(Callbacks callbacks)
        {
            ENetCallbacks nativeCallbacks = callbacks.NativeData;

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