LosaDev source snapshot 2019
This commit is contained in:
commit
c198676e97
20588 files changed
+8812878
No files matched your search
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testLog", "testLog\testLog.vcxproj", "{042DDD45-1F8D-49EB-9468-FCFC42E80FC4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{042DDD45-1F8D-49EB-9468-FCFC42E80FC4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{042DDD45-1F8D-49EB-9468-FCFC42E80FC4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{042DDD45-1F8D-49EB-9468-FCFC42E80FC4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{042DDD45-1F8D-49EB-9468-FCFC42E80FC4}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,99 @@
|
||||
#include "stdafx.h"
|
||||
#include "Log.h"
|
||||
#include "ioLogTestThread.h"
|
||||
|
||||
CLog LOG;
|
||||
CLog HackLOG;
|
||||
CLog ProcessLOG;
|
||||
|
||||
const int TEST_COUNT = 20000000;
|
||||
|
||||
|
||||
|
||||
ioLogTestThread::ioLogTestThread(void)
|
||||
{
|
||||
}
|
||||
|
||||
ioLogTestThread::~ioLogTestThread(void)
|
||||
{
|
||||
}
|
||||
|
||||
void ioLogTestThread::Run()
|
||||
{
|
||||
printf("[%lu]Thread Begin\n", GetCurrentThreadId() );
|
||||
|
||||
for(int i = 0 ; i <= TEST_COUNT ; i++)
|
||||
{
|
||||
int choice = (rand() % 10);
|
||||
switch(choice)
|
||||
{
|
||||
case 0 :
|
||||
TEST_Open();
|
||||
break;
|
||||
case 1 :
|
||||
TEST_Close();
|
||||
break;
|
||||
default :
|
||||
TEST_Write();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
printf("[%lu]-> Thread End\n", GetCurrentThreadId() );
|
||||
}
|
||||
|
||||
void ioLogTestThread::TEST_Open()
|
||||
{
|
||||
//printf("[%lu]TEST_Open\n", GetCurrentThreadId() );
|
||||
|
||||
SYSTEMTIME st;
|
||||
GetLocalTime(&st);
|
||||
char szCurTime[MAX_PATH] = "";
|
||||
sprintf_s(szCurTime, sizeof(szCurTime), "%04d%02d%02d", st.wYear, st.wMonth, st.wDay );
|
||||
|
||||
char TimeLogName[MAX_PATH]="";
|
||||
memset(TimeLogName, 0, sizeof(TimeLogName));
|
||||
sprintf_s(TimeLogName, sizeof(TimeLogName), "%d\\BUG%s-%s-%d.log", rand() % 5, szCurTime, "127.0.0.1", 111111 );
|
||||
|
||||
LOG.CloseLog();
|
||||
LOG.OpenLog( 0, TimeLogName, true);
|
||||
LOG.PrintTimeAndLog(0, "<<< -------------------- Create File -------------------- >>>\r\n");
|
||||
LOG.PrintTimeAndLog( 0, "Version : 버젼 | 시간" );
|
||||
|
||||
memset(TimeLogName, 0, sizeof(TimeLogName));
|
||||
sprintf_s(TimeLogName, sizeof(TimeLogName), "%d\\HACK%s-%s-%d.log", rand() % 5, szCurTime, "127.0.0.1", 111111);
|
||||
HackLOG.CloseLog();
|
||||
HackLOG.OpenLog( 0, TimeLogName, true);
|
||||
HackLOG.PrintTimeAndLog(0, "<<< -------------------- Create File -------------------- >>>\r\n");
|
||||
HackLOG.PrintTimeAndLog( 0, "Version : 버젼 | 시간" );
|
||||
|
||||
memset(TimeLogName, 0, sizeof(TimeLogName));
|
||||
sprintf_s(TimeLogName, sizeof(TimeLogName), "%d\\PROCESS%s-%s-%d.log", rand() % 5, szCurTime, "127.0.0.1", 111111);
|
||||
ProcessLOG.CloseLog();
|
||||
ProcessLOG.OpenLog( 0, TimeLogName, true);
|
||||
ProcessLOG.PrintTimeAndLog(0, "<<< -------------------- Create File -------------------- >>>\r\n");
|
||||
ProcessLOG.PrintTimeAndLog( 0, "Version : 버젼 | 시간" );
|
||||
ProcessLOG.PrintTimeAndLog( 0, "[Main][LogDB][UDP][ClientA][ServerA][Work]" );
|
||||
}
|
||||
|
||||
void ioLogTestThread::TEST_Close()
|
||||
{
|
||||
//printf("[%lu]TEST_Close\n", GetCurrentThreadId() );
|
||||
|
||||
LOG.CloseLog();
|
||||
LOG.PrintTimeAndLog(0, "<<< -------------------- End File -------------------- >>>\r\n");
|
||||
HackLOG.CloseLog();
|
||||
HackLOG.PrintTimeAndLog(0, "<<< -------------------- End File -------------------- >>>\r\n");
|
||||
ProcessLOG.CloseLog();
|
||||
ProcessLOG.PrintTimeAndLog(0, "<<< -------------------- End File -------------------- >>>\r\n");
|
||||
}
|
||||
|
||||
void ioLogTestThread::TEST_Write()
|
||||
{
|
||||
//printf("[%lu]TEST_Write\n", GetCurrentThreadId() );
|
||||
|
||||
LOG.PrintTimeAndLog( 0, "%s pUser == NULL.", __FUNCTION__ );
|
||||
HackLOG.PrintTimeAndLog( 0, "%s PenaltyPeso Hack :->10000", __FUNCTION__ );
|
||||
ProcessLOG.PrintTimeAndLog( 0, "MSTPK_SERVER_UPDATE Packet Delay : %dms", 100 );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "ioThread.h"
|
||||
|
||||
class ioLogTestThread : public ioThread
|
||||
{
|
||||
public:
|
||||
ioLogTestThread(void);
|
||||
~ioLogTestThread(void);
|
||||
|
||||
public:
|
||||
void Run();
|
||||
|
||||
protected:
|
||||
void TEST_Open();
|
||||
void TEST_Close();
|
||||
void TEST_Write();
|
||||
};
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ioThread.h"
|
||||
|
||||
ioThread::ioThread(void) : m_hThread(0L), m_threadID(0)
|
||||
{
|
||||
}
|
||||
|
||||
ioThread::~ioThread(void)
|
||||
{
|
||||
if(m_hThread)
|
||||
{
|
||||
CloseHandle(m_hThread);
|
||||
m_threadID = 0;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned WINAPI ioThread::HandleRunner(LPVOID parameter)
|
||||
{
|
||||
ioThread *pThread = (ioThread *)parameter;
|
||||
if(pThread == NULL)
|
||||
return 0;
|
||||
|
||||
pThread->Run();
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL ioThread::Begin()
|
||||
{
|
||||
HANDLE threadHandle = reinterpret_cast<HANDLE>( _beginthreadex(
|
||||
NULL,
|
||||
0,
|
||||
HandleRunner,
|
||||
this,
|
||||
0,
|
||||
&m_threadID ));
|
||||
if(!threadHandle)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
m_hThread = threadHandle;
|
||||
|
||||
return (m_hThread == 0) ? FALSE : TRUE;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
class ioThread
|
||||
{
|
||||
public:
|
||||
ioThread(void);
|
||||
virtual ~ioThread(void);
|
||||
|
||||
private:
|
||||
static unsigned WINAPI HandleRunner(LPVOID parameter);
|
||||
UINT m_threadID;
|
||||
|
||||
protected:
|
||||
HANDLE m_hThread;
|
||||
BOOL m_threadStart;
|
||||
|
||||
public:
|
||||
virtual void Run() = 0; //상속 받은 클래스가 구현한다.
|
||||
|
||||
public:
|
||||
DWORD GetThread() { return m_threadID; }
|
||||
BOOL Begin();
|
||||
|
||||
BOOL IsStart() const { return m_threadStart; }
|
||||
void SetStart(const BOOL state) { m_threadStart = state; }
|
||||
};
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#include "stdafx.h"
|
||||
#include "ioLogTestThread.h"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
const int logCount = 100;
|
||||
|
||||
ioLogTestThread* testThread = new ioLogTestThread[logCount];
|
||||
for(int i = 0; i < logCount; i++)
|
||||
{
|
||||
testThread[i].Begin();
|
||||
}
|
||||
|
||||
printf("press enter to exit ");
|
||||
char ch = getchar();
|
||||
for(int i = 0; i < logCount; i++)
|
||||
{
|
||||
testThread[i].SetStart( FALSE );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : 표준 포함 파일만 들어 있는 소스 파일입니다.
|
||||
// testCode.pch는 미리 컴파일된 헤더가 됩니다.
|
||||
// stdafx.obj에는 미리 컴파일된 형식 정보가 포함됩니다.
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: 필요한 추가 헤더는
|
||||
// 이 파일이 아닌 STDAFX.H에서 참조합니다.
|
||||
@@ -0,0 +1,15 @@
|
||||
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
|
||||
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
|
||||
// 들어 있는 포함 파일입니다.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
#include <process.h>
|
||||
#include <Windows.h>
|
||||
|
||||
|
||||
// TODO: 프로그램에 필요한 추가 헤더는 여기에서 참조합니다.
|
||||
@@ -0,0 +1,98 @@
|
||||
<?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|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{042DDD45-1F8D-49EB-9468-FCFC42E80FC4}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>testLog</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../../src/include</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>../../../lib</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>logD.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>../../../src/include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>../../../lib</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>log.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ioLogTestThread.cpp" />
|
||||
<ClCompile Include="ioThread.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="stdafx.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ioLogTestThread.h" />
|
||||
<ClInclude Include="ioThread.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="소스 파일">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="헤더 파일">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="리소스 파일">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ioThread.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ioLogTestThread.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ioThread.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ioLogTestThread.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in new issue
Block a user