Danbias/Code/Game/LanServer/GameServerDebugEnvironment/Source.cpp

50 lines
1.1 KiB
C++
Raw Permalink Normal View History

/////////////////////////////////////////////////
// Launcher to launch Danbias server or client //
/////////////////////////////////////////////////
#define NOMINMAX
#include <Windows.h>
#include <vld.h>
#include <GameServerAPI.h>
#include <WindowShell.h>
using namespace DanBias;
2014-02-20 09:14:42 +01:00
int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdShow)
{
if(SetDllDirectory(L"..\\DLL") == FALSE)
{
return cmdShow;
}
WindowShell::CreateConsoleWindow();
GameServerAPI::ServerInitDesc desc;
desc.listenPort = 15151;
desc.serverName = L"bla";
if(GameServerAPI::ServerInitiate(desc) == DanBiasServerReturn_Sucess)
{
GameServerAPI::ServerStart();
GameServerAPI::GameSetGameMode(L"free-for-all");
GameServerAPI::GameSetGameName(L"DebugServer");
GameServerAPI::GameSetGameTime(15);
GameServerAPI::GameSetMapName(L"erik_250.bias");
GameServerAPI::GameSetMaxClients(10);
if(GameServerAPI::GameStart(true))
{
int Q = 0x51;
while ( GetAsyncKeyState(Q) == 0)
{
GameServerAPI::ServerUpdate();
}
}
GameServerAPI::ServerStop();
}
return 0;
}