diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Services/LLLoginService | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to 'OpenSim/Services/LLLoginService')
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginResponse.cs | 83 | ||||
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginService.cs | 166 | ||||
-rw-r--r-- | OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs | 4 |
3 files changed, 201 insertions, 52 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 9ec744f..c3756d0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -190,6 +190,8 @@ namespace OpenSim.Services.LLLoginService | |||
190 | private BuddyList m_buddyList = null; | 190 | private BuddyList m_buddyList = null; |
191 | 191 | ||
192 | private string currency; | 192 | private string currency; |
193 | private string classifiedFee; | ||
194 | private int maxAgentGroups; | ||
193 | 195 | ||
194 | static LLLoginResponse() | 196 | static LLLoginResponse() |
195 | { | 197 | { |
@@ -226,8 +228,8 @@ namespace OpenSim.Services.LLLoginService | |||
226 | public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, | 228 | public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, |
227 | GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, | 229 | GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, |
228 | string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, | 230 | string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, |
229 | GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency, | 231 | GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL, string currency, |
230 | string DSTZone) | 232 | string DSTZone, string destinationsURL, string avatarsURL, string classifiedFee, int maxAgentGroups) |
231 | : this() | 233 | : this() |
232 | { | 234 | { |
233 | FillOutInventoryData(invSkel, libService); | 235 | FillOutInventoryData(invSkel, libService); |
@@ -246,14 +248,19 @@ namespace OpenSim.Services.LLLoginService | |||
246 | MapTileURL = mapTileURL; | 248 | MapTileURL = mapTileURL; |
247 | ProfileURL = profileURL; | 249 | ProfileURL = profileURL; |
248 | OpenIDURL = openIDURL; | 250 | OpenIDURL = openIDURL; |
251 | DestinationsURL = destinationsURL; | ||
252 | AvatarsURL = avatarsURL; | ||
249 | 253 | ||
250 | SearchURL = searchURL; | 254 | SearchURL = searchURL; |
251 | Currency = currency; | 255 | Currency = currency; |
256 | ClassifiedFee = classifiedFee; | ||
257 | MaxAgentGroups = maxAgentGroups; | ||
252 | 258 | ||
253 | FillOutHomeData(pinfo, home); | 259 | FillOutHomeData(pinfo, home); |
254 | LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); | 260 | LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); |
255 | 261 | ||
256 | FillOutRegionData(destination); | 262 | FillOutRegionData(destination); |
263 | m_log.DebugFormat("[LOGIN RESPONSE] LLLoginResponse create. sizeX={0}, sizeY={1}", RegionSizeX, RegionSizeY); | ||
257 | 264 | ||
258 | FillOutSeedCap(aCircuit, destination, clientIP); | 265 | FillOutSeedCap(aCircuit, destination, clientIP); |
259 | 266 | ||
@@ -356,7 +363,8 @@ namespace OpenSim.Services.LLLoginService | |||
356 | 363 | ||
357 | private void FillOutHomeData(GridUserInfo pinfo, GridRegion home) | 364 | private void FillOutHomeData(GridUserInfo pinfo, GridRegion home) |
358 | { | 365 | { |
359 | int x = 1000 * (int)Constants.RegionSize, y = 1000 * (int)Constants.RegionSize; | 366 | int x = (int)Util.RegionToWorldLoc(1000); |
367 | int y = (int)Util.RegionToWorldLoc(1000); | ||
360 | if (home != null) | 368 | if (home != null) |
361 | { | 369 | { |
362 | x = home.RegionLocX; | 370 | x = home.RegionLocX; |
@@ -379,6 +387,8 @@ namespace OpenSim.Services.LLLoginService | |||
379 | SimPort = (uint)endPoint.Port; | 387 | SimPort = (uint)endPoint.Port; |
380 | RegionX = (uint)destination.RegionLocX; | 388 | RegionX = (uint)destination.RegionLocX; |
381 | RegionY = (uint)destination.RegionLocY; | 389 | RegionY = (uint)destination.RegionLocY; |
390 | RegionSizeX = destination.RegionSizeX; | ||
391 | RegionSizeY = destination.RegionSizeY; | ||
382 | } | 392 | } |
383 | 393 | ||
384 | private void FillOutSeedCap(AgentCircuitData aCircuit, GridRegion destination, IPEndPoint ipepClient) | 394 | private void FillOutSeedCap(AgentCircuitData aCircuit, GridRegion destination, IPEndPoint ipepClient) |
@@ -428,10 +438,23 @@ namespace OpenSim.Services.LLLoginService | |||
428 | ErrorReason = "key"; | 438 | ErrorReason = "key"; |
429 | welcomeMessage = "Welcome to OpenSim!"; | 439 | welcomeMessage = "Welcome to OpenSim!"; |
430 | seedCapability = String.Empty; | 440 | seedCapability = String.Empty; |
431 | home = "{'region_handle':[r" + (1000*Constants.RegionSize).ToString() + ",r" + (1000*Constants.RegionSize).ToString() + "], 'position':[r" + | 441 | home = "{'region_handle':[" |
432 | userProfile.homepos.X.ToString() + ",r" + userProfile.homepos.Y.ToString() + ",r" + | 442 | + "r" + Util.RegionToWorldLoc(1000).ToString() |
433 | userProfile.homepos.Z.ToString() + "], 'look_at':[r" + userProfile.homelookat.X.ToString() + ",r" + | 443 | + "," |
434 | userProfile.homelookat.Y.ToString() + ",r" + userProfile.homelookat.Z.ToString() + "]}"; | 444 | + "r" + Util.RegionToWorldLoc(1000).ToString() |
445 | + "], 'position':[" | ||
446 | + "r" + userProfile.homepos.X.ToString() | ||
447 | + "," | ||
448 | + "r" + userProfile.homepos.Y.ToString() | ||
449 | + "," | ||
450 | + "r" + userProfile.homepos.Z.ToString() | ||
451 | + "], 'look_at':[" | ||
452 | + "r" + userProfile.homelookat.X.ToString() | ||
453 | + "," | ||
454 | + "r" + userProfile.homelookat.Y.ToString() | ||
455 | + "," | ||
456 | + "r" + userProfile.homelookat.Z.ToString() | ||
457 | + "]}"; | ||
435 | lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; | 458 | lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; |
436 | RegionX = (uint) 255232; | 459 | RegionX = (uint) 255232; |
437 | RegionY = (uint) 254976; | 460 | RegionY = (uint) 254976; |
@@ -461,6 +484,8 @@ namespace OpenSim.Services.LLLoginService | |||
461 | searchURL = String.Empty; | 484 | searchURL = String.Empty; |
462 | 485 | ||
463 | currency = String.Empty; | 486 | currency = String.Empty; |
487 | ClassifiedFee = "0"; | ||
488 | MaxAgentGroups = 42; | ||
464 | } | 489 | } |
465 | 490 | ||
466 | 491 | ||
@@ -520,9 +545,13 @@ namespace OpenSim.Services.LLLoginService | |||
520 | responseData["seed_capability"] = seedCapability; | 545 | responseData["seed_capability"] = seedCapability; |
521 | responseData["home"] = home; | 546 | responseData["home"] = home; |
522 | responseData["look_at"] = lookAt; | 547 | responseData["look_at"] = lookAt; |
548 | responseData["max-agent-groups"] = MaxAgentGroups; | ||
523 | responseData["message"] = welcomeMessage; | 549 | responseData["message"] = welcomeMessage; |
524 | responseData["region_x"] = (Int32)(RegionX); | 550 | responseData["region_x"] = (Int32)(RegionX); |
525 | responseData["region_y"] = (Int32)(RegionY); | 551 | responseData["region_y"] = (Int32)(RegionY); |
552 | responseData["region_size_x"] = (Int32)RegionSizeX; | ||
553 | responseData["region_size_y"] = (Int32)RegionSizeY; | ||
554 | m_log.DebugFormat("[LOGIN RESPONSE] returning sizeX={0}, sizeY={1}", RegionSizeX, RegionSizeY); | ||
526 | 555 | ||
527 | if (searchURL != String.Empty) | 556 | if (searchURL != String.Empty) |
528 | responseData["search"] = searchURL; | 557 | responseData["search"] = searchURL; |
@@ -533,6 +562,12 @@ namespace OpenSim.Services.LLLoginService | |||
533 | if (profileURL != String.Empty) | 562 | if (profileURL != String.Empty) |
534 | responseData["profile-server-url"] = profileURL; | 563 | responseData["profile-server-url"] = profileURL; |
535 | 564 | ||
565 | if (DestinationsURL != String.Empty) | ||
566 | responseData["destination_guide_url"] = DestinationsURL; | ||
567 | |||
568 | if (AvatarsURL != String.Empty) | ||
569 | responseData["avatar_picker_url"] = AvatarsURL; | ||
570 | |||
536 | // We need to send an openid_token back in the response too | 571 | // We need to send an openid_token back in the response too |
537 | if (openIDURL != String.Empty) | 572 | if (openIDURL != String.Empty) |
538 | responseData["openid_url"] = openIDURL; | 573 | responseData["openid_url"] = openIDURL; |
@@ -547,6 +582,9 @@ namespace OpenSim.Services.LLLoginService | |||
547 | // responseData["real_currency"] = currency; | 582 | // responseData["real_currency"] = currency; |
548 | responseData["currency"] = currency; | 583 | responseData["currency"] = currency; |
549 | } | 584 | } |
585 | |||
586 | if (ClassifiedFee != String.Empty) | ||
587 | responseData["classified_fee"] = ClassifiedFee; | ||
550 | 588 | ||
551 | responseData["login"] = "true"; | 589 | responseData["login"] = "true"; |
552 | 590 | ||
@@ -635,6 +673,7 @@ namespace OpenSim.Services.LLLoginService | |||
635 | map["seed_capability"] = OSD.FromString(seedCapability); | 673 | map["seed_capability"] = OSD.FromString(seedCapability); |
636 | map["home"] = OSD.FromString(home); | 674 | map["home"] = OSD.FromString(home); |
637 | map["look_at"] = OSD.FromString(lookAt); | 675 | map["look_at"] = OSD.FromString(lookAt); |
676 | map["max-agent-groups"] = OSD.FromInteger(MaxAgentGroups); | ||
638 | map["message"] = OSD.FromString(welcomeMessage); | 677 | map["message"] = OSD.FromString(welcomeMessage); |
639 | map["region_x"] = OSD.FromInteger(RegionX); | 678 | map["region_x"] = OSD.FromInteger(RegionX); |
640 | map["region_y"] = OSD.FromInteger(RegionY); | 679 | map["region_y"] = OSD.FromInteger(RegionY); |
@@ -651,6 +690,9 @@ namespace OpenSim.Services.LLLoginService | |||
651 | if (searchURL != String.Empty) | 690 | if (searchURL != String.Empty) |
652 | map["search"] = OSD.FromString(searchURL); | 691 | map["search"] = OSD.FromString(searchURL); |
653 | 692 | ||
693 | if (ClassifiedFee != String.Empty) | ||
694 | map["classified_fee"] = OSD.FromString(ClassifiedFee); | ||
695 | |||
654 | if (m_buddyList != null) | 696 | if (m_buddyList != null) |
655 | { | 697 | { |
656 | map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); | 698 | map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); |
@@ -746,7 +788,7 @@ namespace OpenSim.Services.LLLoginService | |||
746 | Hashtable TempHash; | 788 | Hashtable TempHash; |
747 | foreach (InventoryFolderBase InvFolder in folders) | 789 | foreach (InventoryFolderBase InvFolder in folders) |
748 | { | 790 | { |
749 | if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == "My Inventory") | 791 | if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == InventoryFolderBase.ROOT_FOLDER_NAME) |
750 | { | 792 | { |
751 | rootID = InvFolder.ID; | 793 | rootID = InvFolder.ID; |
752 | } | 794 | } |
@@ -900,6 +942,9 @@ namespace OpenSim.Services.LLLoginService | |||
900 | set { regionY = value; } | 942 | set { regionY = value; } |
901 | } | 943 | } |
902 | 944 | ||
945 | public int RegionSizeX { get; private set; } | ||
946 | public int RegionSizeY { get; private set; } | ||
947 | |||
903 | public string SunTexture | 948 | public string SunTexture |
904 | { | 949 | { |
905 | get { return sunTexture; } | 950 | get { return sunTexture; } |
@@ -1056,6 +1101,28 @@ namespace OpenSim.Services.LLLoginService | |||
1056 | set { currency = value; } | 1101 | set { currency = value; } |
1057 | } | 1102 | } |
1058 | 1103 | ||
1104 | public string ClassifiedFee | ||
1105 | { | ||
1106 | get { return classifiedFee; } | ||
1107 | set { classifiedFee = value; } | ||
1108 | } | ||
1109 | |||
1110 | public int MaxAgentGroups | ||
1111 | { | ||
1112 | get { return maxAgentGroups; } | ||
1113 | set { maxAgentGroups = value; } | ||
1114 | } | ||
1115 | |||
1116 | public string DestinationsURL | ||
1117 | { | ||
1118 | get; set; | ||
1119 | } | ||
1120 | |||
1121 | public string AvatarsURL | ||
1122 | { | ||
1123 | get; set; | ||
1124 | } | ||
1125 | |||
1059 | #endregion | 1126 | #endregion |
1060 | 1127 | ||
1061 | public class UserInfo | 1128 | public class UserInfo |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 59fb559..0b38738 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -50,12 +50,15 @@ namespace OpenSim.Services.LLLoginService | |||
50 | public class LLLoginService : ILoginService | 50 | public class LLLoginService : ILoginService |
51 | { | 51 | { |
52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
53 | private static readonly string LogHeader = "[LLOGIN SERVICE]"; | ||
54 | |||
53 | private static bool Initialized = false; | 55 | private static bool Initialized = false; |
54 | 56 | ||
55 | protected IUserAccountService m_UserAccountService; | 57 | protected IUserAccountService m_UserAccountService; |
56 | protected IGridUserService m_GridUserService; | 58 | protected IGridUserService m_GridUserService; |
57 | protected IAuthenticationService m_AuthenticationService; | 59 | protected IAuthenticationService m_AuthenticationService; |
58 | protected IInventoryService m_InventoryService; | 60 | protected IInventoryService m_InventoryService; |
61 | protected IInventoryService m_HGInventoryService; | ||
59 | protected IGridService m_GridService; | 62 | protected IGridService m_GridService; |
60 | protected IPresenceService m_PresenceService; | 63 | protected IPresenceService m_PresenceService; |
61 | protected ISimulationService m_LocalSimulationService; | 64 | protected ISimulationService m_LocalSimulationService; |
@@ -74,14 +77,15 @@ namespace OpenSim.Services.LLLoginService | |||
74 | protected string m_GatekeeperURL; | 77 | protected string m_GatekeeperURL; |
75 | protected bool m_AllowRemoteSetLoginLevel; | 78 | protected bool m_AllowRemoteSetLoginLevel; |
76 | protected string m_MapTileURL; | 79 | protected string m_MapTileURL; |
77 | protected string m_ProfileURL; | ||
78 | protected string m_OpenIDURL; | ||
79 | protected string m_SearchURL; | 80 | protected string m_SearchURL; |
80 | protected string m_Currency; | 81 | protected string m_Currency; |
81 | 82 | protected string m_ClassifiedFee; | |
83 | protected int m_MaxAgentGroups; | ||
84 | protected string m_DestinationGuide; | ||
85 | protected string m_AvatarPicker; | ||
82 | protected string m_AllowedClients; | 86 | protected string m_AllowedClients; |
83 | protected string m_DeniedClients; | 87 | protected string m_DeniedClients; |
84 | 88 | protected string m_MessageUrl; | |
85 | protected string m_DSTZone; | 89 | protected string m_DSTZone; |
86 | 90 | ||
87 | IConfig m_LoginServerConfig; | 91 | IConfig m_LoginServerConfig; |
@@ -110,18 +114,29 @@ namespace OpenSim.Services.LLLoginService | |||
110 | m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true); | 114 | m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true); |
111 | m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); | 115 | m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); |
112 | m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); | 116 | m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); |
113 | m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); | 117 | m_GatekeeperURL = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", |
118 | new string[] { "Startup", "Hypergrid", "LoginService" }, String.Empty); | ||
114 | m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); | 119 | m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); |
115 | m_ProfileURL = m_LoginServerConfig.GetString("ProfileServerURL", string.Empty); | ||
116 | m_OpenIDURL = m_LoginServerConfig.GetString("OpenIDServerURL", String.Empty); | ||
117 | m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); | 120 | m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); |
118 | m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty); | 121 | m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty); |
122 | m_ClassifiedFee = m_LoginServerConfig.GetString("ClassifiedFee", string.Empty); | ||
123 | m_DestinationGuide = m_LoginServerConfig.GetString ("DestinationGuide", string.Empty); | ||
124 | m_AvatarPicker = m_LoginServerConfig.GetString ("AvatarPicker", string.Empty); | ||
119 | 125 | ||
120 | m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty); | 126 | string[] possibleAccessControlConfigSections = new string[] { "AccessControl", "LoginService" }; |
121 | m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty); | 127 | m_AllowedClients = Util.GetConfigVarFromSections<string>( |
128 | config, "AllowedClients", possibleAccessControlConfigSections, string.Empty); | ||
129 | m_DeniedClients = Util.GetConfigVarFromSections<string>( | ||
130 | config, "DeniedClients", possibleAccessControlConfigSections, string.Empty); | ||
122 | 131 | ||
132 | m_MessageUrl = m_LoginServerConfig.GetString("MessageUrl", string.Empty); | ||
123 | m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time"); | 133 | m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time"); |
124 | 134 | ||
135 | IConfig groupConfig = config.Configs["Groups"]; | ||
136 | if (groupConfig != null) | ||
137 | m_MaxAgentGroups = groupConfig.GetInt("MaxAgentGroups", 42); | ||
138 | |||
139 | |||
125 | // Clean up some of these vars | 140 | // Clean up some of these vars |
126 | if (m_MapTileURL != String.Empty) | 141 | if (m_MapTileURL != String.Empty) |
127 | { | 142 | { |
@@ -156,6 +171,15 @@ namespace OpenSim.Services.LLLoginService | |||
156 | if (agentService != string.Empty) | 171 | if (agentService != string.Empty) |
157 | m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(agentService, args); | 172 | m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(agentService, args); |
158 | 173 | ||
174 | // Get the Hypergrid inventory service (exists only if Hypergrid is enabled) | ||
175 | string hgInvServicePlugin = m_LoginServerConfig.GetString("HGInventoryServicePlugin", String.Empty); | ||
176 | if (hgInvServicePlugin != string.Empty) | ||
177 | { | ||
178 | string hgInvServiceArg = m_LoginServerConfig.GetString("HGInventoryServiceConstructorArg", String.Empty); | ||
179 | Object[] args2 = new Object[] { config, hgInvServiceArg }; | ||
180 | m_HGInventoryService = ServerUtils.LoadPlugin<IInventoryService>(hgInvServicePlugin, args2); | ||
181 | } | ||
182 | |||
159 | // | 183 | // |
160 | // deal with the services given as argument | 184 | // deal with the services given as argument |
161 | // | 185 | // |
@@ -241,6 +265,7 @@ namespace OpenSim.Services.LLLoginService | |||
241 | { | 265 | { |
242 | bool success = false; | 266 | bool success = false; |
243 | UUID session = UUID.Random(); | 267 | UUID session = UUID.Random(); |
268 | string processedMessage; | ||
244 | 269 | ||
245 | m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}", | 270 | m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}", |
246 | firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0); | 271 | firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0); |
@@ -341,6 +366,13 @@ namespace OpenSim.Services.LLLoginService | |||
341 | return LLFailedLoginResponse.InventoryProblem; | 366 | return LLFailedLoginResponse.InventoryProblem; |
342 | } | 367 | } |
343 | 368 | ||
369 | if (m_HGInventoryService != null) | ||
370 | { | ||
371 | // Give the Suitcase service a chance to create the suitcase folder. | ||
372 | // (If we're not using the Suitcase inventory service then this won't do anything.) | ||
373 | m_HGInventoryService.GetRootFolder(account.PrincipalID); | ||
374 | } | ||
375 | |||
344 | List<InventoryFolderBase> inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID); | 376 | List<InventoryFolderBase> inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID); |
345 | if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0))) | 377 | if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0))) |
346 | { | 378 | { |
@@ -375,13 +407,33 @@ namespace OpenSim.Services.LLLoginService | |||
375 | // | 407 | // |
376 | GridRegion home = null; | 408 | GridRegion home = null; |
377 | GridUserInfo guinfo = m_GridUserService.LoggedIn(account.PrincipalID.ToString()); | 409 | GridUserInfo guinfo = m_GridUserService.LoggedIn(account.PrincipalID.ToString()); |
378 | if (guinfo != null && (guinfo.HomeRegionID != UUID.Zero) && m_GridService != null) | 410 | |
411 | // We are only going to complain about no home if the user actually tries to login there, to avoid | ||
412 | // spamming the console. | ||
413 | if (guinfo != null) | ||
379 | { | 414 | { |
380 | home = m_GridService.GetRegionByUUID(scopeID, guinfo.HomeRegionID); | 415 | if (guinfo.HomeRegionID == UUID.Zero && startLocation == "home") |
416 | { | ||
417 | m_log.WarnFormat( | ||
418 | "[LLOGIN SERVICE]: User {0} tried to login to a 'home' start location but they have none set", | ||
419 | account.Name); | ||
420 | } | ||
421 | else if (m_GridService != null) | ||
422 | { | ||
423 | home = m_GridService.GetRegionByUUID(scopeID, guinfo.HomeRegionID); | ||
424 | |||
425 | if (home == null && startLocation == "home") | ||
426 | { | ||
427 | m_log.WarnFormat( | ||
428 | "[LLOGIN SERVICE]: User {0} tried to login to a 'home' start location with ID {1} but this was not found.", | ||
429 | account.Name, guinfo.HomeRegionID); | ||
430 | } | ||
431 | } | ||
381 | } | 432 | } |
382 | if (guinfo == null) | 433 | else |
383 | { | 434 | { |
384 | // something went wrong, make something up, so that we don't have to test this anywhere else | 435 | // something went wrong, make something up, so that we don't have to test this anywhere else |
436 | m_log.DebugFormat("{0} Failed to fetch GridUserInfo. Creating empty GridUserInfo as home", LogHeader); | ||
385 | guinfo = new GridUserInfo(); | 437 | guinfo = new GridUserInfo(); |
386 | guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30); | 438 | guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30); |
387 | } | 439 | } |
@@ -448,16 +500,28 @@ namespace OpenSim.Services.LLLoginService | |||
448 | // | 500 | // |
449 | // Finally, fill out the response and return it | 501 | // Finally, fill out the response and return it |
450 | // | 502 | // |
503 | if (m_MessageUrl != String.Empty) | ||
504 | { | ||
505 | WebClient client = new WebClient(); | ||
506 | processedMessage = client.DownloadString(m_MessageUrl); | ||
507 | } | ||
508 | else | ||
509 | { | ||
510 | processedMessage = m_WelcomeMessage; | ||
511 | } | ||
512 | processedMessage = processedMessage.Replace("\\n", "\n").Replace("<USERNAME>", firstName + " " + lastName); | ||
513 | |||
451 | LLLoginResponse response | 514 | LLLoginResponse response |
452 | = new LLLoginResponse( | 515 | = new LLLoginResponse( |
453 | account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, | 516 | account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, |
454 | where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, | 517 | where, startLocation, position, lookAt, gestures, processedMessage, home, clientIP, |
455 | m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone); | 518 | m_MapTileURL, m_SearchURL, m_Currency, m_DSTZone, |
519 | m_DestinationGuide, m_AvatarPicker, m_ClassifiedFee, m_MaxAgentGroups); | ||
456 | 520 | ||
457 | m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName); | 521 | m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName); |
458 | 522 | ||
459 | return response; | 523 | return response; |
460 | } | 524 | } |
461 | catch (Exception e) | 525 | catch (Exception e) |
462 | { | 526 | { |
463 | m_log.WarnFormat("[LLOGIN SERVICE]: Exception processing login for {0} {1}: {2} {3}", firstName, lastName, e.ToString(), e.StackTrace); | 527 | m_log.WarnFormat("[LLOGIN SERVICE]: Exception processing login for {0} {1}: {2} {3}", firstName, lastName, e.ToString(), e.StackTrace); |
@@ -498,10 +562,6 @@ namespace OpenSim.Services.LLLoginService | |||
498 | 562 | ||
499 | if (home == null) | 563 | if (home == null) |
500 | { | 564 | { |
501 | m_log.WarnFormat( | ||
502 | "[LLOGIN SERVICE]: User {0} {1} tried to login to a 'home' start location but they have none set", | ||
503 | account.FirstName, account.LastName); | ||
504 | |||
505 | tryDefaults = true; | 565 | tryDefaults = true; |
506 | } | 566 | } |
507 | else | 567 | else |
@@ -576,7 +636,7 @@ namespace OpenSim.Services.LLLoginService | |||
576 | // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 | 636 | // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 |
577 | where = "url"; | 637 | where = "url"; |
578 | GridRegion region = null; | 638 | GridRegion region = null; |
579 | Regex reURI = new Regex(@"^uri:(?<region>[^&]+)&(?<x>\d+)&(?<y>\d+)&(?<z>\d+)$"); | 639 | Regex reURI = new Regex(@"^uri:(?<region>[^&]+)&(?<x>\d+[.]?\d*)&(?<y>\d+[.]?\d*)&(?<z>\d+[.]?\d*)$"); |
580 | Match uriMatch = reURI.Match(startLocation); | 640 | Match uriMatch = reURI.Match(startLocation); |
581 | if (uriMatch == null) | 641 | if (uriMatch == null) |
582 | { | 642 | { |
@@ -645,8 +705,7 @@ namespace OpenSim.Services.LLLoginService | |||
645 | if (parts.Length > 1) | 705 | if (parts.Length > 1) |
646 | UInt32.TryParse(parts[1], out port); | 706 | UInt32.TryParse(parts[1], out port); |
647 | 707 | ||
648 | // GridRegion region = FindForeignRegion(domainName, port, regionName, out gatekeeper); | 708 | region = FindForeignRegion(domainName, port, regionName, account, out gatekeeper); |
649 | region = FindForeignRegion(domainName, port, regionName, out gatekeeper); | ||
650 | return region; | 709 | return region; |
651 | } | 710 | } |
652 | } | 711 | } |
@@ -673,7 +732,7 @@ namespace OpenSim.Services.LLLoginService | |||
673 | private GridRegion FindAlternativeRegion(UUID scopeID) | 732 | private GridRegion FindAlternativeRegion(UUID scopeID) |
674 | { | 733 | { |
675 | List<GridRegion> hyperlinks = null; | 734 | List<GridRegion> hyperlinks = null; |
676 | List<GridRegion> regions = m_GridService.GetFallbackRegions(scopeID, 1000 * (int)Constants.RegionSize, 1000 * (int)Constants.RegionSize); | 735 | List<GridRegion> regions = m_GridService.GetFallbackRegions(scopeID, (int)Util.RegionToWorldLoc(1000), (int)Util.RegionToWorldLoc(1000)); |
677 | if (regions != null && regions.Count > 0) | 736 | if (regions != null && regions.Count > 0) |
678 | { | 737 | { |
679 | hyperlinks = m_GridService.GetHyperlinks(scopeID); | 738 | hyperlinks = m_GridService.GetHyperlinks(scopeID); |
@@ -695,7 +754,7 @@ namespace OpenSim.Services.LLLoginService | |||
695 | return null; | 754 | return null; |
696 | } | 755 | } |
697 | 756 | ||
698 | private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper) | 757 | private GridRegion FindForeignRegion(string domainName, uint port, string regionName, UserAccount account, out GridRegion gatekeeper) |
699 | { | 758 | { |
700 | m_log.Debug("[LLLOGIN SERVICE]: attempting to findforeignregion " + domainName + ":" + port.ToString() + ":" + regionName); | 759 | m_log.Debug("[LLLOGIN SERVICE]: attempting to findforeignregion " + domainName + ":" + port.ToString() + ":" + regionName); |
701 | gatekeeper = new GridRegion(); | 760 | gatekeeper = new GridRegion(); |
@@ -707,9 +766,14 @@ namespace OpenSim.Services.LLLoginService | |||
707 | UUID regionID; | 766 | UUID regionID; |
708 | ulong handle; | 767 | ulong handle; |
709 | string imageURL = string.Empty, reason = string.Empty; | 768 | string imageURL = string.Empty, reason = string.Empty; |
769 | string message; | ||
710 | if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason)) | 770 | if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason)) |
711 | { | 771 | { |
712 | GridRegion destination = m_GatekeeperConnector.GetHyperlinkRegion(gatekeeper, regionID); | 772 | string homeURI = null; |
773 | if (account.ServiceURLs != null && account.ServiceURLs.ContainsKey("HomeURI")) | ||
774 | homeURI = (string)account.ServiceURLs["HomeURI"]; | ||
775 | |||
776 | GridRegion destination = m_GatekeeperConnector.GetHyperlinkRegion(gatekeeper, regionID, account.PrincipalID, homeURI, out message); | ||
713 | return destination; | 777 | return destination; |
714 | } | 778 | } |
715 | 779 | ||
@@ -858,13 +922,6 @@ namespace OpenSim.Services.LLLoginService | |||
858 | SetServiceURLs(aCircuit, account); | 922 | SetServiceURLs(aCircuit, account); |
859 | 923 | ||
860 | return aCircuit; | 924 | return aCircuit; |
861 | |||
862 | //m_UserAgentService.LoginAgentToGrid(aCircuit, GatekeeperServiceConnector, region, out reason); | ||
863 | //if (simConnector.CreateAgent(region, aCircuit, 0, out reason)) | ||
864 | // return aCircuit; | ||
865 | |||
866 | //return null; | ||
867 | |||
868 | } | 925 | } |
869 | 926 | ||
870 | private void SetServiceURLs(AgentCircuitData aCircuit, UserAccount account) | 927 | private void SetServiceURLs(AgentCircuitData aCircuit, UserAccount account) |
@@ -899,7 +956,7 @@ namespace OpenSim.Services.LLLoginService | |||
899 | if (!keyValue.EndsWith("/")) | 956 | if (!keyValue.EndsWith("/")) |
900 | keyValue = keyValue + "/"; | 957 | keyValue = keyValue + "/"; |
901 | 958 | ||
902 | if (!account.ServiceURLs.ContainsKey(keyName) || (account.ServiceURLs.ContainsKey(keyName) && account.ServiceURLs[keyName] != keyValue)) | 959 | if (!account.ServiceURLs.ContainsKey(keyName) || (account.ServiceURLs.ContainsKey(keyName) && (string)account.ServiceURLs[keyName] != keyValue)) |
903 | { | 960 | { |
904 | account.ServiceURLs[keyName] = keyValue; | 961 | account.ServiceURLs[keyName] = keyValue; |
905 | newUrls = true; | 962 | newUrls = true; |
@@ -909,6 +966,13 @@ namespace OpenSim.Services.LLLoginService | |||
909 | m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); | 966 | m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); |
910 | } | 967 | } |
911 | 968 | ||
969 | if (!account.ServiceURLs.ContainsKey("GatekeeperURI") && !string.IsNullOrEmpty(m_GatekeeperURL)) | ||
970 | { | ||
971 | m_log.DebugFormat("[LLLOGIN SERVICE]: adding gatekeeper uri {0}", m_GatekeeperURL); | ||
972 | account.ServiceURLs["GatekeeperURI"] = m_GatekeeperURL; | ||
973 | newUrls = true; | ||
974 | } | ||
975 | |||
912 | // The grid operator decided to override the defaults in the | 976 | // The grid operator decided to override the defaults in the |
913 | // [LoginService] configuration. Let's store the correct ones. | 977 | // [LoginService] configuration. Let's store the correct ones. |
914 | if (newUrls) | 978 | if (newUrls) |
@@ -919,13 +983,20 @@ namespace OpenSim.Services.LLLoginService | |||
919 | 983 | ||
920 | private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) | 984 | private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) |
921 | { | 985 | { |
922 | return simConnector.CreateAgent(region, aCircuit, (uint)flags, out reason); | 986 | EntityTransferContext ctx = new EntityTransferContext(); |
987 | |||
988 | if (!simConnector.QueryAccess( | ||
989 | region, aCircuit.AgentID, null, true, aCircuit.startpos, new List<UUID>(), ctx, out reason)) | ||
990 | return false; | ||
991 | |||
992 | return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason); | ||
923 | } | 993 | } |
924 | 994 | ||
925 | private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) | 995 | private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) |
926 | { | 996 | { |
927 | m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); | 997 | m_log.Debug("[LLOGIN SERVICE]: Launching agent at " + destination.RegionName); |
928 | if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, clientIP, out reason)) | 998 | |
999 | if (m_UserAgentService.LoginAgentToGrid(null, aCircuit, gatekeeper, destination, true, out reason)) | ||
929 | return true; | 1000 | return true; |
930 | return false; | 1001 | return false; |
931 | } | 1002 | } |
@@ -961,14 +1032,25 @@ namespace OpenSim.Services.LLLoginService | |||
961 | // or fixing critical issues | 1032 | // or fixing critical issues |
962 | // | 1033 | // |
963 | if (cmd.Length > 2) | 1034 | if (cmd.Length > 2) |
964 | Int32.TryParse(cmd[2], out m_MinLoginLevel); | 1035 | { |
1036 | if (Int32.TryParse(cmd[2], out m_MinLoginLevel)) | ||
1037 | MainConsole.Instance.OutputFormat("Set minimum login level to {0}", m_MinLoginLevel); | ||
1038 | else | ||
1039 | MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid login level", cmd[2]); | ||
1040 | } | ||
965 | break; | 1041 | break; |
966 | case "reset": | 1042 | |
1043 | case "reset": | ||
967 | m_MinLoginLevel = 0; | 1044 | m_MinLoginLevel = 0; |
1045 | MainConsole.Instance.OutputFormat("Reset min login level to {0}", m_MinLoginLevel); | ||
968 | break; | 1046 | break; |
1047 | |||
969 | case "text": | 1048 | case "text": |
970 | if (cmd.Length > 2) | 1049 | if (cmd.Length > 2) |
1050 | { | ||
971 | m_WelcomeMessage = cmd[2]; | 1051 | m_WelcomeMessage = cmd[2]; |
1052 | MainConsole.Instance.OutputFormat("Login welcome message set to '{0}'", m_WelcomeMessage); | ||
1053 | } | ||
972 | break; | 1054 | break; |
973 | } | 1055 | } |
974 | } | 1056 | } |
diff --git a/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs b/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs index 62c6e0f..5c150e3 100644 --- a/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs +++ b/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs | |||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices; | |||
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | [assembly: AssemblyVersion("0.7.5.*")] | 32 | [assembly: AssemblyVersion("0.8.3.*")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | |