summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-06 21:35:03 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-06 21:35:03 +0000
commit8b69e1a5d6316b34cd775aa62532a771975b72bc (patch)
tree0ce9787a4b97e93b544d0e952de015028e612980 /src/modules
parent5accf1b16ae89612df7ce9005e30537ca38be389 (diff)
The map matrix must be static. For some reason it blows up when it is not. This fixes the display oddities, as far as i can tell.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9388 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/override_map.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp
index c8c3e06ec..28b45c632 100644
--- a/src/modules/m_spanningtree/override_map.cpp
+++ b/src/modules/m_spanningtree/override_map.cpp
@@ -41,11 +41,13 @@ const std::string ModuleSpanningTree::MapOperInfo(TreeServer* Current)
// WARNING: NOT THREAD SAFE - DONT GET ANY SMART IDEAS.
void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, char matrix[128][128], float &totusers, float &totservers)
-{
+{
+ ServerInstance->Logs->Log("map",DEBUG,"ShowMap depth %d totusers %0.2f totservers %0.2f", depth, totusers, totservers);
if (line < 128)
{
for (int t = 0; t < depth; t++)
{
+ ServerInstance->Logs->Log("map",DEBUG,"Zero to depth");
matrix[line][t] = ' ';
}
@@ -83,6 +85,8 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, cha
strlcpy(&matrix[line][depth],text,126);
line++;
+ ServerInstance->Logs->Log("map",DEBUG,"Increment line to %d", line);
+
for (unsigned int q = 0; q < Current->ChildCount(); q++)
{
if ((Current->GetChild(q)->Hidden) || ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str()))))
@@ -111,6 +115,7 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, cha
// from the nodes. This is not only friendlier on CPU it uses less stack.
int ModuleSpanningTree::HandleMap(const char* const* parameters, int pcnt, User* user)
{
+ ServerInstance->Logs->Log("map",DEBUG,"HandleMap");
if (pcnt > 0)
{
ServerInstance->Logs->Log("remotemap", DEBUG, "remote map request for %s", parameters[0]);
@@ -149,7 +154,7 @@ int ModuleSpanningTree::HandleMap(const char* const* parameters, int pcnt, User*
// client does not provide for a proper terminal.
float totusers = 0;
float totservers = 0;
- char matrix[128][128];
+ static char matrix[128][128];
for (unsigned int t = 0; t < 128; t++)
{
@@ -202,6 +207,7 @@ int ModuleSpanningTree::HandleMap(const char* const* parameters, int pcnt, User*
// dump the whole lot to the user.
if (IS_LOCAL(user))
{
+ ServerInstance->Logs->Log("map",DEBUG,"local");
for (int t = 0; t < line; t++)
{
user->WriteNumeric(6, "%s :%s",user->nick,&matrix[t][0]);
@@ -213,9 +219,12 @@ int ModuleSpanningTree::HandleMap(const char* const* parameters, int pcnt, User*
{
//void SpanningTreeProtocolInterface::PushToClient(User* target, const std::string &rawline)
+ //
+ ServerInstance->Logs->Log("map", DEBUG, "remote dump lines=%d", line);
for (int t = 0; t < line; t++)
{
+ ServerInstance->Logs->Log("map",DEBUG,"Dump %d", line);
ServerInstance->PI->PushToClient(user, std::string("::") + ServerInstance->Config->ServerName + " 006 " + user->nick + " :" + &matrix[t][0]);
}