实例化对象有问题
This commit is contained in:
parent
6bdd6f637d
commit
ce6413df51
|
|
@ -0,0 +1,2 @@
|
|||
#pragma once
|
||||
#include "framework.h"
|
||||
17
test/STL.h
17
test/STL.h
|
|
@ -21,11 +21,27 @@ static std::map<std::string, std::map<int, std::string>>StringArr_STL;
|
|||
static std::map<std::string, std::map<int, bool>>BoolArr_STL;
|
||||
|
||||
|
||||
//构造 抽奖 类型容器
|
||||
struct Dargonresult
|
||||
{
|
||||
int ItemIndex;
|
||||
int ItemNum;
|
||||
int ItemGrade;
|
||||
};
|
||||
struct DargonMap
|
||||
{
|
||||
int LuckyValue;
|
||||
Dargonresult Result[10];
|
||||
};
|
||||
static std::map<std::string, DargonMap>DargonState_STL;
|
||||
static std::map<std::string, int>DargonModel_STL;
|
||||
|
||||
static std::map<int, int>aod;
|
||||
static std::map<int, float>bod;
|
||||
static std::map<int, std::string>cod;
|
||||
static std::map<int, bool>dod;
|
||||
|
||||
|
||||
class STL
|
||||
{
|
||||
private:
|
||||
|
|
@ -33,6 +49,7 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
|
||||
//查询指定容器是否存在
|
||||
static int Check_STL(std::string name,int Type,int idx = 0);
|
||||
//static int Check_STL_Idx(std::string name,int idx);
|
||||
|
|
|
|||
|
|
@ -11,52 +11,47 @@
|
|||
|
||||
|
||||
|
||||
//뭐芚 녜쉽 잚謹휭포
|
||||
struct Dargonresult
|
||||
{
|
||||
int ItemIndex;
|
||||
int ItemNum;
|
||||
int ItemGrade;
|
||||
};
|
||||
struct DargonMap
|
||||
{
|
||||
int Op;
|
||||
int LuckyValue;
|
||||
Dargonresult Result[10];
|
||||
};
|
||||
static std::map<std::string, DargonMap>Dargon_STL;
|
||||
|
||||
void sock::Pack_³é½±(int idx, int code, void* p3, void* p4)
|
||||
{
|
||||
DWORD Size;
|
||||
Net_Get_Dword(Size);
|
||||
char* Buffer = new char[Size+1];
|
||||
char* Buffer = new char[Size + 1];
|
||||
Net_Get_Buffer(Buffer, Size);
|
||||
Buffer[Size] = '\0';
|
||||
|
||||
rapidjson::Document Dom;
|
||||
Dom.Parse(Buffer);
|
||||
|
||||
//뭐芚res관 써뭐竟
|
||||
Dargonresult Res_Buffer[10];
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
Res_Buffer[i].ItemIndex = Dom["result"][i]["item"].GetInt();
|
||||
Res_Buffer[i].ItemNum = Dom["result"][i]["num"].GetInt();
|
||||
Res_Buffer[i].ItemGrade = Dom["result"][i]["grade"].GetInt();
|
||||
}
|
||||
//뭐芚질분悧 써뭐竟
|
||||
DargonMap M_Buffer;
|
||||
M_Buffer.Op = Dom["op"].GetInt();
|
||||
M_Buffer.LuckyValue = Dom["luckyvalue"].GetInt();
|
||||
for (int b = 0; b < 10; ++b)
|
||||
{
|
||||
M_Buffer.Result[b] = Res_Buffer[b];
|
||||
}
|
||||
//뭐芚 질분 map
|
||||
Dargon_STL["dargonmap"] = M_Buffer;
|
||||
|
||||
|
||||
//뭐芚질분 친駕
|
||||
//DargonModel_STL.emplace("op", Dom["op"].GetInt());
|
||||
DargonModel_STL["op"] = Dom["op"].GetInt();
|
||||
std::cout << DargonModel_STL["op"] << std::endl;
|
||||
/*
|
||||
if (DargonModel_STL["op"] == 4 || DargonModel_STL["op"] == 6)
|
||||
{
|
||||
//뭐芚res관 써뭐竟
|
||||
Dargonresult Res_Buffer[10];
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
Res_Buffer[i].ItemIndex = Dom["result"][i]["item"].GetInt();
|
||||
Res_Buffer[i].ItemNum = Dom["result"][i]["num"].GetInt();
|
||||
Res_Buffer[i].ItemGrade = Dom["result"][i]["grade"].GetInt();
|
||||
}
|
||||
//뭐芚질분悧 써뭐竟
|
||||
DargonMap M_Buffer;
|
||||
M_Buffer.LuckyValue = Dom["luckyvalue"].GetInt();
|
||||
for (int b = 0; b < 10; ++b)
|
||||
{
|
||||
M_Buffer.Result[b] = Res_Buffer[b];
|
||||
}
|
||||
//뭐芚 질분 쉽쟨鑒앴
|
||||
DargonState_STL["dargonmap"] = M_Buffer;
|
||||
}
|
||||
*/
|
||||
std::cout << u8"130뵀澗관냥묘" << std::endl;
|
||||
|
||||
}
|
||||
|
||||
void sock::R_Register_Pack()
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ typedef void(__cdecl* pack_handler_t)(int idx, int err, void*, void*);
|
|||
typedef void(__cdecl* register_pack_handler_t)(int idx, pack_handler_t handler, int zero);
|
||||
|
||||
|
||||
|
||||
|
||||
class sock
|
||||
{
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -731,6 +731,27 @@ static int New_STL(uint32_t v)
|
|||
}
|
||||
|
||||
|
||||
//new
|
||||
static int Get_DragonModel(uint32_t v)
|
||||
{
|
||||
int Model = DargonModel_STL["op"];//ÁúºÐģʽ
|
||||
std::cout << DargonModel_STL["op"] << std::endl;
|
||||
int ParameterNum = SQGetTop(v);
|
||||
std::cout << ParameterNum << std::endl;
|
||||
if (ParameterNum == 1)
|
||||
{
|
||||
SQPushInt(v, Model);
|
||||
}
|
||||
else
|
||||
{
|
||||
SQPushBool(v, false);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//»ñÈ¡Squirrel v »ùÖ·
|
||||
inline uint32_t GetSqVm()
|
||||
{
|
||||
|
|
@ -774,4 +795,8 @@ void squirrel::R_Register_Nut()
|
|||
RegisterNutApi(L"L_New_STL", New_STL);
|
||||
RegisterNutApi(L"L_Set_STL", Set_STL);
|
||||
RegisterNutApi(L"L_Get_STL", Get_STL);
|
||||
|
||||
|
||||
|
||||
RegisterNutApi(L"L_Get_DragonModel", Get_DragonModel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,11 +115,11 @@
|
|||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;TEST_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;TEST_EXPORTS;_WINDOWS;_USRDLL;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Full</Optimization>
|
||||
</ClCompile>
|
||||
|
|
@ -131,6 +131,8 @@
|
|||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>D:\hookDNF\DOF_DllHook\test;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>
|
||||
</IgnoreSpecificDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
|
|
@ -170,6 +172,7 @@
|
|||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Dargon.h" />
|
||||
<ClInclude Include="DNFTOOL.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="hook.h" />
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@
|
|||
<ClInclude Include="STL.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Dargon.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
|
|
|
|||
Loading…
Reference in New Issue