You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-17 15:46:33 +09:00
Added some UNITY defines; fix by aeronaut84. Untested.
This commit is contained in:
@@ -19,7 +19,7 @@ namespace Lidgren.Network
|
||||
|
||||
static NetAESEncryption()
|
||||
{
|
||||
#if !IOS && !__ANDROID__
|
||||
#if !IOS && !__ANDROID__ && !UNITY_4_5
|
||||
AesCryptoServiceProvider aes = new AesCryptoServiceProvider();
|
||||
List<int> temp = new List<int>();
|
||||
foreach (KeySizes keysize in aes.LegalKeySizes)
|
||||
@@ -103,7 +103,7 @@ namespace Lidgren.Network
|
||||
/// </summary>
|
||||
public bool Encrypt(NetOutgoingMessage msg)
|
||||
{
|
||||
#if !IOS && !__ANDROID__
|
||||
#if !IOS && !__ANDROID__ && !UNITY_4_5
|
||||
try
|
||||
{
|
||||
// nested usings are fun!
|
||||
@@ -138,7 +138,7 @@ namespace Lidgren.Network
|
||||
/// </summary>
|
||||
public bool Decrypt(NetIncomingMessage msg)
|
||||
{
|
||||
#if !IOS && !__ANDROID__
|
||||
#if !IOS && !__ANDROID__ && !UNITY_4_5
|
||||
try
|
||||
{
|
||||
// nested usings are fun!
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if !__ANDROID__ && !IOS
|
||||
#if !__ANDROID__ && !IOS && !UNITY_WEBPLAYER
|
||||
#define IS_MAC_AVAILABLE
|
||||
#endif
|
||||
|
||||
|
||||
@@ -35,6 +35,10 @@ namespace Lidgren.Network
|
||||
// -4 bytes to be on the safe side and align to 8-byte boundary
|
||||
// Total 1408 bytes
|
||||
// Note that lidgren headers (5 bytes) are not included here; since it's part of the "mtu payload"
|
||||
|
||||
/// <summary>
|
||||
/// Default MTU value in bytes
|
||||
/// </summary>
|
||||
public const int kDefaultMTU = 1408;
|
||||
|
||||
private const string c_isLockedMessage = "You may not modify the NetPeerConfiguration after it has been used to initialize a NetPeer";
|
||||
|
||||
@@ -16,13 +16,17 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRA
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#if !__ANDROID__ && !IOS
|
||||
#if !__ANDROID__ && !IOS && !UNITY_WEBPLAYER
|
||||
#define IS_FULL_NET_AVAILABLE
|
||||
#endif
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
#if IS_FULL_NET_AVAILABLE
|
||||
using System.Net.NetworkInformation;
|
||||
#endif
|
||||
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
Reference in New Issue
Block a user