forked from LosaDev/ls-2019-source
LosaDev source snapshot 2019
This commit is contained in:
commit
c198676e97
20588 files changed
+8812878
No files matched your search
+60
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4F3072CE-C320-4CB0-8B6C-BDAAB1BE35FB}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CTPKTDefineToStringParser</RootNamespace>
|
||||
<AssemblyName>CTPKTDefineToStringParser</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</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|x86' ">
|
||||
<PlatformTarget>x86</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="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</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>
|
||||
@@ -0,0 +1,138 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Globalization;
|
||||
|
||||
namespace CTPKTDefineToStringParser
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
List<string> writeLine = new List<string>();
|
||||
|
||||
writeLine.Add("#ifndef ___PROTOCOL_HELPER_H__");
|
||||
writeLine.Add("#define ___PROTOCOL_HELPER_H__");
|
||||
writeLine.Add("\r\n");
|
||||
writeLine.Add("#include \"Protocol.h\"");
|
||||
writeLine.Add("\r\n");
|
||||
|
||||
MakeClientToServerPacketForProtocolHelper(writeLine, args);
|
||||
MakeServerToServerPacketForProtocolHelper(writeLine, args);
|
||||
|
||||
writeLine.Add("\r\n");
|
||||
writeLine.Add("#endif");
|
||||
|
||||
System.IO.File.WriteAllLines(args[1], writeLine.ToArray());
|
||||
}
|
||||
|
||||
public static void MakeClientToServerPacketForProtocolHelper(List<string> writeLine, string[] args)
|
||||
{
|
||||
writeLine.Add("#define GetStringOfCTPCKPacket(packetID, p) \\");
|
||||
writeLine.Add(" switch( packetID ) \\");
|
||||
writeLine.Add(" { \\");
|
||||
|
||||
int counter = 0;
|
||||
string line;
|
||||
|
||||
System.IO.StreamReader readFile = new System.IO.StreamReader(args[0]);
|
||||
|
||||
while ((line = readFile.ReadLine()) != null)
|
||||
{
|
||||
if (!line.Contains("#define CTPK") && !line.Contains("#define CUPK"))
|
||||
continue;
|
||||
|
||||
if (line.Contains("//"))
|
||||
continue;
|
||||
|
||||
if (!line.Contains("0x"))
|
||||
continue;
|
||||
|
||||
string[] strings = line.Split(new string[] { " ", "0x" }, StringSplitOptions.None);
|
||||
|
||||
string packetString = RemoveSpecialCharacters(strings[1]);
|
||||
|
||||
{
|
||||
writeLine.Add(" case " + packetString + ": \\");
|
||||
writeLine.Add(" (p) = " + "\"" + packetString + "\"; \\");
|
||||
writeLine.Add(" break; \\");
|
||||
}
|
||||
|
||||
Console.WriteLine(line);
|
||||
counter++;
|
||||
}
|
||||
|
||||
{
|
||||
writeLine.Add(" default: \\");
|
||||
writeLine.Add(" char buf[100]; \\");
|
||||
writeLine.Add(" sprintf(buf, \"0x%x\", packetID); \\");
|
||||
writeLine.Add(" (p) = buf; \\");
|
||||
writeLine.Add(" break; \\");
|
||||
writeLine.Add(" } \\");
|
||||
}
|
||||
|
||||
writeLine.Add("\r\n");
|
||||
writeLine.Add("\r\n");
|
||||
|
||||
readFile.Close();
|
||||
}
|
||||
|
||||
public static void MakeServerToServerPacketForProtocolHelper(List<string> writeLine, string[] args)
|
||||
{
|
||||
writeLine.Add("#define GetStringOfSSTPKPacket(packetID, p) \\");
|
||||
writeLine.Add(" switch( packetID ) \\");
|
||||
writeLine.Add(" { \\");
|
||||
|
||||
|
||||
int counter = 0;
|
||||
string line;
|
||||
|
||||
System.IO.StreamReader readFile = new System.IO.StreamReader(args[0]);
|
||||
while ((line = readFile.ReadLine()) != null)
|
||||
{
|
||||
if (!line.Contains("#define SSTPK"))
|
||||
continue;
|
||||
|
||||
if (line.Contains("//"))
|
||||
continue;
|
||||
|
||||
if (!line.Contains("0x"))
|
||||
continue;
|
||||
|
||||
string[] strings = line.Split(new string[] { " ", "0x" }, StringSplitOptions.None);
|
||||
|
||||
string packetString = RemoveSpecialCharacters(strings[1]);
|
||||
|
||||
{
|
||||
writeLine.Add(" case " + packetString + ": \\");
|
||||
writeLine.Add(" (p) = " + "\"" + packetString + "\"; \\");
|
||||
writeLine.Add(" break; \\");
|
||||
}
|
||||
|
||||
Console.WriteLine(line);
|
||||
counter++;
|
||||
}
|
||||
|
||||
{
|
||||
writeLine.Add(" default: \\");
|
||||
writeLine.Add(" char buf[100]; \\");
|
||||
writeLine.Add(" sprintf(buf, \"0x%x\", packetID); \\");
|
||||
writeLine.Add(" (p) = buf; \\");
|
||||
writeLine.Add(" break; \\");
|
||||
writeLine.Add(" } \\");
|
||||
}
|
||||
|
||||
writeLine.Add("\r\n");
|
||||
writeLine.Add("\r\n");
|
||||
|
||||
readFile.Close();
|
||||
}
|
||||
|
||||
public static string RemoveSpecialCharacters(string str)
|
||||
{
|
||||
return Regex.Replace(str, "[^a-zA-Z0-9_.]+", "", RegexOptions.Compiled);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다.
|
||||
// 어셈블리와 관련된 정보를 수정하려면
|
||||
// 이 특성 값을 변경하십시오.
|
||||
[assembly: AssemblyTitle("CTPKTDefineToStringParser")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CTPKTDefineToStringParser")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||
// 해당 형식에 대해 ComVisible 특성을 true로 설정하십시오.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||
[assembly: Guid("95af633d-fa6f-4b30-b266-62a8ea92860f")]
|
||||
|
||||
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||
//
|
||||
// 주 버전
|
||||
// 부 버전
|
||||
// 빌드 번호
|
||||
// 수정 버전
|
||||
//
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로
|
||||
// 지정되도록 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Reference in new issue
Block a user