* Send an error to the admin. * @param error The error to send. */
| 128 | * @param error The error to send. |
| 129 | */ |
| 130 | NetworkRecvStatus ServerNetworkAdminSocketHandler::SendError(NetworkErrorCode error) |
| 131 | { |
| 132 | /* Whatever the error might be, authentication (keys) must be released as soon as possible. */ |
| 133 | this->authentication_handler = nullptr; |
| 134 | |
| 135 | auto p = std::make_unique<Packet>(this, ADMIN_PACKET_SERVER_ERROR); |
| 136 | |
| 137 | p->Send_uint8(error); |
| 138 | this->SendPacket(std::move(p)); |
| 139 | |
| 140 | std::string error_message = GetString(GetNetworkErrorMsg(error)); |
| 141 | |
| 142 | Debug(net, 1, "[admin] The admin '{}' ({}) made an error and has been disconnected: '{}'", this->admin_name, this->admin_version, error_message); |
| 143 | |
| 144 | return this->CloseConnection(true); |
| 145 | } |
| 146 | |
| 147 | /** Send the protocol version to the admin. */ |
| 148 | NetworkRecvStatus ServerNetworkAdminSocketHandler::SendProtocol() |
no test coverage detected