4651
4651
#ifndef DEDICATED
4652
4652
static bool se_enableChatCommands = true;
4653
static tConfItem<bool> se_enableChatCommandsConf( "LOCAL_CHAT_COMMANDS", se_enableChatCommands );
4653
static tConfItem<bool> se_enableChatCommandsConf( "CHAT_LOCAL_COMMANDS", se_enableChatCommands );
4655
4655
static bool se_showPlayerCommand = true;
4656
4656
static tConfItem<bool> se_showPlayerCommandConf( "SHOW_IP_PLAYERS", se_showPlayerCommand );
4658
static tString se_consoleComand("/console");
4659
static tConfItem<tString> se_consoleComandConf("LOCAL_CONSOLE_COMMAND", se_consoleComand);
4661
static tString se_listcolorsCommand("/listcolors");
4662
static tConfItem<tString> se_listcolorsCommandConf("LOCAL_LISTCOLORS_COMMAND", se_listcolorsCommand);
4664
static tString se_colorsCommand("/colors");
4665
static tConfItem<tString> se_colorsCommandConf("LOCAL_COLORS_COMMAND", se_colorsCommand);
4667
static tString se_infoCommand("/info");
4668
static tConfItem<tString> se_infoCommandConf("LOCAL_INFO_COMMAND", se_infoCommand);
4670
static tString se_rgbCommand("/rgb");
4671
static tConfItem<tString> se_rgbCommandConf("LOCAL_RGB_COMMAND", se_rgbCommand);
4658
//our local commands (should always be lowercase)
4659
static char const * const se_localChatCommands[] = {
4672
4666
#endif //if not dedicated
4674
4668
void ePlayerNetID::Chat(const tString& s_orig)
4676
// our local commands (should always be lowercase)
4677
static char const* const se_localChatCommands[] = { se_consoleComand, se_listcolorsCommand,
4678
se_colorsCommand, se_infoCommand, se_rgbCommand };
4679
4670
tColoredString s(s_orig);
4703
if ((!se_showPlayerCommand) && s_orig.StartsWith("/")
4704
&& (command == "/players" || command == "/listplayers"))
4694
if ((!se_showPlayerCommand) && s_orig.StartsWith("/") && (command == "/players" || command == "/listplayers"))
4706
4696
tCurrentAccessLevel level(tAccessLevel_Owner, true);
4707
4697
tString params("PLAYERS");
4712
4702
if (isLocalCommand && se_enableChatCommands && (s_orig.StartsWith("/")))
4714
4704
// check for direct console commands
4715
if (command == se_consoleComand)
4705
if (command == "/console")
4717
4707
// direct commands are executed at owner level
4718
4708
tCurrentAccessLevel level(tAccessLevel_Owner, true);
4736
4726
// Short handle for grabbing player colors.
4737
else if ((command == se_listcolorsCommand) || (command == se_colorsCommand))
4727
else if ((command == "/listcolors") || (command == "/colors"))
4739
4729
listPlayerColors(tString(s_orig));
4741
4731
// Short handle for grabbing player information.
4742
else if (command == se_infoCommand)
4732
else if (command == "/info")
4744
4734
listPlayerInfo(tString(s_orig));
4746
4736
// Short handle for changing our RGB values.
4747
else if (command == se_rgbCommand)
4737
else if (command == "/rgb")
4749
4739
currentPlayerRGB(tString(s_orig));