diff options
author | diva | 2009-03-21 19:37:35 +0000 |
---|---|---|
committer | diva | 2009-03-21 19:37:35 +0000 |
commit | b140988a1fdb182473b490a6671fd0853f335838 (patch) | |
tree | 8597a08833037b5e22e82634648140227f0409d4 /OpenSim/Region/CoreModules | |
parent | Add code to the inventory transfer module to use the new DB functionality (diff) | |
download | opensim-SC-b140988a1fdb182473b490a6671fd0853f335838.zip opensim-SC-b140988a1fdb182473b490a6671fd0853f335838.tar.gz opensim-SC-b140988a1fdb182473b490a6671fd0853f335838.tar.bz2 opensim-SC-b140988a1fdb182473b490a6671fd0853f335838.tar.xz |
Minor changes in names inside.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Services/RegionAssetService.cs | 76 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Services/RegionMapService.cs | 8 |
2 files changed, 6 insertions, 78 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Services/RegionAssetService.cs b/OpenSim/Region/CoreModules/Framework/Services/RegionAssetService.cs index 629c9c0..ff506bf 100644 --- a/OpenSim/Region/CoreModules/Framework/Services/RegionAssetService.cs +++ b/OpenSim/Region/CoreModules/Framework/Services/RegionAssetService.cs | |||
@@ -48,7 +48,6 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
48 | private static bool enabled = false; | 48 | private static bool enabled = false; |
49 | 49 | ||
50 | Scene m_scene; | 50 | Scene m_scene; |
51 | //AssetService m_assetService; | ||
52 | 51 | ||
53 | #region IRegionModule interface | 52 | #region IRegionModule interface |
54 | 53 | ||
@@ -68,9 +67,8 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
68 | { | 67 | { |
69 | if (enabled) | 68 | if (enabled) |
70 | { | 69 | { |
71 | m_log.Info("[HGStandaloneAssetService]: Starting..."); | 70 | m_log.Info("[RegionAssetService]: Starting..."); |
72 | 71 | ||
73 | //m_assetService = new AssetService(m_scene); | ||
74 | new AssetService(m_scene); | 72 | new AssetService(m_scene); |
75 | } | 73 | } |
76 | } | 74 | } |
@@ -81,7 +79,7 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
81 | 79 | ||
82 | public string Name | 80 | public string Name |
83 | { | 81 | { |
84 | get { return "HGStandaloneAssetService"; } | 82 | get { return "RegionAssetService"; } |
85 | } | 83 | } |
86 | 84 | ||
87 | public bool IsSharedModule | 85 | public bool IsSharedModule |
@@ -122,75 +120,5 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
122 | httpServer.AddStreamHandler(new PostAssetStreamHandler(m_assetProvider)); | 120 | httpServer.AddStreamHandler(new PostAssetStreamHandler(m_assetProvider)); |
123 | 121 | ||
124 | } | 122 | } |
125 | |||
126 | ///// <summary> | ||
127 | ///// Check that the source of an inventory request is one that we trust. | ||
128 | ///// </summary> | ||
129 | ///// <param name="peer"></param> | ||
130 | ///// <returns></returns> | ||
131 | //public bool CheckTrustSource(IPEndPoint peer) | ||
132 | //{ | ||
133 | // if (m_doLookup) | ||
134 | // { | ||
135 | // m_log.InfoFormat("[GRID AGENT INVENTORY]: Checking trusted source {0}", peer); | ||
136 | // UriBuilder ub = new UriBuilder(m_userserver_url); | ||
137 | // IPAddress[] uaddrs = Dns.GetHostAddresses(ub.Host); | ||
138 | // foreach (IPAddress uaddr in uaddrs) | ||
139 | // { | ||
140 | // if (uaddr.Equals(peer.Address)) | ||
141 | // { | ||
142 | // return true; | ||
143 | // } | ||
144 | // } | ||
145 | |||
146 | // m_log.WarnFormat( | ||
147 | // "[GRID AGENT INVENTORY]: Rejecting request since source {0} was not in the list of trusted sources", | ||
148 | // peer); | ||
149 | |||
150 | // return false; | ||
151 | // } | ||
152 | // else | ||
153 | // { | ||
154 | // return true; | ||
155 | // } | ||
156 | //} | ||
157 | |||
158 | /// <summary> | ||
159 | /// Check that the source of an inventory request for a particular agent is a current session belonging to | ||
160 | /// that agent. | ||
161 | /// </summary> | ||
162 | /// <param name="session_id"></param> | ||
163 | /// <param name="avatar_id"></param> | ||
164 | /// <returns></returns> | ||
165 | public bool CheckAuthSession(string session_id, string avatar_id) | ||
166 | { | ||
167 | if (m_doLookup) | ||
168 | { | ||
169 | m_log.InfoFormat("[HGStandaloneInvService]: checking authed session {0} {1}", session_id, avatar_id); | ||
170 | UUID userID = UUID.Zero; | ||
171 | UUID sessionID = UUID.Zero; | ||
172 | UUID.TryParse(avatar_id, out userID); | ||
173 | UUID.TryParse(session_id, out sessionID); | ||
174 | if (userID.Equals(UUID.Zero) || sessionID.Equals(UUID.Zero)) | ||
175 | { | ||
176 | m_log.Info("[HGStandaloneInvService]: Invalid user or session id " + avatar_id + "; " + session_id); | ||
177 | return false; | ||
178 | } | ||
179 | UserProfileData userProfile = m_userService.GetUserProfile(userID); | ||
180 | if (userProfile != null && userProfile.CurrentAgent != null && | ||
181 | userProfile.CurrentAgent.SessionID == sessionID) | ||
182 | { | ||
183 | m_log.Info("[HGStandaloneInvService]: user is logged in and session is valid. Authorizing access."); | ||
184 | return true; | ||
185 | } | ||
186 | |||
187 | m_log.Warn("[HGStandaloneInvService]: unknown user or session_id, request rejected"); | ||
188 | return false; | ||
189 | } | ||
190 | else | ||
191 | { | ||
192 | return true; | ||
193 | } | ||
194 | } | ||
195 | } | 123 | } |
196 | } | 124 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Services/RegionMapService.cs b/OpenSim/Region/CoreModules/Framework/Services/RegionMapService.cs index cc87459..8189b72 100644 --- a/OpenSim/Region/CoreModules/Framework/Services/RegionMapService.cs +++ b/OpenSim/Region/CoreModules/Framework/Services/RegionMapService.cs | |||
@@ -64,8 +64,8 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
64 | initialized = true; | 64 | initialized = true; |
65 | m_scene = scene; | 65 | m_scene = scene; |
66 | 66 | ||
67 | // This module is only on for standalones in hypergrid mode | 67 | // This module is only on for hypergrid mode |
68 | enabled = !config.Configs["Startup"].GetBoolean("gridmode", true) && config.Configs["Startup"].GetBoolean("hypergrid", false); | 68 | enabled = config.Configs["Startup"].GetBoolean("hypergrid", false); |
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
73 | { | 73 | { |
74 | if (enabled) | 74 | if (enabled) |
75 | { | 75 | { |
76 | m_log.Info("[HGStandaloneGridService]: Starting..."); | 76 | m_log.Info("[RegionMapService]: Starting..."); |
77 | 77 | ||
78 | //m_assetService = new AssetService(m_scene); | 78 | //m_assetService = new AssetService(m_scene); |
79 | new GridService(m_scene); | 79 | new GridService(m_scene); |
@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Framework.Services | |||
86 | 86 | ||
87 | public string Name | 87 | public string Name |
88 | { | 88 | { |
89 | get { return "HGStandaloneGridService"; } | 89 | get { return "RegionMapService"; } |
90 | } | 90 | } |
91 | 91 | ||
92 | public bool IsSharedModule | 92 | public bool IsSharedModule |