This repository has been archived on 2026-04-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Tortuga/server/threading.cpp
T
2013-08-11 20:39:08 +10:00

24 lines
470 B
C++

#include "threading.hpp"
#include <stdexcept>
#include <iostream>
int roomThread(void* ptr) {
#ifdef DEBUG
std::cout << "Opening room" << std::endl;
#endif
try {
reinterpret_cast<Room*>(ptr)->Init();
reinterpret_cast<Room*>(ptr)->Loop();
reinterpret_cast<Room*>(ptr)->Quit();
}
catch(std::exception& e) {
std::cerr << "Fatal room error: " << e.what() << std::endl;
return 1;
}
#ifdef DEBUG
std::cout << "Closing room" << std::endl;
#endif
return 0;
}