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:
@@ -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";
|
||||
|
||||
@@ -74,6 +74,7 @@ public:
|
||||
|
||||
void close();
|
||||
bool isOpen() const;
|
||||
bool isHost() const;
|
||||
template<class T>
|
||||
CConnection &operator&(const T&);
|
||||
virtual ~CConnection(void);
|
||||
|
||||
Reference in New Issue
Block a user