// MT5MonkPAMM.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include "pch.h"
#include "PluginInstance.h"

MTPluginInfo ExtPluginInfo =
{
	1,
	MTServerAPIVersion,
	L"Monk MT5 MAM",
	L"",
	L"Multi Account Management"
};

MTPluginParam ExtPluginDefaults[] =
{
	{ MTPluginParam::TYPE_STRING, L"Redis Server", L"-" },
	{ MTPluginParam::TYPE_INT, L"Redis Port", L"-" },
	{ MTPluginParam::TYPE_STRING, L"Redis Password", L"-" },
	{ MTPluginParam::TYPE_INT, L"Trader", L"-" },
	//{ MTPluginParam::TYPE_INT, L"Step", L"-" },
	//{ MTPluginParam::TYPE_INT, L"Tolerance", L"-" },
	{ MTPluginParam::TYPE_STRING, L"Groups", L"-" },
	{ MTPluginParam::TYPE_INT, L"DealerID", L"0" },
	{ MTPluginParam::TYPE_INT, L"DebugMode", L"0" }
};

BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved)
{
	//---
	switch (reason)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return(TRUE);
}

MTAPIENTRY MTAPIRES MTServerAbout(MTPluginInfo& info)
{
	info = ExtPluginInfo;
	memcpy(info.defaults, ExtPluginDefaults, sizeof(ExtPluginDefaults));
	info.defaults_total = _countof(ExtPluginDefaults);
	return MT_RET_OK;
}

MTAPIENTRY MTAPIRES MTServerCreate(UINT apiversion, IMTServerPlugin **plugin)
{
	if (!plugin)	return MT_RET_ERR_PARAMS;
	if (((*plugin) = new(std::nothrow) CPluginInstance()) == NULL)
		return MT_RET_ERR_MEM;
	return MT_RET_OK;
}

