aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/LLLoginService/LLLoginService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/LLLoginService/LLLoginService.cs')
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs31
1 files changed, 23 insertions, 8 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 2b74539..82e5ba4 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -27,6 +27,7 @@ namespace OpenSim.Services.LLLoginService
27 private IPresenceService m_PresenceService; 27 private IPresenceService m_PresenceService;
28 private ISimulationService m_LocalSimulationService; 28 private ISimulationService m_LocalSimulationService;
29 private ILibraryService m_LibraryService; 29 private ILibraryService m_LibraryService;
30 private IAvatarService m_AvatarService;
30 31
31 private string m_DefaultRegionName; 32 private string m_DefaultRegionName;
32 private string m_RemoteSimulationDll; 33 private string m_RemoteSimulationDll;
@@ -45,15 +46,15 @@ namespace OpenSim.Services.LLLoginService
45 string gridService = serverConfig.GetString("GridService", String.Empty); 46 string gridService = serverConfig.GetString("GridService", String.Empty);
46 string presenceService = serverConfig.GetString("PresenceService", String.Empty); 47 string presenceService = serverConfig.GetString("PresenceService", String.Empty);
47 string libService = serverConfig.GetString("LibraryService", String.Empty); 48 string libService = serverConfig.GetString("LibraryService", String.Empty);
49 string avatarService = serverConfig.GetString("AvatarService", String.Empty);
48 50
49 m_DefaultRegionName = serverConfig.GetString("DefaultRegion", String.Empty); 51 m_DefaultRegionName = serverConfig.GetString("DefaultRegion", String.Empty);
50 m_RemoteSimulationDll = serverConfig.GetString("RemoteSimulationService", String.Empty); 52 m_RemoteSimulationDll = serverConfig.GetString("RemoteSimulationService", String.Empty);
51 m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); 53 m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
52 m_RequireInventory = serverConfig.GetBoolean("RequireInventory", true); 54 m_RequireInventory = serverConfig.GetBoolean("RequireInventory", true);
53 55
54 // These 3 are required; the others aren't 56 // These are required; the others aren't
55 if (accountService == string.Empty || authService == string.Empty || 57 if (accountService == string.Empty || authService == string.Empty)
56 invService == string.Empty)
57 throw new Exception("LoginService is missing service specifications"); 58 throw new Exception("LoginService is missing service specifications");
58 59
59 Object[] args = new Object[] { config }; 60 Object[] args = new Object[] { config };
@@ -64,7 +65,8 @@ namespace OpenSim.Services.LLLoginService
64 m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); 65 m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
65 if (presenceService != string.Empty) 66 if (presenceService != string.Empty)
66 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); 67 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
67 68 if (avatarService != string.Empty)
69 m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args);
68 // 70 //
69 // deal with the services given as argument 71 // deal with the services given as argument
70 // 72 //
@@ -116,6 +118,11 @@ namespace OpenSim.Services.LLLoginService
116 } 118 }
117 119
118 // Get the user's inventory 120 // Get the user's inventory
121 if (m_RequireInventory && m_InventoryService == null)
122 {
123 m_log.WarnFormat("[LLOGIN SERVICE]: Login failed, reason: inventory service not set up");
124 return LLFailedLoginResponse.InventoryProblem;
125 }
119 List<InventoryFolderBase> inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID); 126 List<InventoryFolderBase> inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID);
120 if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0))) 127 if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0)))
121 { 128 {
@@ -159,6 +166,13 @@ namespace OpenSim.Services.LLLoginService
159 return LLFailedLoginResponse.GridProblem; 166 return LLFailedLoginResponse.GridProblem;
160 } 167 }
161 168
169 // Get the avatar
170 AvatarData avatar = null;
171 if (m_AvatarService != null)
172 {
173 avatar = m_AvatarService.GetAvatar(account.PrincipalID);
174 }
175
162 // Instantiate/get the simulation interface and launch an agent at the destination 176 // Instantiate/get the simulation interface and launch an agent at the destination
163 ISimulationService simConnector = null; 177 ISimulationService simConnector = null;
164 string reason = string.Empty; 178 string reason = string.Empty;
@@ -175,7 +189,7 @@ namespace OpenSim.Services.LLLoginService
175 if (simConnector != null) 189 if (simConnector != null)
176 { 190 {
177 circuitCode = (uint)Util.RandomClass.Next(); ; 191 circuitCode = (uint)Util.RandomClass.Next(); ;
178 aCircuit = LaunchAgent(simConnector, destination, account, session, secureSession, circuitCode, position, out reason); 192 aCircuit = LaunchAgent(simConnector, destination, account, avatar, session, secureSession, circuitCode, position, out reason);
179 } 193 }
180 if (aCircuit == null) 194 if (aCircuit == null)
181 { 195 {
@@ -337,16 +351,17 @@ namespace OpenSim.Services.LLLoginService
337 } 351 }
338 352
339 private AgentCircuitData LaunchAgent(ISimulationService simConnector, GridRegion region, UserAccount account, 353 private AgentCircuitData LaunchAgent(ISimulationService simConnector, GridRegion region, UserAccount account,
340 UUID session, UUID secureSession, uint circuit, Vector3 position, out string reason) 354 AvatarData avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, out string reason)
341 { 355 {
342 reason = string.Empty; 356 reason = string.Empty;
343 AgentCircuitData aCircuit = new AgentCircuitData(); 357 AgentCircuitData aCircuit = new AgentCircuitData();
344 358
345 aCircuit.AgentID = account.PrincipalID; 359 aCircuit.AgentID = account.PrincipalID;
346 //aCircuit.Appearance = optional 360 if (avatar != null)
361 aCircuit.Appearance = avatar.ToAvatarAppearance();
347 //aCircuit.BaseFolder = irrelevant 362 //aCircuit.BaseFolder = irrelevant
348 aCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); 363 aCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
349 aCircuit.child = false; 364 aCircuit.child = false; // the first login agent is root
350 aCircuit.circuitcode = circuit; 365 aCircuit.circuitcode = circuit;
351 aCircuit.firstname = account.FirstName; 366 aCircuit.firstname = account.FirstName;
352 //aCircuit.InventoryFolder = irrelevant 367 //aCircuit.InventoryFolder = irrelevant