2020-08-27 08:10:21 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <functional>
|
|
|
|
#include <memory>
|
|
|
|
#include <IComponent.h>
|
2020-09-22 07:30:26 +02:00
|
|
|
#include <IEventSource.h>
|
2020-08-27 08:10:21 +02:00
|
|
|
|
|
|
|
#include "GameServerEvents.h"
|
|
|
|
#include "NetCommon.h"
|
|
|
|
|
|
|
|
// {B2D67EE7-8063-488F-B3B9-E7DA675CB752}
|
2020-09-22 07:30:26 +02:00
|
|
|
inline const GUID IID_IGameServer = { 0xb2d67ee7, 0x8063, 0x488f, 0xb3, 0xb9, 0xe7, 0xda, 0x67, 0x5c, 0xb7, 0x52 };
|
2020-08-27 08:10:21 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines an API for communicating with the game server.
|
|
|
|
/// </summary>
|
2020-09-22 07:30:26 +02:00
|
|
|
struct IGameServer : IComponent, IEventSource<GameServerEventType, GameServerEvent>
|
2020-08-27 08:10:21 +02:00
|
|
|
{
|
|
|
|
virtual ~IGameServer() = default;
|
|
|
|
|
|
|
|
virtual void STDMETHODCALLTYPE SendChatMessage(const std::string_view& message, ChatColor color, int flags, PlayerIndex indexTo) = 0;
|
|
|
|
|
|
|
|
virtual void STDMETHODCALLTYPE BanPlayer(int index) = 0;
|
|
|
|
|
|
|
|
virtual void STDMETHODCALLTYPE KickPlayer(int index, KickReason reason) = 0;
|
|
|
|
|
|
|
|
virtual PlayerInfo STDMETHODCALLTYPE GetPlayer(int index) = 0;
|
|
|
|
|
|
|
|
virtual std::vector<PlayerInfo> STDMETHODCALLTYPE GetPlayers() = 0;
|
|
|
|
|
|
|
|
virtual void STDMETHODCALLTYPE ChangeGameOption(GameOption option) = 0;
|
|
|
|
|
|
|
|
virtual NetGameDetails STDMETHODCALLTYPE GetGameDetails() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DECLSPEC_UUID("{B2D67EE7-8063-488F-B3B9-E7DA675CB752}") IGameServer;
|