Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added versions to /map as requested by fraggeln #467

Closed
wants to merge 1 commit into from

3 participants

@Justasic

Title says it all. I am only doing for 2.2 since it's a core command change

src/commands/cmd_map.cpp
@@ -45,7 +45,8 @@ CmdResult CommandMap::Handle (const std::vector<std::string>&, User *user)
if (IS_OPER(user))
{
- user->WriteNumeric(006, "%s :%s [%s]", user->nick.c_str(), ServerInstance->Config->ServerName.c_str(), ServerInstance->Config->GetSID().c_str());
+ std::string version = ServerInstance->GetVersionString(IS_OPER(user));
@SaberUK
SaberUK added a note

If this code is being executed then the user is an oper so you can just pass true here.

@Justasic
Justasic added a note

oh, alright. I copied and pasted and didnt know if IS_OPER returned the user (because it was a macro?) or a boolean so I just left it as is.. I'll fix in a few mins here..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@attilamolnar
Owner

This does not change the "real" /map in spanningtree, so it has no effect when spanningtree is loaded.
If you have the time then change that, test with multiple servers and reopen.

Side note: Most information coming from GetVersionString(true) is not synchronized currently: spanningtree calls GetVersionString(false) when sending VERSION.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 4, 2013
  1. @Justasic
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/commands/cmd_map.cpp
View
3  src/commands/cmd_map.cpp
@@ -45,7 +45,8 @@ CmdResult CommandMap::Handle (const std::vector<std::string>&, User *user)
if (IS_OPER(user))
{
- user->WriteNumeric(006, "%s :%s [%s]", user->nick.c_str(), ServerInstance->Config->ServerName.c_str(), ServerInstance->Config->GetSID().c_str());
+ std::string version = ServerInstance->GetVersionString(true);
+ user->WriteNumeric(006, "%s :%s [%s] [%s]", user->nick.c_str(), ServerInstance->Config->ServerName.c_str(), ServerInstance->Config->GetSID().c_str(), version.c_str());
user->WriteNumeric(007, "%s :End of /MAP", user->nick.c_str());
return CMD_SUCCESS;
}
Something went wrong with that request. Please try again.