- a few safety changes for network communication

- small tweaks for unit selection
This commit is contained in:
Mark Vejvoda
2013-01-24 21:09:40 +00:00
parent d2ee2cfdc8
commit a15bdecbf3
3 changed files with 77 additions and 75 deletions

View File

@@ -208,10 +208,10 @@ void ClientInterface::update() {
}
}
catch(const megaglest_runtime_error &ex) {
if(this->isConnected() == false) {
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] Error [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,ex.what());
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,ex.what());
if(this->isConnected() == false) {
if(gotIntro == false || wasConnected == false) {
string sErr = string(extractFileFromDirectoryPath(__FILE__).c_str()) + "::" + string(__FUNCTION__) + " network error: " + string(ex.what());
DisplayErrorMessage(sErr);

View File

@@ -851,6 +851,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
int minHeadLessPlayersRequired = Config::getInstance().getInt("MinHeadlessPlayersRequired","2");
if(networkMessageLaunch.getMessageType() == nmtLaunch &&
ready == false &&
this->serverInterface->getConnectedSlotCount(true) < minHeadLessPlayersRequired) {
Lang &lang= Lang::getInstance();
const vector<string> languageList = this->serverInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();

View File

@@ -1599,6 +1599,7 @@ vector<int> BaseColorPickEntity::getPickedList(int x,int y,int w,int h,
static Chrono lastSnapshot(true);
const int selectionMillisecondUpdate = 100;
if(rendererModels.empty() == false) {
if(PixelBufferWrapper::getIsPBOEnable() == true) {
// Only update the pixel buffer every x milliseconds or as required
if(cachedPixels.get() == NULL || cachedPixels->getW() != w+1 ||cachedPixels->getH() != h+1 ||
@@ -1690,7 +1691,7 @@ vector<int> BaseColorPickEntity::getPickedList(int x,int y,int w,int h,
//printf("In [%s::%s] Line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
//delete pixmapScreenShot;
}
//printf("In [%s::%s] Line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
return pickedModels;
}