diff options
author | Justin Clark-Casey (justincc) | 2010-07-01 19:25:46 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-01 19:25:46 +0100 |
commit | 18b22e26cbc79bc0fbebc1cc0acbdb4b966038c0 (patch) | |
tree | ff45a6b38956c35ad814c09679a590cb47068ccc | |
parent | replace hand parsing of incoming object media messages with parsing code in l... (diff) | |
download | opensim-SC_OLD-18b22e26cbc79bc0fbebc1cc0acbdb4b966038c0.zip opensim-SC_OLD-18b22e26cbc79bc0fbebc1cc0acbdb4b966038c0.tar.gz opensim-SC_OLD-18b22e26cbc79bc0fbebc1cc0acbdb4b966038c0.tar.bz2 opensim-SC_OLD-18b22e26cbc79bc0fbebc1cc0acbdb4b966038c0.tar.xz |
start storing a mediaurl on the scene object part
not yet persisted or sent in the update
-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 59fd805..f83c4cf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -967,13 +967,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
967 | get { return m_updateFlag; } | 967 | get { return m_updateFlag; } |
968 | set { m_updateFlag = value; } | 968 | set { m_updateFlag = value; } |
969 | } | 969 | } |
970 | |||
971 | /// <summary> | ||
972 | /// Used for media on a prim | ||
973 | /// </summary> | ||
974 | public string MediaUrl { get; set; } | ||
970 | 975 | ||
971 | [XmlIgnore] | 976 | [XmlIgnore] |
972 | public bool CreateSelected | 977 | public bool CreateSelected |
973 | { | 978 | { |
974 | get { return m_createSelected; } | 979 | get { return m_createSelected; } |
975 | set { m_createSelected = value; } | 980 | set { m_createSelected = value; } |
976 | } | 981 | } |
977 | 982 | ||
978 | #endregion | 983 | #endregion |
979 | 984 | ||