]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/server.cpp
Fix formspec field labels
[dragonfireclient.git] / src / server.cpp
index 1455de721767fd461a566d475a94759d8c476bbb..c1cedf0f39297f41dc0114916a7f5eec08d36fc6 100644 (file)
@@ -73,14 +73,14 @@ class ClientNotFoundException : public BaseException
        {}
 };
 
-class ServerThread : public SimpleThread
+class ServerThread : public JThread
 {
        Server *m_server;
 
 public:
 
        ServerThread(Server *server):
-               SimpleThread(),
+               JThread(),
                m_server(server)
        {
        }
@@ -98,7 +98,7 @@ void * ServerThread::Thread()
 
        BEGIN_DEBUG_EXCEPTION_HANDLER
 
-       while(getRun())
+       while(!StopRequested())
        {
                try{
                        //TimeTaker timer("AsyncRunStep() + Receive()");
@@ -963,14 +963,13 @@ void Server::start(unsigned short port)
        infostream<<"Starting server on port "<<port<<"..."<<std::endl;
 
        // Stop thread if already running
-       m_thread->stop();
+       m_thread->Stop();
 
        // Initialize connection
        m_con.SetTimeoutMs(30);
        m_con.Serve(port);
 
        // Start thread
-       m_thread->setRun(true);
        m_thread->Start();
 
        // ASCII art for the win!
@@ -993,9 +992,9 @@ void Server::stop()
        infostream<<"Server: Stopping and waiting threads"<<std::endl;
 
        // Stop threads (set run=false first so both start stopping)
-       m_thread->setRun(false);
+       m_thread->Stop();
        //m_emergethread.setRun(false);
-       m_thread->stop();
+       m_thread->Wait();
        //m_emergethread.stop();
 
        infostream<<"Server: Threads stopped"<<std::endl;
@@ -1682,7 +1681,7 @@ void Server::AsyncRunStep()
                {
                        counter = 0.0;
 
-                       m_emerge->triggerAllThreads();
+                       m_emerge->startAllThreads();
 
                        // Update m_enable_rollback_recording here too
                        m_enable_rollback_recording =