Переглянути джерело

Working CIM, correct #'s shown now.

Steve Thielemann 3 роки тому
батько
коміт
7a9740a43d
8 змінених файлів з 173 додано та 186 видалено
  1. 1 0
      .gitignore
  2. 110 64
      director.cpp
  3. 10 2
      director.h
  4. 28 7
      dispatchers.cpp
  5. 12 0
      dispatchers.h
  6. 11 39
      galaxy.cpp
  7. 1 0
      galaxy.h
  8. 0 74
      session.cpp

+ 1 - 0
.gitignore

@@ -1,4 +1,5 @@
 *.yaml
 *.yaml
+*.json
 *.log
 *.log
 .vscode
 .vscode
 build/
 build/

+ 110 - 64
director.cpp

@@ -12,6 +12,8 @@ Director::Director() {
 
 
   // active = false;
   // active = false;
   game = 0;  // not in a game
   game = 0;  // not in a game
+  galaxy.reset();
+
   // do everything proxy_deactivate does ...
   // do everything proxy_deactivate does ...
   // proxy_deactivate();
   // proxy_deactivate();
   active = false;
   active = false;
@@ -28,6 +30,8 @@ Director::Director() {
   SF_sectorline = [this](const std::string &s) { this->SL_sectorline(s); };
   SF_sectorline = [this](const std::string &s) { this->SL_sectorline(s); };
   SF_portline = [this](const std::string &s) { this->SL_portline(s); };
   SF_portline = [this](const std::string &s) { this->SL_portline(s); };
   SF_warpline = [this](const std::string &s) { this->SL_warpline(s); };
   SF_warpline = [this](const std::string &s) { this->SL_warpline(s); };
+
+  build_menu();
 }
 }
 
 
 Director::~Director() { BUGZ_LOG(warning) << "Director::~Director()"; }
 Director::~Director() { BUGZ_LOG(warning) << "Director::~Director()"; }
@@ -111,20 +115,13 @@ void Director::server_line(const std::string &line,
     There's a delay here when I save the game data.
     There's a delay here when I save the game data.
     I've moved it futher down.  Hide it at a prompt, so it isn't so noticeable.
     I've moved it futher down.  Hide it at a prompt, so it isn't so noticeable.
      */
      */
-    /*
-    if (game) {
-      // TODO:  Save galaxy data
-      galaxy.save();
-    }
-    game = 0;
-    */
     // reset "active game" -- we're at the TWGS main menu
     // reset "active game" -- we're at the TWGS main menu
   }
   }
 
 
   if (line.find("Selection (? for menu): ") != std::string::npos) {
   if (line.find("Selection (? for menu): ") != std::string::npos) {
     char ch = line[line.length() - 1];
     char ch = line[line.length() - 1];
     if (ch >= 'A' && ch < 'Q') {
     if (ch >= 'A' && ch < 'Q') {
-      if ((game) && (game != ch) ) {
+      if ((game) && (game != ch)) {
         galaxy.save();
         galaxy.save();
       }
       }
       game = ch;
       game = ch;
@@ -141,6 +138,7 @@ void Director::server_line(const std::string &line,
         galaxy.save();
         galaxy.save();
       }
       }
       game = 0;
       game = 0;
+      galaxy.reset();
     }
     }
   }
   }
 
 
@@ -164,7 +162,7 @@ void Director::server_line(const std::string &line,
    This is where all of the server lines are gleaned for all the
    This is where all of the server lines are gleaned for all the
    information that we can get out of them.
    information that we can get out of them.
 
 
-    // When activating the computer 
+    // When activating the computer
     SP: [Command [TL=00:00:00]:[926] (?=Help)? : ]
     SP: [Command [TL=00:00:00]:[926] (?=Help)? : ]
     Sector: 926
     Sector: 926
     CI: [c]
     CI: [c]
@@ -188,7 +186,6 @@ void Director::server_line(const std::string &line,
     if (line == ": ") SL_parser = SF_cimline;
     if (line == ": ") SL_parser = SF_cimline;
   }
   }
 
 
-
   if (SL_parser) {
   if (SL_parser) {
     SL_parser(line);
     SL_parser(line);
   }
   }
@@ -208,11 +205,11 @@ void Director::server_prompt(const std::string &prompt,
   current_prompt = prompt;
   current_prompt = prompt;
   current_raw_prompt = raw_prompt;
   current_raw_prompt = raw_prompt;
 
 
- 
   if (game) {
   if (game) {
     if (prompt == "Selection (? for menu): ") {
     if (prompt == "Selection (? for menu): ") {
-        galaxy.save();
-        game = 0;
+      galaxy.save();
+      game = 0;
+      galaxy.reset();
     }
     }
 
 
     // in-game parsing here.
     // in-game parsing here.
@@ -234,6 +231,28 @@ void Director::server_prompt(const std::string &prompt,
   if (chain) chain->server_prompt(prompt);
   if (chain) chain->server_prompt(prompt);
 }
 }
 
 
+void Director::build_menu(void) {
+  main_menu = std::make_shared<MenuDispatch>(*this);
+  MenuDispatch *md = static_cast<MenuDispatch *>(&(*main_menu));
+  md->menu_box_color = "\x1b[1;33;44m";
+  md->menu_text_color = "\x1b[1;37;44m";
+  md->menu_title = "Proxy Menu";
+  md->menu_options_color = "\x1b[1;36;40m";
+
+  md->menu_prompt =
+      "\x1b[0;31;40m\xdb\xb2\xb1\xb0 \x1b[31;40mRED "
+      "\x1b[32;40mGREEN\x1b[30;42m\xdb\xb2\xb1\xb0 \x1b[0m : ";
+  md->lazy = true;
+  md->menu = {{"C", "Configure"},        {"D", "Display Report"},
+              {"E", "Export Data/Save"}, {"P", "Port CIM"},
+              {"W", "Warp CIM"},         {"T", "Trading Report"},
+              {"S", "Scripts"},          {"X", "eXit"}};
+  md->setNotify([this]() { this->menu_choice(); });
+
+  cim = std::make_shared<CIMDispatch>(*this);
+  cim->setNotify([this]() { this->cim_done(); });
+}
+
 void Director::proxy_activate(void) {
 void Director::proxy_activate(void) {
   active = true;   // yes, set keep-alive timer.
   active = true;   // yes, set keep-alive timer.
   to_server(" ");  // start keep-alive timer.
   to_server(" ");  // start keep-alive timer.
@@ -265,21 +284,8 @@ void Director::proxy_activate(void) {
   to_client(box.row(output));
   to_client(box.row(output));
   to_client(box.bottom());
   to_client(box.bottom());
 
 
-  std::shared_ptr<Dispatch> menu = std::make_shared<MenuDispatch>(*this);
-  chain = menu;
-  MenuDispatch *md = static_cast<MenuDispatch *>(&(*menu));
-  md->menu_box_color = "\x1b[1;33;44m";
-  md->menu_text_color = "\x1b[1;37;44m";
-  md->menu_title = "Proxy Menu";
-  md->menu_options_color = "\x1b[1;36;40m";
-
-  md->menu_prompt =
-      "\x1b[0;31;40m\xdb\xb2\xb1\xb0 \x1b[31;40mRED "
-      "\x1b[32;40mGREEN\x1b[30;42m\xdb\xb2\xb1\xb0 \x1b[0m : ";
-  md->lazy = true;
-  md->menu = {{"A", "Apple"}, {"B", "Blue"}, {"R", "Rabbit"}, {"Z", "ZOOO!"}};
-  md->setNotify([this]() { this->menu_choice(); });
-  menu->activate();
+  chain = main_menu;
+  main_menu->activate();
   /*
   /*
     // Using InputDispatch  -- and see have_input
     // Using InputDispatch  -- and see have_input
     std::shared_ptr<Dispatch> readline = std::make_shared<InputDispatch>(*this);
     std::shared_ptr<Dispatch> readline = std::make_shared<InputDispatch>(*this);
@@ -300,6 +306,39 @@ void Director::menu_choice(void) {
       proxy_deactivate();
       proxy_deactivate();
       return;
       return;
     } else {
     } else {
+      switch (md->input[0]) {
+        case 'C':  // configure
+          break;
+        case 'D':  // display report
+          break;
+        case 'E':  // Export Data/Save
+          to_client("Saving...");
+          galaxy.save();
+          to_client("\rSaved....\n\r");
+          break;
+        case 'P':  // Port CIM
+          // TO FIX: Save type 0 & 9 ports, and restore!
+          chain = cim;
+          to_server("^RQ");
+          to_client("Port CIM Report\n\r");
+          chain->activate();
+          return;
+          break;
+        case 'W':  // Warp CIM
+          chain = cim;
+          to_server("^IQ");
+          to_client("Warp CIM Report\n\r");
+          chain->activate();
+          return;
+          break;
+        case 'T':  // Trading Report
+          break;
+        case 'S':  // Scripts
+          break;
+        case 'X':  // Exit
+          proxy_deactivate();
+          return;
+      }
       std::string text = str(
       std::string text = str(
           boost::format("Back from Menu [%1%] was selected.\n\r") % md->input);
           boost::format("Back from Menu [%1%] was selected.\n\r") % md->input);
       to_client(text);
       to_client(text);
@@ -328,6 +367,12 @@ void Director::have_input(void) {
   }
   }
 }
 }
 
 
+void Director::cim_done(void) {
+  BUGZ_LOG(info) << "CIM done";
+  chain = main_menu;
+  main_menu->activate();
+}
+
 void Director::proxy_deactivate(void) {
 void Director::proxy_deactivate(void) {
   active = false;
   active = false;
   // reset everything back to good state
   // reset everything back to good state
@@ -351,8 +396,9 @@ void Director::SL_cimline(const std::string &line) {
   }
   }
   if (line == ": ") {
   if (line == ": ") {
     // do I need to do anything special here for this?
     // do I need to do anything special here for this?
-    // Maybe -- We would save special ports that don't show up (StarDock/Special) before.
-    // We don't know (at this point) if this is warps or ports.
+    // Maybe -- We would save special ports that don't show up
+    // (StarDock/Special) before. We don't know (at this point) if this is warps
+    // or ports.
     return;
     return;
   }
   }
   if (line.empty()) {
   if (line.empty()) {
@@ -372,7 +418,7 @@ void Director::SL_cimline(const std::string &line) {
       BUGZ_LOG(fatal) << "portcim:  FAIL [" << line << "]";
       BUGZ_LOG(fatal) << "portcim:  FAIL [" << line << "]";
     else
     else
       BUGZ_LOG(fatal) << "portcim: " << p;
       BUGZ_LOG(fatal) << "portcim: " << p;
-    galaxy.add_port(p);    
+    galaxy.add_port(p);
   } else {
   } else {
     // warpcim
     // warpcim
     BUGZ_LOG(fatal) << "warpcim: [" << line << "]";
     BUGZ_LOG(fatal) << "warpcim: [" << line << "]";
@@ -417,36 +463,36 @@ void Director::SL_sectorline(const std::string &line) {
     sectorline: [Warps to Sector(s) :  70 - 441 - 575 - 600 - 629 - 711]
     sectorline: [Warps to Sector(s) :  70 - 441 - 575 - 600 - 629 - 711]
     sectorline: [Warps to Sector(s) :  70 - (475) - 569]
     sectorline: [Warps to Sector(s) :  70 - (475) - 569]
     */
     */
-   if (in(line, "Sector  :")) {
-     current_sector = stoi(line.substr(10));
-     BUGZ_LOG(warning) << "SECTOR: " << current_sector;
-   }
-   if (in(line, "Ports   :")) {
-     std::string port_class;
-     size_t pos = line.find(", Class ");
-     if (pos != std::string::npos) {
-       pos += 8;
-       int class_ = stoi(line.substr(pos));
-       BUGZ_LOG(fatal) << "PORT: " << class_;
-       galaxy.add_port(current_sector, class_);
-     }
-   }
-   if (in(line, "Warps to Sector(s) :")) {
-     std::string temp = line.substr( 20 );
-     replace(temp, " - ", " ");
-     // unexplored sectors ()
-     // Should I track these?
-     replace(temp, "(", "");
-     replace(temp, ")", "");
-     sector_warps sw;
-     auto warps = split(temp);
-     sw.sector = current_sector;
-     for( auto const &w : warps) {
-       sw.add(stoi(w));
-     }
-     BUGZ_LOG(fatal) << "WARPS: " << sw;
-     galaxy.add_warp(sw);
-   }
+    if (in(line, "Sector  :")) {
+      current_sector = stoi(line.substr(10));
+      BUGZ_LOG(warning) << "SECTOR: " << current_sector;
+    }
+    if (in(line, "Ports   :")) {
+      std::string port_class;
+      size_t pos = line.find(", Class ");
+      if (pos != std::string::npos) {
+        pos += 8;
+        int class_ = stoi(line.substr(pos));
+        BUGZ_LOG(fatal) << "PORT: " << class_;
+        galaxy.add_port(current_sector, class_);
+      }
+    }
+    if (in(line, "Warps to Sector(s) :")) {
+      std::string temp = line.substr(20);
+      replace(temp, " - ", " ");
+      // unexplored sectors ()
+      // Should I track these?
+      replace(temp, "(", "");
+      replace(temp, ")", "");
+      sector_warps sw;
+      auto warps = split(temp);
+      sw.sector = current_sector;
+      for (auto const &w : warps) {
+        sw.add(stoi(w));
+      }
+      BUGZ_LOG(fatal) << "WARPS: " << sw;
+      galaxy.add_warp(sw);
+    }
   }
   }
 }
 }
 
 
@@ -470,14 +516,14 @@ void Director::SL_portline(const std::string &line) {
    */
    */
   BUGZ_LOG(info) << "portline : " << line;
   BUGZ_LOG(info) << "portline : " << line;
   if (in(line, "%")) {
   if (in(line, "%")) {
-  // size_t pos = line.find('%');
-  // if (pos != line.npos) {
+    // size_t pos = line.find('%');
+    // if (pos != line.npos) {
     // Ok, this is a valid portline
     // Ok, this is a valid portline
     std::string work = line;
     std::string work = line;
     replace(work, "Fuel Ore", "Fuel");
     replace(work, "Fuel Ore", "Fuel");
     auto parts = split(work);
     auto parts = split(work);
     BUGZ_LOG(fatal) << "portline split:";
     BUGZ_LOG(fatal) << "portline split:";
-    for( auto const p : parts) {
+    for (auto const p : parts) {
       BUGZ_LOG(fatal) << p;
       BUGZ_LOG(fatal) << p;
     }
     }
     // BUGZ_LOG(fatal) << "portline split : [" << parts << "]";
     // BUGZ_LOG(fatal) << "portline split : [" << parts << "]";

+ 10 - 2
director.h

@@ -8,6 +8,7 @@ class Dispatch;
 class Director {
 class Director {
  public:
  public:
   std::shared_ptr<Dispatch> chain;
   std::shared_ptr<Dispatch> chain;
+
   StringFunc to_client;
   StringFunc to_client;
   StringFunc to_server;
   StringFunc to_server;
   // void Session::post(notifyFunc nf)
   // void Session::post(notifyFunc nf)
@@ -43,8 +44,6 @@ class Director {
   Director();
   Director();
   ~Director();
   ~Director();
 
 
-  void have_input(void);
-  void menu_choice(void);
   int count;
   int count;
 
 
   int current_sector;
   int current_sector;
@@ -52,6 +51,15 @@ class Director {
   std::string username;
   std::string username;
 
 
  private:
  private:
+  void build_menu(void);
+  std::shared_ptr<Dispatch> main_menu;
+  std::shared_ptr<Dispatch> cim;
+
+  // notifications
+  void have_input(void);
+  void menu_choice(void);
+  void cim_done(void);
+
   StringFunc SL_parser;
   StringFunc SL_parser;
   StringFunc SF_cimline, SF_sectorline, SF_portline, SF_warpline;
   StringFunc SF_cimline, SF_sectorline, SF_portline, SF_warpline;
 
 

+ 28 - 7
dispatchers.cpp

@@ -217,8 +217,7 @@ void InputDispatch::deactivate(void) { notify(); }
 
 
 void InputDispatch::server_line(const std::string &line,
 void InputDispatch::server_line(const std::string &line,
                                 const std::string &raw_line) {
                                 const std::string &raw_line) {
-  if (line.empty())
-    return;
+  if (line.empty()) return;
 
 
   std::string temp = repr(raw_line);
   std::string temp = repr(raw_line);
   BUGZ_LOG(fatal) << "Input:SL(" << temp << ")";
   BUGZ_LOG(fatal) << "Input:SL(" << temp << ")";
@@ -246,7 +245,7 @@ void InputDispatch::server_line(const std::string &line,
   temp = raw_line;
   temp = raw_line;
   replace(temp, "\x1b[1A", "");
   replace(temp, "\x1b[1A", "");
   // replace(temp, "\x1[2J", "");
   // replace(temp, "\x1[2J", "");
-  to_client(temp); 
+  to_client(temp);
   to_client("\n\r");
   to_client("\n\r");
   // Doesn't matter if it is one or two calls.
   // Doesn't matter if it is one or two calls.
   temp = prompt;
   temp = prompt;
@@ -406,8 +405,7 @@ void MenuDispatch::server_line(const std::string &line,
                                const std::string &raw_line) {
                                const std::string &raw_line) {
   // TODO:
   // TODO:
   // Clear prompt, display raw server line, restore prompt.
   // Clear prompt, display raw server line, restore prompt.
-  if (line.empty())
-    return;
+  if (line.empty()) return;
 
 
   std::string temp = repr(raw_line);
   std::string temp = repr(raw_line);
   BUGZ_LOG(fatal) << "Input:SL(" << temp << ")";
   BUGZ_LOG(fatal) << "Input:SL(" << temp << ")";
@@ -435,14 +433,14 @@ void MenuDispatch::server_line(const std::string &line,
   temp = raw_line;
   temp = raw_line;
   replace(temp, "\x1b[1A", "");
   replace(temp, "\x1b[1A", "");
   // replace(temp, "\x1[2J", "");
   // replace(temp, "\x1[2J", "");
-  to_client(temp); 
+  to_client(temp);
   to_client("\n\r");
   to_client("\n\r");
   // Doesn't matter if it is one or two calls.
   // Doesn't matter if it is one or two calls.
   temp = menu_prompt;
   temp = menu_prompt;
   temp.append(input);
   temp.append(input);
   to_client(temp);
   to_client(temp);
   // to_client(prompt);
   // to_client(prompt);
-  // to_client(input);  
+  // to_client(input);
 }
 }
 
 
 void MenuDispatch::client_input(const std::string &cinput) {
 void MenuDispatch::client_input(const std::string &cinput) {
@@ -524,6 +522,29 @@ void MenuDispatch::client_input(const std::string &cinput) {
   }
   }
 }
 }
 
 
+CIMDispatch::CIMDispatch(Director &d) : Dispatch(d) {}
+
+void CIMDispatch::activate(void) { count = 0; }
+
+void CIMDispatch::deactivate(void) { notify(); }
+
+void CIMDispatch::server_line(const std::string &line,
+                              const std::string &raw_line) {
+  if (!((line.empty() || startswith(line, ": ") ||
+         startswith(line, "Command [")))) {
+    count++;
+    if (count % 100 == 0) {
+      std::string message = str(boost::format("\r%1%") % count);
+      to_client(message);
+    }
+  }
+  if (line == ": ENDINTERROG") {
+    std::string message = str(boost::format("\r%1%\n\r") % count);
+    to_client(message);
+    deactivate();
+  }
+}
+
 /*
 /*
  * CoreDispatch:  This is an example class that does dispatch.
  * CoreDispatch:  This is an example class that does dispatch.
  * Copy this and make changes from there...
  * Copy this and make changes from there...

+ 12 - 0
dispatchers.h

@@ -149,6 +149,18 @@ class MainDispatch : public Dispatch {
   std::string old_prompt;
   std::string old_prompt;
 };
 };
 
 
+class CIMDispatch : public Dispatch {
+ public:
+  CIMDispatch(Director &);
+  int count;
+  
+  void activate(void) override;
+  void deactivate(void) override;
+
+  // optional here
+  void server_line(const std::string &line, const std::string &raw_line) override;
+};
+
 class CoreDispatch : public Dispatch {
 class CoreDispatch : public Dispatch {
  public:
  public:
   CoreDispatch(Director &);
   CoreDispatch(Director &);

+ 11 - 39
galaxy.cpp

@@ -99,46 +99,11 @@ std::ostream &operator<<(std::ostream &os, const sector_warps &warps) {
   return os;
   return os;
 }
 }
 
 
-#ifdef NOT_SET
-bool sector_sort(sector_type st1, sector_type st2) {
-  /* Sort sectors, put 0's at the end. */
-  if (st1 == 0) return false;
-  if (st2 == 0) return false;
-  return (st1 < st2);
-}
-
-void sector_warps::sort(void) {
-  std::sort(&warps[0], &warps[MAX_WARPS], sector_sort);
-}
-
-bool sector_warps::operator==(const sector_warps &rhs) const {
-  /*
-  Comapre if the sector_warps are the same.
-  They do not need to be in the same order.
-  */
-  std::set<sector_type> contains;
-  if (sector == rhs.sector) {
-    int x;
-    for (x = 0; x < MAX_WARPS; ++x) {
-      if (warps[x] == 0) break;
-      contains.insert(warps[x]);
-    }
-    for (x = 0; x < MAX_WARPS; ++x) {
-      if (warps[0] == 0) break;
-      auto pos = contains.find(rhs.warps[x]);
-      if (pos == contains.end()) return false;
-      contains.erase(pos);
-    }
-    return contains.empty();
-  }
-
-  // sector number doesn't match!
-  return false;
-}
-#endif
-
 #define GTEST_COUT std::cerr << "[          ] [ INFO ]"
 #define GTEST_COUT std::cerr << "[          ] [ INFO ]"
-#define GTEST_DEBUG
+// #define GTEST_DEBUG
+
+// TODO:  fix this.  I want some trace output, but I don't want
+// my logs flooded ...
 
 
 struct port parse_portcim(const std::string line) {
 struct port parse_portcim(const std::string line) {
   struct port p;
   struct port p;
@@ -215,6 +180,13 @@ struct port parse_portcim(const std::string line) {
 Galaxy::Galaxy() {}
 Galaxy::Galaxy() {}
 Galaxy::~Galaxy() { BUGZ_LOG(fatal) << "Galaxy::~Galaxy()"; }
 Galaxy::~Galaxy() { BUGZ_LOG(fatal) << "Galaxy::~Galaxy()"; }
 
 
+void Galaxy::reset(void) {
+  meta = YAML::Node();
+  config = YAML::Node();
+  ports.clear();
+  warps.clear();
+}
+
 void Galaxy::add_warp(sector_warps sw) {
 void Galaxy::add_warp(sector_warps sw) {
   auto pos = warps.find(sw.sector);
   auto pos = warps.find(sw.sector);
 
 

+ 1 - 0
galaxy.h

@@ -171,6 +171,7 @@ class Galaxy {
  Galaxy();
  Galaxy();
  ~Galaxy();
  ~Galaxy();
 
 
+  void reset(void);
   YAML::Node config;
   YAML::Node config;
   YAML::Node meta;
   YAML::Node meta;
   
   

+ 0 - 74
session.cpp

@@ -145,80 +145,6 @@ void Session::on_server_line(const std::string &line,
                              const std::string &raw_line) {
                              const std::string &raw_line) {
   BUGZ_LOG(info) << "SL: [" << line << "]";
   BUGZ_LOG(info) << "SL: [" << line << "]";
   director.server_line(line, raw_line);
   director.server_line(line, raw_line);
-
-#ifdef DECOUPLE
-  if (line.find("TradeWars Game Server   ") != std::string::npos) {
-    to_client("\rTradeWars Proxy v2++ READY (~ or ESC to activate)\n\r");
-    game = 0;
-    // reset "active game" -- we're back at the menu
-  }
-
-  /*
-     ____                             _     _
-    / ___|  ___ _ ____   _____ _ __  | |   (_)_ __   ___
-    \___ \ / _ \ '__\ \ / / _ \ '__| | |   | | '_ \ / _ \
-     ___) |  __/ |   \ V /  __/ |    | |___| | | | |  __/
-    |____/ \___|_|    \_/ \___|_|    |_____|_|_| |_|\___|
-
-     ____                _
-    |  _ \ __ _ _ __ ___(_)_ __   __ _
-    | |_) / _` | '__/ __| | '_ \ / _` |
-    |  __/ (_| | |  \__ \ | | | | (_| |
-    |_|   \__,_|_|  |___/_|_| |_|\__, |
-                                 |___/
-
-  This is where all of the server lines are gleaned for all the
-  information that we can get out of them.
-
-   */
-
-  if (line.find("Selection (? for menu): ") != std::string::npos) {
-    char ch = line[line.length() - 1];
-    if (ch >= 'A' && ch < 'Q') {
-      game = ch;
-      BUGZ_LOG(warning) << "GAME " << game << " activated!";
-    }
-    // not needed (handled by above Game Server check).
-    if (ch == 'Q') game = 0;
-  }
-
-  // Do I need to run through the tests (below) before calling the parser here?
-  // Or will the parsers know when they are done processing, and clear?
-
-  // Yes, run through the various tests, then call SL_parser.
-
-  if ((line.substr(0, 19) == "The shortest path (") ||
-      (line.substr(0, 7) == "  TO > ")) {
-    SL_parser = [this](const std::string s) { this->SL_warpline(s); };
-  } else {
-    if (line.substr(0, 43) == " Items     Status  Trading % of max OnBoard") {
-      SL_parser = [this](const std::string s) { this->SL_portline(s); };
-
-    } else {
-      if (line.substr(0, 10) == "<Thievery>") {
-        SL_parser = [this](const std::string s) { this->SL_thiefline(s); };
-
-      } else {
-        if (line == ": ") {
-          SL_parser = [this](const std::string s) { this->SL_cimline(s); };
-        } else {
-          if (line.substr(0, 1) == "Sector  : ") {
-            SL_parser = [this](const std::string s) { this->SL_sectorline(s); };
-          }
-        }
-      }
-    }
-  }
-
-  if (SL_parser) {
-    SL_parser(line);
-  }
-
-  // should I have an internal emit_server_line for parsing sections?
-  // rather then having a weird state machine to track where we are?
-
-  if (emit_server_line) emit_server_line(line);
-#endif
 }
 }
 
 
 /**
 /**