#pragma once #include #include #include #include "Menu.h" class ServerStatus : public ZeichnungHintergrund { private: Framework::Text name; Framework::Text ip; unsigned short sslPort; unsigned short port; Framework::Text playerName; int ping; Framework::Text status; int statusId; int requestId; Framework::HashMap *secrets; Framework::AlphaFeld *closeAF; Framework::Knopf* join; public: ServerStatus(Framework::Text name, Framework::Text ip, unsigned short sslPort, unsigned short port, Framework::HashMap *secrets); ~ServerStatus(); virtual void updatePlayerName(Framework::Text playerName); virtual void doMausEreignis(Framework::MausEreignis& me, bool userRet) override; virtual bool tick(double time) override; virtual void render(Framework::Bild& rObj) override; Framework::Text getName() const; Framework::Text getIp() const; unsigned short getSSLPort() const; unsigned short getPort() const; Framework::HashMap* zSecrets() const; bool canConnect() const; }; class ServerSelectionMenu : public Menu { private: Framework::TextFeld* playerName; Framework::TextFeld* playerNameLabel; Framework::TextFeld* serverLabel; Framework::ZListe* serverList; Framework::Knopf* add; Framework::Knopf* refresh; public: ServerSelectionMenu(Framework::Bildschirm* zScreen); void addServer(Framework::Text name, Framework::Text ip, unsigned short sslPort, unsigned short port); bool hasServer(Framework::Text name) const; void removeServer(Framework::Text name) const; void saveServers() const; };