This is a change that I have committed on my end and I thought I would share it.
It uses the existing client UI interface to send the bot list to the client via Popup. It helps lower the business of the chat window. It also rectifies filtering logic (i.e. #bot list 1) for classes.
bot.cpp
Code:
2009-08-10 20:32:18.694884800 -0500
@@ -8467,7 +8467,7 @@
if(!strcasecmp(sep->arg[1], "list")) {
bool listAll = true;
- int iClass = atoi(sep->arg[2]);
+ uint16 iClass = (uint16) atoi(sep->arg[2]);
if(iClass > 0 && iClass < 17)
listAll = false;
@@ -8480,14 +8480,21 @@
}
if(!AvailableBots.empty()) {
+ std::stringstream botListStringStream;
+ std::string botListString;
for(std::list<BotsAvailableList>::iterator TempAvailable
BotsList = AvailableBots.begin(); TempAvailableBotsList != AvailableBots.end();
TempAvailableBotsList++) {
- if(listAll) {
- c->Message(0, "ID: %u -- Class: %s -- Na
me: %s -- Race: %s", TempAvailableBotsList->BotID, ClassIdToString(TempAvailable
BotsList->BotClass).c_str(), TempAvailableBotsList->BotName, RaceIdToString(Temp
AvailableBotsList->BotRace).c_str());
+ if(listAll) {
+
+ botListStringStream <<"ID: " << TempAvai
lableBotsList->BotID << " " << TempAvailableBotsList->BotName << " " << RaceIdTo
String(TempAvailableBotsList->BotRace) << " " << ClassIdToString(TempAvailableBo
tsList->BotClass) << "<br>";
+
}
else {
- if(TempAvailableBotsList->BotClass == iC
lass)
- c->Message(0, "ID: %u -- Class:
%s -- Name: %s -- Race: %s", TempAvailableBotsList->BotID, ClassIdToString(TempA
vailableBotsList->BotClass).c_str(), TempAvailableBotsList->BotName, RaceIdToStr
ing(TempAvailableBotsList->BotRace).c_str());
+ if(TempAvailableBotsList->BotClass == iC
lass)
+ botListStringStream <<"ID: " <<
TempAvailableBotsList->BotID << " " << TempAvailableBotsList->BotName << " " <<
RaceIdToString(TempAvailableBotsList->BotRace) << " " << ClassIdToString(TempAva
ilableBotsList->BotClass) << "<br>";
+
}
+ botListString = botListStringStream.str();
+ c->SendPopupToClient("Available Bots", botListSt
ring.c_str());
}
}
else {
I plan to also make this change to "#bot inventory list". I will post that when I have it done if anyone is interested.