// test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "windows.h"
#include "interface.h"

#pragma comment(lib,"interface.lib")

void GuajiCallBack(int flag)
{
	if(flag == 1)
		MessageBoxA(0,"执行了开始挂机。",0,0);
	if(flag == 0)
		MessageBoxA(0,"执行了停止挂机。",0,0);

}

void BonusCallBack(int flag)
{
	if(flag == 1)
		MessageBoxA(0,"执行了开始收金。",0,0);
	if(flag == 0)
		MessageBoxA(0,"执行了停止收金。",0,0);

}

int _tmain(int argc, _TCHAR* argv[])
{
/*	HMODULE hMod = 0;
	hMod = LoadLibrary("interface.dll");
	if(hMod == 0)
	{
		return 1;
	}
*/

	InitInterface();
	SetVersion(110);


//设置回调函数，用来响应主控端的挂机和收金命令
	SetGuajiCallBack((DWORD)GuajiCallBack);
	SetBonusCallBack((DWORD)BonusCallBack);

	for(int i = 0;i < 2;i ++)
	{
		char Buffer[200];
		sprintf(Buffer,"hahahahahahahahahahahahahahahahahahahahahahahahahahaha%d",i);
		SendInformationToServer(Buffer);
		Sleep(1000);
	}

	
	for(int i = 0;i < 3;i ++)
	{
		char Buffer[200];
		sprintf(Buffer,"loglogloglog%d",i);
		SendLogToServer(Buffer);
		Sleep(1000);
	}	



	for(int i = 0;i < 3;i ++)
	{
		char Buffer[200];
		sprintf(Buffer,"alarmalarmalarmalarma%d",i);
		SendAlarmToServer(1,Buffer);
		Sleep(1000);
	}


	SendBanedToServer(1);
	Sleep(1000);
	SendBanedToServer(0);


	Sleep(1000);
	SendAlarmToServer(0,"警告解除");

	getchar();

	return 0;
}

