File: ClientAppFixture.h

package info (click to toggle)
freeorion 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 194,940 kB
  • sloc: cpp: 186,508; python: 40,969; ansic: 1,164; xml: 719; makefile: 32; sh: 7
file content (39 lines) | stat: -rw-r--r-- 1,382 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _ClientAppFixture_h_
#define _ClientAppFixture_h_

#include "client/ClientApp.h"

class ClientAppFixture : public ClientApp {
public:
    ClientAppFixture();

    bool PingLocalHostServer();
    bool ConnectToLocalHostServer();
    bool ConnectToServer(const std::string& ip_address);
    void DisconnectFromServer();

    void HostSPGame(unsigned int num_AIs);
    void JoinGame();

    bool ProcessMessages(const boost::posix_time::ptime& start_time, int max_seconds);
    bool HandleMessage(Message& msg);
    void SaveGame();
    void UpdateLobby();

    unsigned int GetLobbyAICount() const;

    int EffectsProcessingThreads() const override;
protected:
    std::set<int>        m_ai_empires;             ///< Ids of AI empires in game.
    std::set<int>        m_ai_waiting;             ///< Ids of AI empires not yet send orders.
    boost::uuids::uuid   m_cookie;                 ///< Cookie from server login.
    MultiplayerLobbyData m_lobby_data;             ///< Lobby data.
    bool                 m_lobby_updated = false;  ///< Did player get updated lobby.
    bool                 m_game_started = false;   ///< Is server started the game?
    bool                 m_turn_done = false;      ///< Is server processed turn?
    bool                 m_save_completed = false; ///< Is server saved game?
};

constexpr static int MAX_WAITING_SEC = 120;

#endif