Json stl拓展完成
This commit is contained in:
parent
bb87d4d3a9
commit
44ea52a10a
|
|
@ -248,6 +248,22 @@ char* DNFTOOL::UnicodeToAnsi(const wchar_t* szStr, char* pResult, int maxLen)
|
||||||
return pResult;
|
return pResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* DNFTOOL::wchar_tTochar(wchar_t* wbuffer)
|
||||||
|
{
|
||||||
|
size_t requiredSize = wcstombs(nullptr, wbuffer, 0);
|
||||||
|
char* key = new char[requiredSize + 1];
|
||||||
|
wcstombs(key, wbuffer, requiredSize + 1);
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
wchar_t* DNFTOOL::charTowchar_t(char* wbuffer)
|
||||||
|
{
|
||||||
|
size_t requiredSize = mbstowcs(nullptr, wbuffer, 0);
|
||||||
|
wchar_t* wcString = new wchar_t[requiredSize + 1];
|
||||||
|
mbstowcs(wcString, wbuffer, requiredSize + 1);
|
||||||
|
return wcString;
|
||||||
|
}
|
||||||
|
|
||||||
wchar_t* DNFTOOL::AnsiToUnicode(const char* szStr, wchar_t* pResult, int maxLen)
|
wchar_t* DNFTOOL::AnsiToUnicode(const char* szStr, wchar_t* pResult, int maxLen)
|
||||||
{
|
{
|
||||||
if (NULL == pResult)
|
if (NULL == pResult)
|
||||||
|
|
@ -321,3 +337,13 @@ void DNFTOOL::Wchar_tToString(std::string& szDst, wchar_t* wchar)
|
||||||
szDst = psText;// std::string赋值
|
szDst = psText;// std::string赋值
|
||||||
delete[]psText;// psText的清除
|
delete[]psText;// psText的清除
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const wchar_t* DNFTOOL::GetWC(const char* c)
|
||||||
|
{
|
||||||
|
const size_t cSize = strlen(c) + 1;
|
||||||
|
wchar_t* wc = new wchar_t[cSize];
|
||||||
|
mbstowcs(wc, c, cSize);
|
||||||
|
|
||||||
|
return wc;
|
||||||
|
}
|
||||||
|
|
@ -72,12 +72,24 @@ public:
|
||||||
//获取装备偏移地址
|
//获取装备偏移地址
|
||||||
static int GetEquAddr(int addr);
|
static int GetEquAddr(int addr);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//wchar_t* 转 char*
|
//wchar_t* 转 char*
|
||||||
static char* UnicodeToAnsi(const wchar_t* szStr, char* pResult, int maxLen);
|
static char* UnicodeToAnsi(const wchar_t* szStr, char* pResult, int maxLen);
|
||||||
|
|
||||||
|
|
||||||
|
//wchar_t* 转 char* 有用
|
||||||
|
static char* wchar_tTochar(wchar_t* wbuffer);
|
||||||
|
//char* 转 wchar_t* 有用
|
||||||
|
static wchar_t* charTowchar_t(char* wbuffer);
|
||||||
|
|
||||||
//wchar_t* 转 string*
|
//wchar_t* 转 string*
|
||||||
static void Wchar_tToString(std::string& szDst, wchar_t* wchar);
|
static void Wchar_tToString(std::string& szDst, wchar_t* wchar);
|
||||||
//char* 转 wchar_t*
|
//char* 转 wchar_t*
|
||||||
static wchar_t* AnsiToUnicode(const char* szStr, wchar_t* pResult, int maxLen);
|
static wchar_t* AnsiToUnicode(const char* szStr, wchar_t* pResult, int maxLen);
|
||||||
|
//string 转 wchar_t*
|
||||||
|
static const wchar_t* GetWC(const char* c);
|
||||||
|
|
||||||
|
|
||||||
//窗口公告 0x10d
|
//窗口公告 0x10d
|
||||||
static void WindowsNotice(char* str, int type = 0x10d, int b = 0x0);
|
static void WindowsNotice(char* str, int type = 0x10d, int b = 0x0);
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ void STL::SetIntArr_STL(std::string name, int idx, int value)
|
||||||
IntArr_STL[name][idx] = value;
|
IntArr_STL[name][idx] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void STL::SetFloatArr_STL(std::string name, int idx, float value)
|
void STL::SetFloatArr_STL(std::string name, int idx, FLOAT value)
|
||||||
{
|
{
|
||||||
FloatArr_STL[name][idx] = value;
|
FloatArr_STL[name][idx] = value;
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +180,7 @@ void STL::SetStringArr_STL(std::string name, int idx, std::string value)
|
||||||
StringArr_STL[name][idx] = value;
|
StringArr_STL[name][idx] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void STL::SetBoolArr_STL(std::string name, int idx, bool value)
|
void STL::SetBoolArr_STL(std::string name, int idx, BOOL value)
|
||||||
{
|
{
|
||||||
BoolArr_STL[name][idx] = value;
|
BoolArr_STL[name][idx] = value;
|
||||||
}
|
}
|
||||||
|
|
@ -190,7 +190,7 @@ int STL::GetIntArr_STL(std::string name, int idx)
|
||||||
return IntArr_STL[name][idx];
|
return IntArr_STL[name][idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
float STL::GetFloatArr_STL(std::string name, int idx)
|
FLOAT STL::GetFloatArr_STL(std::string name, int idx)
|
||||||
{
|
{
|
||||||
return FloatArr_STL[name][idx];
|
return FloatArr_STL[name][idx];
|
||||||
}
|
}
|
||||||
|
|
@ -200,7 +200,7 @@ std::string STL::GetStringArr_STL(std::string name, int idx)
|
||||||
return StringArr_STL[name][idx];
|
return StringArr_STL[name][idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool STL::GetBoolArr_STL(std::string name, int idx)
|
BOOL STL::GetBoolArr_STL(std::string name, int idx)
|
||||||
{
|
{
|
||||||
return BoolArr_STL[name][idx];
|
return BoolArr_STL[name][idx];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
22
test/STL.h
22
test/STL.h
|
|
@ -5,25 +5,25 @@
|
||||||
//构造int类型容器
|
//构造int类型容器
|
||||||
static std::map<std::string, int>Int_STL;
|
static std::map<std::string, int>Int_STL;
|
||||||
//构造float类型容器
|
//构造float类型容器
|
||||||
static std::map<std::string, float>Float_STL;
|
static std::map<std::string, FLOAT>Float_STL;
|
||||||
//构造string类型容器
|
//构造string类型容器
|
||||||
static std::map<std::string, std::string>String_STL;
|
static std::map<std::string, std::string>String_STL;
|
||||||
//构造bool类型容器
|
//构造bool类型容器
|
||||||
static std::map<std::string, bool>Bool_STL;
|
static std::map<std::string, BOOL>Bool_STL;
|
||||||
|
|
||||||
//构造intarr类型容器
|
//构造intarr类型容器
|
||||||
static std::map<std::string, std::map<int, int>>IntArr_STL;
|
static std::map<std::string, std::map<int, int>>IntArr_STL;
|
||||||
//构造floatarr类型容器
|
//构造floatarr类型容器
|
||||||
static std::map<std::string, std::map<int, float>>FloatArr_STL;
|
static std::map<std::string, std::map<int, FLOAT>>FloatArr_STL;
|
||||||
//构造stringarr类型容器
|
//构造stringarr类型容器
|
||||||
static std::map<std::string, std::map<int, std::string>>StringArr_STL;
|
static std::map<std::string, std::map<int, std::string>>StringArr_STL;
|
||||||
//构造boolarr类型容器
|
//构造boolarr类型容器
|
||||||
static std::map<std::string, std::map<int, bool>>BoolArr_STL;
|
static std::map<std::string, std::map<int, BOOL>>BoolArr_STL;
|
||||||
|
|
||||||
static std::map<int, int>aod;
|
static std::map<int, int>aod;
|
||||||
static std::map<int, float>bod;
|
static std::map<int, FLOAT>bod;
|
||||||
static std::map<int, std::string>cod;
|
static std::map<int, std::string>cod;
|
||||||
static std::map<int, bool>dod;
|
static std::map<int, BOOL>dod;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//时间 STL
|
//时间 STL
|
||||||
|
|
@ -63,6 +63,8 @@ static std::map<std::string, DargonMap>DargonState_STL;
|
||||||
static std::map<std::string, int>DargonModel_STL;
|
static std::map<std::string, int>DargonModel_STL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class STL
|
class STL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
@ -84,15 +86,15 @@ public:
|
||||||
|
|
||||||
//设置 Int数组容器
|
//设置 Int数组容器
|
||||||
static void SetIntArr_STL(std::string name,int idx,int value);
|
static void SetIntArr_STL(std::string name,int idx,int value);
|
||||||
static void SetFloatArr_STL(std::string name,int idx,float value);
|
static void SetFloatArr_STL(std::string name,int idx, FLOAT value);
|
||||||
static void SetStringArr_STL(std::string name,int idx,std::string value);
|
static void SetStringArr_STL(std::string name,int idx,std::string value);
|
||||||
static void SetBoolArr_STL(std::string name,int idx,bool value);
|
static void SetBoolArr_STL(std::string name,int idx,BOOL value);
|
||||||
|
|
||||||
//获取 Int数组容器
|
//获取 Int数组容器
|
||||||
static int GetIntArr_STL(std::string name, int idx);
|
static int GetIntArr_STL(std::string name, int idx);
|
||||||
static float GetFloatArr_STL(std::string name, int idx);
|
static FLOAT GetFloatArr_STL(std::string name, int idx);
|
||||||
static std::string GetStringArr_STL(std::string name, int idx);
|
static std::string GetStringArr_STL(std::string name, int idx);
|
||||||
static bool GetBoolArr_STL(std::string name, int idx);
|
static BOOL GetBoolArr_STL(std::string name, int idx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//龙盒
|
//龙盒
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,14 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#pragma warning(disable:4244)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//#define LOCALHOSTS_SWITCH "本地免验证 开启"
|
|
||||||
|
#define LOCALHOSTS_SWITCH "本地免验证 开启"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -46,7 +48,7 @@
|
||||||
#define DRAGONBOX_SWITCH "龙盒开启"
|
#define DRAGONBOX_SWITCH "龙盒开启"
|
||||||
#define NORMAL_STL "普通STL开启"
|
#define NORMAL_STL "普通STL开启"
|
||||||
#define TIME_STL "时间STL开启"
|
#define TIME_STL "时间STL开启"
|
||||||
|
#define JSON_STL "Json_STL 开启"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ uint32_t ThFunc(uint32_t v)
|
||||||
SQGetString(v, i, &Name);
|
SQGetString(v, i, &Name);
|
||||||
if (bufferm.count(Name) == 0)
|
if (bufferm.count(Name) == 0)
|
||||||
{
|
{
|
||||||
bufferm[Name] == 1;
|
bufferm[Name] = 1;
|
||||||
std::wcout << u8"参数为" << Name << std::endl;
|
std::wcout << u8"参数为" << Name << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,10 @@
|
||||||
#include "RSAC.h"
|
#include "RSAC.h"
|
||||||
#include "STL.h"
|
#include "STL.h"
|
||||||
|
|
||||||
int squirrel::SQloadfile(uint32_t v, const wchar_t* filename, bool printerror)
|
int squirrel::SQloadfile(uint32_t v, const wchar_t* filename, BOOL printerror)
|
||||||
{
|
{
|
||||||
//wchar_t* 转 char*
|
//wchar_t* 转 char*
|
||||||
int size = wcslen(filename);
|
char* fname = DNFTOOL::wchar_tTochar((wchar_t*)filename);
|
||||||
char* fname = (char*)new char[size];
|
|
||||||
DNFTOOL::UnicodeToAnsi(filename, fname, size);
|
|
||||||
|
|
||||||
FILE* file;
|
FILE* file;
|
||||||
file = fopen(fname, "rb");
|
file = fopen(fname, "rb");
|
||||||
|
|
@ -55,7 +53,7 @@ int squirrel::SQloadfile(uint32_t v, const wchar_t* filename, bool printerror)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int squirrel::SQdofile(uint32_t v, const wchar_t* filename, bool retval, bool printerror)
|
int squirrel::SQdofile(uint32_t v, const wchar_t* filename, BOOL retval, BOOL printerror)
|
||||||
{
|
{
|
||||||
if (SQloadfile(v, filename, printerror) >= 0)
|
if (SQloadfile(v, filename, printerror) >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -274,14 +272,9 @@ int squirrel::SendPackWChar(uint32_t v)
|
||||||
wchar_t* n1;
|
wchar_t* n1;
|
||||||
|
|
||||||
SQGetString(v, 2, &n1);
|
SQGetString(v, 2, &n1);
|
||||||
std::wcout << u8"×Ö·û´®ÖµÎª:" << n1 << std::endl;
|
|
||||||
|
|
||||||
//wchar_t* 转 char*
|
//wchar_t* 转 char*
|
||||||
int size = wcslen(n1);
|
char* fname = DNFTOOL::wchar_tTochar(n1);
|
||||||
char* fname = (char*)new char[size];
|
|
||||||
DNFTOOL::UnicodeToAnsi(n1, fname, size);
|
|
||||||
fname[size] = '\0';
|
|
||||||
std::cout << u8"×Ö·û´®ÖµÎª:" << fname << std::endl;
|
|
||||||
_SendPacksChar(*_SendClass, 0, fname, strlen(fname));
|
_SendPacksChar(*_SendClass, 0, fname, strlen(fname));
|
||||||
|
|
||||||
SQPushInt(v, 1);
|
SQPushInt(v, 1);
|
||||||
|
|
@ -724,9 +717,9 @@ int squirrel::Set_STL(uint32_t v)
|
||||||
int ParameterNum = SQGetTop(v);
|
int ParameterNum = SQGetTop(v);
|
||||||
|
|
||||||
int IntValue;
|
int IntValue;
|
||||||
float FloatValue;
|
FLOAT FloatValue;
|
||||||
char* StrValue;
|
char* StrValue;
|
||||||
bool BoolValue;
|
BOOL BoolValue;
|
||||||
if (ParameterNum == 5)
|
if (ParameterNum == 5)
|
||||||
{
|
{
|
||||||
//获取容器名字
|
//获取容器名字
|
||||||
|
|
@ -1059,6 +1052,126 @@ int squirrel::Set_DragonModel(uint32_t v)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined JSON_STL
|
||||||
|
//构造Json类型容器
|
||||||
|
static std::map<wchar_t*, std::string>Json_STL;
|
||||||
|
//Json容器
|
||||||
|
int squirrel::Jsoner_STL(uint32_t v)
|
||||||
|
{
|
||||||
|
wchar_t* Name;
|
||||||
|
int Type;
|
||||||
|
int ParameterNum = SQGetTop(v);
|
||||||
|
if (ParameterNum == 3)
|
||||||
|
{
|
||||||
|
//获取容器名字
|
||||||
|
SQGetString(v, 2, &Name);
|
||||||
|
//获取模式
|
||||||
|
SQGetInt(v, 3, &Type);
|
||||||
|
|
||||||
|
switch (Type)
|
||||||
|
{
|
||||||
|
case 0://构造
|
||||||
|
{
|
||||||
|
if (Json_STL.count(Name) != 0)//如果这个hash不存在 就创建
|
||||||
|
{
|
||||||
|
//构造对应 hash 的 Json容器
|
||||||
|
std::string str = "";
|
||||||
|
Json_STL[Name] = str;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SQPushBool(v, false);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1://读取
|
||||||
|
{
|
||||||
|
wchar_t* buffer = DNFTOOL::charTowchar_t((char*)Json_STL[Name].c_str());
|
||||||
|
SQPushString(v, buffer, wcslen(buffer));//传给nut
|
||||||
|
return 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SQPushBool(v, true);
|
||||||
|
}
|
||||||
|
else if (ParameterNum == 4)
|
||||||
|
{
|
||||||
|
//获取容器名字
|
||||||
|
SQGetString(v, 2, &Name);
|
||||||
|
//获取Key 的名字
|
||||||
|
wchar_t* keybuffer;
|
||||||
|
SQGetString(v, 3, &keybuffer);
|
||||||
|
//转化为可用Key
|
||||||
|
char* key = DNFTOOL::wchar_tTochar(keybuffer);
|
||||||
|
|
||||||
|
//构造json dom
|
||||||
|
rapidjson::Document Dom;
|
||||||
|
Dom.Parse(Json_STL[Name].c_str());//加载 字符串
|
||||||
|
if(Json_STL[Name].length() == 0 )Dom.SetObject();//如果未初始化就初始化一次
|
||||||
|
|
||||||
|
rapidjson::Value BB;
|
||||||
|
|
||||||
|
//获取值的类型
|
||||||
|
int ValueType = SQ_GetType(v, 4);
|
||||||
|
//判断值类型
|
||||||
|
switch (ValueType)
|
||||||
|
{
|
||||||
|
case OT_INTEGER://int类型
|
||||||
|
{
|
||||||
|
int Value;
|
||||||
|
SQGetInt(v, 4, &Value);
|
||||||
|
BB.SetInt(Value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case OT_FLOAT://float类型
|
||||||
|
{
|
||||||
|
FLOAT Value;
|
||||||
|
SQGetFloat(v, 4, &Value);
|
||||||
|
BB.SetFloat(Value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case OT_BOOL://bool类型
|
||||||
|
{
|
||||||
|
BOOL Value;
|
||||||
|
SQGetBool(v, 4, &Value);
|
||||||
|
BB.SetBool(Value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case OT_STRING://string类型
|
||||||
|
{
|
||||||
|
wchar_t* Value;
|
||||||
|
SQGetString(v, 4, &Value);
|
||||||
|
char* str = DNFTOOL::wchar_tTochar(Value);
|
||||||
|
BB.SetString(rapidjson::StringRef(str));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (Dom[key].IsNull())
|
||||||
|
{
|
||||||
|
Dom.AddMember(rapidjson::StringRef(key), BB, Dom.GetAllocator());
|
||||||
|
}
|
||||||
|
|
||||||
|
rapidjson::StringBuffer jsonBuffer;
|
||||||
|
rapidjson::Writer<rapidjson::StringBuffer> writer(jsonBuffer);
|
||||||
|
Dom.Accept(writer);
|
||||||
|
Json_STL[Name] = jsonBuffer.GetString();
|
||||||
|
//delete[] key;
|
||||||
|
SQPushBool(v, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SQPushBool(v, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//获取Squirrel v 基址
|
//获取Squirrel v 基址
|
||||||
inline uint32_t GetSqVm()
|
inline uint32_t GetSqVm()
|
||||||
{
|
{
|
||||||
|
|
@ -1142,6 +1255,11 @@ void squirrel::R_Register_Nut()
|
||||||
RegisterNutApi(L"L_Timer_STL", squirrel::Timer_STL);//时间容器
|
RegisterNutApi(L"L_Timer_STL", squirrel::Timer_STL);//时间容器
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//Json STL
|
||||||
|
#if defined JSON_STL
|
||||||
|
RegisterNutApi(L"L_Json_STL", squirrel::Jsoner_STL);//时间容器
|
||||||
|
#endif
|
||||||
|
|
||||||
//龙盒
|
//龙盒
|
||||||
#if defined DRAGONBOX_SWITCH
|
#if defined DRAGONBOX_SWITCH
|
||||||
RegisterNutApi(L"L_Get_DragonModel", squirrel::Get_DragonModel);//获取龙盒模式
|
RegisterNutApi(L"L_Get_DragonModel", squirrel::Get_DragonModel);//获取龙盒模式
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ static realSqNewClosure* RealSqNewClosure = (realSqNewClosure*)0x135B850;
|
||||||
#define INIT_NUT_ADDRESS 0x135B850
|
#define INIT_NUT_ADDRESS 0x135B850
|
||||||
static realSqNewClosure* MLnewclosure = nullptr;
|
static realSqNewClosure* MLnewclosure = nullptr;
|
||||||
// New槽
|
// New槽
|
||||||
typedef int(SqNewSlot)(uint32_t v, int a, bool b);
|
typedef int(SqNewSlot)(uint32_t v, int a, BOOL b);
|
||||||
static SqNewSlot* SQNewSlot = (SqNewSlot*)0x135AA80;
|
static SqNewSlot* SQNewSlot = (SqNewSlot*)0x135AA80;
|
||||||
// 平栈
|
// 平栈
|
||||||
typedef int(SqPopTop)(uint32_t v);
|
typedef int(SqPopTop)(uint32_t v);
|
||||||
|
|
@ -25,9 +25,55 @@ static SqPop* SQPop = (SqPop*)0x1358FD0;
|
||||||
//SQ_Get
|
//SQ_Get
|
||||||
typedef int(Sq_Get)(uint32_t v, int n);
|
typedef int(Sq_Get)(uint32_t v, int n);
|
||||||
static Sq_Get* SQ_Get = (Sq_Get*)0x135AE30;
|
static Sq_Get* SQ_Get = (Sq_Get*)0x135AE30;
|
||||||
//SQ_Get
|
|
||||||
|
#define _RT_NULL 0x00000001
|
||||||
|
#define _RT_INTEGER 0x00000002
|
||||||
|
#define _RT_FLOAT 0x00000004
|
||||||
|
#define _RT_BOOL 0x00000008
|
||||||
|
#define _RT_STRING 0x00000010
|
||||||
|
#define _RT_TABLE 0x00000020
|
||||||
|
#define _RT_ARRAY 0x00000040
|
||||||
|
#define _RT_USERDATA 0x00000080
|
||||||
|
#define _RT_CLOSURE 0x00000100
|
||||||
|
#define _RT_NATIVECLOSURE 0x00000200
|
||||||
|
#define _RT_GENERATOR 0x00000400
|
||||||
|
#define _RT_USERPOINTER 0x00000800
|
||||||
|
#define _RT_THREAD 0x00001000
|
||||||
|
#define _RT_FUNCPROTO 0x00002000
|
||||||
|
#define _RT_CLASS 0x00004000
|
||||||
|
#define _RT_INSTANCE 0x00008000
|
||||||
|
#define _RT_WEAKREF 0x00010000
|
||||||
|
|
||||||
|
#define SQOBJECT_REF_COUNTED 0x08000000
|
||||||
|
#define SQOBJECT_NUMERIC 0x04000000
|
||||||
|
#define SQOBJECT_DELEGABLE 0x02000000
|
||||||
|
#define SQOBJECT_CANBEFALSE 0x01000000
|
||||||
|
|
||||||
|
typedef enum tagSQObjectType {
|
||||||
|
OT_NULL = (_RT_NULL | SQOBJECT_CANBEFALSE),
|
||||||
|
OT_INTEGER = (_RT_INTEGER | SQOBJECT_NUMERIC | SQOBJECT_CANBEFALSE),
|
||||||
|
OT_FLOAT = (_RT_FLOAT | SQOBJECT_NUMERIC | SQOBJECT_CANBEFALSE),
|
||||||
|
OT_BOOL = (_RT_BOOL | SQOBJECT_CANBEFALSE),
|
||||||
|
OT_STRING = (_RT_STRING | SQOBJECT_REF_COUNTED),
|
||||||
|
OT_TABLE = (_RT_TABLE | SQOBJECT_REF_COUNTED | SQOBJECT_DELEGABLE),
|
||||||
|
OT_ARRAY = (_RT_ARRAY | SQOBJECT_REF_COUNTED),
|
||||||
|
OT_USERDATA = (_RT_USERDATA | SQOBJECT_REF_COUNTED | SQOBJECT_DELEGABLE),
|
||||||
|
OT_CLOSURE = (_RT_CLOSURE | SQOBJECT_REF_COUNTED),
|
||||||
|
OT_NATIVECLOSURE = (_RT_NATIVECLOSURE | SQOBJECT_REF_COUNTED),
|
||||||
|
OT_GENERATOR = (_RT_GENERATOR | SQOBJECT_REF_COUNTED),
|
||||||
|
OT_USERPOINTER = _RT_USERPOINTER,
|
||||||
|
OT_THREAD = (_RT_THREAD | SQOBJECT_REF_COUNTED),
|
||||||
|
OT_FUNCPROTO = (_RT_FUNCPROTO | SQOBJECT_REF_COUNTED), //internal usage only
|
||||||
|
OT_CLASS = (_RT_CLASS | SQOBJECT_REF_COUNTED),
|
||||||
|
OT_INSTANCE = (_RT_INSTANCE | SQOBJECT_REF_COUNTED | SQOBJECT_DELEGABLE),
|
||||||
|
OT_WEAKREF = (_RT_WEAKREF | SQOBJECT_REF_COUNTED)
|
||||||
|
}SQObjectType;
|
||||||
|
//SQ_GetType
|
||||||
typedef int(Sq_GetType)(uint32_t v, int n);
|
typedef int(Sq_GetType)(uint32_t v, int n);
|
||||||
static Sq_GetType* SQ_GetType = (Sq_GetType*)0x1358CD0;
|
static Sq_GetType* SQ_GetType = (Sq_GetType*)0x1358CD0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//SQ_Rawget
|
//SQ_Rawget
|
||||||
typedef int(Sq_Rawget)(uint32_t v, int n);
|
typedef int(Sq_Rawget)(uint32_t v, int n);
|
||||||
static Sq_Rawget* SQ_Rawget = (Sq_Rawget*)0x135AEA0;
|
static Sq_Rawget* SQ_Rawget = (Sq_Rawget*)0x135AEA0;
|
||||||
|
|
@ -47,10 +93,10 @@ static SQ_RemoveFunc* SQ_Remove = (SQ_RemoveFunc*)0x1359000;
|
||||||
typedef int(SqGetIntFunc)(uint32_t v, uint32_t stackIndex, int* sint);
|
typedef int(SqGetIntFunc)(uint32_t v, uint32_t stackIndex, int* sint);
|
||||||
static SqGetIntFunc* SQGetInt = (SqGetIntFunc*)0x1358D70;
|
static SqGetIntFunc* SQGetInt = (SqGetIntFunc*)0x1358D70;
|
||||||
//GetFloat
|
//GetFloat
|
||||||
typedef int(SqGetFloatFunc)(uint32_t v, uint32_t stackIndex, float* sfloat);
|
typedef int(SqGetFloatFunc)(uint32_t v, uint32_t stackIndex, FLOAT* sfloat);
|
||||||
static SqGetFloatFunc* SQGetFloat = (SqGetFloatFunc*)0x1358DD0;
|
static SqGetFloatFunc* SQGetFloat = (SqGetFloatFunc*)0x1358DD0;
|
||||||
//GetBool
|
//GetBool
|
||||||
typedef int(SqGetBoolFunc)(uint32_t v, uint32_t stackIndex, bool* sbool);
|
typedef int(SqGetBoolFunc)(uint32_t v, uint32_t stackIndex, BOOL* sbool);
|
||||||
static SqGetBoolFunc* SQGetBool = (SqGetBoolFunc*)0x1358E30;
|
static SqGetBoolFunc* SQGetBool = (SqGetBoolFunc*)0x1358E30;
|
||||||
//GetString
|
//GetString
|
||||||
typedef int(SqGetStringFunc)(uint32_t v, uint32_t stackIndex, wchar_t** sstring);
|
typedef int(SqGetStringFunc)(uint32_t v, uint32_t stackIndex, wchar_t** sstring);
|
||||||
|
|
@ -81,19 +127,19 @@ static SqPushStringFuncs* SQPushStringc = (SqPushStringFuncs*)0x1358A60;
|
||||||
typedef int(SqPushIntFunc)(uint32_t v, int sint);
|
typedef int(SqPushIntFunc)(uint32_t v, int sint);
|
||||||
static SqPushIntFunc* SQPushInt = (SqPushIntFunc*)0x1358AD0;
|
static SqPushIntFunc* SQPushInt = (SqPushIntFunc*)0x1358AD0;
|
||||||
//PushBool
|
//PushBool
|
||||||
typedef int(SqPushBoolFunc)(uint32_t v, bool sbool);
|
typedef int(SqPushBoolFunc)(uint32_t v, BOOL sbool);
|
||||||
static SqPushBoolFunc* SQPushBool = (SqPushBoolFunc*)0x1358B10;
|
static SqPushBoolFunc* SQPushBool = (SqPushBoolFunc*)0x1358B10;
|
||||||
//PushFloat
|
//PushFloat
|
||||||
typedef int(SqPushFloatFunc)(uint32_t v, float sfloat);
|
typedef int(SqPushFloatFunc)(uint32_t v, FLOAT sfloat);
|
||||||
static SqPushFloatFunc* SQPushFloat = (SqPushFloatFunc*)0x1358B60;
|
static SqPushFloatFunc* SQPushFloat = (SqPushFloatFunc*)0x1358B60;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//SQLOADFILE
|
//SQLOADFILE
|
||||||
typedef void* (SQLOADFILEFunc)(uint32_t v, const wchar_t* filename, bool printerror);
|
typedef void* (SQLOADFILEFunc)(uint32_t v, const wchar_t* filename, BOOL printerror);
|
||||||
static SQLOADFILEFunc* SQLOADFILEF = (SQLOADFILEFunc*)0x13560E0;
|
static SQLOADFILEFunc* SQLOADFILEF = (SQLOADFILEFunc*)0x13560E0;
|
||||||
//SQDOFILE
|
//SQDOFILE
|
||||||
typedef void* (SQDOFILEFunc)(uint32_t v, const wchar_t* filename, bool retval, bool printerror);
|
typedef void* (SQDOFILEFunc)(uint32_t v, const wchar_t* filename, BOOL retval, BOOL printerror);
|
||||||
static SQDOFILEFunc* SQDOFILE = (SQDOFILEFunc*)0x1356240;
|
static SQDOFILEFunc* SQDOFILE = (SQDOFILEFunc*)0x1356240;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -130,7 +176,7 @@ static SQ_ReadclosureFunc* SQ_Readclosure = (SQ_ReadclosureFunc*)0x1359460;
|
||||||
typedef int(SQ__FcloseFunc)(void* file);
|
typedef int(SQ__FcloseFunc)(void* file);
|
||||||
static SQ__FcloseFunc* SQ__Fclose = (SQ__FcloseFunc*)0x1355E70;
|
static SQ__FcloseFunc* SQ__Fclose = (SQ__FcloseFunc*)0x1355E70;
|
||||||
//SQ_Compile
|
//SQ_Compile
|
||||||
typedef int(SQ_CompileFunc)(uint32_t v, LSQLEXREADFUNC FUNC, void* file, const wchar_t* filename, bool printerror);
|
typedef int(SQ_CompileFunc)(uint32_t v, LSQLEXREADFUNC FUNC, void* file, const wchar_t* filename, BOOL printerror);
|
||||||
static SQ_CompileFunc* SQ_Compile = (SQ_CompileFunc*)0x135A390;
|
static SQ_CompileFunc* SQ_Compile = (SQ_CompileFunc*)0x135A390;
|
||||||
//SQ_Throwerror
|
//SQ_Throwerror
|
||||||
typedef int(SQ_ThrowerrorFunc)(uint32_t v, const wchar_t* error);
|
typedef int(SQ_ThrowerrorFunc)(uint32_t v, const wchar_t* error);
|
||||||
|
|
@ -146,8 +192,8 @@ private:
|
||||||
|
|
||||||
|
|
||||||
public://加载
|
public://加载
|
||||||
static int SQloadfile(uint32_t v, const wchar_t* filename, bool printerror);
|
static int SQloadfile(uint32_t v, const wchar_t* filename, BOOL printerror);
|
||||||
static int SQdofile(uint32_t v, const wchar_t* filename, bool retval, bool printerror);
|
static int SQdofile(uint32_t v, const wchar_t* filename, BOOL retval, BOOL printerror);
|
||||||
|
|
||||||
public://NUT API 接口
|
public://NUT API 接口
|
||||||
static int sq_Test(uint32_t v);//测试接口
|
static int sq_Test(uint32_t v);//测试接口
|
||||||
|
|
@ -183,6 +229,7 @@ public://
|
||||||
static int Set_STL(uint32_t v);//设置 类型容器
|
static int Set_STL(uint32_t v);//设置 类型容器
|
||||||
static int New_STL(uint32_t v);//new 类型容器
|
static int New_STL(uint32_t v);//new 类型容器
|
||||||
static int Timer_STL(uint32_t v);//时间容器
|
static int Timer_STL(uint32_t v);//时间容器
|
||||||
|
static int Jsoner_STL(uint32_t v);//ʱ¼äÈÝÆ÷
|
||||||
|
|
||||||
public://龙盒
|
public://龙盒
|
||||||
static int Sync_Dragon_Pack(uint32_t v);//同步 龙盒数据包
|
static int Sync_Dragon_Pack(uint32_t v);//同步 龙盒数据包
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,8 @@
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<OutDir>D:\BaiduNetdiskWorkspace\DOF-Lenheart\Plugins\</OutDir>
|
<OutDir>D:\BaiduNetdiskWorkspace\DOF-Lenheart\Plugins\</OutDir>
|
||||||
<LibraryPath>E:\Testnixiang\test\test\OpenSSL-Win32\lib;E:\Testnixiang\test\test\OpenSSL-Win32\lib\VC;$(LibraryPath)</LibraryPath>
|
<LibraryPath>E:\openssl\lib;E:\Testnixiang\test\test\OpenSSL-Win32\lib;E:\Testnixiang\test\test\OpenSSL-Win32\lib\VC;$(LibraryPath)</LibraryPath>
|
||||||
|
<IncludePath>E:\openssl\include;$(IncludePath)</IncludePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue