swift
fs9host.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2014 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
4 #ifndef DIRECTPLAY_HOST_H
5 #define DIRECTPLAY_HOST_H
6 
7 #include "directplaypeer.h"
8 
10 
11 namespace swift::simplugin::fs9
12 {
14  class CFs9Host : public CDirectPlayPeer
15  {
16  Q_OBJECT
17 
18  public:
21  {
22  Hosting,
23  Terminated
24  };
25 
27  CFs9Host(QObject *parent = nullptr);
28 
30  virtual ~CFs9Host() override;
31 
33  bool isConnected() const { return m_playerUser != 0; }
34 
36  QString getHostAddress();
37 
38  public slots:
40  void sendTextMessage(const QString &textMessage);
41 
42  signals:
45 
46  private:
48  HRESULT startHosting(const QString &session, const QString &callsign);
49 
51  HRESULT stopHosting();
52 
53  HostStatus m_hostStatus = Terminated;
54  };
55 } // namespace swift::simplugin::fs9
56 
58 
59 #endif // DIRECTPLAY_HOST_H
DirectPlay peer implementation More information can be found in the DirectX9 SDK documentation http:/...
std::atomic< DPNID > m_playerUser
User player Id.
Class encapsulating a FS9 host.
Definition: fs9host.h:15
void sendTextMessage(const QString &textMessage)
Send new text message.
Definition: fs9host.cpp:77
QString getHostAddress()
Get DirectPlay host url.
Definition: fs9host.cpp:32
void statusChanged(swift::simplugin::fs9::CFs9Host::HostStatus)
Hosting status changed.
CFs9Host(QObject *parent=nullptr)
Constructor.
Definition: fs9host.cpp:23
virtual ~CFs9Host()
Destructor.
Definition: fs9host.cpp:30
bool isConnected() const
Returns true if the users simulator is connected.
Definition: fs9host.h:33
HostStatus
Connection status.
Definition: fs9host.h:21