mirror of
https://github.com/glest/glest-source.git
synced 2025-09-02 12:32:34 +02:00
Now handles lobby errors more gracefully
This commit is contained in:
@@ -560,7 +560,8 @@ namespace Glest {
|
|||||||
serverFTPPort = networkMessageIntro.getFtpPort();
|
serverFTPPort = networkMessageIntro.getFtpPort();
|
||||||
|
|
||||||
if (playerIndex < 0 || playerIndex >= GameConstants::maxPlayers) {
|
if (playerIndex < 0 || playerIndex >= GameConstants::maxPlayers) {
|
||||||
throw megaglest_runtime_error("playerIndex < 0 || playerIndex >= GameConstants::maxPlayers");
|
printf("playerIndex < 0 || playerIndex >= GameConstants::maxPlayers\n");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MutexSafeWrapper safeMutexFlags(flagAccessor, CODE_AT_LINE);
|
MutexSafeWrapper safeMutexFlags(flagAccessor, CODE_AT_LINE);
|
||||||
@@ -925,9 +926,8 @@ namespace Glest {
|
|||||||
} else {
|
} else {
|
||||||
if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Lined: %d] got networkMessageLaunch.getMessageType() = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, networkMessageLaunch.getMessageType());
|
if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Lined: %d] got networkMessageLaunch.getMessageType() = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, networkMessageLaunch.getMessageType());
|
||||||
|
|
||||||
char szBuf[1024] = "";
|
printf("In [%s::%s Line: %d] Invalid networkMessageLaunch.getMessageType() = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, networkMessageLaunch.getMessageType());
|
||||||
snprintf(szBuf, 1023, "In [%s::%s Line: %d] Invalid networkMessageLaunch.getMessageType() = %d", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, networkMessageLaunch.getMessageType());
|
//throw megaglest_runtime_error(szBuf);
|
||||||
throw megaglest_runtime_error(szBuf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
networkMessageLaunch.buildGameSettings(&gameSettings);
|
networkMessageLaunch.buildGameSettings(&gameSettings);
|
||||||
|
@@ -191,7 +191,7 @@ namespace Glest {
|
|||||||
//sanity check new message type
|
//sanity check new message type
|
||||||
if (messageType < 0 || messageType >= nmtCount) {
|
if (messageType < 0 || messageType >= nmtCount) {
|
||||||
if (getConnectHasHandshaked() == true) {
|
if (getConnectHasHandshaked() == true) {
|
||||||
throw megaglest_runtime_error("Invalid message type: " + intToStr(messageType));
|
printf("%s%d\n", "Invalid message type: ", messageType);
|
||||||
} else {
|
} else {
|
||||||
if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Line: %d] Invalid message type = %d (no packet handshake yet so ignored)\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, messageType);
|
if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Line: %d] Invalid message type = %d (no packet handshake yet so ignored)\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, messageType);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user