refactor: Move "friends show cache" console command out into separate FriendsCommandsModule.

Expose required methods on IFriendsModule.  Rename GetFriends() -> GetFriendsFromCache() for self-documentation
This commit is contained in:
Justin Clark-Casey (justincc)
2012-03-30 01:05:29 +01:00
parent 59157d9d63
commit bce7964ac2
4 changed files with 205 additions and 97 deletions

View File

@@ -163,7 +163,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, client.AgentId);
if (account == null) // foreign
{
FriendInfo[] friends = GetFriends(client.AgentId);
FriendInfo[] friends = GetFriendsFromCache(client.AgentId);
foreach (FriendInfo f in friends)
{
client.SendChangeUserRights(new UUID(f.Friend), client.AgentId, f.TheirFlags);
@@ -346,7 +346,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (agentIsLocal) // agent is local, friend is foreigner
{
FriendInfo[] finfos = GetFriends(agentID);
FriendInfo[] finfos = GetFriendsFromCache(agentID);
FriendInfo finfo = GetFriend(finfos, friendID);
if (finfo != null)
{
@@ -453,7 +453,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
bool confirming = false;
if (friendUUI == string.Empty)
{
finfos = GetFriends(agentID);
finfos = GetFriendsFromCache(agentID);
foreach (FriendInfo finfo in finfos)
{
if (finfo.TheirFlags == -1)
@@ -546,7 +546,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// Delete any previous friendship relations
FriendInfo[] finfos = null;
FriendInfo f = null;
finfos = GetFriends(a1);
finfos = GetFriendsFromCache(a1);
if (finfos != null)
{
f = GetFriend(finfos, a2);
@@ -558,7 +558,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
finfos = GetFriends(a2);
finfos = GetFriendsFromCache(a2);
if (finfos != null)
{
f = GetFriend(finfos, a1);
@@ -595,7 +595,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (agentIsLocal) // agent is local, 'friend' is foreigner
{
// We need to look for its information in the friends list itself
FriendInfo[] finfos = GetFriends(agentID);
FriendInfo[] finfos = GetFriendsFromCache(agentID);
FriendInfo finfo = GetFriend(finfos, exfriendID);
if (finfo != null)
{
@@ -639,7 +639,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
private string GetUUI(UUID localUser, UUID foreignUser)
{
// Let's see if the user is here by any chance
FriendInfo[] finfos = GetFriends(localUser);
FriendInfo[] finfos = GetFriendsFromCache(localUser);
if (finfos != EMPTY_FRIENDS) // friend is here, cool
{
FriendInfo finfo = GetFriend(finfos, foreignUser);