aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs18
-rw-r--r--OpenSim/Framework/Communications/IUserServiceAdmin.cs7
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs9
-rw-r--r--OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs54
4 files changed, 80 insertions, 8 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 198bd83..1bf8c05 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -261,6 +261,24 @@ namespace OpenSim.Framework.Communications
261 return userProf.ID; 261 return userProf.ID;
262 } 262 }
263 } 263 }
264
265 public UUID AddUser(string firstName, string lastName, string password, uint regX, uint regY, UUID SetUUID)
266 {
267 string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty);
268
269 m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY, SetUUID);
270 UserProfileData userProf = UserService.GetUserProfile(firstName, lastName);
271 if (userProf == null)
272 {
273 return UUID.Zero;
274 }
275 else
276 {
277 InterServiceInventoryService.CreateNewUserInventory(userProf.ID);
278 m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName);
279 return userProf.ID;
280 }
281 }
264 282
265 /// <summary> 283 /// <summary>
266 /// Reset a user password 284 /// Reset a user password
diff --git a/OpenSim/Framework/Communications/IUserServiceAdmin.cs b/OpenSim/Framework/Communications/IUserServiceAdmin.cs
index 9d1ab9f..169385f 100644
--- a/OpenSim/Framework/Communications/IUserServiceAdmin.cs
+++ b/OpenSim/Framework/Communications/IUserServiceAdmin.cs
@@ -35,8 +35,11 @@ namespace OpenSim.Framework.Communications
35 /// Add a new user profile 35 /// Add a new user profile
36 /// </summary> 36 /// </summary>
37 /// <param name="user"></param> 37 /// <param name="user"></param>
38 UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY); 38 UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY);
39 39
40 // Adds one for allowing setting of the UUID from modules.. SHOULD ONLY BE USED in very special circumstances!
41 UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY, UUID setUUID);
42
40 /// <summary> 43 /// <summary>
41 /// Reset a user password 44 /// Reset a user password
42 /// </summary> 45 /// </summary>
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 46a9b67..b7f9f5a 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -546,9 +546,14 @@ namespace OpenSim.Framework.Communications
546 /// <param name="user"></param> 546 /// <param name="user"></param>
547 public UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) 547 public UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
548 { 548 {
549 return AddUserProfile(firstName, lastName, pass, regX, regY, UUID.Random());
550 }
551
552 public UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY, UUID SetUUID)
553 {
549 UserProfileData user = new UserProfileData(); 554 UserProfileData user = new UserProfileData();
550 user.HomeLocation = new Vector3(128, 128, 100); 555 user.HomeLocation = new Vector3(128, 128, 100);
551 user.ID = UUID.Random(); 556 user.ID = SetUUID;
552 user.FirstName = firstName; 557 user.FirstName = firstName;
553 user.SurName = lastName; 558 user.SurName = lastName;
554 user.PasswordHash = pass; 559 user.PasswordHash = pass;
@@ -572,7 +577,7 @@ namespace OpenSim.Framework.Communications
572 577
573 return user.ID; 578 return user.ID;
574 } 579 }
575 580
576 /// <summary> 581 /// <summary>
577 /// Reset a user password 582 /// Reset a user password
578 /// </summary> 583 /// </summary>
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
index 478fbb7..f0737a6 100644
--- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
@@ -37,6 +37,7 @@ using System.Web;
37 37
38using OpenMetaverse; 38using OpenMetaverse;
39using OpenMetaverse.StructuredData; 39using OpenMetaverse.StructuredData;
40using OpenMetaverse.Packets;
40 41
41using log4net; 42using log4net;
42using Nini.Config; 43using Nini.Config;
@@ -94,6 +95,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
94 private string httpsCN = ""; 95 private string httpsCN = "";
95 private bool httpSSL = false; 96 private bool httpSSL = false;
96 private uint httpsslport = 0; 97 private uint httpsslport = 0;
98 private bool GridMode = false;
97 99
98 #region IRegionModule Members 100 #region IRegionModule Members
99 101
@@ -102,6 +104,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
102 bool enabled = false; 104 bool enabled = false;
103 IConfig cfg = null; 105 IConfig cfg = null;
104 IConfig httpcfg = null; 106 IConfig httpcfg = null;
107 IConfig startupcfg = null;
105 try 108 try
106 { 109 {
107 cfg = config.Configs["OpenGridProtocol"]; 110 cfg = config.Configs["OpenGridProtocol"];
@@ -118,6 +121,19 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
118 { 121 {
119 122
120 } 123 }
124 try
125 {
126 startupcfg = config.Configs["Startup"];
127 }
128 catch (NullReferenceException)
129 {
130
131 }
132
133 if (startupcfg != null)
134 {
135 GridMode = enabled = cfg.GetBoolean("gridmode", false);
136 }
121 137
122 if (cfg != null) 138 if (cfg != null)
123 { 139 {
@@ -182,17 +198,18 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
182 // Of interest to this module potentially 198 // Of interest to this module potentially
183 //scene.EventManager.OnNewClient += OnNewClient; 199 //scene.EventManager.OnNewClient += OnNewClient;
184 //scene.EventManager.OnGridInstantMessageToFriendsModule += OnGridInstantMessage; 200 //scene.EventManager.OnGridInstantMessageToFriendsModule += OnGridInstantMessage;
185 //scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; 201 // scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
186 //scene.EventManager.OnMakeChildAgent += MakeChildAgent; 202 //scene.EventManager.OnMakeChildAgent += MakeChildAgent;
187 //scene.EventManager.OnClientClosed += ClientLoggedOut; 203 //scene.EventManager.OnClientClosed += ClientLoggedOut;
188 } 204 }
189 205
190 public void PostInitialise() 206 public void PostInitialise()
191 { 207 {
192 } 208 }
193 209
194 public void Close() 210 public void Close()
195 { 211 {
212 //scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel;
196 } 213 }
197 214
198 public string Name 215 public string Name
@@ -516,8 +533,21 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
516 userProfile.WebLoginKey = UUID.Random(); 533 userProfile.WebLoginKey = UUID.Random();
517 534
518 // Do caps registration 535 // Do caps registration
519 // get seed cap 536 // get seed capagentData.firstname = FirstName;agentData.lastname = LastName;
537 if (homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID) == null && !GridMode)
538 {
539 homeScene.CommsManager.AddUser(agentData.firstname, agentData.lastname, CreateRandomStr(7), homeScene.RegionInfo.RegionLocX, homeScene.RegionInfo.RegionLocY, agentData.AgentID);
540 UserProfileData userProfile2 = homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID);
541 if (userProfile2 != null)
542 {
543 userProfile = userProfile2;
544 userProfile.AboutText = "OGP USER";
545 userProfile.FirstLifeAboutText = "OGP USER";
546 homeScene.CommsManager.UserService.UpdateUserProfile(userProfile);
547 }
520 548
549 }
550
521 // Stick our data in the cache so the region will know something about us 551 // Stick our data in the cache so the region will know something about us
522 homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile); 552 homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile);
523 553
@@ -576,6 +606,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
576 CapsLoginID.Add(rezAvatarPath, agentData); 606 CapsLoginID.Add(rezAvatarPath, agentData);
577 } 607 }
578 } 608 }
609
579 //System.Console.WriteLine("Response:" + responseMap.ToString()); 610 //System.Console.WriteLine("Response:" + responseMap.ToString());
580 return responseMap; 611 return responseMap;
581 } 612 }
@@ -733,6 +764,8 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
733 764
734 responseMap["connect"] = LLSD.FromBoolean(true); 765 responseMap["connect"] = LLSD.FromBoolean(true);
735 766
767
768
736 m_log.InfoFormat("[OGP]: host: {0}, IP {1}", responseMap["sim_host"].ToString(), responseMap["sim_ip"].ToString()); 769 m_log.InfoFormat("[OGP]: host: {0}, IP {1}", responseMap["sim_host"].ToString(), responseMap["sim_ip"].ToString());
737 } 770 }
738 } 771 }
@@ -1162,6 +1195,18 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
1162 } 1195 }
1163 } 1196 }
1164 1197
1198 private string CreateRandomStr(int len)
1199 {
1200 Random rnd = new Random(System.Environment.TickCount);
1201 string returnstring = "";
1202 string chars = "abcdefghijklmnopqrstuvwxyz0123456789";
1203
1204 for (int i = 0; i < len; i++)
1205 {
1206 returnstring += chars.Substring(rnd.Next(chars.Length), 1);
1207 }
1208 return returnstring;
1209 }
1165 // Temporary hack to allow teleporting to and from Vaak 1210 // Temporary hack to allow teleporting to and from Vaak
1166 private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) 1211 private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
1167 { 1212 {
@@ -1206,8 +1251,9 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
1206 } 1251 }
1207 } 1252 }
1208 } 1253 }
1254
1209 } 1255 }
1210 1256
1211 public class MonoCert : ICertificatePolicy 1257 public class MonoCert : ICertificatePolicy
1212 { 1258 {
1213 #region ICertificatePolicy Members 1259 #region ICertificatePolicy Members