- user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0].c_str());
- ret = true;
- }
- else if (s && s != Utils->TreeRoot)
- {
- std::deque<std::string> params;
- params.push_back(parameters[0]);
-
- params[0] = s->GetName();
- Utils->DoOneToOne(user->uuid, "MAP", params, s->GetName());
- ret = true;
- }
-
- // Don't return if s == Utils->TreeRoot (us)
- if (ret)
- return 1;
- }
-
- // This array represents a virtual screen which we will
- // "scratch" draw to, as the console device of an irc
- // client does not provide for a proper terminal.
- float totusers = 0;
- float totservers = 0;
- static char matrix[128][128];
-
- for (unsigned int t = 0; t < 128; t++)
- {
- matrix[t][0] = '\0';
- }
-
- line = 0;
-
- // The only recursive bit is called here.
- ShowMap(Utils->TreeRoot,user,0,matrix,totusers,totservers);
-
- // Process each line one by one. The algorithm has a limit of
- // 128 servers (which is far more than a spanning tree should have
- // anyway, so we're ok). This limit can be raised simply by making
- // the character matrix deeper, 128 rows taking 10k of memory.
- for (int l = 1; l < line; l++)
- {
- // scan across the line looking for the start of the
- // servername (the recursive part of the algorithm has placed
- // the servers at indented positions depending on what they
- // are related to)
- int first_nonspace = 0;
-
- while (matrix[l][first_nonspace] == ' ')
- {
- first_nonspace++;