[Orxonox-commit 733] r3263 - branches/netp6/src/orxonox/gamestates
scheusso at orxonox.net
scheusso at orxonox.net
Wed Jul 1 10:51:57 CEST 2009
Author: scheusso
Date: 2009-07-01 10:51:57 +0200 (Wed, 01 Jul 2009)
New Revision: 3263
Modified:
branches/netp6/src/orxonox/gamestates/GSDedicated.cc
Log:
fix for tab completion in dedicated server console
Modified: branches/netp6/src/orxonox/gamestates/GSDedicated.cc
===================================================================
--- branches/netp6/src/orxonox/gamestates/GSDedicated.cc 2009-07-01 08:04:54 UTC (rev 3262)
+++ branches/netp6/src/orxonox/gamestates/GSDedicated.cc 2009-07-01 08:51:57 UTC (rev 3263)
@@ -84,6 +84,8 @@
#endif
this->server_ = new Server(CommandLine::getValue("port"));
+ if( this->commandLine_ )
+ delete[] this->commandLine_;
COUT(0) << "Loading scene in server mode" << std::endl;
server_->open();
@@ -110,17 +112,17 @@
void GSDedicated::update(const Clock& time)
{
timeSinceLastUpdate_ += time.getDeltaTime();
- if (timeSinceLastUpdate_ >= NETWORK_PERIOD)
+ //if (timeSinceLastUpdate_ >= NETWORK_PERIOD)
{
timeSinceLastUpdate_ -= static_cast<unsigned int>(timeSinceLastUpdate_ / NETWORK_PERIOD) * NETWORK_PERIOD;
server_->update(time);
}
- else
+ /*else
{
msleep(static_cast<unsigned int>((NETWORK_PERIOD - timeSinceLastUpdate_)*1000));
msleep(static_cast<unsigned int>(NETWORK_PERIOD*1000)); // NOTE: this is to throttle the non-network framerate
// COUT(0) << "sleeping for " << (int)((NETWORK_PERIOD - timeSinceLastUpdate_) * 1000 * 1000) << " usec" << endl;
- }
+ }*/
processQueue();
printLine();
}
@@ -194,7 +196,8 @@
// boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
std::cout << endl << CommandExecutor::hint( std::string((const char*)this->commandLine_,inputIterator_) ) << endl;
strncpy((char*)this->commandLine_, CommandExecutor::complete( std::string((const char*)this->commandLine_,inputIterator_) ).c_str(), MAX_COMMAND_LENGTH);
- inputIterator_ = strlen((const char*)this->commandLine_);
+ this->inputIterator_ = strlen((const char*)this->commandLine_);
+ this->cursorX_ = this->inputIterator_;
break;
}
case '\033': // 1. escape character
More information about the Orxonox-commit
mailing list