8474
//Gather all the rgb colors and put them in a nice list.
8475
static void se_listPlayerColors()
8477
void ePlayerNetID::listPlayerColors()
8477
tColoredString listColors;
8478
for ( int i = 0; i <= se_PlayerNetIDs.Len()-1; i++ )
8479
con << tOutput("$player_colors_text");
8480
for ( int i = 0; i <= se_PlayerNetIDs.Len()-1; i++ )
8482
tColoredString listColors;
8480
8483
ePlayerNetID * otherPlayers = se_PlayerNetIDs(i);
8483
8485
listColors << (i+1) << ": " << otherPlayers->GetColoredName() << "0xRESETT (" << otherPlayers->r << ", " << otherPlayers->g << ", " << otherPlayers->b << ")\n";
8485
8487
con << listColors;
8493
List player information.
8498
Used Rubber out of max
8500
Spectating / Playing
8502
Sometimes Alive / Dead
8503
Usage: /info - Returns own information
8504
/info playername - Returns that players name. (or more depending if the search word is found in more than one player)
8507
void ePlayerNetID::listPlayerInfo(tString s_orig)
8510
if (se_PlayerNetIDs.Len()>0)
8512
if (s_orig.StrPos(" ") == -1)
8514
con << tOutput("$player_info_text");
8516
for(int i=0; i < se_PlayerNetIDs.Len(); i++)
8519
ePlayerNetID *p=se_PlayerNetIDs(i);
8520
if (p->Owner() == sn_myNetID)
8522
con << gatherPlayerInfo(p);
8530
tArray<tString> msgsExt = s_orig.Split(" ");
8531
tArray<ePlayerNetID *> foundPlayers;
8533
bool playerFound = false;
8535
con << tOutput("$player_info_text");
8537
for(int i = 0; i < msgsExt.Len(); i++)
8539
tString word = msgsExt[i];
8541
for(int i=0; i < se_PlayerNetIDs.Len(); i++)
8543
ePlayerNetID *p=se_PlayerNetIDs(i);
8545
if (p->GetName().Filter().Contains(word.Filter()))
8549
con << gatherPlayerInfo(p);
8557
con << "No players found for "<< msgsExt[1] << ".\n";
8566
// Gather all the player information and return it in a tColorString object.
8567
tColoredString ePlayerNetID::gatherPlayerInfo(ePlayerNetID * p)
8569
tColoredString listinfo;
8570
listinfo << "Results for " << p->GetColoredName() << "0xRESETT: \n";
8572
///Status. Includes player type, spectating or playing, and if the player is chatting.
8573
listinfo << "Status: ";
8574
(p->IsHuman()) ? listinfo << "Human" : listinfo << "Bot";
8578
//Oddly IsSpectating caused some confusing status.
8579
(!p->CurrentTeam()) ? listinfo << ", Spectating" : listinfo << ", Playing";
8581
//Are we chatting / out of focus? Calculating the time worked for our local player but didnt work too well for players who joined before us.
8582
(p->IsChatting()) ? listinfo << ", Chatting" : listinfo << ""; // ("<< fabs(p->TimeChatting()) << ") seconds\n" : listinfo << "\n";
8585
//Only grab this information if the player is an active object.
8586
if (p->Object() && p->currentTeam)
8588
//If the player is an active object, are they alive? Pretty sure we know this already but no harm in including it.
8589
(p->Object()->Alive()) ? listinfo << ", Alive\n" : listinfo << ", Dead\n";
8591
//Only grab this information if the player is an alive object.
8592
if (p->Object()->Alive())
8594
gCycle *pCycle = dynamic_cast<gCycle *>(p->Object());
8596
listinfo << "Position: x: " << pCycle->MapPosition().x << ", y: " << pCycle->MapPosition().y << "\n";
8598
//Had trouble converting the direction to an angle, will have to visit this later
8599
listinfo << "Map Direction: " << "x: " << pCycle->MapDirection().x << ", y: " << pCycle->MapDirection().y << "\n";
8600
listinfo << "Speed: " << pCycle->verletSpeed_ << "\n";
8601
listinfo << "Rubber: " << pCycle->GetRubber() << "/" << sg_rubberCycle << "\n";
8605
return listinfo << "\n";
8493
8611
static nSettingItem<int> se_pingCharityServerConf("PING_CHARITY_SERVER",sn_pingCharityServer );