diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r-- | OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs | 54 |
1 files changed, 50 insertions, 4 deletions
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 | ||
38 | using OpenMetaverse; | 38 | using OpenMetaverse; |
39 | using OpenMetaverse.StructuredData; | 39 | using OpenMetaverse.StructuredData; |
40 | using OpenMetaverse.Packets; | ||
40 | 41 | ||
41 | using log4net; | 42 | using log4net; |
42 | using Nini.Config; | 43 | using 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 |