From 0e966baa2c482300b52ba9d3f857f3c505b7a276 Mon Sep 17 00:00:00 2001 From: Brian McBee Date: Thu, 3 Jan 2008 19:38:58 +0000 Subject: [PATCH] Tweaked "show users" formatting, added user's IP address to display. --- OpenSim/Region/Application/OpenSimMain.cs | 19 +++++++++++++------ OpenSim/Region/ClientStack/UDPServer.cs | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index fdc3d7980a..6758808472 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -880,13 +880,14 @@ namespace OpenSim break; case "users": m_log.Error( - String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", - "Agent ID", "Session ID", "Circuit", "IP", "World")); + String.Format("{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}", "Firstname", "Lastname", + "Agent ID", "Circuit", "IP", "Region")); foreach (ScenePresence presence in m_sceneManager.GetCurrentSceneAvatars()) { RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); string regionName; + System.Net.EndPoint ep = null; if (regionInfo == null) { @@ -896,15 +897,21 @@ namespace OpenSim { regionName = regionInfo.RegionName; } + for (int i = 0; i < m_udpServers.Count; i++) + { + if (m_udpServers[i].RegionHandle == presence.RegionHandle) + { + m_udpServers[i].clientCircuits_reverse.TryGetValue(presence.ControllingClient.CircuitCode, out ep); + } + } m_log.Error( - String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", + String.Format("{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}", presence.Firstname, presence.Lastname, presence.UUID, - presence.ControllingClient.AgentId, - "Unknown", - "Unknown", + presence.ControllingClient.CircuitCode, + ep, regionName)); } diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index bcbd81ac1a..4e4a0aac93 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.ClientStack public class UDPServer : ClientStackNetworkHandler { protected Dictionary clientCircuits = new Dictionary(); - protected Dictionary clientCircuits_reverse = new Dictionary(); + public Dictionary clientCircuits_reverse = new Dictionary(); public Socket Server; protected IPEndPoint ServerIncoming; protected byte[] RecvBuffer = new byte[4096];