Danbias/Code/Game/GameServer/GameServerAPI.h

73 lines
1.8 KiB
C
Raw Normal View History

/////////////////////////////////////////
// Created by [Dennis Andersen] [2013] //
/////////////////////////////////////////
2013-12-03 12:07:37 +01:00
#ifndef DANBIAS_SERVER_DANBIAS_SERVER_H
#define DANBIAS_SERVER_DANBIAS_SERVER_H
2013-12-13 23:47:16 +01:00
#include <vld.h>
2013-12-12 09:33:59 +01:00
#define DANBIAS_SERVER
2013-12-03 12:07:37 +01:00
2013-12-12 09:33:59 +01:00
#ifdef DANBIAS_SERVER_DLL_EXPORT
2013-12-03 12:07:37 +01:00
#define DANBIAS_SERVER_DLL __declspec(dllexport)
#else
#define DANBIAS_SERVER_DLL __declspec(dllimport)
#endif
namespace DanBias
{
2013-12-12 09:33:59 +01:00
enum DanBiasServerReturn
2013-12-03 12:07:37 +01:00
{
2013-12-12 09:33:59 +01:00
DanBiasServerReturn_Error,
DanBiasServerReturn_Sucess,
2014-01-29 10:18:01 +01:00
DanBiasServerReturn_GameNotCreated,
2013-12-12 09:33:59 +01:00
};
2013-12-03 12:07:37 +01:00
2013-12-12 09:33:59 +01:00
extern "C"
{
2014-01-28 09:00:02 +01:00
class DANBIAS_SERVER_DLL GameServerAPI
2013-12-03 12:07:37 +01:00
{
public:
2014-01-30 00:19:00 +01:00
struct ServerInitDesc
2014-01-28 09:00:02 +01:00
{
2014-01-30 00:19:00 +01:00
char* serverName;
2014-01-29 10:18:01 +01:00
int listenPort;
bool broadcast; //Not fully implemented!
2014-01-30 00:19:00 +01:00
ServerInitDesc()
: serverName("Game Server")
, listenPort(15151)
, broadcast(true)
2014-01-30 00:19:00 +01:00
{};
};
struct GameServerInfo
{
unsigned int listenPort; // If set to 0, the default port 15151 will be used
const char *serverIp; // This cant be mofidfied..
2014-01-28 09:00:02 +01:00
};
2014-01-29 10:18:01 +01:00
2014-01-28 09:00:02 +01:00
public:
2014-01-30 00:19:00 +01:00
static DanBiasServerReturn ServerInitiate(const ServerInitDesc& desc);
static void ServerStart();
static void ServerStop();
static void ServerUpdate();
static GameServerInfo ServerGetInfo();
static bool ServerIsRunning();
2014-01-30 00:19:00 +01:00
static void GameSetMapId(const int& val);
static void GameSetMaxClients(const int& val);
static void GameSetGameMode(const int& val);
static void GameSetGameTime(const int& val);
static int GameGetMapId();
static int GameGetMaxClients();
static int GameGetGameMode();
static int GameGetGameTime();
static const char* GameGetGameName();
static bool GameStart();
2014-01-29 10:18:01 +01:00
2013-12-12 09:33:59 +01:00
};//End class DanBiasServer
2013-12-03 12:07:37 +01:00
}//End Extern "C"
} //End namspace DanBias
#endif // !DANBIAS_SERVER_DANBIAS_SERVER_H