diff options
author | Justin Clark-Casey (justincc) | 2010-07-01 19:25:46 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-26 23:34:18 +0100 |
commit | 4a6adff4cd66a3bfeaa99af10caf9136e011df46 (patch) | |
tree | af3ce1fdfe3eedf3817ace598472919010ce7aaf /OpenSim | |
parent | replace hand parsing of incoming object media messages with parsing code in l... (diff) | |
download | opensim-SC_OLD-4a6adff4cd66a3bfeaa99af10caf9136e011df46.zip opensim-SC_OLD-4a6adff4cd66a3bfeaa99af10caf9136e011df46.tar.gz opensim-SC_OLD-4a6adff4cd66a3bfeaa99af10caf9136e011df46.tar.bz2 opensim-SC_OLD-4a6adff4cd66a3bfeaa99af10caf9136e011df46.tar.xz |
start storing a mediaurl on the scene object part
not yet persisted or sent in the update
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | 30 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 |
2 files changed, 30 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 568170e..edd0397 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | |||
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.Media.Moap | |||
91 | // avatar that set the texture in the first place. | 91 | // avatar that set the texture in the first place. |
92 | // Even though we're registering for POST we're going to get GETS and UPDATES too | 92 | // Even though we're registering for POST we're going to get GETS and UPDATES too |
93 | caps.RegisterHandler( | 93 | caps.RegisterHandler( |
94 | "ObjectMedia", new RestStreamHandler("POST", "/CAPS/" + UUID.Random(), HandleObjectMediaRequest)); | 94 | "ObjectMedia", new RestStreamHandler("POST", "/CAPS/" + UUID.Random(), HandleObjectMediaMessage)); |
95 | 95 | ||
96 | // We do get these posts when the url has been changed. | 96 | // We do get these posts when the url has been changed. |
97 | // Even though we're registering for POST we're going to get GETS and UPDATES too | 97 | // Even though we're registering for POST we're going to get GETS and UPDATES too |
@@ -108,7 +108,7 @@ namespace OpenSim.Region.CoreModules.Media.Moap | |||
108 | /// <param name="httpRequest"></param> | 108 | /// <param name="httpRequest"></param> |
109 | /// <param name="httpResponse"></param> | 109 | /// <param name="httpResponse"></param> |
110 | /// <returns></returns> | 110 | /// <returns></returns> |
111 | protected string HandleObjectMediaRequest( | 111 | protected string HandleObjectMediaMessage( |
112 | string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 112 | string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
113 | { | 113 | { |
114 | m_log.DebugFormat("[MOAP]: Got ObjectMedia raw request [{0}]", request); | 114 | m_log.DebugFormat("[MOAP]: Got ObjectMedia raw request [{0}]", request); |
@@ -167,10 +167,7 @@ namespace OpenSim.Region.CoreModules.Media.Moap | |||
167 | 167 | ||
168 | resp.PrimID = primId; | 168 | resp.PrimID = primId; |
169 | resp.FaceMedia = part.Shape.Media.ToArray(); | 169 | resp.FaceMedia = part.Shape.Media.ToArray(); |
170 | 170 | resp.Version = part.MediaUrl; | |
171 | // I know this has to end with the last avatar to edit and the version code shouldn't always be 16. Just trying | ||
172 | // to minimally satisfy for now to get something working | ||
173 | resp.Version = "x-mv:0000000016/" + UUID.Random(); | ||
174 | 171 | ||
175 | string rawResp = OSDParser.SerializeLLSDXmlString(resp.Serialize()); | 172 | string rawResp = OSDParser.SerializeLLSDXmlString(resp.Serialize()); |
176 | 173 | ||
@@ -197,6 +194,27 @@ namespace OpenSim.Region.CoreModules.Media.Moap | |||
197 | 194 | ||
198 | part.Shape.Media = new List<MediaEntry>(omu.FaceMedia); | 195 | part.Shape.Media = new List<MediaEntry>(omu.FaceMedia); |
199 | 196 | ||
197 | if (null == part.MediaUrl) | ||
198 | { | ||
199 | // TODO: We can't set the last changer until we start tracking which cap we give to which agent id | ||
200 | part.MediaUrl = "x-mv:0000000000/" + UUID.Zero; | ||
201 | } | ||
202 | else | ||
203 | { | ||
204 | string rawVersion = part.MediaUrl.Substring(5, 10); | ||
205 | int version = int.Parse(rawVersion); | ||
206 | part.MediaUrl = string.Format("x-mv:{0:10D}/{1}", version, UUID.Zero); | ||
207 | } | ||
208 | |||
209 | m_log.DebugFormat("[MOAP]: Storing media url [{0}] in prim {1} {2}", part.MediaUrl, part.Name, part.UUID); | ||
210 | |||
211 | // I know this has to end with the last avatar to edit and the version code shouldn't always be 16. Just trying | ||
212 | // to minimally satisfy for now to get something working | ||
213 | //resp.Version = "x-mv:0000000016/" + UUID.Random(); | ||
214 | |||
215 | // TODO: schedule full object update for all other avatars. This will trigger them to send an | ||
216 | // ObjectMediaRequest once they see that the MediaUrl is different. | ||
217 | |||
200 | return string.Empty; | 218 | return string.Empty; |
201 | } | 219 | } |
202 | 220 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index e331bb0..c25c973 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -970,13 +970,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
970 | get { return m_updateFlag; } | 970 | get { return m_updateFlag; } |
971 | set { m_updateFlag = value; } | 971 | set { m_updateFlag = value; } |
972 | } | 972 | } |
973 | |||
974 | /// <summary> | ||
975 | /// Used for media on a prim | ||
976 | /// </summary> | ||
977 | public string MediaUrl { get; set; } | ||
973 | 978 | ||
974 | [XmlIgnore] | 979 | [XmlIgnore] |
975 | public bool CreateSelected | 980 | public bool CreateSelected |
976 | { | 981 | { |
977 | get { return m_createSelected; } | 982 | get { return m_createSelected; } |
978 | set { m_createSelected = value; } | 983 | set { m_createSelected = value; } |
979 | } | 984 | } |
980 | 985 | ||
981 | #endregion | 986 | #endregion |
982 | 987 | ||