~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/engine/ePlayer.cpp

  • Committer: SwagTron
  • Date: 2019-08-07 00:35:38 UTC
  • Revision ID: swagtron-20190807003538-v4l20ab8ngnrvffn
Undoing changes until I can fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4650
4650
 
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 );
4654
4654
 
4655
4655
static bool se_showPlayerCommand = true;
4656
4656
static tConfItem<bool> se_showPlayerCommandConf( "SHOW_IP_PLAYERS", se_showPlayerCommand );
4657
4657
 
4658
 
static tString se_consoleComand("/console");
4659
 
static tConfItem<tString> se_consoleComandConf("LOCAL_CONSOLE_COMMAND", se_consoleComand);
4660
 
 
4661
 
static tString se_listcolorsCommand("/listcolors");
4662
 
static tConfItem<tString> se_listcolorsCommandConf("LOCAL_LISTCOLORS_COMMAND", se_listcolorsCommand);
4663
 
 
4664
 
static tString se_colorsCommand("/colors");
4665
 
static tConfItem<tString> se_colorsCommandConf("LOCAL_COLORS_COMMAND", se_colorsCommand);
4666
 
 
4667
 
static tString se_infoCommand("/info");
4668
 
static tConfItem<tString> se_infoCommandConf("LOCAL_INFO_COMMAND", se_infoCommand);
4669
 
 
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[] = {
 
4660
    "/console",
 
4661
    "/listcolors",
 
4662
    "/colors",
 
4663
    "/info",
 
4664
    "/rgb"
 
4665
};
4672
4666
#endif //if not dedicated
4673
4667
 
4674
4668
void ePlayerNetID::Chat(const tString& s_orig)
4675
4669
{
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);
4680
4671
    s.NetFilter();
4681
4672
 
4700
4691
        }
4701
4692
    }
4702
4693
 
4703
 
    if ((!se_showPlayerCommand) && s_orig.StartsWith("/")
4704
 
        && (command == "/players" || command == "/listplayers"))
 
4694
    if ((!se_showPlayerCommand) && s_orig.StartsWith("/") && (command == "/players" || command == "/listplayers"))
4705
4695
    {
4706
4696
        tCurrentAccessLevel level(tAccessLevel_Owner, true);
4707
4697
        tString params("PLAYERS");
4712
4702
    if (isLocalCommand && se_enableChatCommands && (s_orig.StartsWith("/")))
4713
4703
    {
4714
4704
        // check for direct console commands
4715
 
        if (command == se_consoleComand)
 
4705
        if (command == "/console")
4716
4706
        {
4717
4707
            // direct commands are executed at owner level
4718
4708
            tCurrentAccessLevel level(tAccessLevel_Owner, true);
4734
4724
            }
4735
4725
        }
4736
4726
        // Short handle for grabbing player colors.
4737
 
        else if ((command == se_listcolorsCommand) || (command == se_colorsCommand))
 
4727
        else if ((command == "/listcolors") || (command == "/colors"))
4738
4728
        {
4739
4729
            listPlayerColors(tString(s_orig));
4740
4730
        }
4741
4731
        // Short handle for grabbing player information.
4742
 
        else if (command == se_infoCommand)
 
4732
        else if (command == "/info")
4743
4733
        {
4744
4734
            listPlayerInfo(tString(s_orig));
4745
4735
        }
4746
4736
        // Short handle for changing our RGB values.
4747
 
        else if (command == se_rgbCommand)
 
4737
        else if (command == "/rgb")
4748
4738
        {
4749
4739
            currentPlayerRGB(tString(s_orig));
4750
4740
        }