Finish menu + fix operand bug
This commit is contained in:
parent
18ea465b93
commit
c544f574b3
4
main.cpp
4
main.cpp
@ -34,7 +34,7 @@ auto onClientMessaged(networked& client, std::string& message)
|
||||
int operation = std::stoi(message);
|
||||
sscout << "OPCode is " << operation << ".\n";
|
||||
if (math::is_between<0,7>(operation))
|
||||
client.send_message(net::system(commands[operation]));
|
||||
client.send_message(net::system(commands[operation-1]));
|
||||
else
|
||||
badOperand();
|
||||
}catch(std::invalid_argument& invalid_number) { badOperand(); }
|
||||
@ -58,7 +58,7 @@ auto execute_as_client(std::string ipaddress, std::uint16_t port)
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
auto operation = get_input<int>("Pick Command\n\t1. Date\n\t2. \n\t3. \n\t4. Netstat\n\t5.\n\t6.\n\t7. Exit\n:>", "Invalid Selection", math::is_between<0, 8>);
|
||||
auto operation = get_input<int>("Pick Command\n\t1. Date\n\t2. Uptime\n\t3. Memory Use\n\t4. Netstat\n\t5. Current Users\n\t6. Running Processes\n\t7. Exit\n:>", "Invalid Selection", math::is_between<0, 8>);
|
||||
if (operation == 7)
|
||||
break;
|
||||
auto num_clients = get_input<int>("Enter number of clients. (1-25): ", "Invalid Amount", math::is_between<0, 26>);
|
||||
|
Loading…
Reference in New Issue
Block a user