Catch VersionMismatchException while loading world data
authorPerttu Ahola <celeron55@gmail.com>
Sun, 3 Jun 2012 17:42:49 +0000 (20:42 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sun, 3 Jun 2012 17:42:49 +0000 (20:42 +0300)
src/server.cpp

index 771eb36522ce6b66853131f37487147bf5cbde41..e4ac8bf4842fc33790b946bc3048cc0c74eee1e1 100644 (file)
@@ -172,7 +172,7 @@ void * EmergeThread::Thread()
                After queue is empty, exit.
        */
        while(getRun())
-       {
+       try{
                QueuedBlockEmerge *qptr = m_server->m_emerge_queue.pop();
                if(qptr == NULL)
                        break;
@@ -374,7 +374,11 @@ void * EmergeThread::Thread()
                                client->SetBlocksNotSent(modified_blocks);
                        }
                }
-               
+       }
+       catch(VersionMismatchException &e)
+       {
+               m_server->setAsyncFatalError(std::string(
+                               "World data version mismatch (server-side) (world probably saved by a newer version of Minetest): ")+e.what());
        }
 
        END_DEBUG_EXCEPTION_HANDLER(errorstream)