Add 'reload_playlists' concommand.

Allows reloading the playlists file from the console or the dedicated server.
This commit is contained in:
Kawe Mazidjatari 2022-09-08 01:02:22 +02:00
parent 5813c0ed24
commit 570f6419df
3 changed files with 27 additions and 12 deletions

View File

@ -329,6 +329,9 @@ void ConCommand::Init(void)
ConCommand::Create("sphere", "Draw a debug sphere.", FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT, Sphere_f, nullptr);
ConCommand::Create("capsule", "Draw a debug capsule.", FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT, Capsule_f, nullptr);
#endif //!DEDICATED
#ifndef CLIENT_DLL
ConCommand::Create("reload_playlists", "Reloads the playlists file.", FCVAR_RELEASE, Host_ReloadPlaylists_f, nullptr);
#endif // !CLIENT_DLL
//-------------------------------------------------------------------------
// SERVER DLL |
#ifndef CLIENT_DLL
@ -338,7 +341,7 @@ void ConCommand::Init(void)
ConCommand::Create("sv_ban", "Bans a client from the server by user name. | Usage: sv_ban <UserID>.", FCVAR_GAMEDLL | FCVAR_RELEASE, Host_Ban_f, nullptr);
ConCommand::Create("sv_banid", "Bans a client from the server by handle, nucleus id or ip address | Usage: sv_banid \"<HandleID>\"/\"<NucleusID>/<IPAddress>\".", FCVAR_GAMEDLL | FCVAR_RELEASE, Host_BanID_f, nullptr);
ConCommand::Create("sv_unban", "Unbans a client from the server by nucleus id or ip address | Usage: sv_unban \"<NucleusID>\"/\"<IPAddress>\".", FCVAR_RELEASE, Host_Unban_f, nullptr);
ConCommand::Create("sv_reloadbanlist", "Reloads the ban list from the disk.", FCVAR_RELEASE, Host_ReloadBanList_f, nullptr);
ConCommand::Create("sv_reloadbanlist", "Reloads the banned list.", FCVAR_RELEASE, Host_ReloadBanList_f, nullptr);
#endif // !CLIENT_DLL
#ifndef DEDICATED
//-------------------------------------------------------------------------

View File

@ -339,16 +339,6 @@ void Host_Unban_f(const CCommand& args)
}
}
/*
=====================
Host_ReloadBanList_f
=====================
*/
void Host_ReloadBanList_f(const CCommand& args)
{
g_pBanSystem->Load(); // Reload banlist.
}
/*
=====================
Host_Changelevel_f
@ -368,6 +358,27 @@ void Host_Changelevel_f(const CCommand& args)
}
}
/*
=====================
Host_ReloadBanList_f
=====================
*/
void Host_ReloadBanList_f(const CCommand& args)
{
g_pBanSystem->Load(); // Reload banlist.
}
/*
=====================
Host_ReloadPlaylists_f
=====================
*/
void Host_ReloadPlaylists_f(const CCommand& args)
{
_DownloadPlaylists_f();
KeyValues::InitPlaylists(); // Re-Init playlist.
}
#endif // !CLIENT_DLL
/*
=====================

View File

@ -21,8 +21,9 @@ void Host_KickID_f(const CCommand& args);
void Host_Ban_f(const CCommand& args);
void Host_BanID_f(const CCommand& args);
void Host_Unban_f(const CCommand& args);
void Host_ReloadBanList_f(const CCommand& args);
void Host_Changelevel_f(const CCommand& args);
void Host_ReloadBanList_f(const CCommand& args);
void Host_ReloadPlaylists_f(const CCommand& args);
#endif // !CLIENT_DLL
void Pak_ListPaks_f(const CCommand& args);
void Pak_RequestUnload_f(const CCommand& args);