Skip to content

Commit

Permalink
Inform clients when the server is full
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Fernandez committed Oct 31, 2010
1 parent 095ed40 commit f916524
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/network/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ class RegistryResponse : public OutMessage {
INVALID_RESPONSE = 5,
USER_BANNED = 6,
SUCCESSFUL_LOGIN = 7,
USER_ALREADY_ON = 8
USER_ALREADY_ON = 8,
SERVER_FULL = 9
};
RegistryResponse(const TYPE type, const string &details = string()):
OutMessage(REGISTRY_RESPONSE) {
Expand Down Expand Up @@ -2383,6 +2384,7 @@ void ServerImpl::handleAccept(ClientImplPtr client,
return;
}
if (m_population > m_userLimit) {
client->sendMessage(RegistryResponse(RegistryResponse::SERVER_FULL));
boost::system::error_code ec;
client->getSocket().close(ec);
return;
Expand Down

0 comments on commit f916524

Please sign in to comment.