public void AllowQuery(bool enabled) { if (pointer != IntPtr.Zero) { RakPeer_Native.NET_AllowQuery(pointer, enabled); } }
public void SendToAddress(byte[] data, string target_address, ushort target_port) { if (pointer != IntPtr.Zero) { RakPeer_Native.NETSND_ToAddress(pointer, data, data.Length, target_address, target_port); } }
public void SetQueryResponce(byte[] data) { if (pointer != IntPtr.Zero) { RakPeer_Native.NET_SetQueryResponce(pointer, data); } }
public uint GetMaximumConnections() { if (pointer == IntPtr.Zero) { return(0); } return(RakPeer_Native.NET_GetMaximumConnections(pointer)); }
public uint GetIndexFromGUID(ulong guid) { if (pointer == IntPtr.Zero) { return(0); } return(RakPeer_Native.NET_GetIndexFromGUID(pointer, guid)); }
public ushort GetPort(ulong guid = 0) { if (pointer == IntPtr.Zero) { return(0); } return(RakPeer_Native.NET_GetPort(pointer, guid)); }
public ushort NumberOfConnections() { if (pointer == IntPtr.Zero) { return(0); } return(RakPeer_Native.NET_NumberOfConnections(pointer)); }
public bool IsBannedIP(string address) { if (pointer == IntPtr.Zero) { return(false); } return(RakPeer_Native.NET_IsBannedIP(pointer, address)); }
public void RemoveBanIP(string address) { if (pointer == IntPtr.Zero) { return; } RakPeer_Native.NET_RemoveBanIP(pointer, address); }
public void SetLimitIPConnectionFrequency(bool value) { if (pointer == IntPtr.Zero) { return; } RakPeer_Native.NET_SetLimitIPConnectionFrequency(pointer, value); }
public ulong GetStatisticsTotal(uint index, RNSPerSecondMetrics metrics) { if (pointer == IntPtr.Zero) { return(0); } return(RakPeer_Native.NET_GetStatisticsTotal(pointer, index, metrics)); }
public bool HasPassword() { if (pointer == IntPtr.Zero) { return(false); } return(RakPeer_Native.NET_HasPassword(pointer)); }
public void SetPassword(string password) { if (pointer == IntPtr.Zero) { return; } RakPeer_Native.NET_SetPassword(pointer, password); }
public void SetMaxConnections(ushort max_connections) { if (pointer == IntPtr.Zero) { return; } RakPeer_Native.NET_SetMaxConnections(pointer, max_connections); }
public StartupResult Startup() { if (pointer == IntPtr.Zero) { return(StartupResult.FAILED_TO_CREATE_NETWORK_THREAD); } return(RakPeer_Native.NET_Startup(pointer)); }
public void AddBanIP(string address, int seconds = 60) { if (pointer == IntPtr.Zero) { return; } RakPeer_Native.NET_AddBanIP(pointer, address, seconds); }
public ulong GetGUIDFromIndex(uint index) { if (pointer == IntPtr.Zero) { return(0); } return(RakPeer_Native.NET_GetGUIDFromIndex(pointer, index)); }
public int GetLowestPing(ulong guid = 0) { if (pointer == IntPtr.Zero) { return(0); } return(RakPeer_Native.NET_GetLowestPing(pointer, guid)); }
public ulong GetMyGUID() { if (pointer == IntPtr.Zero) { return(0); } return(RakPeer_Native.NET_MyGUID(pointer)); }
public void CloseConnection(ulong guid, bool send_disconnect_notification = true) { if (pointer == IntPtr.Zero) { return; } RakPeer_Native.NET_CloseConnection(pointer, guid, send_disconnect_notification); }
public byte SendToServer(BitStream stream, PacketPriority priority = PacketPriority.IMMEDIATE_PRIORITY, PacketReliability reliability = PacketReliability.RELIABLE, byte channel = 0) { if (pointer != IntPtr.Zero && stream != null && stream.pointer != IntPtr.Zero) { return(RakPeer_Native.NETSND_ToServer(pointer, stream.pointer, priority, reliability, channel)); } return(0); }
public void SetLimitBandwidth(uint bytesPerSecond) { if (Type != PeerType.Server || pointer == IntPtr.Zero) { return; } RakPeer_Native.NET_LimitBandwidth(pointer, bytesPerSecond * 8); }
public bool IsQueryAllowed() { if (pointer != IntPtr.Zero) { return(RakPeer_Native.NET_IsQueryAllowed(pointer)); } return(false); }
public bool IsActive() { if (pointer == IntPtr.Zero) { return(false); } return(RakPeer_Native.NET_IsActive(pointer)); }
public int ReceiveCount() { if (pointer == IntPtr.Zero) { return(0); } return(RakPeer_Native.NET_ReceiveCount(pointer)); }
public void Destroy() { Shutdown(); if (pointer != IntPtr.Zero) { RakPeer_Native.NET_Destroy(pointer); } }
public ConnectionState GetConnectionState(ulong guid) { if (pointer == IntPtr.Zero) { return(ConnectionState.IS_NOT_CONNECTED); } return(RakPeer_Native.NET_ConnectionState(pointer, guid)); }
private bool is_shutteddown = false;//Damn knows what the mistake is, but I'm too lazy to fix it... (See Shutdown()) public void Shutdown() { if (pointer == IntPtr.Zero || is_shutteddown) { return; } is_shutteddown = true; RakPeer_Native.NET_Shutdown(pointer); }
public bool GetStatisticsFull(uint index, out RakNetStatistics _statistics) { _statistics = new RakNetStatistics(); if (pointer == IntPtr.Zero) { return(false); } return(RakPeer_Native.NET_Statistics(pointer, index, ref _statistics)); }
public bool Ping(string address, ushort port, bool onlyReplyOnAcceptingConnections = false) { StartupResult result = Startup(); if (result == StartupResult.RAKNET_STARTED || result == StartupResult.RAKNET_ALREADY_STARTED) { return(RakPeer_Native.NET_Ping(pointer, address, port, onlyReplyOnAcceptingConnections)); } else { return(false); } }