Add reconnect command (#121)

This commit is contained in:
efinst0rm 2024-02-29 23:16:12 -05:00 committed by GitHub
parent 95adbede91
commit 2495cd4c5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -436,6 +436,25 @@ namespace party
game::SV_CmdsMP_RequestMapRestart(0, 0);
});
command::add("reconnect", [](const command::params& argument)
{
if (!server_connection_state.hostDefined)
{
console::info("Cannot connect to server.\n");
return;
}
if (game::CL_IsGameClientActive(0))
{
command::execute("disconnect");
command::execute("reconnect");
}
else
{
connect(server_connection_state.host);
}
});
command::add("connect", [](const command::params& argument)
{
if (argument.size() != 2)