removed ServerDummy function cause it isn't needed anymore(actual console separates client and server commands) and added two missing server commands to the tab completion

This commit is contained in:
oy 2010-08-07 00:01:43 +02:00
parent cac5554bdb
commit 3f0ff1fb14
3 changed files with 19 additions and 30 deletions

View file

@ -1899,24 +1899,19 @@ void CClient::Con_StopRecord(IConsole::IResult *pResult, void *pUserData)
pSelf->m_DemoRecorder.Stop();
}
void CClient::Con_ServerDummy(IConsole::IResult *pResult, void *pUserData)
{
dbg_msg("client", "this command is not available on the client");
}
void CClient::RegisterCommands()
{
m_pConsole = Kernel()->RequestInterface<IConsole>();
// register server dummy commands for tab completion
m_pConsole->Register("kick", "i", CFGFLAG_SERVER, Con_ServerDummy, this, "Kick player with specified id");
m_pConsole->Register("ban", "s?i", CFGFLAG_SERVER, Con_ServerDummy, this, "Ban player with ip/id for x minutes");
m_pConsole->Register("unban", "s", CFGFLAG_SERVER, Con_ServerDummy, this, "Unban ip");
m_pConsole->Register("bans", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Show banlist");
m_pConsole->Register("status", "", CFGFLAG_SERVER, Con_ServerDummy, this, "List players");
m_pConsole->Register("shutdown", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Shut down");
m_pConsole->Register("record", "s", CFGFLAG_SERVER, Con_ServerDummy, this, "Record to a file");
m_pConsole->Register("stoprecord", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Stop recording");
m_pConsole->Register("reload", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Reload the map");
m_pConsole->Register("kick", "i", CFGFLAG_SERVER, 0, 0, "Kick player with specified id");
m_pConsole->Register("ban", "s?i", CFGFLAG_SERVER, 0, 0, "Ban player with ip/id for x minutes");
m_pConsole->Register("unban", "s", CFGFLAG_SERVER, 0, 0, "Unban ip");
m_pConsole->Register("bans", "", CFGFLAG_SERVER, 0, 0, "Show banlist");
m_pConsole->Register("status", "", CFGFLAG_SERVER, 0, 0, "List players");
m_pConsole->Register("shutdown", "", CFGFLAG_SERVER, 0, 0, "Shut down");
m_pConsole->Register("record", "s", CFGFLAG_SERVER, 0, 0, "Record to a file");
m_pConsole->Register("stoprecord", "", CFGFLAG_SERVER, 0, 0, "Stop recording");
m_pConsole->Register("reload", "", CFGFLAG_SERVER, 0, 0, "Reload the map");
m_pConsole->Register("quit", "", CFGFLAG_CLIENT, Con_Quit, this, "Quit Teeworlds");
m_pConsole->Register("exit", "", CFGFLAG_CLIENT, Con_Quit, this, "Quit Teeworlds");

View file

@ -280,7 +280,6 @@ public:
static void Con_Play(IConsole::IResult *pResult, void *pUserData);
static void Con_Record(IConsole::IResult *pResult, void *pUserData);
static void Con_StopRecord(IConsole::IResult *pResult, void *pUserData);
static void Con_ServerDummy(IConsole::IResult *pResult, void *pUserData);
void RegisterCommands();

View file

@ -99,11 +99,6 @@ static int gs_LoadTotal;
}
}*/
static void ConServerDummy(IConsole::IResult *pResult, void *pUserData)
{
dbg_msg("client", "this command is not available on the client");
}
#include <base/tl/sorted_array.h>
const char *CGameClient::Version() { return GAME_VERSION; }
@ -187,16 +182,16 @@ void CGameClient::OnConsoleInit()
Console()->Register("kill", "", CFGFLAG_CLIENT, ConKill, this, "Kill yourself");
// register server dummy commands for tab completion
Console()->Register("tune", "si", CFGFLAG_SERVER, ConServerDummy, 0, "Tune variable to value");
Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConServerDummy, 0, "Reset tuning");
Console()->Register("tune_dump", "", CFGFLAG_SERVER, ConServerDummy, 0, "Dump tuning");
Console()->Register("change_map", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Change map");
Console()->Register("restart", "?i", CFGFLAG_SERVER, ConServerDummy, 0, "Restart in x seconds");
Console()->Register("broadcast", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Broadcast message");
//MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_SERVER, con_serverdummy, 0);
Console()->Register("set_team", "ii", CFGFLAG_SERVER, ConServerDummy, 0, "Set team of player to team");
Console()->Register("addvote", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Add a voting option");
//MACRO_REGISTER_COMMAND("vote", "", CFGFLAG_SERVER, con_serverdummy, 0);
Console()->Register("tune", "si", CFGFLAG_SERVER, 0, 0, "Tune variable to value");
Console()->Register("tune_reset", "", CFGFLAG_SERVER, 0, 0, "Reset tuning");
Console()->Register("tune_dump", "", CFGFLAG_SERVER, 0, 0, "Dump tuning");
Console()->Register("change_map", "r", CFGFLAG_SERVER, 0, 0, "Change map");
Console()->Register("restart", "?i", CFGFLAG_SERVER, 0, 0, "Restart in x seconds");
Console()->Register("broadcast", "r", CFGFLAG_SERVER, 0, 0, "Broadcast message");
Console()->Register("say", "r", CFGFLAG_SERVER, 0, 0, "Say in chat");
Console()->Register("set_team", "ii", CFGFLAG_SERVER, 0, 0, "Set team of player to team");
Console()->Register("addvote", "r", CFGFLAG_SERVER, 0, 0, "Add a voting option");
Console()->Register("vote", "r", CFGFLAG_SERVER, 0, 0, "Force a vote to yes/no");
// propagate pointers