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

Logging cleanup (server).

This commit is contained in:
AlexVinS
2017-08-11 16:50:00 +03:00
parent 046e1a7c29
commit a8a3230798
3 changed files with 13 additions and 11 deletions

View File

@@ -278,7 +278,9 @@ void CConnection::enableSmartVectorMemberSerializatoin()
CSerializer::smartVectorMembersSerialization = true;
}
std::ostream & operator<<(std::ostream &str, const CConnection &cpc)
{
return str << "Connection with " << cpc.name << " (ID: " << cpc.connectionID << /*", " << (cpc.host ? "host" : "guest") <<*/ ")";
}
std::string CConnection::toString() const
{
boost::format fmt("Connection with %s (ID: %d)");
fmt % name % connectionID;
return fmt.str();
}

View File

@@ -90,6 +90,8 @@ public:
void prepareForSendingHeroes(); //disables sending vectorized, enables smart pointer serialization, clears saved/loaded ptr cache
void enterPregameConnectionMode();
std::string toString() const;
template<class T>
CConnection & operator>>(T &t)
{
@@ -104,5 +106,3 @@ public:
return * this;
}
};
DLL_LINKAGE std::ostream &operator<<(std::ostream &str, const CConnection &cpc);