Init
This commit is contained in:
325
Samples/BigPacketTest/BigPacketTest.cpp
Normal file
325
Samples/BigPacketTest/BigPacketTest.cpp
Normal file
@ -0,0 +1,325 @@
|
||||
/*
|
||||
* Original work: Copyright (c) 2014, Oculus VR, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* RakNet License.txt file in the licenses directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the RakNet Patents.txt file in the same directory.
|
||||
*
|
||||
*
|
||||
* Modified work: Copyright (c) 2016-2019, SLikeSoft UG (haftungsbeschränkt)
|
||||
*
|
||||
* This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
|
||||
* license found in the license.txt file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include "slikenet/peerinterface.h"
|
||||
#include "slikenet/BitStream.h"
|
||||
#include <stdlib.h> // For atoi
|
||||
#include <cstring> // For strlen
|
||||
#include "slikenet/statistics.h"
|
||||
#include "slikenet/GetTime.h"
|
||||
#include "slikenet/MessageIdentifiers.h"
|
||||
#include "slikenet/MTUSize.h"
|
||||
#include <stdio.h>
|
||||
#include "slikenet/Kbhit.h"
|
||||
#include "slikenet/sleep.h"
|
||||
#include "slikenet/Gets.h"
|
||||
#include "slikenet/linux_adapter.h"
|
||||
#include "slikenet/osx_adapter.h"
|
||||
|
||||
bool quit;
|
||||
bool sentPacket=false;
|
||||
|
||||
#define BIG_PACKET_SIZE 83296256
|
||||
|
||||
using namespace SLNet;
|
||||
|
||||
RakPeerInterface *client, *server;
|
||||
char *text;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
client=server=0;
|
||||
|
||||
text= new char [BIG_PACKET_SIZE];
|
||||
quit=false;
|
||||
int ch;
|
||||
|
||||
printf("This is a test I use to test the packet splitting capabilities of RakNet\n");
|
||||
printf("All it does is send a large block of data to the feedback loop\n");
|
||||
printf("Difficulty: Beginner\n\n");
|
||||
|
||||
printf("Enter 's' to run as server, 'c' to run as client, space to run local.\n");
|
||||
ch=' ';
|
||||
Gets(text,BIG_PACKET_SIZE);
|
||||
ch=text[0];
|
||||
|
||||
if (ch=='c')
|
||||
{
|
||||
client= SLNet::RakPeerInterface::GetInstance();
|
||||
printf("Working as client\n");
|
||||
printf("Enter remote IP: ");
|
||||
Gets(text,BIG_PACKET_SIZE);
|
||||
if (text[0]==0)
|
||||
strcpy_s(text, BIG_PACKET_SIZE, "natpunch.slikesoft.com"); // dx in Europe
|
||||
}
|
||||
else if (ch=='s')
|
||||
{
|
||||
server= SLNet::RakPeerInterface::GetInstance();
|
||||
printf("Working as server\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
client= SLNet::RakPeerInterface::GetInstance();
|
||||
server= SLNet::RakPeerInterface::GetInstance();;
|
||||
strcpy_s(text, BIG_PACKET_SIZE, "127.0.0.1");
|
||||
}
|
||||
|
||||
// Test IPV6
|
||||
short socketFamily;
|
||||
socketFamily=AF_INET;
|
||||
//socketFamily=AF_INET6;
|
||||
|
||||
if (server)
|
||||
{
|
||||
server->SetTimeoutTime(5000, SLNet::UNASSIGNED_SYSTEM_ADDRESS);
|
||||
SLNet::SocketDescriptor socketDescriptor(3000,0);
|
||||
socketDescriptor.socketFamily=socketFamily;
|
||||
server->SetMaximumIncomingConnections(4);
|
||||
StartupResult sr;
|
||||
sr=server->Startup(4, &socketDescriptor, 1);
|
||||
if (sr!=RAKNET_STARTED)
|
||||
{
|
||||
printf("Server failed to start. Error=%i\n", sr);
|
||||
return 1;
|
||||
}
|
||||
// server->SetPerConnectionOutgoingBandwidthLimit(40000);
|
||||
|
||||
printf("Started server on %s\n", server->GetMyBoundAddress().ToString(true));
|
||||
}
|
||||
if (client)
|
||||
{
|
||||
client->SetTimeoutTime(5000, SLNet::UNASSIGNED_SYSTEM_ADDRESS);
|
||||
SLNet::SocketDescriptor socketDescriptor(0,0);
|
||||
socketDescriptor.socketFamily=socketFamily;
|
||||
StartupResult sr;
|
||||
sr=client->Startup(4, &socketDescriptor, 1);
|
||||
if (sr!=RAKNET_STARTED)
|
||||
{
|
||||
printf("Client failed to start. Error=%i\n", sr);
|
||||
return 1;
|
||||
}
|
||||
client->SetSplitMessageProgressInterval(10000); // Get ID_DOWNLOAD_PROGRESS notifications
|
||||
// client->SetPerConnectionOutgoingBandwidthLimit(28800);
|
||||
|
||||
printf("Started client on %s\n", client->GetMyBoundAddress().ToString(true));
|
||||
|
||||
client->Connect(text, 3000, 0, 0);
|
||||
}
|
||||
RakSleep(500);
|
||||
|
||||
printf("My IP addresses:\n");
|
||||
RakPeerInterface *rakPeer;
|
||||
if (server)
|
||||
rakPeer=server;
|
||||
else
|
||||
rakPeer=client;
|
||||
for (unsigned int i=0; i < rakPeer->GetNumberOfAddresses(); i++)
|
||||
{
|
||||
printf("%u. %s\n", i+1, rakPeer->GetLocalIP(i));
|
||||
}
|
||||
|
||||
|
||||
// Always apply the network simulator on two systems, never just one, with half the values on each.
|
||||
// Otherwise the flow control gets confused.
|
||||
// if (client)
|
||||
// client->ApplyNetworkSimulator(.01, 0, 0);
|
||||
// if (server)
|
||||
// server->ApplyNetworkSimulator(.01, 0, 0);
|
||||
|
||||
SLNet::TimeMS start,stop;
|
||||
|
||||
SLNet::TimeMS nextStatTime = SLNet::GetTimeMS() + 1000;
|
||||
SLNet::Packet *packet;
|
||||
start= SLNet::GetTimeMS();
|
||||
while (!quit)
|
||||
{
|
||||
if (server)
|
||||
{
|
||||
for (packet = server->Receive(); packet; server->DeallocatePacket(packet), packet=server->Receive())
|
||||
{
|
||||
if (packet->data[0]==ID_NEW_INCOMING_CONNECTION || packet->data[0]==253)
|
||||
{
|
||||
printf("Starting send\n");
|
||||
start= SLNet::GetTimeMS();
|
||||
// #med - replace BIG_PACKET_SIZE macro with static const
|
||||
#if BIG_PACKET_SIZE <= 100000
|
||||
for (int i=0; i < BIG_PACKET_SIZE; i++)
|
||||
text[i]=255-(i&255);
|
||||
#else
|
||||
text[0]=(unsigned char) 255;
|
||||
#endif
|
||||
server->Send(text, BIG_PACKET_SIZE, LOW_PRIORITY, RELIABLE_ORDERED_WITH_ACK_RECEIPT, 0, packet->systemAddress, false);
|
||||
// Keep the stat from updating until the messages move to the thread or it quits right away
|
||||
nextStatTime= SLNet::GetTimeMS()+1000;
|
||||
}
|
||||
if (packet->data[0]==ID_CONNECTION_LOST)
|
||||
printf("ID_CONNECTION_LOST from %s\n", packet->systemAddress.ToString());
|
||||
else if (packet->data[0]==ID_DISCONNECTION_NOTIFICATION)
|
||||
printf("ID_DISCONNECTION_NOTIFICATION from %s\n", packet->systemAddress.ToString());
|
||||
else if (packet->data[0]==ID_NEW_INCOMING_CONNECTION)
|
||||
printf("ID_NEW_INCOMING_CONNECTION from %s\n", packet->systemAddress.ToString());
|
||||
else if (packet->data[0]==ID_CONNECTION_REQUEST_ACCEPTED)
|
||||
printf("ID_CONNECTION_REQUEST_ACCEPTED from %s\n", packet->systemAddress.ToString());
|
||||
}
|
||||
|
||||
if (_kbhit())
|
||||
{
|
||||
ch=_getch();
|
||||
if (ch==' ')
|
||||
{
|
||||
printf("Sending medium priority message\n");
|
||||
char t[1];
|
||||
t[0]=(unsigned char) 254;
|
||||
server->Send(t, 1, MEDIUM_PRIORITY, RELIABLE_ORDERED, 1, SLNet::UNASSIGNED_SYSTEM_ADDRESS, true);
|
||||
}
|
||||
if (ch=='q')
|
||||
quit=true;
|
||||
}
|
||||
}
|
||||
if (client)
|
||||
{
|
||||
packet = client->Receive();
|
||||
while (packet)
|
||||
{
|
||||
if (packet->data[0]==ID_DOWNLOAD_PROGRESS)
|
||||
{
|
||||
SLNet::BitStream progressBS(packet->data, packet->length, false);
|
||||
progressBS.IgnoreBits(8); // ID_DOWNLOAD_PROGRESS
|
||||
unsigned int progress;
|
||||
unsigned int total;
|
||||
unsigned int partLength;
|
||||
|
||||
// Disable endian swapping on reading this, as it's generated locally in ReliabilityLayer.cpp
|
||||
progressBS.ReadBits( (unsigned char* ) &progress, BYTES_TO_BITS(sizeof(progress)), true );
|
||||
progressBS.ReadBits( (unsigned char* ) &total, BYTES_TO_BITS(sizeof(total)), true );
|
||||
progressBS.ReadBits( (unsigned char* ) &partLength, BYTES_TO_BITS(sizeof(partLength)), true );
|
||||
|
||||
printf("Progress: msgID=%i Progress %i/%i Partsize=%i\n",
|
||||
(unsigned char) packet->data[0],
|
||||
progress,
|
||||
total,
|
||||
partLength);
|
||||
}
|
||||
else if (packet->data[0]==255)
|
||||
{
|
||||
if (packet->length!=BIG_PACKET_SIZE)
|
||||
{
|
||||
printf("Test failed. %i bytes (wrong number of bytes).\n", packet->length);
|
||||
quit=true;
|
||||
break;
|
||||
}
|
||||
// #med - replace BIG_PACKET_SIZE macro with static const
|
||||
#if BIG_PACKET_SIZE <= 100000
|
||||
for (int i=0; i < BIG_PACKET_SIZE; i++)
|
||||
{
|
||||
if (packet->data[i]!=255-(i&255))
|
||||
{
|
||||
printf("Test failed. %i bytes (bad data).\n", packet->length);
|
||||
quit=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (quit==false)
|
||||
{
|
||||
printf("Test succeeded. %i bytes.\n", packet->length);
|
||||
bool repeat=false;
|
||||
if (repeat)
|
||||
{
|
||||
printf("Rerequesting send.\n");
|
||||
unsigned char ch2=(unsigned char) 253;
|
||||
client->Send((const char*) &ch2, 1, MEDIUM_PRIORITY, RELIABLE_ORDERED, 1, SLNet::UNASSIGNED_SYSTEM_ADDRESS, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
quit=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (packet->data[0]==254)
|
||||
{
|
||||
printf("Got high priority message.\n");
|
||||
}
|
||||
else if (packet->data[0]==ID_CONNECTION_LOST)
|
||||
printf("ID_CONNECTION_LOST from %s\n", packet->systemAddress.ToString());
|
||||
else if (packet->data[0]==ID_DISCONNECTION_NOTIFICATION)
|
||||
printf("ID_DISCONNECTION_NOTIFICATION from %s\n", packet->systemAddress.ToString());
|
||||
else if (packet->data[0]==ID_NEW_INCOMING_CONNECTION)
|
||||
printf("ID_NEW_INCOMING_CONNECTION from %s\n", packet->systemAddress.ToString());
|
||||
else if (packet->data[0]==ID_CONNECTION_REQUEST_ACCEPTED)
|
||||
{
|
||||
start= SLNet::GetTimeMS();
|
||||
printf("ID_CONNECTION_REQUEST_ACCEPTED from %s\n", packet->systemAddress.ToString());
|
||||
}
|
||||
else if (packet->data[0]==ID_CONNECTION_ATTEMPT_FAILED)
|
||||
printf("ID_CONNECTION_ATTEMPT_FAILED from %s\n", packet->systemAddress.ToString());
|
||||
|
||||
client->DeallocatePacket(packet);
|
||||
packet = client->Receive();
|
||||
}
|
||||
}
|
||||
|
||||
if (SLNet::GetTimeMS() > nextStatTime)
|
||||
{
|
||||
nextStatTime= SLNet::GetTimeMS()+1000;
|
||||
RakNetStatistics rssSender;
|
||||
RakNetStatistics rssReceiver;
|
||||
if (server)
|
||||
{
|
||||
unsigned short numSystems;
|
||||
server->GetConnectionList(0,&numSystems);
|
||||
if (numSystems>0)
|
||||
{
|
||||
for (unsigned int i=0; i < numSystems; i++)
|
||||
{
|
||||
server->GetStatistics(server->GetSystemAddressFromIndex(i), &rssSender);
|
||||
StatisticsToString(&rssSender, text, BIG_PACKET_SIZE, 2);
|
||||
printf("==== System %i ====\n", i+1);
|
||||
printf("%s\n\n", text);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (client && server==0 && client->GetGUIDFromIndex(0)!=UNASSIGNED_RAKNET_GUID)
|
||||
{
|
||||
client->GetStatistics(client->GetSystemAddressFromIndex(0), &rssReceiver);
|
||||
StatisticsToString(&rssReceiver, text,BIG_PACKET_SIZE, 2);
|
||||
printf("%s\n\n", text);
|
||||
}
|
||||
}
|
||||
|
||||
RakSleep(100);
|
||||
}
|
||||
stop= SLNet::GetTimeMS();
|
||||
double seconds = (double)(stop-start)/1000.0;
|
||||
|
||||
if (server)
|
||||
{
|
||||
RakNetStatistics *rssSender2=server->GetStatistics(server->GetSystemAddressFromIndex(0));
|
||||
StatisticsToString(rssSender2, text, BIG_PACKET_SIZE, 1);
|
||||
printf("%s", text);
|
||||
}
|
||||
|
||||
printf("%i bytes per second (%.2f seconds). Press enter to quit\n", (int)((double)(BIG_PACKET_SIZE) / seconds ), seconds) ;
|
||||
Gets(text,BIG_PACKET_SIZE);
|
||||
|
||||
delete []text;
|
||||
SLNet::RakPeerInterface::DestroyInstance(client);
|
||||
SLNet::RakPeerInterface::DestroyInstance(server);
|
||||
|
||||
return 0;
|
||||
}
|
||||
262
Samples/BigPacketTest/BigPacketTest.vcxproj
Normal file
262
Samples/BigPacketTest/BigPacketTest.vcxproj
Normal file
@ -0,0 +1,262 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug - Unicode|Win32">
|
||||
<Configuration>Debug - Unicode</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release - Unicode|Win32">
|
||||
<Configuration>Release - Unicode</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Retail - Unicode|Win32">
|
||||
<Configuration>Retail - Unicode</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Retail|Win32">
|
||||
<Configuration>Retail</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>BigPacketTest</ProjectName>
|
||||
<ProjectGuid>{5B38727A-2D86-4235-907D-37A1530392FA}</ProjectGuid>
|
||||
<RootNamespace>BigPacketTest</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">$(Configuration)\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">$(Configuration)\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>./../../Source/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ShowProgress>NotSet</ShowProgress>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)BigPacketTest.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>./../../Source/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ShowProgress>NotSet</ShowProgress>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)BigPacketTest.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>./../../Source/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>./../../Source/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_RETAIL;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>./../../Source/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>./../../Source/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_RETAIL;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BigPacketTest.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Lib\LibStatic\LibStatic.vcxproj">
|
||||
<Project>{6533bdae-0f0c-45e4-8fe7-add0f37fe063}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
18
Samples/BigPacketTest/BigPacketTest.vcxproj.filters
Normal file
18
Samples/BigPacketTest/BigPacketTest.vcxproj.filters
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BigPacketTest.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
15
Samples/BigPacketTest/CMakeLists.txt
Normal file
15
Samples/BigPacketTest/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
#
|
||||
# This file was taken from RakNet 4.082 without any modifications.
|
||||
# Please see licenses/RakNet license.txt for the underlying license and related copyright.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
GETCURRENTFOLDER()
|
||||
STANDARDSUBPROJECT(${current_folder})
|
||||
VSUBFOLDER(${current_folder} "Samples")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user