~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 02:52:56 UTC
  • Revision ID: swagtron-20190806025256-8sruhpbirsa67du8
Planned to wait until I could think of a better way to code /rgb, but I have been asked to add the ability to save and load several times.
Edited /rgb
Current Usuage:
       /rgb with no parameters displays current rgb.
       /rgb 15 3 3 will set player 1's RGB to R15 G3 B3.
       /rgb unique gives all players unique colors.
       /rgb random gives all players random colors.
       /rgb 2 15 3 3 Will change player 2's colors to 15 3 3.
       /rgb save will save your current colors to var/colors.txt
       /rgb save player will save the players current colors to var/colors.txt
       /rgb list will list your current saved colors from var/colors.txt.
       /rgb load 1 will load from line #1 in the list.
       /rgb clear will clear your current list of saved colors.
       /rgb help displays the usuage in-game.
Added RGB_COLORS_FILE which can be configured to change the name of the colors.txt file to another name within /var/ where user.cfg is. This can be used to use new files when your old list is full.
Also made a lot of the text use english_base.txt

Currently no preview other than converting the r,g,b values into a color string or using the color code already in colors.txt. Hopefully I could add a mutli-colored tail preview.

Added ReplaceWhitespace to tString for /rgb.

Also edited the style of other commands (/colors).

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
#include "../tron/gGame.h"
61
61
#include "eGrid.h"
62
62
#include <time.h>
 
63
#include "eFloor.h"
63
64
 
64
65
//!RACE FILE
65
66
#include "../tron/gRace.h"
8546
8547
            for ( int i = 0; i <= se_PlayerNetIDs.Len()-1; i++ )
8547
8548
            {
8548
8549
                ePlayerNetID *p=se_PlayerNetIDs(i);
8549
 
                con << (i+1) << ": " << gatherPlayerColor(p);
 
8550
                con << (i+1) << ") " << gatherPlayerColor(p);
8550
8551
 
8551
8552
            }
8552
8553
        }
8569
8570
                    {
8570
8571
                        playerFound = true;
8571
8572
 
8572
 
                        con << (j+1) << ": " << gatherPlayerColor(p);
 
8573
                        con << (j+1) << ") " << gatherPlayerColor(p);
8573
8574
                        j++;
8574
8575
 
8575
8576
                    }
8578
8579
            //No one found.
8579
8580
            if (!playerFound)
8580
8581
            {
8581
 
                con << tOutput("$player_not_found_text", msgsExt[1]);
 
8582
                con << tOutput("$player_colors_not_found", msgsExt[1]);
8582
8583
            }
8583
8584
 
8584
8585
        }
8586
8587
    }
8587
8588
}
8588
8589
 
8589
 
//Not sure if this is better / faster but better looking I guess?
8590
 
tColoredString ePlayerNetID::gatherPlayerColor(ePlayerNetID * p)
 
8590
tColoredString ePlayerNetID::gatherPlayerColor(ePlayerNetID* p, bool showReset)
8591
8591
{
8592
 
tColoredString listColors;
8593
 
return listColors << p->GetColoredName() << "0xRESETT (" << p->r << ", " << p->g << ", " << p->b << ")\n";
 
8592
    tColoredString listColors;
 
8593
    if (showReset)
 
8594
    {
 
8595
        return listColors << p->GetColoredName() << "0xRESETT (" << p->r << ", " << p->g << ", "
 
8596
                          << p->b << ")\n";
 
8597
    }
 
8598
    else
 
8599
    {
 
8600
        tString coloredName = p->GetColoredName();
 
8601
        return listColors << coloredName.ReplaceWhitespace() << " (" << p->r << ", " << p->g << ", " << p->b
 
8602
                          << ")\n";
 
8603
    }
8594
8604
}
8595
8605
 
8596
8606
 
8597
 
 
8598
8607
/*
8599
8608
List player information.
8600
8609
Displays:
8696
8705
    return listinfo << "\n";
8697
8706
}
8698
8707
 
 
8708
static tString se_colorVarFile("colors.txt");
 
8709
static tConfItem<tString> se_colorVarFileConf("RGB_COLORS_FILE", se_colorVarFile);
 
8710
 
 
8711
static void se_loadSavedColor(int lineNumber)
 
8712
{
 
8713
    tArray<tString> colors;
 
8714
 
 
8715
    std::ifstream i;
 
8716
    if (tDirectories::Var().Open(i, se_colorVarFile))
 
8717
    {
 
8718
        while (!i.eof())
 
8719
        {
 
8720
            std::string sayLine;
 
8721
            std::getline(i, sayLine);
 
8722
            std::istringstream s(sayLine);
 
8723
 
 
8724
            tString params;
 
8725
            params.ReadLine(s);
 
8726
            int pos = 0;
 
8727
 
 
8728
            if (params.Filter() != "")
 
8729
                colors.Insert(params);
 
8730
        }
 
8731
    }
 
8732
    i.close();
 
8733
 
 
8734
    tString currentLine = colors[lineNumber];
 
8735
    if (currentLine != "")
 
8736
    {
 
8737
        int pos = 0;
 
8738
        tString Name = currentLine.ExtractNonBlankSubString(pos);
 
8739
        tString ColorOne = currentLine.ExtractNonBlankSubString(pos);
 
8740
        ColorOne.RemoveSubStr(0, 1);
 
8741
        int Color1 = atoi(ColorOne);
 
8742
        int Color2 = atoi(currentLine.ExtractNonBlankSubString(pos));
 
8743
        int Color3 = atoi(currentLine.ExtractNonBlankSubString(pos));
 
8744
        REAL c1 = Color1;
 
8745
        REAL c2 = Color2;
 
8746
        REAL c3 = Color3;
 
8747
        se_MakeColorValid(c1, c2, c3, 1.0f);
 
8748
        if (tColoredString::HasColors(Name))
 
8749
        {
 
8750
            con << tOutput("$player_colors_loading");
 
8751
            con << (lineNumber + 1) << ") " << Name << "0xRESETT (" << Color1 << ", " << Color2
 
8752
                << ", " << Color3 << ")\n";
 
8753
        }
 
8754
        else
 
8755
        {
 
8756
            con << tOutput("$player_colors_loading");
 
8757
            con << (lineNumber + 1) << ") "
 
8758
                << tColoredString::ColorString(c1 / 15, c2 / 15, c3 / 15) << Name << "0xRESETT ("
 
8759
                << Color1 << ", " << Color2 << ", " << Color3 << ")\n";
 
8760
        }
 
8761
        ePlayer::PlayerConfig(0)->rgb[0] = Color1;
 
8762
        ePlayer::PlayerConfig(0)->rgb[1] = Color2;
 
8763
        ePlayer::PlayerConfig(0)->rgb[2] = Color3;
 
8764
    }
 
8765
}
 
8766
 
 
8767
static int se_savedColorsCount()
 
8768
{
 
8769
    int count = 0;
 
8770
    std::ifstream i;
 
8771
    if (tDirectories::Var().Open(i, se_colorVarFile))
 
8772
    {
 
8773
        while (!i.eof())
 
8774
        {
 
8775
            std::string sayLine;
 
8776
            std::getline(i, sayLine);
 
8777
            std::istringstream s(sayLine);
 
8778
 
 
8779
            tString params;
 
8780
            params.ReadLine(s);
 
8781
 
 
8782
            if (params.Filter() != "")
 
8783
                count++;
 
8784
        }
 
8785
    }
 
8786
    i.close();
 
8787
 
 
8788
    return count;
 
8789
}
 
8790
 
 
8791
 
 
8792
static void se_SavedColors(int savedColorsCount)
 
8793
{
 
8794
    tArray<tString> colors;
 
8795
 
 
8796
    std::ifstream i;
 
8797
    if (tDirectories::Var().Open(i, se_colorVarFile))
 
8798
    {
 
8799
        while (!i.eof())
 
8800
        {
 
8801
            std::string sayLine;
 
8802
            std::getline(i, sayLine);
 
8803
            std::istringstream s(sayLine);
 
8804
 
 
8805
            tString params;
 
8806
            params.ReadLine(s);
 
8807
            int pos = 0;
 
8808
 
 
8809
            if (params.Filter() != "")
 
8810
                colors.Insert(params);
 
8811
        }
 
8812
    }
 
8813
    i.close();
 
8814
 
 
8815
    for (int index = 0; index <= savedColorsCount; index++)
 
8816
    {
 
8817
        tString currentLine = colors[index];
 
8818
        if (currentLine != "")
 
8819
        {
 
8820
            int pos = 0;
 
8821
            tString Name = currentLine.ExtractNonBlankSubString(pos);
 
8822
            tString ColorOne = currentLine.ExtractNonBlankSubString(pos);
 
8823
            ColorOne.RemoveSubStr(0, 1);
 
8824
            int Color1 = atoi(ColorOne);
 
8825
            int Color2 = atoi(currentLine.ExtractNonBlankSubString(pos));
 
8826
            int Color3 = atoi(currentLine.ExtractNonBlankSubString(pos));
 
8827
            REAL c1 = Color1;
 
8828
            REAL c2 = Color2;
 
8829
            REAL c3 = Color3;
 
8830
            se_MakeColorValid(c1, c2, c3, 1.0f);
 
8831
            if (tColoredString::HasColors(Name))
 
8832
            {
 
8833
                con << (index + 1) << ") " << Name << "0xRESETT (" << Color1 << ", " << Color2
 
8834
                    << ", " << Color3 << ")\n";
 
8835
            }
 
8836
            else
 
8837
            {
 
8838
                con << (index + 1) << ") " << tColoredString::ColorString(c1 / 15, c2 / 15, c3 / 15)
 
8839
                    << Name << "0xRESETT (" << Color1 << ", " << Color2 << ", " << Color3 << ")\n";
 
8840
            }
 
8841
        }
 
8842
    }
 
8843
}
 
8844
 
 
8845
 
8699
8846
// Allow us to change our current RGB easily.
8700
8847
// Usage: /rgb with no parameters displays current rgb.
8701
 
//        /rgb 15 3 3 Would set player 1's RGB to R15 G3 B3. 
 
8848
//        /rgb 15 3 3 Would set player 1's RGB to R15 G3 B3.
8702
8849
//        /rgb unique gives all players unique colors.
8703
8850
//        /rgb random gives all players random colors.
8704
 
//        /rgb 2 15 3 3 Will change player 2's colors to 15 3 3. 
 
8851
//        /rgb 2 15 3 3 Will change player 2's colors to 15 3 3.
 
8852
//        /rgb save would save your current colors to colors.txt
 
8853
//        /rgb save player would save the players current colors to colors.txt
 
8854
//        /rgb list would list your current saved colors.
 
8855
//        /rgb load 1 would load from line #1 in the list.
 
8856
//        /rgb clear would clear your current list of saved colors.
8705
8857
void ePlayerNetID::currentPlayerRGB(tString s_orig)
8706
8858
{
8707
8859
    if (s_orig.StrPos(" ") == -1)
8708
8860
    {
8709
8861
        con << tOutput("$player_colors_current_text");
8710
 
        for(int i=0; i<MAX_PLAYERS; ++i )
 
8862
        for (int i = 0; i < MAX_PLAYERS; ++i)
8711
8863
        {
8712
 
            bool in_game=ePlayer::PlayerIsInGame(i);
8713
 
            ePlayer *me=ePlayer::PlayerConfig(i);
 
8864
            bool in_game = ePlayer::PlayerIsInGame(i);
 
8865
            ePlayer* me = ePlayer::PlayerConfig(i);
8714
8866
            tASSERT(me);
8715
 
            tCONTROLLED_PTR(ePlayerNetID) &p=me->netPlayer;
 
8867
            tCONTROLLED_PTR(ePlayerNetID)& p = me->netPlayer;
8716
8868
            if (bool(p) && in_game)
8717
8869
            {
8718
8870
                tColoredString listColors;
8719
 
                listColors << p->GetColoredName() << "0xRESETT (" << ePlayer::PlayerConfig(i)->rgb[0] << ", " << ePlayer::PlayerConfig(i)->rgb[1] << ", " << ePlayer::PlayerConfig(i)->rgb[2] << ")\n";
 
8871
                listColors << p->GetColoredName() << "0xRESETT ("
 
8872
                           << ePlayer::PlayerConfig(i)->rgb[0] << ", "
 
8873
                           << ePlayer::PlayerConfig(i)->rgb[1] << ", "
 
8874
                           << ePlayer::PlayerConfig(i)->rgb[2] << ")\n";
8720
8875
                con << listColors;
8721
8876
            }
8722
8877
        }
8725
8880
    {
8726
8881
        tArray<tString> passedString = s_orig.Split(" ");
8727
8882
        bool correctParameters = false;
 
8883
        bool help = false;
 
8884
        bool hideError = false;
 
8885
        bool load = false;
 
8886
        bool save = false;
8728
8887
        bool random = false;
 
8888
        bool list = false;
 
8889
        bool clear = false;
8729
8890
        bool unique = false;
8730
8891
        int ourID = 0;
8731
8892
 
8734
8895
            correctParameters = true;
8735
8896
            random = true;
8736
8897
 
8737
 
            //For now everyone gets random colors.
8738
 
            for(int i=0; i<MAX_PLAYERS; ++i )
 
8898
            // For now everyone gets random colors.
 
8899
            for (int i = 0; i < MAX_PLAYERS; ++i)
8739
8900
            {
8740
8901
                bool in_game = ePlayer::PlayerIsInGame(i);
8741
 
                ePlayer *me = ePlayer::PlayerConfig(i);
 
8902
                ePlayer* me = ePlayer::PlayerConfig(i);
8742
8903
                tASSERT(me);
8743
 
                tCONTROLLED_PTR(ePlayerNetID) &p=me->netPlayer;
 
8904
                tCONTROLLED_PTR(ePlayerNetID)& p = me->netPlayer;
8744
8905
 
8745
8906
                if (bool(p) && in_game)
8746
8907
                {
8747
8908
                    se_RandomizeColor(me);
8748
8909
                }
8749
8910
            }
8750
 
 
8751
 
        }
8752
 
        else if(passedString[1] == "unique")
 
8911
        }
 
8912
        else if (passedString[1] == "help")
 
8913
        {
 
8914
            help = true;
 
8915
            hideError = true;
 
8916
            con << tOutput("$player_colors_command_help", se_colorVarFile);
 
8917
        }
 
8918
        else if (passedString[1] == "save")
 
8919
        {
 
8920
            hideError = true;
 
8921
            save = true;
 
8922
            bool foundPlayer = false;
 
8923
 
 
8924
            if (passedString.Len() == 2)
 
8925
            {
 
8926
                foundPlayer = true;
 
8927
                std::ofstream o;
 
8928
 
 
8929
                if (tDirectories::Var().Open(o, se_colorVarFile, std::ios::app))
 
8930
                {
 
8931
                    con << tOutput("$player_colors_saved");
 
8932
                    for (int i = 0; i < MAX_PLAYERS; ++i)
 
8933
                    {
 
8934
                        bool in_game = ePlayer::PlayerIsInGame(i);
 
8935
                        ePlayer* me = ePlayer::PlayerConfig(i);
 
8936
                        tASSERT(me);
 
8937
                        tCONTROLLED_PTR(ePlayerNetID)& p = me->netPlayer;
 
8938
 
 
8939
                        if (bool(p) && in_game)
 
8940
                        {
 
8941
                            o << ePlayerNetID::gatherPlayerColor(p,0);
 
8942
                            con << ePlayerNetID::gatherPlayerColor(p);;
 
8943
                        }
 
8944
                    }
 
8945
                }
 
8946
                else
 
8947
                {
 
8948
                    con << tOutput("$players_color_error");
 
8949
                }
 
8950
                o.close();
 
8951
            }
 
8952
            else if (passedString.Len() >= 3)
 
8953
            {
 
8954
                for (int i = 0; i <= se_PlayerNetIDs.Len() - 1; i++)
 
8955
                {
 
8956
                    ePlayerNetID* p = se_PlayerNetIDs(i);
 
8957
                    if (p->GetName().Filter().Contains(passedString[2].Filter()))
 
8958
                    {
 
8959
                        foundPlayer = true;
 
8960
                        std::ofstream o;
 
8961
                        if (tDirectories::Var().Open(o, se_colorVarFile, std::ios::app))
 
8962
                        {
 
8963
                            con << tOutput("$player_colors_saved");
 
8964
                            o << ePlayerNetID::gatherPlayerColor(p,0);
 
8965
                            con << ePlayerNetID::gatherPlayerColor(p);;
 
8966
                        }
 
8967
                        else
 
8968
                        {
 
8969
                            con << tOutput("$players_color_error");
 
8970
                        }
 
8971
                        o.close();
 
8972
                    }
 
8973
                }
 
8974
                if (!foundPlayer)
 
8975
                {
 
8976
                    con << tOutput("$player_colors_not_found", passedString[2]);
 
8977
                }
 
8978
            }
 
8979
        }
 
8980
 
 
8981
        else if (passedString[1] == "load")
 
8982
        {
 
8983
            load = true;
 
8984
            int savedColorsCount = se_savedColorsCount();
 
8985
 
 
8986
            if (passedString.Len() == 2)
 
8987
            {
 
8988
                con << tOutput("$player_colors_changed_usage_error");
 
8989
                return;
 
8990
            }
 
8991
            else if (passedString.Len() == 3)
 
8992
            {
 
8993
                correctParameters = true;
 
8994
                int lineNumber = (atoi(passedString[2]) - 1);
 
8995
                if ((lineNumber >= 0) && lineNumber <= savedColorsCount - 1)
 
8996
                {
 
8997
                    se_loadSavedColor(lineNumber);
 
8998
                }
 
8999
                else
 
9000
                {
 
9001
                    correctParameters = false;
 
9002
                    hideError = true;
 
9003
                    con << tOutput("$players_color_line_not_found", se_colorVarFile,
 
9004
                        savedColorsCount, lineNumber + 1);
 
9005
                }
 
9006
            }
 
9007
        }
 
9008
        else if (passedString[1] == "list")
 
9009
        {
 
9010
            hideError = true;
 
9011
            list = true;
 
9012
            int savedColorsCount = se_savedColorsCount();
 
9013
            con << tOutput("$players_color_list", savedColorsCount, se_colorVarFile);
 
9014
            if (savedColorsCount > 0)
 
9015
            {
 
9016
                se_SavedColors(savedColorsCount);
 
9017
            }
 
9018
            else
 
9019
            {
 
9020
                con << tOutput("$player_colors_empty");
 
9021
            }
 
9022
        }
 
9023
        else if (passedString[1] == "clear")
 
9024
        {
 
9025
            hideError = true;
 
9026
            clear = true;
 
9027
            std::ofstream o;
 
9028
            if (tDirectories::Var().Open(o, se_colorVarFile))
 
9029
            {
 
9030
                o << "";
 
9031
            }
 
9032
            o.close();
 
9033
            con << tOutput("$player_colors_cleared", se_colorVarFile);
 
9034
        }
 
9035
        else if (passedString[1] == "unique" && !(help || random || load || save || list || clear))
8753
9036
        {
8754
9037
            correctParameters = true;
8755
9038
            unique = true;
8756
 
            //Also everyone gets unique colors if sent.
8757
 
            for(int i=0; i<MAX_PLAYERS; ++i )
 
9039
 
 
9040
            // Also everyone gets unique colors if sent.
 
9041
            for (int i = 0; i < MAX_PLAYERS; ++i)
8758
9042
            {
8759
 
                bool in_game=ePlayer::PlayerIsInGame(i);
8760
 
                ePlayer *me=ePlayer::PlayerConfig(i);
 
9043
                bool in_game = ePlayer::PlayerIsInGame(i);
 
9044
                ePlayer* me = ePlayer::PlayerConfig(i);
8761
9045
                tASSERT(me);
8762
 
                tCONTROLLED_PTR(ePlayerNetID) &p=me->netPlayer;
 
9046
                tCONTROLLED_PTR(ePlayerNetID)& p = me->netPlayer;
8763
9047
 
8764
9048
                if (bool(p) && in_game)
8765
9049
                {
8766
 
                    se_UniqueColor(me,p);
 
9050
                    se_UniqueColor(me, p);
8767
9051
                }
8768
9052
            }
8769
9053
        }
8770
9054
 
8771
 
        //Not really checking if the strings passed parameters are numbers, but if someone did /rgb asd asd asd it would just make it 0 0 0.
8772
 
        else if (passedString.Len() >= 4 && !(random || unique ))
 
9055
        // Not really checking if the strings passed parameters are numbers,
 
9056
        // but if someone did /rgb asd asd asd it would just make it 0 0 0.
 
9057
        else if (passedString.Len() >= 4
 
9058
            && !(help || random || unique || load || save || list || clear))
8773
9059
        {
8774
 
            //Guess we must be ID 0?
 
9060
            // Guess we must be ID 0?
8775
9061
            if (passedString.Len() == 4)
8776
9062
            {
8777
9063
                correctParameters = true;
8778
9064
 
8779
 
                unsigned short r = (unsigned short) strtoul(passedString[1], NULL, 0);
8780
 
                unsigned short g = (unsigned short) strtoul(passedString[2], NULL, 0);
8781
 
                unsigned short b = (unsigned short) strtoul(passedString[3], NULL, 0);
8782
 
                
 
9065
                int r = atoi(passedString[1]);
 
9066
                int g = atoi(passedString[2]);
 
9067
                int b = atoi(passedString[3]);
 
9068
 
8783
9069
                ePlayer::PlayerConfig(0)->rgb[0] = r;
8784
9070
                ePlayer::PlayerConfig(0)->rgb[1] = g;
8785
9071
                ePlayer::PlayerConfig(0)->rgb[2] = b;
8786
 
 
8787
9072
            }
8788
 
            else if (passedString.Len() == 5)
 
9073
            else if (passedString.Len() == 5
 
9074
                && !(help || random || unique || load || save || list || clear))
8789
9075
            {
8790
 
                ourID = (unsigned short) strtoul(passedString[1], NULL, 0);
 
9076
                ourID = atoi(passedString[1]);
8791
9077
                if ((ourID <= MAX_PLAYERS) && (ourID > 0))
8792
9078
                {
8793
9079
                    correctParameters = true;
8794
9080
 
8795
 
                    bool in_game=ePlayer::PlayerIsInGame(ourID-1);
8796
 
                    ePlayer *me=ePlayer::PlayerConfig(ourID-1);
8797
 
 
8798
 
                    unsigned short r = (unsigned short) strtoul(passedString[2], NULL, 0);
8799
 
                    unsigned short g = (unsigned short) strtoul(passedString[3], NULL, 0);
8800
 
                    unsigned short b = (unsigned short) strtoul(passedString[4], NULL, 0);
8801
 
 
8802
 
                    ePlayer::PlayerConfig(ourID-1)->rgb[0] = r;
8803
 
                    ePlayer::PlayerConfig(ourID-1)->rgb[1] = g;
8804
 
                    ePlayer::PlayerConfig(ourID-1)->rgb[2] = b;
 
9081
                    bool in_game = ePlayer::PlayerIsInGame(ourID - 1);
 
9082
                    ePlayer* me = ePlayer::PlayerConfig(ourID - 1);
 
9083
 
 
9084
                    int r = atoi(passedString[2]);
 
9085
                    int g = atoi(passedString[3]);
 
9086
                    int b = atoi(passedString[4]);
 
9087
 
 
9088
                    ePlayer::PlayerConfig(ourID - 1)->rgb[0] = r;
 
9089
                    ePlayer::PlayerConfig(ourID - 1)->rgb[1] = g;
 
9090
                    ePlayer::PlayerConfig(ourID - 1)->rgb[2] = b;
8805
9091
                }
8806
9092
            }
8807
9093
        }
8811
9097
        {
8812
9098
            con << tOutput("$player_colors_current_text");
8813
9099
 
8814
 
            for(int i=0; i<MAX_PLAYERS; ++i )
 
9100
            for (int i = 0; i < MAX_PLAYERS; ++i)
8815
9101
            {
8816
 
                bool in_game=ePlayer::PlayerIsInGame(i);
8817
 
                ePlayer *me=ePlayer::PlayerConfig(i);
 
9102
                bool in_game = ePlayer::PlayerIsInGame(i);
 
9103
                ePlayer* me = ePlayer::PlayerConfig(i);
8818
9104
                tASSERT(me);
8819
 
                tCONTROLLED_PTR(ePlayerNetID) &p=me->netPlayer;
 
9105
                tCONTROLLED_PTR(ePlayerNetID)& p = me->netPlayer;
8820
9106
                if (bool(p) && in_game)
8821
 
                {   tColoredString listColors;
8822
 
                    listColors << i+1 << ": " << p->GetColoredName() << "0xRESETT (" << ePlayer::PlayerConfig(i)->rgb[0] << ", " << ePlayer::PlayerConfig(i)->rgb[1] << ", " << ePlayer::PlayerConfig(i)->rgb[2] << ")\n";
 
9107
                {
 
9108
                    ePlayerNetID::Update();
 
9109
                    tColoredString listColors;
 
9110
                    listColors << i + 1 << ") " << p->GetColoredName() << "0xRESETT ("
 
9111
                               << ePlayer::PlayerConfig(i)->rgb[0] << ", "
 
9112
                               << ePlayer::PlayerConfig(i)->rgb[1] << ", "
 
9113
                               << ePlayer::PlayerConfig(i)->rgb[2] << ")\n";
8823
9114
                    con << listColors;
8824
9115
                }
8825
 
                if(!(bool(p) && in_game) && ourID-1 == i)
 
9116
                if (!(bool(p) && in_game) && ourID - 1 == i)
8826
9117
                {
8827
 
                    con << tOutput("$player_colors_changed_text", ourID, ePlayer::PlayerConfig(i)->rgb[0], ePlayer::PlayerConfig(i)->rgb[1], ePlayer::PlayerConfig(i)->rgb[2]);
 
9118
                    con << tOutput("$player_colors_changed_text", ourID,
 
9119
                        ePlayer::PlayerConfig(i)->rgb[0], ePlayer::PlayerConfig(i)->rgb[1],
 
9120
                        ePlayer::PlayerConfig(i)->rgb[2]);
8828
9121
                }
8829
9122
            }
8830
9123
        }
8831
9124
        else
8832
9125
        {
8833
 
            con << tOutput("$player_colors_changed_usage_error");
 
9126
            // If hideError is enabled we wont display the error message.
 
9127
            if (!hideError)
 
9128
            {
 
9129
                con << tOutput("$player_colors_changed_usage_error");
 
9130
            }
8834
9131
        }
8835
9132
    }
8836
9133
}
8837
9134
 
8838
 
 
8839
 
 
8840
 
 
8841
9135
static nSettingItem<int> se_pingCharityServerConf("PING_CHARITY_SERVER",sn_pingCharityServer );
8842
9136
static nVersionFeature   se_pingCharityServerControlled( 14 );
8843
9137