Multiplayer: Send an error message when connecting to a full room

This commit is contained in:
James Rowe
2018-04-20 01:34:37 -06:00
committed by zhupengfei
parent a9c9ffd32c
commit e040bc9355
7 changed files with 42 additions and 7 deletions

View File

@@ -22,6 +22,8 @@ const ConnectionError UNABLE_TO_CONNECT(
QT_TR_NOOP("Unable to connect to the host. Verify that the connection settings are correct. If "
"you still cannot connect, contact the room host and verify that the host is "
"properly configured with the external port forwarded."));
const ConnectionError ROOM_IS_FULL(
QT_TR_NOOP("Unable to connect to the room because it is already full."));
const ConnectionError COULD_NOT_CREATE_ROOM(
QT_TR_NOOP("Creating a room failed. Please retry. Restarting Citra might be necessary."));
const ConnectionError HOST_BANNED(

View File

@@ -27,6 +27,7 @@ extern const ConnectionError IP_ADDRESS_NOT_VALID;
extern const ConnectionError PORT_NOT_VALID;
extern const ConnectionError NO_INTERNET;
extern const ConnectionError UNABLE_TO_CONNECT;
extern const ConnectionError ROOM_IS_FULL;
extern const ConnectionError COULD_NOT_CREATE_ROOM;
extern const ConnectionError HOST_BANNED;
extern const ConnectionError WRONG_VERSION;

View File

@@ -102,6 +102,9 @@ void MultiplayerState::OnNetworkStateChanged(const Network::RoomMember::State& s
case Network::RoomMember::State::MacCollision:
NetworkMessage::ShowError(NetworkMessage::MAC_COLLISION);
break;
case Network::RoomMember::State::RoomIsFull:
NetworkMessage::ShowError(NetworkMessage::ROOM_IS_FULL);
break;
case Network::RoomMember::State::WrongPassword:
NetworkMessage::ShowError(NetworkMessage::WRONG_PASSWORD);
break;