1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Multiplayer: gracefully handle player loss unless it's a host

We don't want server to shutdown after just one of players lost the game.
This commit is contained in:
Arseniy Shestakov
2016-10-30 02:43:06 +03:00
parent c66c66c5ae
commit db5a52a0f8
4 changed files with 14 additions and 3 deletions

View File

@@ -201,6 +201,11 @@ bool CConnection::isOpen() const
return socket && connected;
}
bool CConnection::isHost() const
{
return connectionID == 1;
}
void CConnection::reportState(CLogger * out)
{
out->debugStream() << "CConnection";

View File

@@ -74,6 +74,7 @@ public:
void close();
bool isOpen() const;
bool isHost() const;
template<class T>
CConnection &operator&(const T&);
virtual ~CConnection(void);