2013-12-03 12:07:37 +01:00
|
|
|
/////////////////////////////////////////////////
|
|
|
|
// Launcher to launch Danbias server or client //
|
|
|
|
/////////////////////////////////////////////////
|
2013-12-04 11:32:43 +01:00
|
|
|
#define NOMINMAX
|
2013-12-03 12:07:37 +01:00
|
|
|
#include <Windows.h>
|
2013-12-13 23:47:16 +01:00
|
|
|
#include <vld.h>
|
2013-12-03 12:07:37 +01:00
|
|
|
|
2013-12-14 22:04:42 +01:00
|
|
|
|
2013-12-17 10:25:34 +01:00
|
|
|
#include "DanBiasServerAPI.h"
|
|
|
|
//#include "DanBiasGame.h"
|
2013-12-03 12:07:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdShow)
|
|
|
|
{
|
|
|
|
#if defined(DANBIAS_SERVER)
|
|
|
|
if(SetDllDirectory(L"..\\DLL") == FALSE)
|
|
|
|
{
|
|
|
|
return cmdShow;
|
|
|
|
}
|
2013-12-12 09:33:59 +01:00
|
|
|
if( DanBias::DanBiasServerAPI::Initiate() == DanBias::DanBiasServerReturn_Sucess)
|
2013-12-03 12:07:37 +01:00
|
|
|
{
|
2013-12-12 09:33:59 +01:00
|
|
|
DanBias::DanBiasServerAPI::Run();
|
|
|
|
DanBias::DanBiasServerAPI::Release();
|
2013-12-03 12:07:37 +01:00
|
|
|
}
|
2013-12-16 09:45:12 +01:00
|
|
|
#elif defined(DANBIAS_CLIENT)
|
2013-12-04 11:32:43 +01:00
|
|
|
if(SetDllDirectory(L"..\\DLL") == FALSE)
|
|
|
|
{
|
|
|
|
return cmdShow;
|
|
|
|
}
|
2013-12-03 12:07:37 +01:00
|
|
|
// Game client starter code goes here
|
2013-12-04 11:32:43 +01:00
|
|
|
DanBias::DanBiasGameDesc gameDesc;
|
|
|
|
gameDesc.port = 1;
|
2013-12-16 09:55:51 +01:00
|
|
|
gameDesc.IP = "10.1010.303";
|
2013-12-04 11:32:43 +01:00
|
|
|
gameDesc.hinst = hinst;
|
|
|
|
gameDesc.nCmdShow = cmdShow;
|
|
|
|
|
|
|
|
if( DanBias::DanBiasGame::Initiate(gameDesc) == DanBias::DanBiasClientReturn_Sucess)
|
|
|
|
{
|
|
|
|
DanBias::DanBiasGame::Run();
|
|
|
|
DanBias::DanBiasGame::Release();
|
|
|
|
}
|
2013-12-03 12:07:37 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return cmdShow;
|
|
|
|
}
|