void ColladaViewerModule::Initialize() { // Getting needed pointers TundraLogic::TundraLogicModule* tundra_ = framework_->GetModule<TundraLogic::TundraLogicModule>(); assetAPI_ = framework_->Asset(); client_ = tundra_->GetClient().get(); server_ = tundra_->GetServer().get(); // Getting remote collada storage url if(framework_->HasCommandLineParameter("--remoteColladaStorage")) { QStringList params = framework_->CommandLineParameters("--remoteColladaStorage"); if(params.length() > 0) remoteStorageUrl = params.at(0).toStdString(); } /// Initializing signal listeners // Starts the server process if the module runs on tundra server bool check = connect(server_, SIGNAL(ServerStarted()), this, SLOT(serverProcess()), Qt::QueuedConnection); Q_ASSERT(check); // Starts the client process if the module runs on tundra client check = connect(client_, SIGNAL(Connected(UserConnectedResponseData *)), this, SLOT(clientProcess()), Qt::QueuedConnection); Q_ASSERT(check); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->actionStop_mouse_listening->setEnabled(false); try { QDesktopWidget desktop; QSize screenSize = desktop.geometry().size(); Singleton::Instance().GetFacade()->GetMouseListener()->SetScreenSize(screenSize); Singleton::Instance().GetFacade()->GetMouseListener()->SetTCPPortNumber(TCPPortNumber); Singleton::Instance().GetFacade()->GetMouseListener()->SetUDPPortNumber(UDPPortNumber); Singleton::Instance().GetFacade()->GetMouseListener()->SetBroadCastPortNumber(broadCastPortNumber); connect(Singleton::Instance().GetFacade(), SIGNAL(ServerStartedSignal()), this, SLOT(ServerStarted())); connect(Singleton::Instance().GetFacade(), SIGNAL(ServerStoppedSignal()), this, SLOT(ServerStopped())); connect(Singleton::Instance().GetFacade(), SIGNAL(ErrorSendCommandToDeviceSignal()), this, SLOT(ErrorSendCommandToDevice())); connect(Singleton::Instance().GetFacade(), SIGNAL(ClientConnectedSignal(QString,int)), this, SLOT(ClientConnected(QString,int))); connect(Singleton::Instance().GetFacade(), SIGNAL(ClientDisconnectedSignal(QString,int)), this, SLOT(ClientDisconnected(QString,int))); connect(Singleton::Instance().GetFacade(), SIGNAL(ClientBroadCastSignal(QString,int)), this, SLOT(ClientBroadCast(QString,int))); } catch (Exception& exception) {} }
//============================================================================ // NMessageServer::SocketDidOpen : A socket has been opened. //---------------------------------------------------------------------------- void NMessageServer::SocketDidOpen(NSocket *theSocket) { StLock acquireLock(mLock); // Start the server if (theSocket == &mSocket) { NN_ASSERT(mStatus == kNServerStarting); mStatus = kNServerStarted; ServerStarted(); } }