try { // takes about 90ms with -O1 on an e3-1230v2
m_server->getScriptIface()->environment_OnGenerated(
minp, maxp, mapgen->blockseed);
- } catch(LuaError &e) {
- m_server->setAsyncFatalError(e.what());
+ } catch (LuaError &e) {
+ m_server->setAsyncFatalError("Lua: " + std::string(e.what()));
}
EMERGE_DBG_OUT("ended up with: " << analyze_block(block));
void * Thread();
};
-void * ServerThread::Thread()
+void *ServerThread::Thread()
{
log_register_thread("ServerThread");
porting::setThreadName("ServerThread");
- while(!StopRequested())
- {
- try{
+ while (!StopRequested()) {
+ try {
//TimeTaker timer("AsyncRunStep() + Receive()");
m_server->AsyncRunStep();
m_server->Receive();
- }
- catch(con::NoIncomingDataException &e)
- {
- }
- catch(con::PeerNotFoundException &e)
- {
+ } catch (con::NoIncomingDataException &e) {
+ } catch (con::PeerNotFoundException &e) {
infostream<<"Server: PeerNotFoundException"<<std::endl;
- }
- catch(ClientNotFoundException &e)
- {
- }
- catch(con::ConnectionBindFailed &e)
- {
- m_server->setAsyncFatalError(e.what());
- }
- catch(LuaError &e)
- {
+ } catch (ClientNotFoundException &e) {
+ } catch (con::ConnectionBindFailed &e) {
m_server->setAsyncFatalError(e.what());
+ } catch (LuaError &e) {
+ m_server->setAsyncFatalError("Lua: " + std::string(e.what()));
}
}