mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-10 21:00:06 +00:00
multiplayer: check nickname regex server side
This commit is contained in:
parent
e040bc9355
commit
3c589f473f
4 changed files with 13 additions and 6 deletions
|
@ -12,8 +12,8 @@ const ConnectionError USERNAME_NOT_VALID(
|
|||
QT_TR_NOOP("Username is not valid. Must be 4 to 20 alphanumeric characters."));
|
||||
const ConnectionError ROOMNAME_NOT_VALID(
|
||||
QT_TR_NOOP("Room name is not valid. Must be 4 to 20 alphanumeric characters."));
|
||||
const ConnectionError USERNAME_IN_USE(
|
||||
QT_TR_NOOP("Username is already in use. Please choose another."));
|
||||
const ConnectionError USERNAME_NOT_VALID_SERVER(
|
||||
QT_TR_NOOP("Username is already in use or not valid. Please choose another."));
|
||||
const ConnectionError IP_ADDRESS_NOT_VALID(QT_TR_NOOP("IP is not a valid IPv4 address."));
|
||||
const ConnectionError PORT_NOT_VALID(QT_TR_NOOP("Port must be a number between 0 to 65535."));
|
||||
const ConnectionError NO_INTERNET(
|
||||
|
|
|
@ -20,9 +20,11 @@ private:
|
|||
std::string err;
|
||||
};
|
||||
|
||||
/// When the nickname is considered invalid by the client
|
||||
extern const ConnectionError USERNAME_NOT_VALID;
|
||||
extern const ConnectionError ROOMNAME_NOT_VALID;
|
||||
extern const ConnectionError USERNAME_IN_USE;
|
||||
/// When the nickname is considered invalid by the room server
|
||||
extern const ConnectionError USERNAME_NOT_VALID_SERVER;
|
||||
extern const ConnectionError IP_ADDRESS_NOT_VALID;
|
||||
extern const ConnectionError PORT_NOT_VALID;
|
||||
extern const ConnectionError NO_INTERNET;
|
||||
|
|
|
@ -97,7 +97,7 @@ void MultiplayerState::OnNetworkStateChanged(const Network::RoomMember::State& s
|
|||
NetworkMessage::ShowError(NetworkMessage::UNABLE_TO_CONNECT);
|
||||
break;
|
||||
case Network::RoomMember::State::NameCollision:
|
||||
NetworkMessage::ShowError(NetworkMessage::USERNAME_IN_USE);
|
||||
NetworkMessage::ShowError(NetworkMessage::USERNAME_NOT_VALID_SERVER);
|
||||
break;
|
||||
case Network::RoomMember::State::MacCollision:
|
||||
NetworkMessage::ShowError(NetworkMessage::MAC_COLLISION);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue