mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 03:32:35 +01:00
Now handles lobby errors more gracefully
This commit is contained in:
parent
d992eaa4bb
commit
5b0737190d
@ -560,7 +560,8 @@ namespace Glest {
|
||||
serverFTPPort = networkMessageIntro.getFtpPort();
|
||||
|
||||
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);
|
||||
@ -925,9 +926,8 @@ namespace Glest {
|
||||
} 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());
|
||||
|
||||
char szBuf[1024] = "";
|
||||
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);
|
||||
printf("In [%s::%s Line: %d] Invalid networkMessageLaunch.getMessageType() = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, networkMessageLaunch.getMessageType());
|
||||
//throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
|
||||
networkMessageLaunch.buildGameSettings(&gameSettings);
|
||||
|
@ -191,7 +191,7 @@ namespace Glest {
|
||||
//sanity check new message type
|
||||
if (messageType < 0 || messageType >= nmtCount) {
|
||||
if (getConnectHasHandshaked() == true) {
|
||||
throw megaglest_runtime_error("Invalid message type: " + intToStr(messageType));
|
||||
printf("%s%d\n", "Invalid message type: ", messageType);
|
||||
} 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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user