1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-22 06:05:38 +01:00
GiantsTools/ServerConsoleExample/ServerDialog.h

63 lines
1.6 KiB
C++

#pragma once
#include "Network/Public/IGameServer.h"
#include "Network/Public/IGameServerConsole.h"
#include "Core/Public/IGameServiceProvider.h"
#include "Core/Public/ITextLookupService.h"
// ServerDialog dialog
class ServerDialog : public CDialogEx, public IGameServerConsole
{
DECLARE_DYNAMIC(ServerDialog)
public:
~ServerDialog();
ServerDialog(IGameServiceProvider* container, CWnd* parent = nullptr);
void CreateColumns();
void RefreshPlayers();
static void STDMETHODCALLTYPE TimerCallback(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime);
void CloseDialog() override;
void ShowDialog() override;
EventListenerResult HandlePlayerConnected(const GameServerEvent& event);
EventListenerResult HandlePlayerDisconnected(const GameServerEvent& event);
EventListenerResult HandleChatMessage(const GameServerEvent& event);
EventListenerResult HandleWorldLoaded(const GameServerEvent& event);
// MFC methods
BOOL OnInitDialog() override;
void PostNcDestroy() override;
void OnOK() override;
void OnCancel() override;
// Dialog Data
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_SERVER };
#endif
private:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
CEdit ConsoleEditBox;
CListCtrl PlayersListCtrl;
CButton ButtonBan;
CButton ButtonKick;
afx_msg void OnBnClickedKick();
afx_msg void OnBnClickedBan();
afx_msg void OnItemChanged(NMHDR* pNMHDR, LRESULT* pResult);
UUID m_playerConnectedEventHandle{};
UUID m_playerDisconnectedEventHandle{};
UUID m_playerChatMessageHandle{};
UUID m_worldLoadedHandle{};
IGameServiceProvider* m_serviceProvider{};
const int NumColumns = 5;
};