mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fixed #1208.
This commit is contained in:
parent
12e627ec49
commit
d23a5dcfdf
@ -714,6 +714,7 @@ CSelectionScreen::CSelectionScreen(CMenuScreen::EState Type, CMenuScreen::EMulti
|
||||
serv = CServerHandler::justConnectToServer();
|
||||
}
|
||||
|
||||
serv->enterPregameConnectionMode();
|
||||
*serv << playerNames.begin()->second;
|
||||
|
||||
if(multiPlayer == CMenuScreen::MULTI_NETWORK_GUEST)
|
||||
@ -933,6 +934,7 @@ void CSelectionScreen::handleConnection()
|
||||
{
|
||||
CPackForSelectionScreen *pack = NULL;
|
||||
*serv >> pack;
|
||||
tlog5 << "Received a pack of type " << typeid(*pack).name() << std::endl;
|
||||
assert(pack);
|
||||
if(QuitMenuWithoutStarting *endingPack = dynamic_cast<QuitMenuWithoutStarting *>(pack))
|
||||
{
|
||||
|
@ -279,8 +279,16 @@ void CConnection::prepareForSendingHeroes()
|
||||
savedPointers.clear();
|
||||
CISer<CConnection>::smartVectorMembersSerialization = false;
|
||||
COSer<CConnection>::smartVectorMembersSerialization = false;
|
||||
CISer<CConnection>::smartPointerSerialization = true;
|
||||
COSer<CConnection>::smartPointerSerialization = true;
|
||||
enableSmartPointerSerializatoin();
|
||||
}
|
||||
|
||||
void CConnection::enterPregameConnectionMode()
|
||||
{
|
||||
loadedPointers.clear();
|
||||
savedPointers.clear();
|
||||
CISer<CConnection>::smartVectorMembersSerialization = false;
|
||||
COSer<CConnection>::smartVectorMembersSerialization = false;
|
||||
disableSmartPointerSerialization();
|
||||
}
|
||||
|
||||
CSaveFile::CSaveFile( const std::string &fname )
|
||||
|
@ -1289,6 +1289,7 @@ public:
|
||||
void enableSmartPointerSerializatoin();
|
||||
|
||||
void prepareForSendingHeroes(); //disables sending vectorised, enables smart pointer serialization, clears saved/loaded ptr cache
|
||||
void enterPregameConnectionMode();
|
||||
};
|
||||
|
||||
DLL_LINKAGE std::ostream &operator<<(std::ostream &str, const CConnection &cpc);
|
||||
|
@ -66,6 +66,7 @@ CPregameServer::CPregameServer(CConnection *Host, TAcceptor *Acceptor /*= NULL*/
|
||||
|
||||
void CPregameServer::handleConnection(CConnection *cpc)
|
||||
{
|
||||
setThreadName("CPregameServer::handleConnection");
|
||||
try
|
||||
{
|
||||
while(!cpc->receivedStop)
|
||||
@ -299,6 +300,7 @@ void CPregameServer::initConnection(CConnection *c)
|
||||
void CPregameServer::startListeningThread(CConnection * pc)
|
||||
{
|
||||
listeningThreads++;
|
||||
pc->enterPregameConnectionMode();
|
||||
pc->handler = new boost::thread(&CPregameServer::handleConnection, this, pc);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user