NetPlayProto: Turn connection error enum into an enum class

Continues the migration off the MessageId type alias
This commit is contained in:
Lioncash 2021-09-22 15:06:46 -04:00
parent dedd0b7ba1
commit a034f378a0
4 changed files with 22 additions and 21 deletions

View file

@ -244,25 +244,25 @@ bool NetPlayClient::Connect()
return false;
}
MessageId error;
ConnectionError error;
rpac >> error;
// got error message
if (error)
if (error != ConnectionError::NoError)
{
switch (error)
{
case CON_ERR_SERVER_FULL:
case ConnectionError::ServerFull:
m_dialog->OnConnectionError(_trans("The server is full."));
break;
case CON_ERR_VERSION_MISMATCH:
case ConnectionError::VersionMismatch:
m_dialog->OnConnectionError(
_trans("The server and client's NetPlay versions are incompatible."));
break;
case CON_ERR_GAME_RUNNING:
case ConnectionError::GameRunning:
m_dialog->OnConnectionError(_trans("The game is currently running."));
break;
case CON_ERR_NAME_TOO_LONG:
case ConnectionError::NameTooLong:
m_dialog->OnConnectionError(_trans("Nickname is too long."));
break;
default: