From 6dd99837fd4bb6dcaf4dbf89ddc1b3f28337bca5 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 30 Jan 2014 00:03:22 +0000 Subject: [PATCH] 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. --- .../UserAccountService/GridUserService.cs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs index 944411f2c8..25f6a57dcb 100644 --- a/OpenSim/Services/UserAccountService/GridUserService.cs +++ b/OpenSim/Services/UserAccountService/GridUserService.cs @@ -48,6 +48,14 @@ namespace OpenSim.Services.UserAccountService { m_log.Debug("[GRID USER SERVICE]: Starting user grid service"); + MainConsole.Instance.Commands.AddCommand( + "Users", false, + "show grid user", + "show grid user ", + "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( "Users", false, "show grid users online", @@ -58,6 +66,31 @@ namespace OpenSim.Services.UserAccountService HandleShowGridUsersOnline); } + protected void HandleShowGridUser(string module, string[] cmdparams) + { + if (cmdparams.Length != 4) + { + MainConsole.Instance.Output("Usage: show grid user "); + 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 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) { // if (cmdparams.Length != 4)