|
@@ -38,6 +38,7 @@ Director::Director() {
|
|
|
SF_computer_portline = [this](const std::string &s) {
|
|
|
this->SL_computer_portline(s);
|
|
|
};
|
|
|
+ SF_planetline = [this](const std::string &s) { this->SL_planetline(s); };
|
|
|
build_menu();
|
|
|
}
|
|
|
|
|
@@ -201,6 +202,16 @@ void Director::server_line(const std::string &line,
|
|
|
if (line == "<Port>") {
|
|
|
SL_parser = SF_portline;
|
|
|
}
|
|
|
+
|
|
|
+ if (line ==
|
|
|
+ " Corporate Planet Scan "
|
|
|
+ " " ||
|
|
|
+ line ==
|
|
|
+ " Personal Planet Scan "
|
|
|
+ " ") {
|
|
|
+ SL_parser = SF_planetline;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if (startswith(line, " Items Status Trading % of max OnBoard"))
|
|
|
SL_parser = SF_portline;
|
|
@@ -1234,3 +1245,53 @@ void Director::SL_computer_portline(const std::string &line) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+void Director::SL_planetline(const std::string &line) {
|
|
|
+ if (line == "Corporate command [TL=00:00:00]:[344] (?=Help)? Q" ||
|
|
|
+ line == "Computer command [TL=00:00:00]:[344] (?=Help)? Q") {
|
|
|
+ SL_parser = nullptr;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (in(line, "Class ") && (in(line, "Level ") || (endswith(line, "No Citadel")))) {
|
|
|
+ int level;
|
|
|
+ char c;
|
|
|
+ sector_type sector;
|
|
|
+ int number;
|
|
|
+ std::string name;
|
|
|
+ std::string work = line;
|
|
|
+ size_t pos = work.find('#');
|
|
|
+ std::string temp = work.substr(0, pos);
|
|
|
+ trim(temp);
|
|
|
+ sector = sstoi(temp);
|
|
|
+ work = work.substr(pos + 1);
|
|
|
+ number = sstoi(work);
|
|
|
+ pos = work.find(' ');
|
|
|
+ work = work.substr(pos + 1);
|
|
|
+ trim(work);
|
|
|
+ if (endswith(work, "No Citadel")) {
|
|
|
+ level = 0;
|
|
|
+ } else {
|
|
|
+ pos = work.rfind("Level ");
|
|
|
+ temp = work.substr(pos + 6);
|
|
|
+ level = sstoi(temp);
|
|
|
+ }
|
|
|
+ pos = work.rfind("Class ");
|
|
|
+ temp = work.substr(pos + 6);
|
|
|
+ c = temp[0];
|
|
|
+ work = work.substr(0, pos);
|
|
|
+ trim(work);
|
|
|
+ name = work;
|
|
|
+ BUGZ_LOG(warning) << (int)sector << " # " << number << " Class " << c
|
|
|
+ << " Level " << level << " name: [" << name << "]";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ SL: [ 344 #4 Enjoy the Silence Class M, Earth Type Level 3] SL:
|
|
|
+ [ --- (4M) 1T 64 25 14T 693 277 2T 10M] SL: [
|
|
|
+ 344 #5 High There! Class L, Mountainous Level 2]
|
|
|
+ SL: [ --- (5M) 2T 0 6 25T 100 112 2T 6M]
|
|
|
+ ...
|
|
|
+ SL: [ --- (9M) 3T 64 31 39T 793 389 4T ---]
|
|
|
+ */
|
|
|
+}
|