~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-06 03:48:13 UTC
  • Revision ID: swagtron-20190806034813-p4437k19fbvozveu
Added SHOW_IP_PLAYERS
The confusingly named command determines if you should you use the server for the /players command. If 1 your ip will be shown in /players if not, your IP will not be shown and the local se_ListPlayers will be used.

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