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!) --- .../Environment/Scenes/Scene.PacketHandlers.cs | 2 +- OpenSim/Region/Environment/Scenes/Scene.cs | 14 ++++---- .../Scenes/SceneCommunicationService.cs | 40 ++++++++++++++++++++++ 3 files changed, 48 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Environment') 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