MCDV_Lib_Sharp/
MCDV_Processor/
MCDV_Web/
+installer/
# User-specific files
*.suo
[Bb]in/
[Oo]bj/
[Ll]og/
+[Dd]eploy/
# Visual Studio 2015 cache/options directory
.vs/
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.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>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>15.0</VCProjectVersion>
+ <ProjectGuid>{D73B6BD7-47B5-4426-BC6B-26B69F47CACA}</ProjectGuid>
+ <RootNamespace>AutoRadarinstaller</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </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>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <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|x64'">
+ <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'">
+ <OutDir>$(SolutionDir)\installer\$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)\installer\$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <ConformanceMode>true</ConformanceMode>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <ConformanceMode>true</ConformanceMode>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <ConformanceMode>true</ConformanceMode>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <ConformanceMode>true</ConformanceMode>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="main.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="ConColor.h" />
+ <ClInclude Include="FileSystemHelper.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+<?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;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <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>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="ConColor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="FileSystemHelper.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+#pragma once
+#include <Windows.h>
+#include <stdint.h>
+
+HANDLE hConsole;
+uint16_t consoleColorDefault;
+
+namespace cc {
+
+ void setup() {
+ hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
+
+ CONSOLE_SCREEN_BUFFER_INFO info;
+ GetConsoleScreenBufferInfo(hConsole, &info);
+
+ consoleColorDefault = info.wAttributes;
+ }
+
+ void reset() {
+ SetConsoleTextAttribute(hConsole, consoleColorDefault);
+ }
+
+ void error() {
+ SetConsoleTextAttribute(hConsole, 12);
+ }
+
+ void warning() {
+ SetConsoleTextAttribute(hConsole, 14);
+ }
+
+ void info() {
+ SetConsoleTextAttribute(hConsole, 8);
+ }
+
+ void success() {
+ SetConsoleTextAttribute(hConsole, 10);
+ }
+
+ void fancy() {
+ SetConsoleTextAttribute(hConsole, 13);
+ }
+}
\ No newline at end of file
--- /dev/null
+#include <Windows.h>
+#include <vector>
+#include <string>
+
+namespace fs
+{
+ std::vector<std::string> getFilesInDirectory(std::string folder) {
+ std::vector<std::string> names;
+ std::string search_path = folder + "/*.*";
+ WIN32_FIND_DATA fd;
+ HANDLE hFind = ::FindFirstFile(search_path.c_str(), &fd);
+ if (hFind != INVALID_HANDLE_VALUE) {
+ do {
+ if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
+ names.push_back(folder + "\\" + fd.cFileName);
+ }
+ } while (::FindNextFile(hFind, &fd));
+ ::FindClose(hFind);
+ }
+ for (auto && s : names) s = s.substr(s.size());
+
+ return names;
+ }
+
+ std::vector<std::string> getFilesInDirectoryRecursive(std::string folder, std::vector<std::string>* vec = NULL) {
+ std::vector<std::string>* v = vec;
+
+ std::vector<std::string> names;
+ if (v == NULL) // First iteration
+ v = &names;
+
+ std::string search_path = folder + "/*.*";
+ WIN32_FIND_DATA fd;
+ HANDLE hFind = ::FindFirstFile(search_path.c_str(), &fd);
+ if (hFind != INVALID_HANDLE_VALUE) {
+ do {
+ if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
+ v->push_back(folder + "\\" + fd.cFileName);
+ }
+ else {
+ if ((std::string(fd.cFileName) != ".") && (std::string(fd.cFileName) != ".."))
+ getFilesInDirectoryRecursive(folder + "\\" + fd.cFileName, v);
+ }
+ } while (::FindNextFile(hFind, &fd));
+ ::FindClose(hFind);
+ }
+
+ for (auto && s : names) s = s.substr(folder.size());
+
+ return *v;
+ }
+
+ void copyFile(std::string src, std::string dst) {
+ std::ifstream _src(src, std::ios::binary);
+ std::ofstream _dst(dst, std::ios::binary);
+
+ _dst << _src.rdbuf();
+ }
+
+
+ bool dirExists(const std::string& dirName_in) {
+ DWORD ftyp = GetFileAttributesA(dirName_in.c_str());
+ if (ftyp == INVALID_FILE_ATTRIBUTES)
+ return false; //something is wrong with your path!
+
+ if (ftyp & FILE_ATTRIBUTE_DIRECTORY)
+ return true; // this is a directory!
+
+ return false; // this is not a directory!
+ }
+
+ std::string getDirName(std::string f) {
+ return f.substr(0, f.size() - split(sutil::ReplaceAll(f, "/", "\\"), '\\').back().size());
+ }
+}
\ No newline at end of file
--- /dev/null
+#include "../MCDV/vdf.hpp"
+#include "../MCDV/wc.hpp"
+#include "../MCDV/util.h"
+
+#include <windows.h>
+#include <iostream>
+#include <io.h>
+#include <fstream>
+
+#include "ConColor.h"
+
+#include "FileSystemHelper.h"
+
+std::string steam_install_path = "C:\\Program Files (x86)\\Steam\\";
+std::string csgo_sdk_bin_path = "";
+
+int exit() {
+ cc::reset();
+ system("PAUSE");
+ return -1;
+}
+
+int main(){
+ cc::setup();
+
+ /* Load install configuration */
+ std::ifstream ifs_vinfo("versioninfo.vdf");
+ if (!ifs_vinfo) {
+ cc::error();
+ std::cout << "versioninfo.vdf not found!!!" << std::endl;
+ return exit();
+ }
+
+ cc::info();
+
+ std::string vinfo_str((std::istreambuf_iterator<char>(ifs_vinfo)), std::istreambuf_iterator<char>());
+ kv::FileData vinfo(vinfo_str);
+ kv::DataBlock vinfodata = vinfo.headNode.SubBlocks[0];
+
+ cc::fancy(); std::cout << "Installing version: " << vinfodata.Values["version"] << "\n";
+
+#pragma region sdk_detect
+ /* Get steam installation path */
+
+ cc::info(); std::cout << "Getting steam installation path from windows registry\n";
+
+ HKEY hKey = NULL;
+ char buffer[1024];
+
+ bool regReadSuccess = true;
+
+ if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Valve\\Steam", NULL, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS){
+ DWORD size;
+ if (RegQueryValueEx(hKey, "SteamPath", NULL, NULL, (LPBYTE)buffer, &size) == ERROR_SUCCESS){
+ steam_install_path = buffer;
+ steam_install_path += "\\";
+ }
+ else regReadSuccess = false;
+ }
+ else regReadSuccess = false;
+
+ RegCloseKey(hKey);
+
+ if (!regReadSuccess) {
+ cc::warning();
+ std::cout << "Failed to read registry key: 'Software\\Valve\\Steam\\SteamPath'\nDefaulting to C:\\Program Files (x86)\\Steam\\ installation...\n";
+ }
+
+ cc::info();
+ std::cout << "Reading steam library folders\n";
+
+ /* Read library folders file */
+
+ std::vector<std::string> libraryFolders;
+ libraryFolders.push_back(steam_install_path + "steammapps\\common\\");
+
+ std::ifstream ifs(steam_install_path + "steamapps\\libraryfolders.vdf");
+ if (!ifs) {
+ std::cout << "Libraryfolders.vdf not found. Skipping search...\n" << std::endl;
+ }
+ else {
+ std::string str((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
+ kv::FileData libFolders(str);
+
+ kv::DataBlock* libFoldersDB = libFolders.headNode.GetFirstByName("\"LibraryFolders\"");
+
+ if (libFoldersDB != NULL) {
+ int index = 0;
+ while (libFoldersDB->Values.count(std::to_string(++index))) libraryFolders.push_back(libFoldersDB->Values[std::to_string(index)] + "\\steamapps\\common\\");
+ }
+ }
+
+ if (libraryFolders.size() == 0) std::cout << "No library folders found, defaulting to steamapps common folder...\n";
+
+ /* Scan for csgo sdk installations */
+
+ std::cout << "Scanning for SDK installation\n";
+
+ for (auto && folder : libraryFolders) {
+ if (_access_s((folder + "Counter-Strike Global Offensive\\bin\\SDKLauncher.exe").c_str(), 0) == 0) {
+ csgo_sdk_bin_path = folder + "Counter-Strike Global Offensive\\bin\\";
+ }
+ }
+
+ if (csgo_sdk_bin_path == "") {
+ cc::error();
+ std::cout << "Failed to find CS:GO SDK bin.\n";
+ return exit();
+ }
+
+#pragma endregion
+
+ /* Start doing the heavy work */
+ std::cout << "Copying files\n________________________________________________________\n\n";
+
+ // Copy folders
+ for (auto && folder : vinfodata.GetAllByName("folder")){
+ std::string source_folder = kv::tryGetStringValue(folder.Values, "path");
+ std::string target_folder = kv::tryGetStringValue(folder.Values, "target");
+
+ if ((source_folder == "") || (target_folder == "")) {
+ cc::warning(); std::cout << "Missing source/destination paths. Skipping...\n";
+ continue;
+ }
+
+ cc::info();
+ std::cout << "Copying folder: " << source_folder << "\n";
+
+ source_folder = source_folder + "\\";
+ target_folder = csgo_sdk_bin_path + target_folder + "\\";
+
+ std::vector<std::string> files = fs::getFilesInDirectoryRecursive(source_folder);
+
+ for (auto && f : files) {
+ std::string fDstFolder = target_folder + fs::getDirName(f);
+
+ if (_access_s(fDstFolder.c_str(), 0)) {
+ std::cout << "mkdr " << fs::getDirName(f) << "\n";
+ CreateDirectory(fDstFolder.c_str(), NULL);
+ }
+
+ std::cout << "copy " << f << "\n";
+
+ fs::copyFile(source_folder + f, target_folder + f);
+ }
+ }
+
+ std::cout << "\n";
+
+ // Install command sequences
+ std::cout << "Installing command sequences\n________________________________________________________\n\n";
+
+ for (auto && seqH : vinfodata.GetAllByName("CommandSequenceFile")) {
+ std::string target_file = kv::tryGetStringValue(seqH.Values, "target");
+
+ if (target_file == "") {
+ cc::warning(); std::cout << "Missing target file. Skipping CommandSeq...\n";
+ continue;
+ }
+
+ cc::info();
+
+ target_file = csgo_sdk_bin_path + target_file;
+
+ fs::copyFile(target_file, target_file + ".bak");
+
+ wc::filedata WcFile(target_file);
+
+ std::cout << "Writing to: " << kv::tryGetStringValue(seqH.Values, "target") << "\n";
+
+ for (auto && seqS : seqH.GetAllByName("Sequence")) {
+ std::cout << "Installing sequence: " << kv::tryGetStringValue(seqS.Values, "name", "error-name") << "\n";
+ std::string name = kv::tryGetStringValue(seqS.Values, "name", "error-name");
+
+ for (auto && seq : WcFile.sequences) {
+ if (strstr(seq.name, name.c_str()) != NULL) {
+ seq.write_enable = false;
+ }
+ }
+
+ wc::Sequence seq_new = wc::Sequence();
+ strcpy_s(seq_new.name, name.c_str());
+
+ for (auto && cmd : seqS.GetAllByName("Command"))
+ {
+ wc::Command command_build = wc::Command();
+ command_build.is_enabled = kv::tryGetValue(cmd.Values, "is_enabled", 0);
+ command_build.special = kv::tryGetValue(cmd.Values, "special", 0);
+ command_build.is_long_filename = kv::tryGetValue(cmd.Values, "is_long_filename", 0);
+ command_build.ensure_check = kv::tryGetValue(cmd.Values, "ensure_check", 0);
+ command_build.use_proc_win = kv::tryGetValue(cmd.Values, "use_proc_win", 0);
+ command_build.no_wait = kv::tryGetValue(cmd.Values, "no_wait", 0);;
+
+ std::string executable = kv::tryGetStringValue(cmd.Values, "executable", "error-executable");
+
+ strcpy_s(command_build.executable, executable.c_str());
+
+ std::string args = kv::tryGetStringValue(cmd.Values, "args", "error-args");
+ strcpy_s(command_build.args, args.c_str());
+
+ seq_new.commands.push_back(command_build);
+ }
+
+ WcFile.sequences.push_back(seq_new);
+ }
+
+ WcFile.serialize(target_file);
+ }
+
+ // Install custom entities
+
+ cc::success(); std::cout << "Completed setup!\n";
+
+ /* Small wait to auto close */
+ for (int i = 10; i > 0; i--) {
+ cc::info();
+ std::cout << "Closing in " << i << " seconds...\r";
+ Sleep(1000);
+ }
+
+ cc::reset();
+ std::cout << "\n";
+ return 0;
+}
\ No newline at end of file
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2006
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MCDV", "MCDV\MCDV.vcxproj", "{3F5631FE-0F0C-4285-B301-66DA219121EC}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AutoRadar", "MCDV\MCDV.vcxproj", "{3F5631FE-0F0C-4285-B301-66DA219121EC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AutoRadar_installer", "AutoRadar_installer\AutoRadar_installer.vcxproj", "{D73B6BD7-47B5-4426-BC6B-26B69F47CACA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
{3F5631FE-0F0C-4285-B301-66DA219121EC}.Release|x64.Build.0 = Release|x64
{3F5631FE-0F0C-4285-B301-66DA219121EC}.Release|x86.ActiveCfg = Release|Win32
{3F5631FE-0F0C-4285-B301-66DA219121EC}.Release|x86.Build.0 = Release|Win32
+ {D73B6BD7-47B5-4426-BC6B-26B69F47CACA}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {D73B6BD7-47B5-4426-BC6B-26B69F47CACA}.Debug|x64.ActiveCfg = Debug|x64
+ {D73B6BD7-47B5-4426-BC6B-26B69F47CACA}.Debug|x64.Build.0 = Debug|x64
+ {D73B6BD7-47B5-4426-BC6B-26B69F47CACA}.Debug|x86.ActiveCfg = Debug|Win32
+ {D73B6BD7-47B5-4426-BC6B-26B69F47CACA}.Debug|x86.Build.0 = Debug|Win32
+ {D73B6BD7-47B5-4426-BC6B-26B69F47CACA}.Release|Any CPU.ActiveCfg = Release|Win32
+ {D73B6BD7-47B5-4426-BC6B-26B69F47CACA}.Release|x64.ActiveCfg = Release|x64
+ {D73B6BD7-47B5-4426-BC6B-26B69F47CACA}.Release|x64.Build.0 = Release|x64
+ {D73B6BD7-47B5-4426-BC6B-26B69F47CACA}.Release|x86.ActiveCfg = Release|Win32
+ {D73B6BD7-47B5-4426-BC6B-26B69F47CACA}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
int main()
{
- wc::filedata fileData("sample_stuff/CmdSeq.wc");
+ wc::filedata fileData("CmdSeq.wc");
+
+ for (auto && seq : fileData.sequences) {
+ if (strstr(seq.name, "[TAR] Generate Radar") != NULL){
+ seq.write_enable = false;
+ }
+ }
wc::Sequence seq_new = wc::Sequence();
- char name_new[128] = "Testeroonie BAP";
+ char name_new[128] = "[TAR] Generate Radar";
memcpy(&seq_new.name, &name_new, 128);
+ wc::Command command_build = wc::Command();
+ command_build.is_enabled = 1;
+ command_build.special = 0;
+ command_build.is_long_filename = 0;
+ command_build.ensure_check = 0;
+ command_build.use_proc_win = 0;
+ command_build.no_wait = 0;
+
+ char executable[260] = "$exedir\\bin\\tar\\AutoRadar.exe";
+ memcpy(&command_build.executable, &executable, 260);
+
+ char args[260] = "-g $gamedir $path\\$file";
+ memcpy(&command_build.args, &args, 260);
+
+ seq_new.commands.push_back(command_build);
fileData.sequences.push_back(seq_new);
fileData.serialize("CmdSeq.wc");
{
"editorversion" "400"
"editorbuild" "8075"
- "mapversion" "53"
+ "mapversion" "54"
"formatversion" "100"
"prefab" "0"
}
world
{
"id" "1"
- "mapversion" "53"
+ "mapversion" "54"
"classname" "worldspawn"
"detailmaterial" "detail/detailsprites"
"detailvbsp" "detail.vbsp"
template<typename T>
T tryGetValue(std::map<std::string, std::string> map, const char* key, T defaultValue) {
if (!map.count(key)) return defaultValue;
- return static_cast<T>(::atof(key));
+ return static_cast<T>(::atof(map[key].c_str()));
+ }
+
+ std::string tryGetStringValue(std::map<std::string, std::string> map, const char* key, std::string defaultValue = "") {
+ if (!map.count(key)) return defaultValue;
+ return map[key];
}
class DataBlock
{
char name[128];
std::vector<Command> commands;
+ bool write_enable = true;
};
struct Header {
// Write header
Header header = Header();
- header.seq_count = sequences.size();
+
+ int count = sequences.size();
+ for (auto && seq : this->sequences) if (!seq.write_enable) count--;
+
+ header.seq_count = count;
writer.write((char*)&header, sizeof(header));
// Write Sequences
for (auto && sequence : this->sequences){
+ if (!sequence.write_enable) continue;
+
writer.write((char*)&sequence.name, 128);
uint32_t cmdCount = sequence.commands.size();