2020-08-27 08:19:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
2021-01-24 00:40:09 +01:00
|
|
|
#include "Network/Public/IGameServer.h"
|
|
|
|
#include "Network/Public/IGameServerConsole.h"
|
|
|
|
#include "Core/Public/IGameServiceProvider.h"
|
|
|
|
#include "Core/Public/ITextLookupService.h"
|
2020-08-27 08:19:09 +02:00
|
|
|
|
|
|
|
// ServerDialog dialog
|
|
|
|
|
2021-01-24 00:40:09 +01:00
|
|
|
class ServerDialog : public CDialogEx, public IGameServerConsole
|
2020-08-27 08:19:09 +02:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC(ServerDialog)
|
|
|
|
|
|
|
|
public:
|
|
|
|
~ServerDialog();
|
2021-01-24 00:40:09 +01:00
|
|
|
ServerDialog(IGameServiceProvider* container, CWnd* parent = nullptr);
|
2020-08-27 08:19:09 +02:00
|
|
|
|
|
|
|
void CreateColumns();
|
|
|
|
void RefreshPlayers();
|
|
|
|
|
|
|
|
static void STDMETHODCALLTYPE TimerCallback(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime);
|
2021-01-24 00:40:09 +01:00
|
|
|
void CloseDialog() override;
|
|
|
|
void ShowDialog() override;
|
2020-08-27 08:19:09 +02:00
|
|
|
|
|
|
|
void HandlePlayerConnected(const GameServerEvent& event);
|
|
|
|
void HandlePlayerDisconnected(const GameServerEvent& event);
|
|
|
|
void HandleChatMessage(const GameServerEvent& event);
|
|
|
|
void 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{};
|
2021-01-24 00:40:09 +01:00
|
|
|
IGameServiceProvider* m_serviceProvider{};
|
2020-08-27 08:19:09 +02:00
|
|
|
|
|
|
|
const int NumColumns = 5;
|
|
|
|
};
|