(61d00a474) v0.9.7.1
This commit is contained in:
17
Libraries/Lidgren.Network/Lidgren.NetStandard.csproj
Normal file
17
Libraries/Lidgren.Network/Lidgren.NetStandard.csproj
Normal file
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Authors>Lidgren</Authors>
|
||||
<Company />
|
||||
<Product>Lidgren.Network</Product>
|
||||
<Copyright>Copyright (c) 2015 lidgren</Copyright>
|
||||
<Version>2012.1.7.0</Version>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,195 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{49BA1C69-6104-41AC-A5D8-B54FA9F696E8}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Lidgren.Network</RootNamespace>
|
||||
<AssemblyName>Lidgren.Network</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
<ReleaseVersion>0.9.0.0</ReleaseVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<DocumentationFile>bin\Debug\Lidgren.Network.XML</DocumentationFile>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;USE_RELEASE_STATISTICS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile>bin\Debug\Lidgren.Network.XML</DocumentationFile>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;USE_RELEASE_STATISTICS</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Encryption\NetAESEncryption.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Encryption\NetCryptoProviderBase.cs" />
|
||||
<Compile Include="Encryption\NetDESEncryption.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Encryption\NetEncryption.cs" />
|
||||
<Compile Include="Encryption\NetBlockEncryptionBase.cs" />
|
||||
<Compile Include="Encryption\NetRC2Encryption.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Encryption\NetTripleDESEncryption.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Encryption\NetXorEncryption.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Encryption\NetXteaEncryption.cs" />
|
||||
<Compile Include="NamespaceDoc.cs" />
|
||||
<Compile Include="NetBigInteger.cs" />
|
||||
<Compile Include="NetBitVector.cs" />
|
||||
<Compile Include="NetBitWriter.cs" />
|
||||
<Compile Include="NetBuffer.cs" />
|
||||
<Compile Include="NetBuffer.Peek.cs" />
|
||||
<Compile Include="NetBuffer.Read.cs" />
|
||||
<Compile Include="NetBuffer.Read.Reflection.cs" />
|
||||
<Compile Include="NetBuffer.Write.cs" />
|
||||
<Compile Include="NetBuffer.Write.Reflection.cs" />
|
||||
<Compile Include="NetClient.cs" />
|
||||
<Compile Include="NetConnection.cs" />
|
||||
<Compile Include="NetConnection.Handshake.cs" />
|
||||
<Compile Include="NetConnection.Latency.cs" />
|
||||
<Compile Include="NetConnection.MTU.cs" />
|
||||
<Compile Include="NetConnectionStatistics.cs" />
|
||||
<Compile Include="NetConnectionStatus.cs" />
|
||||
<Compile Include="NetConstants.cs" />
|
||||
<Compile Include="NetDeliveryMethod.cs" />
|
||||
<Compile Include="NetException.cs" />
|
||||
<Compile Include="NetFragmentationHelper.cs" />
|
||||
<Compile Include="NetIncomingMessage.cs" />
|
||||
<Compile Include="NetIncomingMessageType.cs" />
|
||||
<Compile Include="NetMessageType.cs" />
|
||||
<Compile Include="NetNatIntroduction.cs" />
|
||||
<Compile Include="NetOutgoingMessage.cs" />
|
||||
<Compile Include="NetPeer.cs" />
|
||||
<Compile Include="NetPeer.Discovery.cs" />
|
||||
<Compile Include="NetPeer.Fragmentation.cs" />
|
||||
<Compile Include="NetPeer.Internal.cs" />
|
||||
<Compile Include="NetPeer.LatencySimulation.cs" />
|
||||
<Compile Include="NetPeer.Logging.cs" />
|
||||
<Compile Include="NetPeer.MessagePools.cs" />
|
||||
<Compile Include="NetPeer.Send.cs" />
|
||||
<Compile Include="NetPeerConfiguration.cs" />
|
||||
<Compile Include="NetPeerStatistics.cs" />
|
||||
<Compile Include="NetPeerStatus.cs" />
|
||||
<Compile Include="NetQueue.cs" />
|
||||
<Compile Include="NetRandom.cs" />
|
||||
<Compile Include="NetRandom.Implementations.cs" />
|
||||
<Compile Include="NetRandomSeed.cs" />
|
||||
<Compile Include="NetReceiverChannelBase.cs" />
|
||||
<Compile Include="NetReliableOrderedReceiver.cs" />
|
||||
<Compile Include="NetReliableSenderChannel.cs" />
|
||||
<Compile Include="NetReliableSequencedReceiver.cs" />
|
||||
<Compile Include="NetReliableUnorderedReceiver.cs" />
|
||||
<Compile Include="NetSenderChannelBase.cs" />
|
||||
<Compile Include="NetSendResult.cs" />
|
||||
<Compile Include="NetServer.cs" />
|
||||
<Compile Include="NetSRP.cs" />
|
||||
<Compile Include="NetStoredReliableMessage.cs" />
|
||||
<Compile Include="NetTime.cs" />
|
||||
<Compile Include="NetTuple.cs" />
|
||||
<Compile Include="NetUnreliableSenderChannel.cs" />
|
||||
<Compile Include="NetUnreliableSequencedReceiver.cs" />
|
||||
<Compile Include="NetUnreliableUnorderedReceiver.cs" />
|
||||
<Compile Include="NetUPnP.cs" />
|
||||
<Compile Include="NetUtility.cs" />
|
||||
<Compile Include="Platform\PlatformAndroid.cs" />
|
||||
<Compile Include="Platform\PlatformConstrained.cs" />
|
||||
<Compile Include="Platform\PlatformWin32.cs" />
|
||||
<Compile Include="Platform\PlatformWinRT.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -76,7 +76,7 @@ namespace Lidgren.Network
|
||||
MethodInfo[] methods = typeof(NetIncomingMessage).GetMethods(BindingFlags.Instance | BindingFlags.Public);
|
||||
foreach (MethodInfo mi in methods)
|
||||
{
|
||||
if (mi.GetParameters().Length == 0 && mi.Name.StartsWith("Read", StringComparison.InvariantCulture) && mi.Name.Substring(4) == mi.ReturnType.Name)
|
||||
if (mi.GetParameters().Length == 0 && mi.Name.StartsWith("Read", StringComparison.OrdinalIgnoreCase) && mi.Name.Substring(4) == mi.ReturnType.Name)
|
||||
{
|
||||
s_readMethods[mi.ReturnType] = mi;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ namespace Lidgren.Network
|
||||
methods = typeof(NetOutgoingMessage).GetMethods(BindingFlags.Instance | BindingFlags.Public);
|
||||
foreach (MethodInfo mi in methods)
|
||||
{
|
||||
if (mi.Name.Equals("Write", StringComparison.InvariantCulture))
|
||||
if (mi.Name.Equals("Write", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
ParameterInfo[] pis = mi.GetParameters();
|
||||
if (pis.Length == 1)
|
||||
|
||||
@@ -580,5 +580,13 @@ namespace Lidgren.Network
|
||||
{
|
||||
return "[NetConnection to " + m_remoteEndPoint + "]";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Causes the connection to time out immediately. Only intended for testing.
|
||||
/// </summary>
|
||||
public void ForceTimeOut()
|
||||
{
|
||||
m_timeoutDeadline = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,6 +506,14 @@ namespace Lidgren.Network
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Changes the number of maximum connections after the peer has been started
|
||||
/// </summary>
|
||||
internal void ChangeMaximumConnectionsInternal(int num)
|
||||
{
|
||||
m_maximumConnections = num;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a memberwise shallow clone of this configuration
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
||||
namespace Lidgren.Network
|
||||
{
|
||||
@@ -66,5 +68,33 @@ namespace Lidgren.Network
|
||||
{
|
||||
return "[NetServer " + ConnectionsCount + " connections]";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes the number of maximum allowed connections, closing existing ones if the limit is lowered below the current amount.
|
||||
/// </summary>
|
||||
public void ChangeMaximumConnections(int num)
|
||||
{
|
||||
m_configuration.ChangeMaximumConnectionsInternal(num);
|
||||
|
||||
int reservedSlots = m_handshakes.Count + m_connections.Count;
|
||||
while (reservedSlots >= m_configuration.m_maximumConnections)
|
||||
{
|
||||
if (m_handshakes.Count > 0)
|
||||
{
|
||||
IPEndPoint endpoint = m_handshakes.Keys.Last();
|
||||
|
||||
// server full
|
||||
NetOutgoingMessage full = CreateMessage("Server full");
|
||||
full.m_messageType = NetMessageType.Disconnect;
|
||||
SendLibrary(full, endpoint);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_connections.Last().Disconnect("Server full");
|
||||
}
|
||||
|
||||
reservedSlots = m_handshakes.Count + m_connections.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ namespace Lidgren.Network
|
||||
{
|
||||
if (j >= h)
|
||||
{
|
||||
if (string.Compare(list[j - h].Name, tmp.Name, StringComparison.InvariantCulture) > 0)
|
||||
if (string.Compare(list[j - h].Name, tmp.Name, StringComparison.OrdinalIgnoreCase) > 0)
|
||||
{
|
||||
list[j] = list[j - h];
|
||||
j -= h;
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Lidgren.Network")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Lidgren.Network")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("78f2a988-46e1-4fc4-b7b4-dd2cbe46da6a")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2012.1.7.0")]
|
||||
[assembly: AssemblyFileVersion("2012.1.7.0")]
|
||||
[assembly: System.CLSCompliant(true)]
|
||||
Reference in New Issue
Block a user