List of friends now retrieved upon login. Configured and tested in standalone only.

slimupdates
Diva Canto 2010-02-25 16:11:04 -08:00
parent 44d5b2910f
commit 679ad95750
6 changed files with 44 additions and 22 deletions

View File

@ -71,10 +71,12 @@ namespace OpenSim.Services.Friends
// //
// We tried, but this doesn't exist. We can't proceed. // We tried, but this doesn't exist. We can't proceed.
// //
if (dllName.Equals(String.Empty)) if (String.Empty.Equals(dllName))
throw new Exception("No StorageProvider configured"); throw new Exception("No StorageProvider configured");
string realm = friendsConfig.GetString("Realm", "Friends"); string realm = "Friends";
if (friendsConfig != null)
realm = friendsConfig.GetString("Realm", realm);
m_Database = LoadPlugin<IFriendsData>(dllName, new Object[] { connString, realm }); m_Database = LoadPlugin<IFriendsData>(dllName, new Object[] { connString, realm });
if (m_Database == null) if (m_Database == null)

View File

@ -306,6 +306,7 @@ namespace OpenSim.Services.HypergridService
return false; return false;
string addressee = parts[0]; string addressee = parts[0];
m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, m_ExternalName);
return (addressee == m_ExternalName); return (addressee == m_ExternalName);
} }

View File

@ -35,6 +35,7 @@ using OpenSim.Framework;
using OpenSim.Framework.Capabilities; using OpenSim.Framework.Capabilities;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion; using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
using log4net; using log4net;
using OpenMetaverse; using OpenMetaverse;
@ -215,7 +216,7 @@ namespace OpenSim.Services.LLLoginService
} }
public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, PresenceInfo pinfo, public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, PresenceInfo pinfo,
GridRegion destination, List<InventoryFolderBase> invSkel, ILibraryService libService, GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
string where, string startlocation, Vector3 position, Vector3 lookAt, string message, string where, string startlocation, Vector3 position, Vector3 lookAt, string message,
GridRegion home, IPEndPoint clientIP) GridRegion home, IPEndPoint clientIP)
: this() : this()
@ -230,8 +231,7 @@ namespace OpenSim.Services.LLLoginService
SecureSessionID = aCircuit.SecureSessionID; SecureSessionID = aCircuit.SecureSessionID;
Message = message; Message = message;
// While we don't have friends... // While we don't have friends...
//BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(agentID)); BuddList = ConvertFriendListItem(friendsList);
BuddList = new LLLoginResponse.BuddyList();
StartLocation = where; StartLocation = where;
FillOutHomeData(pinfo, home); FillOutHomeData(pinfo, home);
@ -607,15 +607,15 @@ namespace OpenSim.Services.LLLoginService
} }
private static LLLoginResponse.BuddyList ConvertFriendListItem(List<FriendListItem> LFL) private static LLLoginResponse.BuddyList ConvertFriendListItem(FriendInfo[] friendsList)
{ {
LLLoginResponse.BuddyList buddylistreturn = new LLLoginResponse.BuddyList(); LLLoginResponse.BuddyList buddylistreturn = new LLLoginResponse.BuddyList();
foreach (FriendListItem fl in LFL) foreach (FriendInfo finfo in friendsList)
{ {
LLLoginResponse.BuddyList.BuddyInfo buddyitem = new LLLoginResponse.BuddyList.BuddyInfo(fl.Friend); LLLoginResponse.BuddyList.BuddyInfo buddyitem = new LLLoginResponse.BuddyList.BuddyInfo(finfo.Friend);
buddyitem.BuddyID = fl.Friend; buddyitem.BuddyID = finfo.Friend;
buddyitem.BuddyRightsHave = (int)fl.FriendListOwnerPerms; buddyitem.BuddyRightsHave = (int)finfo.TheirFlags;
buddyitem.BuddyRightsGiven = (int)fl.FriendPerms; buddyitem.BuddyRightsGiven = (int)finfo.MyFlags;
buddylistreturn.AddNewBuddy(buddyitem); buddylistreturn.AddNewBuddy(buddyitem);
} }
return buddylistreturn; return buddylistreturn;
@ -945,16 +945,16 @@ namespace OpenSim.Services.LLLoginService
{ {
public int BuddyRightsHave = 1; public int BuddyRightsHave = 1;
public int BuddyRightsGiven = 1; public int BuddyRightsGiven = 1;
public UUID BuddyID; public string BuddyID;
public BuddyInfo(string buddyID) public BuddyInfo(string buddyID)
{ {
BuddyID = new UUID(buddyID); BuddyID = buddyID;
} }
public BuddyInfo(UUID buddyID) public BuddyInfo(UUID buddyID)
{ {
BuddyID = buddyID; BuddyID = buddyID.ToString();
} }
public Hashtable ToHashTable() public Hashtable ToHashTable()
@ -962,7 +962,7 @@ namespace OpenSim.Services.LLLoginService
Hashtable hTable = new Hashtable(); Hashtable hTable = new Hashtable();
hTable["buddy_rights_has"] = BuddyRightsHave; hTable["buddy_rights_has"] = BuddyRightsHave;
hTable["buddy_rights_given"] = BuddyRightsGiven; hTable["buddy_rights_given"] = BuddyRightsGiven;
hTable["buddy_id"] = BuddyID.ToString(); hTable["buddy_id"] = BuddyID;
return hTable; return hTable;
} }
} }

View File

@ -14,6 +14,7 @@ using OpenSim.Framework.Console;
using OpenSim.Server.Base; using OpenSim.Server.Base;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion; using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
using OpenSim.Services.Connectors.Hypergrid; using OpenSim.Services.Connectors.Hypergrid;
namespace OpenSim.Services.LLLoginService namespace OpenSim.Services.LLLoginService
@ -31,6 +32,7 @@ namespace OpenSim.Services.LLLoginService
private ISimulationService m_LocalSimulationService; private ISimulationService m_LocalSimulationService;
private ISimulationService m_RemoteSimulationService; private ISimulationService m_RemoteSimulationService;
private ILibraryService m_LibraryService; private ILibraryService m_LibraryService;
private IFriendsService m_FriendsService;
private IAvatarService m_AvatarService; private IAvatarService m_AvatarService;
private IUserAgentService m_UserAgentService; private IUserAgentService m_UserAgentService;
@ -57,6 +59,7 @@ namespace OpenSim.Services.LLLoginService
string gridService = m_LoginServerConfig.GetString("GridService", String.Empty); string gridService = m_LoginServerConfig.GetString("GridService", String.Empty);
string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty); string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty);
string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty); string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty);
string friendsService = m_LoginServerConfig.GetString("FriendsService", String.Empty);
string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty); string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty);
string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty); string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty);
@ -79,6 +82,8 @@ namespace OpenSim.Services.LLLoginService
m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
if (avatarService != string.Empty) if (avatarService != string.Empty)
m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args); m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args);
if (friendsService != string.Empty)
m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args);
if (simulationService != string.Empty) if (simulationService != string.Empty)
m_RemoteSimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); m_RemoteSimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args);
if (agentService != string.Empty) if (agentService != string.Empty)
@ -228,12 +233,18 @@ namespace OpenSim.Services.LLLoginService
return LLFailedLoginResponse.AuthorizationProblem; return LLFailedLoginResponse.AuthorizationProblem;
} }
// TODO: Get Friends list... // Get Friends list
FriendInfo[] friendsList = new FriendInfo[0];
if (m_FriendsService != null)
{
friendsList = m_FriendsService.GetFriends(account.PrincipalID);
m_log.DebugFormat("[LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length);
}
// //
// Finally, fill out the response and return it // Finally, fill out the response and return it
// //
LLLoginResponse response = new LLLoginResponse(account, aCircuit, presence, destination, inventorySkel, m_LibraryService, LLLoginResponse response = new LLLoginResponse(account, aCircuit, presence, destination, inventorySkel, friendsList, m_LibraryService,
where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP); where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP);
return response; return response;
@ -587,7 +598,7 @@ namespace OpenSim.Services.LLLoginService
private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, out string reason) private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, out string reason)
{ {
m_log.Debug("XXX Launching agent at {0}" + destination.RegionName); m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason);
} }

View File

@ -59,6 +59,9 @@
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService"
[Friends]
Connector = "OpenSim.Services.FriendsService.dll"
[LoginService] [LoginService]
LocalServiceModule = "OpenSim.Services.LLLoginService.dll:LLLoginService" LocalServiceModule = "OpenSim.Services.LLLoginService.dll:LLLoginService"
UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
@ -67,6 +70,7 @@
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService" AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService"
FriendsService = "OpenSim.Services.FriendsService.dll:FriendsService"
WelcomeMessage = "Welcome, Avatar!" WelcomeMessage = "Welcome, Avatar!"

View File

@ -77,6 +77,8 @@
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService"
[Friends]
Connector = "OpenSim.Services.FriendsService.dll"
[LoginService] [LoginService]
LocalServiceModule = "OpenSim.Services.LLLoginService.dll:LLLoginService" LocalServiceModule = "OpenSim.Services.LLLoginService.dll:LLLoginService"
@ -87,6 +89,7 @@
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService" AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService"
FriendsService = "OpenSim.Services.FriendsService.dll:FriendsService"
[GatekeeperService] [GatekeeperService]
LocalServiceModule = "OpenSim.Services.HypergridService.dll:GatekeeperService" LocalServiceModule = "OpenSim.Services.HypergridService.dll:GatekeeperService"
@ -96,7 +99,8 @@
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
AuthenticationService = "OpenSim.Services.Connectors.dll:AuthenticationServicesConnector" AuthenticationService = "OpenSim.Services.Connectors.dll:AuthenticationServicesConnector"
; how does the outside world reach me? This acts as public key too. SimulationService ="OpenSim.Services.Connectors.dll:SimulationServiceConnector"
WelcomeMessage = "Welcome, Avatar!"
[UserAgentService] [UserAgentService]
LocalServiceModule = "OpenSim.Services.HypergridService.dll:UserAgentService" LocalServiceModule = "OpenSim.Services.HypergridService.dll:UserAgentService"