Danbias/Code/Game/DanBiasServerLauncher/ServerLauncher.cpp

37 lines
953 B
C++
Raw Normal View History

2014-01-07 10:26:09 +01:00
//////////////////////////////////////////////////
// Launcher to launch Danbias server //
2014-01-07 10:26:09 +01:00
// Created by [Dennis Andersen] [2013] //
//////////////////////////////////////////////////
#define NOMINMAX //Blame it on microsoft
2013-12-19 13:35:56 +01:00
#include <Windows.h>
#include <vld.h>
2014-01-29 10:18:01 +01:00
#include <iostream>
#include <WindowShell.h>
2014-01-28 09:00:02 +01:00
#include <GameServerAPI.h>
2013-12-19 13:35:56 +01:00
int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdShow)
{
if(SetDllDirectory(L"..\\DLL") == FALSE)
{
return cmdShow;
}
2014-01-28 09:00:02 +01:00
2014-01-29 10:18:01 +01:00
WindowShell::CreateConsoleWindow();
2014-01-30 00:19:00 +01:00
DanBias::GameServerAPI::ServerInitDesc desc;
2014-01-29 10:18:01 +01:00
desc.listenPort = 15151;
2014-01-30 00:19:00 +01:00
if(DanBias::GameServerAPI::ServerInitiate(desc) == DanBias::DanBiasServerReturn_Sucess)
2013-12-19 13:35:56 +01:00
{
2014-01-30 00:19:00 +01:00
DanBias::GameServerAPI::ServerStart();
//DanBias::GameServerAPI::GameStart();
2014-01-30 00:19:00 +01:00
while (!(GetAsyncKeyState(0x51))) //Q for exit
{
DanBias::GameServerAPI::ServerUpdate();
Sleep(1);
}
DanBias::GameServerAPI::ServerStop();
2013-12-19 13:35:56 +01:00
}
return cmdShow;
}