diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs new file mode 100644 index 0000000..4ad7297 --- /dev/null +++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs | |||
@@ -0,0 +1,92 @@ | |||
1 | using System; | ||
2 | using System.Reflection; | ||
3 | using Nini.Config; | ||
4 | using OpenSim.Server.Base; | ||
5 | using OpenSim.Services.Interfaces; | ||
6 | using OpenSim.Framework.Servers.HttpServer; | ||
7 | using OpenSim.Framework; | ||
8 | using OpenSim.Server.Handlers.Base; | ||
9 | using log4net; | ||
10 | |||
11 | namespace OpenSim.Server.Handlers.Profiles | ||
12 | { | ||
13 | public class UserProfilesConnector: ServiceConnector | ||
14 | { | ||
15 | static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
16 | |||
17 | |||
18 | // Our Local Module | ||
19 | public IUserProfilesService ServiceModule | ||
20 | { | ||
21 | get; private set; | ||
22 | } | ||
23 | |||
24 | // The HTTP server. | ||
25 | public IHttpServer Server | ||
26 | { | ||
27 | get; private set; | ||
28 | } | ||
29 | |||
30 | public string ConfigName | ||
31 | { | ||
32 | get; private set; | ||
33 | } | ||
34 | |||
35 | public bool Enabled | ||
36 | { | ||
37 | get; private set; | ||
38 | } | ||
39 | |||
40 | public UserProfilesConnector(IConfigSource config, IHttpServer server, string configName) : | ||
41 | base(config, server, configName) | ||
42 | { | ||
43 | ConfigName = "UserProfilesService"; | ||
44 | if(!string.IsNullOrEmpty(configName)) | ||
45 | ConfigName = configName; | ||
46 | |||
47 | IConfig serverConfig = config.Configs[ConfigName]; | ||
48 | if (serverConfig == null) | ||
49 | throw new Exception(String.Format("No section {0} in config file", ConfigName)); | ||
50 | |||
51 | if(!serverConfig.GetBoolean("Enabled",false)) | ||
52 | { | ||
53 | Enabled = false; | ||
54 | return; | ||
55 | } | ||
56 | |||
57 | Enabled = true; | ||
58 | |||
59 | Server = server; | ||
60 | |||
61 | string service = serverConfig.GetString("LocalServiceModule", String.Empty); | ||
62 | |||
63 | Object[] args = new Object[] { config, ConfigName }; | ||
64 | ServiceModule = ServerUtils.LoadPlugin<IUserProfilesService>(service, args); | ||
65 | |||
66 | JsonRpcProfileHandlers handler = new JsonRpcProfileHandlers(ServiceModule); | ||
67 | |||
68 | Server.AddJsonRPCHandler("avatarclassifiedsrequest", handler.AvatarClassifiedsRequest); | ||
69 | Server.AddJsonRPCHandler("classified_update", handler.ClassifiedUpdate); | ||
70 | Server.AddJsonRPCHandler("classifieds_info_query", handler.ClassifiedInfoRequest); | ||
71 | Server.AddJsonRPCHandler("classified_delete", handler.ClassifiedDelete); | ||
72 | Server.AddJsonRPCHandler("avatarpicksrequest", handler.AvatarPicksRequest); | ||
73 | Server.AddJsonRPCHandler("pickinforequest", handler.PickInfoRequest); | ||
74 | Server.AddJsonRPCHandler("picks_update", handler.PicksUpdate); | ||
75 | Server.AddJsonRPCHandler("picks_delete", handler.PicksDelete); | ||
76 | Server.AddJsonRPCHandler("avatarnotesrequest", handler.AvatarNotesRequest); | ||
77 | Server.AddJsonRPCHandler("avatar_notes_update", handler.NotesUpdate); | ||
78 | Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest); | ||
79 | Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate); | ||
80 | Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate); | ||
81 | Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); | ||
82 | // Server.AddJsonRPCHandler("user_preferences_request", handler.UserPreferencesRequest); | ||
83 | // Server.AddJsonRPCHandler("user_preferences_update", handler.UserPreferencesUpdate); | ||
84 | // Server.AddJsonRPCHandler("user_account_create", handler.UserAccountCreate); | ||
85 | // Server.AddJsonRPCHandler("user_account_auth", handler.UserAccountAuth); | ||
86 | // Server.AddJsonRPCHandler("user_account_test", handler.UserAccountTest); | ||
87 | Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); | ||
88 | Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); | ||
89 | } | ||
90 | } | ||
91 | } | ||
92 | |||