You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-17 23:56:30 +09:00
updated garbagethrowersample
This commit is contained in:
@@ -0,0 +1,64 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{6F2BBE07-7D84-4B8B-9882-1556D2C9F79B}</ProjectGuid>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Client</RootNamespace>
|
||||||
|
<AssemblyName>Client</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\..\Lidgren.Network\Lidgren.Network.csproj">
|
||||||
|
<Project>{49ba1c69-6104-41ac-a5d8-b54fa9f696e8}</Project>
|
||||||
|
<Name>Lidgren.Network</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\SamplesCommon\SamplesCommon.csproj">
|
||||||
|
<Project>{773069da-b66e-4667-adcb-0d215ad8cf3e}</Project>
|
||||||
|
<Name>SamplesCommon</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</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>
|
||||||
@@ -20,6 +20,7 @@ namespace Client
|
|||||||
var buffer = new byte[1024];
|
var buffer = new byte[1024];
|
||||||
var rnd = new Random();
|
var rnd = new Random();
|
||||||
|
|
||||||
|
int batch = 0;
|
||||||
// use RawSend to throw poop at server
|
// use RawSend to throw poop at server
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
@@ -43,7 +44,12 @@ namespace Client
|
|||||||
// fling teh poop
|
// fling teh poop
|
||||||
client.RawSend(buffer, 0, length, target);
|
client.RawSend(buffer, 0, length, target);
|
||||||
|
|
||||||
Thread.Sleep(1);
|
batch++;
|
||||||
|
if (batch >= 3)
|
||||||
|
{
|
||||||
|
batch = 0;
|
||||||
|
Thread.Sleep(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lidgren.Network", "..\..\..
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamplesCommon", "..\..\SamplesCommon\SamplesCommon.csproj", "{773069DA-B66E-4667-ADCB-0D215AD8CF3E}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamplesCommon", "..\..\SamplesCommon\SamplesCommon.csproj", "{773069DA-B66E-4667-ADCB-0D215AD8CF3E}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Client\Client.csproj", "{154863C7-4198-48B7-B7BC-CB27821EE7E8}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{CCE7E8B5-4167-464C-9B11-EEB9A4439EC1}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{CCE7E8B5-4167-464C-9B11-EEB9A4439EC1}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Client\Client.csproj", "{6F2BBE07-7D84-4B8B-9882-1556D2C9F79B}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -23,14 +23,14 @@ Global
|
|||||||
{773069DA-B66E-4667-ADCB-0D215AD8CF3E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{773069DA-B66E-4667-ADCB-0D215AD8CF3E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{773069DA-B66E-4667-ADCB-0D215AD8CF3E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{773069DA-B66E-4667-ADCB-0D215AD8CF3E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{773069DA-B66E-4667-ADCB-0D215AD8CF3E}.Release|Any CPU.Build.0 = Release|Any CPU
|
{773069DA-B66E-4667-ADCB-0D215AD8CF3E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{154863C7-4198-48B7-B7BC-CB27821EE7E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{154863C7-4198-48B7-B7BC-CB27821EE7E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{154863C7-4198-48B7-B7BC-CB27821EE7E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{154863C7-4198-48B7-B7BC-CB27821EE7E8}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{CCE7E8B5-4167-464C-9B11-EEB9A4439EC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{CCE7E8B5-4167-464C-9B11-EEB9A4439EC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{CCE7E8B5-4167-464C-9B11-EEB9A4439EC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{CCE7E8B5-4167-464C-9B11-EEB9A4439EC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{CCE7E8B5-4167-464C-9B11-EEB9A4439EC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{CCE7E8B5-4167-464C-9B11-EEB9A4439EC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{CCE7E8B5-4167-464C-9B11-EEB9A4439EC1}.Release|Any CPU.Build.0 = Release|Any CPU
|
{CCE7E8B5-4167-464C-9B11-EEB9A4439EC1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{6F2BBE07-7D84-4B8B-9882-1556D2C9F79B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{6F2BBE07-7D84-4B8B-9882-1556D2C9F79B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{6F2BBE07-7D84-4B8B-9882-1556D2C9F79B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{6F2BBE07-7D84-4B8B-9882-1556D2C9F79B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ namespace Server
|
|||||||
NetPeerConfiguration config = new NetPeerConfiguration("garbagethrower");
|
NetPeerConfiguration config = new NetPeerConfiguration("garbagethrower");
|
||||||
config.MaximumConnections = 1;
|
config.MaximumConnections = 1;
|
||||||
config.Port = 14242;
|
config.Port = 14242;
|
||||||
|
config.PingInterval = 2.0f;
|
||||||
|
config.ConnectionTimeout = 2.0f;
|
||||||
var server = new NetServer(config);
|
var server = new NetServer(config);
|
||||||
|
|
||||||
server.Start();
|
server.Start();
|
||||||
|
|||||||
Reference in New Issue
Block a user