~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 06:56:07 UTC
  • Revision ID: swagtron-20190807065607-etzhkn3hdrj5ug1j
Added code from revision 1123 with fixes.

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( "CHAT_LOCAL_COMMANDS", se_enableChatCommands );
 
4653
static tConfItem<bool> se_enableChatCommandsConf( "LOCAL_CHAT_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
 
//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
 
};
 
4658
// our local commands (should always be lowercase)
 
4659
static tString se_consoleComand("/console");
 
4660
static tConfItem<tString> se_consoleComandConf("LOCAL_CONSOLE_COMMAND", se_consoleComand);
 
4661
 
 
4662
static tString se_listcolorsCommand("/listcolors");
 
4663
static tConfItem<tString> se_listcolorsCommandConf("LOCAL_LISTCOLORS_COMMAND", se_listcolorsCommand);
 
4664
 
 
4665
static tString se_colorsCommand("/colors");
 
4666
static tConfItem<tString> se_colorsCommandConf("LOCAL_COLORS_COMMAND", se_colorsCommand);
 
4667
 
 
4668
static tString se_infoCommand("/info");
 
4669
static tConfItem<tString> se_infoCommandConf("LOCAL_INFO_COMMAND", se_infoCommand);
 
4670
 
 
4671
static tString se_rgbCommand("/rgb");
 
4672
static tConfItem<tString> se_rgbCommandConf("LOCAL_RGB_COMMAND", se_rgbCommand);
 
4673
 
4666
4674
#endif //if not dedicated
4667
4675
 
4668
4676
void ePlayerNetID::Chat(const tString& s_orig)
4672
4680
 
4673
4681
#ifndef DEDICATED
4674
4682
 
 
4683
    tString se_localChatCommands[] =
 
4684
    { 
 
4685
        se_consoleComand, 
 
4686
        se_listcolorsCommand, 
 
4687
        se_colorsCommand, 
 
4688
        se_infoCommand, 
 
4689
        se_rgbCommand
 
4690
    };
 
4691
 
4675
4692
    std::string chatString(s_orig);
4676
4693
    std::istringstream passedString(chatString);
4677
4694
 
4691
4708
        }
4692
4709
    }
4693
4710
 
4694
 
    if ((!se_showPlayerCommand) && s_orig.StartsWith("/") && (command == "/players" || command == "/listplayers"))
 
4711
    if ((!se_showPlayerCommand) && s_orig.StartsWith("/")
 
4712
        && (command == "/players" || command == "/listplayers"))
4695
4713
    {
4696
4714
        tCurrentAccessLevel level(tAccessLevel_Owner, true);
4697
4715
        tString params("PLAYERS");
4702
4720
    if (isLocalCommand && se_enableChatCommands && (s_orig.StartsWith("/")))
4703
4721
    {
4704
4722
        // check for direct console commands
4705
 
        if (command == "/console")
 
4723
        if (command == se_consoleComand)
4706
4724
        {
4707
4725
            // direct commands are executed at owner level
4708
4726
            tCurrentAccessLevel level(tAccessLevel_Owner, true);
4724
4742
            }
4725
4743
        }
4726
4744
        // Short handle for grabbing player colors.
4727
 
        else if ((command == "/listcolors") || (command == "/colors"))
 
4745
        else if ((command == se_listcolorsCommand) || (command == se_colorsCommand))
4728
4746
        {
4729
4747
            listPlayerColors(tString(s_orig));
4730
4748
        }
4731
4749
        // Short handle for grabbing player information.
4732
 
        else if (command == "/info")
 
4750
        else if (command == se_infoCommand)
4733
4751
        {
4734
4752
            listPlayerInfo(tString(s_orig));
4735
4753
        }
4736
4754
        // Short handle for changing our RGB values.
4737
 
        else if (command == "/rgb")
 
4755
        else if (command == se_rgbCommand)
4738
4756
        {
4739
4757
            currentPlayerRGB(tString(s_orig));
4740
4758
        }