33 using System.Collections.Generic;
34 using System.Reflection;
35 using OpenSim.Framework;
36 using OpenSim.Framework.Console;
37 using OpenSim.Server.Base;
38 using OpenSim.Server.Handlers;
39 using OpenSim.Region.Framework.Interfaces;
40 using OpenSim.Framework.Servers.HttpServer;
41 using OpenSim.Framework.Servers;
42 using OpenSim.Region.Framework.Scenes;
43 using OpenSim.Services.Interfaces;
49 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"LocalUserProfilesServicesConnector")]
52 private static readonly ILog m_log =
54 MethodBase.GetCurrentMethod().DeclaringType);
56 private Dictionary<UUID, Scene> regions =
new Dictionary<UUID, Scene>();
72 return "LocalUserProfilesServicesConnector";
76 public string ConfigName
81 public Type ReplaceableInterface
88 m_log.Debug(
"[LOCAL USERPROFILES SERVICE CONNECTOR]: LocalUserProfileServicesConnector no params");
93 m_log.Debug(
"[LOCAL USERPROFILES SERVICE CONNECTOR]: LocalUserProfileServicesConnector instantiated directly.");
94 InitialiseService(source);
99 ConfigName =
"UserProfilesService";
104 IConfig config = source.Configs[ConfigName];
107 m_log.Error(
"[LOCAL USERPROFILES SERVICE CONNECTOR]: UserProfilesService missing from OpenSim.ini");
111 if(!config.GetBoolean(
"Enabled",
false))
119 string serviceDll = config.GetString(
"LocalServiceModule",
122 if (serviceDll ==
String.Empty)
124 m_log.Error(
"[LOCAL USERPROFILES SERVICE CONNECTOR]: No LocalServiceModule named in section UserProfilesService");
133 if (ServiceModule == null)
135 m_log.Error(
"[LOCAL USERPROFILES SERVICE CONNECTOR]: Can't load user profiles service");
143 Server.AddJsonRPCHandler(
"avatarclassifiedsrequest", handler.AvatarClassifiedsRequest);
144 Server.AddJsonRPCHandler(
"classified_update", handler.ClassifiedUpdate);
147 Server.AddJsonRPCHandler(
"avatarpicksrequest", handler.AvatarPicksRequest);
148 Server.AddJsonRPCHandler(
"pickinforequest", handler.PickInfoRequest);
149 Server.AddJsonRPCHandler(
"picks_update", handler.PicksUpdate);
150 Server.AddJsonRPCHandler(
"picks_delete", handler.PicksDelete);
151 Server.AddJsonRPCHandler(
"avatarnotesrequest", handler.AvatarNotesRequest);
152 Server.AddJsonRPCHandler(
"avatar_notes_update", handler.NotesUpdate);
153 Server.AddJsonRPCHandler(
"avatar_properties_request", handler.AvatarPropertiesRequest);
154 Server.AddJsonRPCHandler(
"avatar_properties_update", handler.AvatarPropertiesUpdate);
155 Server.AddJsonRPCHandler(
"avatar_interests_update", handler.AvatarInterestsUpdate);
156 Server.AddJsonRPCHandler(
"user_preferences_update", handler.UserPreferenecesUpdate);
157 Server.AddJsonRPCHandler(
"user_preferences_request", handler.UserPreferencesRequest);
158 Server.AddJsonRPCHandler(
"image_assets_request", handler.AvatarImageAssetsRequest);
159 Server.AddJsonRPCHandler(
"user_data_request", handler.RequestUserAppData);
160 Server.AddJsonRPCHandler(
"user_data_update", handler.UpdateUserAppData);
164 #region ISharedRegionModule implementation
166 void ISharedRegionModule.PostInitialise()
174 #region IRegionModuleBase implementation
176 void IRegionModuleBase.Initialise(IConfigSource source)
178 IConfig moduleConfig = source.Configs[
"Modules"];
179 if (moduleConfig != null)
181 string name = moduleConfig.GetString(
"UserProfilesServices",
"");
184 InitialiseService(source);
185 m_log.Info(
"[LOCAL USERPROFILES SERVICE CONNECTOR]: Local user profiles connector enabled");
190 void IRegionModuleBase.Close()
195 void IRegionModuleBase.AddRegion(
Scene scene)
202 if (regions.ContainsKey(scene.RegionInfo.RegionID))
203 m_log.ErrorFormat(
"[LOCAL USERPROFILES SERVICE CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!");
205 regions.Add(scene.RegionInfo.RegionID, scene);
209 void IRegionModuleBase.RemoveRegion(
Scene scene)
216 if (regions.ContainsKey(scene.RegionInfo.RegionID))
217 regions.Remove(scene.RegionInfo.RegionID);
221 void IRegionModuleBase.RegionLoaded(
Scene scene)
LocalUserProfilesServicesConnector()
void InitialiseService(IConfigSource source)
OpenSim.Services.Interfaces.GridRegion GridRegion
LocalUserProfilesServicesConnector(IConfigSource source)
Interface to OpenSimulator's built in HTTP server. Use this to register handlers (http, llsd, xmlrpc, etc.) for given URLs.
Interactive OpenSim region server
delegate void ClassifiedDelete(UUID classifiedID, IClientAPI client)
delegate void ClassifiedInfoRequest(UUID classifiedID, IClientAPI client)