Add "show grid user" robust/standalone console command for debug purposes.

Shows all data on entries which match or start with a given ID.
This would usually be a UUID.
justincc-master
Justin Clark-Casey (justincc) 2014-01-30 00:03:22 +00:00
parent 2cf224166f
commit bdab05df0e
1 changed files with 33 additions and 0 deletions

View File

@ -48,6 +48,14 @@ namespace OpenSim.Services.UserAccountService
{ {
m_log.Debug("[GRID USER SERVICE]: Starting user grid service"); m_log.Debug("[GRID USER SERVICE]: Starting user grid service");
MainConsole.Instance.Commands.AddCommand(
"Users", false,
"show grid user",
"show grid user <ID>",
"Show grid user entry or entries that match or start with the given ID. This will normally be a UUID.",
"This is for debug purposes to see what data is found for a particular user id.",
HandleShowGridUser);
MainConsole.Instance.Commands.AddCommand( MainConsole.Instance.Commands.AddCommand(
"Users", false, "Users", false,
"show grid users online", "show grid users online",
@ -58,6 +66,31 @@ namespace OpenSim.Services.UserAccountService
HandleShowGridUsersOnline); HandleShowGridUsersOnline);
} }
protected void HandleShowGridUser(string module, string[] cmdparams)
{
if (cmdparams.Length != 4)
{
MainConsole.Instance.Output("Usage: show grid user <UUID>");
return;
}
GridUserData[] data = m_Database.GetAll(cmdparams[3]);
foreach (GridUserData gu in data)
{
ConsoleDisplayList cdl = new ConsoleDisplayList();
cdl.AddRow("User ID", gu.UserID);
foreach (KeyValuePair<string,string> kvp in gu.Data)
cdl.AddRow(kvp.Key, kvp.Value);
MainConsole.Instance.Output(cdl.ToString());
}
MainConsole.Instance.OutputFormat("Entries: {0}", data.Length);
}
protected void HandleShowGridUsersOnline(string module, string[] cmdparams) protected void HandleShowGridUsersOnline(string module, string[] cmdparams)
{ {
// if (cmdparams.Length != 4) // if (cmdparams.Length != 4)