From 694dff3b7007760039c9eea95fe9b1a89df68432 Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 16 Feb 2008 11:55:09 +0000 Subject: Some changes to remove some of the direct calls to CommsManager from Scene, so that they now go through the SceneCommunicationService. As a small step towards the day we can kill the CommsManager (YAY!) --- OpenSim/Region/ClientStack/UDPServer.cs | 3 +- .../Communications/Local/LocalLoginService.cs | 2 +- .../Environment/Scenes/Scene.PacketHandlers.cs | 2 +- OpenSim/Region/Environment/Scenes/Scene.cs | 14 ++++---- .../Scenes/SceneCommunicationService.cs | 40 ++++++++++++++++++++++ 5 files changed, 51 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index a7e0c22..0a301b5 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs @@ -199,7 +199,8 @@ namespace OpenSim.Region.ClientStack try { - packet = PacketPool.Instance.GetPacket(RecvBuffer, ref packetEnd, ZeroBuffer); + packet = PacketPool.Instance.GetPacket(RecvBuffer, ref packetEnd, ZeroBuffer); + } catch (Exception e) { diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 53748ab..e6a9621 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -138,7 +138,7 @@ namespace OpenSim.Region.Communications.Local response.SimAddress = reg.ExternalEndPoint.Address.ToString(); response.SimPort = (uint) reg.ExternalEndPoint.Port; response.RegionX = reg.RegionLocX; - response.RegionY = reg.RegionLocY; + response.RegionY = reg.RegionLocY ; response.SeedCapability = "http://" + reg.ExternalHostName + ":" + serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 5071f9b..7c0cd77 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -183,7 +183,7 @@ namespace OpenSim.Region.Environment.Scenes //EventManager.TriggerAvatarPickerRequest(); List AvatarResponses = new List(); - AvatarResponses = CommsManager.GenerateAgentPickerRequestResponse(RequestID, query); + AvatarResponses = m_sceneGridService.GenerateAgentPickerRequestResponse(RequestID, query); AvatarPickerReplyPacket replyPacket = (AvatarPickerReplyPacket) PacketPool.Instance.GetPacket(PacketType.AvatarPickerReply); // TODO: don't create new blocks if recycling an old packet diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d8cb11c..b534b4d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -900,7 +900,7 @@ namespace OpenSim.Region.Environment.Scenes public void ExportWorldMap(string fileName) { List mapBlocks = - CommsManager.GridService.RequestNeighbourMapBlocks((int)(RegionInfo.RegionLocX - 9), + m_sceneGridService.RequestNeighbourMapBlocks((int)(RegionInfo.RegionLocX - 9), (int)(RegionInfo.RegionLocY - 9), (int)(RegionInfo.RegionLocX + 9), (int)(RegionInfo.RegionLocY + 9)); @@ -1461,7 +1461,7 @@ namespace OpenSim.Region.Environment.Scenes else { m_innerScene.removeUserCount(true); - CommsManager.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, + m_sceneGridService.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); m_sceneGridService.SendCloseChildAgentConnections(avatar); @@ -1530,7 +1530,7 @@ namespace OpenSim.Region.Environment.Scenes } // Remove client agent from profile, so new logins will work - CommsManager.UserService.clearUserAgent(agentID); + m_sceneGridService.ClearUserAgent(agentID); //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); @@ -1983,24 +1983,24 @@ namespace OpenSim.Region.Environment.Scenes public virtual void StoreAddFriendship(LLUUID ownerID, LLUUID friendID, uint perms) { // TODO: m_sceneGridService.DoStuff; - CommsManager.AddNewUserFriend(ownerID, friendID, perms); + m_sceneGridService.AddNewUserFriend(ownerID, friendID, perms); } public virtual void StoreUpdateFriendship(LLUUID ownerID, LLUUID friendID, uint perms) { // TODO: m_sceneGridService.DoStuff; - CommsManager.UpdateUserFriendPerms(ownerID, friendID, perms); + m_sceneGridService.UpdateUserFriendPerms(ownerID, friendID, perms); } public virtual void StoreRemoveFriendship(LLUUID ownerID, LLUUID ExfriendID) { // TODO: m_sceneGridService.DoStuff; - CommsManager.RemoveUserFriend(ownerID, ExfriendID); + m_sceneGridService.RemoveUserFriend(ownerID, ExfriendID); } public virtual List StoreGetFriendsForUser(LLUUID ownerID) { // TODO: m_sceneGridService.DoStuff; - return CommsManager.GetUserFriendList(ownerID); + return m_sceneGridService.GetUserFriendList(ownerID); } public void AddPacketStats(int inPackets, int outPackets, int unAckedBytes) diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 482701b..4cf93ed 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -554,5 +554,45 @@ namespace OpenSim.Region.Environment.Scenes { return m_commsProvider.GridService.GetGridSettings(); } + + public void LogOffUser(LLUUID userid, LLUUID regionid, ulong regionhandle, float posx, float posy, float posz) + { + m_commsProvider.LogOffUser(userid, regionid, regionhandle, posx, posy, posz); + } + + public void ClearUserAgent(LLUUID avatarID) + { + m_commsProvider.UserService.clearUserAgent(avatarID); + } + + public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) + { + m_commsProvider.AddNewUserFriend(friendlistowner, friend, perms); + } + + public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) + { + m_commsProvider.UpdateUserFriendPerms(friendlistowner, friend, perms); + } + + public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) + { + m_commsProvider.RemoveUserFriend(friendlistowner, friend); + } + + public List GetUserFriendList(LLUUID friendlistowner) + { + return m_commsProvider.GetUserFriendList(friendlistowner); + } + + public List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) + { + return m_commsProvider.GridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); + } + + public List GenerateAgentPickerRequestResponse(LLUUID queryID, string query) + { + return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query); + } } } \ No newline at end of file -- cgit v1.1