Exemplo n.º 1
0
VOID InitializeMQ2Plugins()
{
    DebugSpew("Initializing plugins");
    bmWriteChatColor=AddMQ2Benchmark("WriteChatColor");
    bmPluginsIncomingChat=AddMQ2Benchmark("PluginsIncomingChat");
    bmPluginsPulse=AddMQ2Benchmark("PluginsPulse");
    bmPluginsOnZoned=AddMQ2Benchmark("PluginsOnZoned");
    bmPluginsCleanUI=AddMQ2Benchmark("PluginsCleanUI");
    bmPluginsReloadUI=AddMQ2Benchmark("PluginsReloadUI");
    bmPluginsDrawHUD=AddMQ2Benchmark("PluginsDrawHUD");
    bmPluginsSetGameState=AddMQ2Benchmark("PluginsSetGameState");
    bmCalculate=AddMQ2Benchmark("Calculate");
    bmBeginZone=AddMQ2Benchmark("BeginZone"); 
    bmEndZone=AddMQ2Benchmark("EndZone"); 


    bPluginCS=1;

    CHAR PluginList[MAX_STRING*10] = {0};
    CHAR szBuffer[MAX_STRING] = {0};
    CHAR MainINI[MAX_STRING] = {0};
    sprintf_s(MainINI,"%s\\macroquest.ini",gszINIPath);
    GetPrivateProfileString("Plugins",NULL,"",PluginList,MAX_STRING*10,MainINI);
    PCHAR pPluginList = PluginList;
	BOOL loadvalue = 0;
    while (pPluginList[0]!=0) {
        GetPrivateProfileString("Plugins",pPluginList,"",szBuffer,MAX_STRING,MainINI);
        if (IsNumber(szBuffer)) {
			loadvalue=atoi(szBuffer);
			szBuffer[0] = '\0';
		}
		if(loadvalue==1 || szBuffer[0]!=0) {
            LoadMQ2Plugin(pPluginList);
        }
        pPluginList+=strlen(pPluginList)+1;
    }
	//ok now check if user has a CustomPlugin.ini and load those as well...
	sprintf_s(MainINI,"%s\\CustomPlugins.ini",gszINIPath);
    GetPrivateProfileString("Plugins",NULL,"",PluginList,MAX_STRING*10,MainINI);
    pPluginList = PluginList;
    while (pPluginList[0]!=0) {
        GetPrivateProfileString("Plugins",pPluginList,"",szBuffer,MAX_STRING,MainINI);
        if (IsNumber(szBuffer)) {
			loadvalue=atoi(szBuffer);
			szBuffer[0] = '\0';
		}
		if(loadvalue==1 || szBuffer[0]!=0) {
            LoadMQ2Plugin(pPluginList,1);
        }
        pPluginList+=strlen(pPluginList)+1;
    }
}
Exemplo n.º 2
0
// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
	bzsrchhandle = CreateMutex(NULL, FALSE, NULL);
    DebugSpewAlways("Initializing MQ2Bzsrch");

    LoadMQ2Plugin("MQ2ItemDisplay");
    HMODULE h = LoadLibrary("MQ2ItemDisplay.dll");
    if (!h) {
        pg_Item = NULL;
    }
    else {
        pg_Item = (ITEMINFO *)GetProcAddress(h, "g_Item");
    }
    FreeLibrary(h);

    // Add commands, macro parameters, hooks, etc.
    AddCommand("/bzsrch",BzSrchMe);
    AddCommand("/breset",BzSrchMe);
    AddCommand("/mq2bzsrch",MQ2BzSrch);
    //AddCommand("/pricecheck",bzpc);
    AddMQ2Data("Bazaar",dataBazaar);              // cc - added, but not using TLO yet

    EzDetour(CBazaarSearchWnd__HandleBazaarMsg,&BzSrchHook::BzDetour,&BzSrchHook::BzTrampoline);
    pBazaarType = new MQ2BazaarType;
    pBazaarItemType = new MQ2BazaarItemType;
}