diff options
| author | 2008-08-18 19:25:17 +0000 | |
|---|---|---|
| committer | 2008-08-18 19:25:17 +0000 | |
| commit | 11e600d02028b8ff55e975b1ede3d666899e4514 (patch) | |
| tree | ffab7f972c25838086dedc7a093f2a756889d820 /src/modules/m_spanningtree/main.cpp | |
| parent | Merge in patch for bug #592 submitted by Zerg2000, thanks. Not required for t... (diff) | |
Increase the size of the matrix for map drawing to 250x250
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@10159 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/main.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index eb2023eab..76a61f85f 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -168,9 +168,9 @@ const std::string ModuleSpanningTree::MapOperInfo(TreeServer* Current) } // WARNING: NOT THREAD SAFE - DONT GET ANY SMART IDEAS. -void ModuleSpanningTree::ShowMap(TreeServer* Current, userrec* user, int depth, char matrix[128][128], float &totusers, float &totservers) +void ModuleSpanningTree::ShowMap(TreeServer* Current, userrec* user, int depth, char matrix[250][250], float &totusers, float &totservers) { - if (line < 128) + if (line < 250) { for (int t = 0; t < depth; t++) { @@ -178,19 +178,19 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, userrec* user, int depth, } // For Aligning, we need to work out exactly how deep this thing is, and produce // a 'Spacer' String to compensate. - char spacer[40]; - memset(spacer,' ',40); - if ((40 - Current->GetName().length() - depth) > 1) { - spacer[40 - Current->GetName().length() - depth] = '\0'; + char spacer[80]; + memset(spacer,' ',80); + if ((80 - Current->GetName().length() - depth) > 1) { + spacer[80 - Current->GetName().length() - depth] = '\0'; } else { spacer[5] = '\0'; } float percent; - char text[128]; + char text[250]; /* Neat and tidy default values, as we're dealing with a matrix not a simple string */ - memset(text, 0, 128); + memset(text, 0, 250); if (ServerInstance->clientlist->size() == 0) { // If there are no users, WHO THE HELL DID THE /MAP?!?!?! @@ -201,10 +201,10 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, userrec* user, int depth, percent = ((float)Current->GetUserCount() / (float)ServerInstance->clientlist->size()) * 100; } const std::string operdata = IS_OPER(user) ? MapOperInfo(Current) : ""; - snprintf(text, 126, "%s %s%5d [%5.2f%%]%s", Current->GetName().c_str(), spacer, Current->GetUserCount(), percent, operdata.c_str()); + snprintf(text, 249, "%s %s%5d [%5.2f%%]%s", Current->GetName().c_str(), spacer, Current->GetUserCount(), percent, operdata.c_str()); totusers += Current->GetUserCount(); totservers++; - strlcpy(&matrix[line][depth],text,126); + strlcpy(&matrix[line][depth], text, 249); line++; for (unsigned int q = 0; q < Current->ChildCount(); q++) { @@ -336,8 +336,8 @@ void ModuleSpanningTree::HandleMap(const char** parameters, int pcnt, userrec* u // client does not provide for a proper terminal. float totusers = 0; float totservers = 0; - char matrix[128][128]; - for (unsigned int t = 0; t < 128; t++) + char matrix[250][250]; + for (unsigned int t = 0; t < 250; t++) { matrix[t][0] = '\0'; } |
