diff options
author | Justin Clark-Casey (justincc) | 2010-09-03 23:29:59 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-09-03 23:29:59 +0100 |
commit | d4b572d2a53c1d0a8d87e94eeb3acfc5c1a46d61 (patch) | |
tree | 5da32f3d784c1a7d996c67923ffbbc3205cb98fb /OpenSim/Services | |
parent | minor: remove mono compiler warnings (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-d4b572d2a53c1d0a8d87e94eeb3acfc5c1a46d61.zip opensim-SC-d4b572d2a53c1d0a8d87e94eeb3acfc5c1a46d61.tar.gz opensim-SC-d4b572d2a53c1d0a8d87e94eeb3acfc5c1a46d61.tar.bz2 opensim-SC-d4b572d2a53c1d0a8d87e94eeb3acfc5c1a46d61.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs index 89f3594..1afb1e1 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs | |||
@@ -76,38 +76,29 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
76 | 76 | ||
77 | public void Initialise(IConfigSource source) | 77 | public void Initialise(IConfigSource source) |
78 | { | 78 | { |
79 | bool isSimianEnabled = false; | 79 | IConfig gridConfig = source.Configs["FriendsService"]; |
80 | 80 | if (gridConfig != null) | |
81 | if (source.Configs["Friends"] != null) | ||
82 | { | ||
83 | string module = source.Configs["Friends"].GetString("Connector"); | ||
84 | isSimianEnabled = !String.IsNullOrEmpty(module) && module.EndsWith(this.Name); | ||
85 | } | ||
86 | |||
87 | if (isSimianEnabled) | ||
88 | { | 81 | { |
89 | IConfig assetConfig = source.Configs["FriendsService"]; | 82 | string serviceUrl = gridConfig.GetString("FriendsServerURI"); |
90 | if (assetConfig == null) | 83 | if (!String.IsNullOrEmpty(serviceUrl)) |
91 | { | ||
92 | m_log.Error("[SIMIAN FRIENDS CONNECTOR]: FriendsService missing from OpenSim.ini"); | ||
93 | throw new Exception("Friends connector init error"); | ||
94 | } | ||
95 | |||
96 | string serviceURI = assetConfig.GetString("FriendsServerURI"); | ||
97 | if (String.IsNullOrEmpty(serviceURI)) | ||
98 | { | 84 | { |
99 | m_log.Error("[SIMIAN FRIENDS CONNECTOR]: No Server URI named in section FriendsService"); | 85 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) |
100 | throw new Exception("Friends connector init error"); | 86 | serviceUrl = serviceUrl + '/'; |
87 | m_serverUrl = serviceUrl; | ||
101 | } | 88 | } |
102 | |||
103 | m_serverUrl = serviceURI; | ||
104 | } | 89 | } |
90 | |||
91 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
92 | m_log.Info("[SIMIAN FRIENDS CONNECTOR]: No FriendsServerURI specified, disabling connector"); | ||
105 | } | 93 | } |
106 | 94 | ||
107 | #region IFriendsService | 95 | #region IFriendsService |
108 | 96 | ||
109 | public FriendInfo[] GetFriends(UUID principalID) | 97 | public FriendInfo[] GetFriends(UUID principalID) |
110 | { | 98 | { |
99 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
100 | return new FriendInfo[0]; | ||
101 | |||
111 | Dictionary<UUID, FriendInfo> friends = new Dictionary<UUID, FriendInfo>(); | 102 | Dictionary<UUID, FriendInfo> friends = new Dictionary<UUID, FriendInfo>(); |
112 | 103 | ||
113 | OSDArray friendsArray = GetFriended(principalID); | 104 | OSDArray friendsArray = GetFriended(principalID); |
@@ -156,6 +147,9 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
156 | 147 | ||
157 | public bool StoreFriend(UUID principalID, string friend, int flags) | 148 | public bool StoreFriend(UUID principalID, string friend, int flags) |
158 | { | 149 | { |
150 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
151 | return true; | ||
152 | |||
159 | NameValueCollection requestArgs = new NameValueCollection | 153 | NameValueCollection requestArgs = new NameValueCollection |
160 | { | 154 | { |
161 | { "RequestMethod", "AddGeneric" }, | 155 | { "RequestMethod", "AddGeneric" }, |
@@ -176,6 +170,9 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
176 | 170 | ||
177 | public bool Delete(UUID principalID, string friend) | 171 | public bool Delete(UUID principalID, string friend) |
178 | { | 172 | { |
173 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
174 | return true; | ||
175 | |||
179 | NameValueCollection requestArgs = new NameValueCollection | 176 | NameValueCollection requestArgs = new NameValueCollection |
180 | { | 177 | { |
181 | { "RequestMethod", "RemoveGeneric" }, | 178 | { "RequestMethod", "RemoveGeneric" }, |