diff options
author | Jeff Ames | 2008-08-18 00:39:10 +0000 |
---|---|---|
committer | Jeff Ames | 2008-08-18 00:39:10 +0000 |
commit | 6ef9d4da901a346c232458317cca6268da888e2e (patch) | |
tree | dd1d935b10f34f261839da9f9879c02322e8ede7 | |
parent | Update svn properties, minor formatting cleanup. (diff) | |
download | opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.zip opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.gz opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.bz2 opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.xz |
Formatting cleanup.
Diffstat (limited to '')
208 files changed, 2966 insertions, 3149 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 256e862..c79122c 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -56,8 +56,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
56 | public string Version { get { return m_version; } } | 56 | public string Version { get { return m_version; } } |
57 | public string Name { get { return m_name; } } | 57 | public string Name { get { return m_name; } } |
58 | 58 | ||
59 | public void Initialise() | 59 | public void Initialise() |
60 | { | 60 | { |
61 | m_log.Info("[RADMIN]: " + Name + " cannot be default-initialized!"); | 61 | m_log.Info("[RADMIN]: " + Name + " cannot be default-initialized!"); |
62 | throw new PluginNotInitialisedException (Name); | 62 | throw new PluginNotInitialisedException (Name); |
63 | } | 63 | } |
@@ -512,7 +512,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
512 | try | 512 | try |
513 | { | 513 | { |
514 | Hashtable requestData = (Hashtable) request.Params[0]; | 514 | Hashtable requestData = (Hashtable) request.Params[0]; |
515 | 515 | ||
516 | // check completeness | 516 | // check completeness |
517 | checkStringParameters(request, new string[] { "password", "user_firstname", | 517 | checkStringParameters(request, new string[] { "password", "user_firstname", |
518 | "user_lastname", "user_password" }); | 518 | "user_lastname", "user_password" }); |
@@ -603,7 +603,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
603 | try | 603 | try |
604 | { | 604 | { |
605 | Hashtable requestData = (Hashtable) request.Params[0]; | 605 | Hashtable requestData = (Hashtable) request.Params[0]; |
606 | 606 | ||
607 | // check completeness | 607 | // check completeness |
608 | checkStringParameters(request, new string[] { "password", "user_firstname", | 608 | checkStringParameters(request, new string[] { "password", "user_firstname", |
609 | "user_lastname" }); | 609 | "user_lastname" }); |
@@ -616,7 +616,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
616 | string firstname = (string) requestData["user_firstname"]; | 616 | string firstname = (string) requestData["user_firstname"]; |
617 | string lastname = (string) requestData["user_lastname"]; | 617 | string lastname = (string) requestData["user_lastname"]; |
618 | 618 | ||
619 | 619 | ||
620 | string passwd = String.Empty; | 620 | string passwd = String.Empty; |
621 | uint? regX = null; | 621 | uint? regX = null; |
622 | uint? regY = null; | 622 | uint? regY = null; |
@@ -632,7 +632,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
632 | if (null == userProfile) | 632 | if (null == userProfile) |
633 | throw new Exception(String.Format("avatar {0} {1} does not exist", firstname, lastname)); | 633 | throw new Exception(String.Format("avatar {0} {1} does not exist", firstname, lastname)); |
634 | 634 | ||
635 | if (null != passwd) | 635 | if (null != passwd) |
636 | { | 636 | { |
637 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(passwd) + ":" + String.Empty); | 637 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(passwd) + ":" + String.Empty); |
638 | userProfile.PasswordHash = md5PasswdHash; | 638 | userProfile.PasswordHash = md5PasswdHash; |
@@ -648,7 +648,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
648 | 648 | ||
649 | response.Value = responseData; | 649 | response.Value = responseData; |
650 | 650 | ||
651 | m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", firstname, lastname, | 651 | m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", firstname, lastname, |
652 | userProfile.ID); | 652 | userProfile.ID); |
653 | } | 653 | } |
654 | catch (Exception e) | 654 | catch (Exception e) |
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs index 94aecbd..6fc3ea3 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs | |||
@@ -23,7 +23,6 @@ | |||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | ||
27 | */ | 26 | */ |
28 | 27 | ||
29 | using System; | 28 | using System; |
@@ -44,14 +43,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
44 | 43 | ||
45 | /// <summary> | 44 | /// <summary> |
46 | /// This class represents the current REST request. It | 45 | /// This class represents the current REST request. It |
47 | /// encapsulates the request/response state and takes care | 46 | /// encapsulates the request/response state and takes care |
48 | /// of response generation without exposing the REST handler | 47 | /// of response generation without exposing the REST handler |
49 | /// to the actual mechanisms involved. | 48 | /// to the actual mechanisms involved. |
50 | /// | 49 | /// |
51 | /// This structure is created on entry to the Handler | 50 | /// This structure is created on entry to the Handler |
52 | /// method and is disposed of upon return. It is part of | 51 | /// method and is disposed of upon return. It is part of |
53 | /// the plug-in infrastructure, rather than the functionally | 52 | /// the plug-in infrastructure, rather than the functionally |
54 | /// specific REST handler, and fundamental changes to | 53 | /// specific REST handler, and fundamental changes to |
55 | /// this should be reflected in the Rest HandlerVersion. The | 54 | /// this should be reflected in the Rest HandlerVersion. The |
56 | /// object is instantiated, and may be extended by, any | 55 | /// object is instantiated, and may be extended by, any |
57 | /// given handler. See the inventory handler for an example | 56 | /// given handler. See the inventory handler for an example |
@@ -100,7 +99,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
100 | internal bool chunked = false; | 99 | internal bool chunked = false; |
101 | 100 | ||
102 | // Authentication related state | 101 | // Authentication related state |
103 | 102 | ||
104 | internal bool authenticated = false; | 103 | internal bool authenticated = false; |
105 | // internal string scheme = Rest.AS_DIGEST; | 104 | // internal string scheme = Rest.AS_DIGEST; |
106 | // internal string scheme = Rest.AS_BASIC; | 105 | // internal string scheme = Rest.AS_BASIC; |
@@ -132,7 +131,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
132 | private static readonly string[] EmptyPath = { String.Empty }; | 131 | private static readonly string[] EmptyPath = { String.Empty }; |
133 | 132 | ||
134 | // Session related tables. These are only needed if QOP is set to "auth-sess" | 133 | // Session related tables. These are only needed if QOP is set to "auth-sess" |
135 | // and for now at least, it is not. Session related authentication is of | 134 | // and for now at least, it is not. Session related authentication is of |
136 | // questionable merit in the context of REST anyway, but it is, arguably, more | 135 | // questionable merit in the context of REST anyway, but it is, arguably, more |
137 | // secure. | 136 | // secure. |
138 | 137 | ||
@@ -148,27 +147,27 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
148 | 147 | ||
149 | private static Regex schema = new Regex("^\\s*(?<scheme>\\w+)\\s*.*", | 148 | private static Regex schema = new Regex("^\\s*(?<scheme>\\w+)\\s*.*", |
150 | RegexOptions.Compiled | RegexOptions.IgnoreCase); | 149 | RegexOptions.Compiled | RegexOptions.IgnoreCase); |
151 | 150 | ||
152 | private static Regex basicParms = new Regex("^\\s*(?:\\w+)\\s+(?<pval>\\S+)\\s*", | 151 | private static Regex basicParms = new Regex("^\\s*(?:\\w+)\\s+(?<pval>\\S+)\\s*", |
153 | RegexOptions.Compiled | RegexOptions.IgnoreCase); | 152 | RegexOptions.Compiled | RegexOptions.IgnoreCase); |
154 | 153 | ||
155 | private static Regex digestParm1 = new Regex("\\s*(?<parm>\\w+)\\s*=\\s*\"(?<pval>[^\"]+)\"", | 154 | private static Regex digestParm1 = new Regex("\\s*(?<parm>\\w+)\\s*=\\s*\"(?<pval>[^\"]+)\"", |
156 | RegexOptions.Compiled | RegexOptions.IgnoreCase); | 155 | RegexOptions.Compiled | RegexOptions.IgnoreCase); |
157 | 156 | ||
158 | private static Regex digestParm2 = new Regex("\\s*(?<parm>\\w+)\\s*=\\s*(?<pval>[^\\p{P}\\s]+)", | 157 | private static Regex digestParm2 = new Regex("\\s*(?<parm>\\w+)\\s*=\\s*(?<pval>[^\\p{P}\\s]+)", |
159 | RegexOptions.Compiled | RegexOptions.IgnoreCase); | 158 | RegexOptions.Compiled | RegexOptions.IgnoreCase); |
160 | 159 | ||
161 | private static Regex reuserPass = new Regex("(?<user>[^:]+):(?<pass>[\\S\\s]*)", | 160 | private static Regex reuserPass = new Regex("(?<user>[^:]+):(?<pass>[\\S\\s]*)", |
162 | RegexOptions.Compiled | RegexOptions.IgnoreCase); | 161 | RegexOptions.Compiled | RegexOptions.IgnoreCase); |
163 | 162 | ||
164 | // For efficiency, we create static instances of these objects | 163 | // For efficiency, we create static instances of these objects |
165 | 164 | ||
166 | private static MD5 md5hash = MD5.Create(); | 165 | private static MD5 md5hash = MD5.Create(); |
167 | 166 | ||
168 | private static StringComparer sc = StringComparer.OrdinalIgnoreCase; | 167 | private static StringComparer sc = StringComparer.OrdinalIgnoreCase; |
169 | 168 | ||
170 | // Constructor | 169 | // Constructor |
171 | 170 | ||
172 | internal RequestData(OSHttpRequest p_request, OSHttpResponse p_response, string p_qprefix) | 171 | internal RequestData(OSHttpRequest p_request, OSHttpResponse p_response, string p_qprefix) |
173 | { | 172 | { |
174 | 173 | ||
@@ -203,7 +202,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
203 | internal bool IsAuthenticated | 202 | internal bool IsAuthenticated |
204 | { | 203 | { |
205 | get | 204 | get |
206 | { | 205 | { |
207 | if (Rest.Authenticate) | 206 | if (Rest.Authenticate) |
208 | { | 207 | { |
209 | if (!authenticated) | 208 | if (!authenticated) |
@@ -223,7 +222,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
223 | /// Realm, domain, etc. | 222 | /// Realm, domain, etc. |
224 | /// | 223 | /// |
225 | /// This method checks to see if the current request is already | 224 | /// This method checks to see if the current request is already |
226 | /// authenticated for this domain. If it is, then it returns | 225 | /// authenticated for this domain. If it is, then it returns |
227 | /// true. If it is not, then it issues a challenge to the client | 226 | /// true. If it is not, then it issues a challenge to the client |
228 | /// and responds negatively to the request. | 227 | /// and responds negatively to the request. |
229 | /// </summary> | 228 | /// </summary> |
@@ -243,7 +242,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
243 | Rest.Log.DebugFormat("{0} Challenge reason: No authorization data", MsgId); | 242 | Rest.Log.DebugFormat("{0} Challenge reason: No authorization data", MsgId); |
244 | DoChallenge(); | 243 | DoChallenge(); |
245 | } | 244 | } |
246 | 245 | ||
247 | // So, we have authentication data, now we have to check to | 246 | // So, we have authentication data, now we have to check to |
248 | // see what we got and whether or not it is valid for the | 247 | // see what we got and whether or not it is valid for the |
249 | // current domain. To do this we need to interpret the data | 248 | // current domain. To do this we need to interpret the data |
@@ -327,7 +326,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
327 | foreach (Match m in matches) | 326 | foreach (Match m in matches) |
328 | { | 327 | { |
329 | authparms.Add("response",m.Groups["pval"].Value); | 328 | authparms.Add("response",m.Groups["pval"].Value); |
330 | Rest.Log.DebugFormat("{0} Parameter matched : {1} = {2}", | 329 | Rest.Log.DebugFormat("{0} Parameter matched : {1} = {2}", |
331 | MsgId, "response", m.Groups["pval"].Value); | 330 | MsgId, "response", m.Groups["pval"].Value); |
332 | } | 331 | } |
333 | 332 | ||
@@ -369,7 +368,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
369 | foreach (Match m in matches) | 368 | foreach (Match m in matches) |
370 | { | 369 | { |
371 | authparms.Add(m.Groups["parm"].Value,m.Groups["pval"].Value); | 370 | authparms.Add(m.Groups["parm"].Value,m.Groups["pval"].Value); |
372 | Rest.Log.DebugFormat("{0} String Parameter matched : {1} = {2}", | 371 | Rest.Log.DebugFormat("{0} String Parameter matched : {1} = {2}", |
373 | MsgId, m.Groups["parm"].Value,m.Groups["pval"].Value); | 372 | MsgId, m.Groups["parm"].Value,m.Groups["pval"].Value); |
374 | } | 373 | } |
375 | 374 | ||
@@ -380,7 +379,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
380 | foreach (Match m in matches) | 379 | foreach (Match m in matches) |
381 | { | 380 | { |
382 | authparms.Add(m.Groups["parm"].Value,m.Groups["pval"].Value); | 381 | authparms.Add(m.Groups["parm"].Value,m.Groups["pval"].Value); |
383 | Rest.Log.DebugFormat("{0} Tokenized Parameter matched : {1} = {2}", | 382 | Rest.Log.DebugFormat("{0} Tokenized Parameter matched : {1} = {2}", |
384 | MsgId, m.Groups["parm"].Value,m.Groups["pval"].Value); | 383 | MsgId, m.Groups["parm"].Value,m.Groups["pval"].Value); |
385 | } | 384 | } |
386 | 385 | ||
@@ -417,7 +416,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
417 | 416 | ||
418 | if (!authparms.TryGetValue("nonce", out nonce) || nonce == null) | 417 | if (!authparms.TryGetValue("nonce", out nonce) || nonce == null) |
419 | { | 418 | { |
420 | Rest.Log.WarnFormat("{0} Authentication failed: nonce missing", MsgId); | 419 | Rest.Log.WarnFormat("{0} Authentication failed: nonce missing", MsgId); |
421 | break; | 420 | break; |
422 | } | 421 | } |
423 | 422 | ||
@@ -428,7 +427,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
428 | { | 427 | { |
429 | if (temp != opaque) | 428 | if (temp != opaque) |
430 | { | 429 | { |
431 | Rest.Log.WarnFormat("{0} Authentication failed: bad opaque value", MsgId); | 430 | Rest.Log.WarnFormat("{0} Authentication failed: bad opaque value", MsgId); |
432 | break; | 431 | break; |
433 | } | 432 | } |
434 | } | 433 | } |
@@ -440,7 +439,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
440 | { | 439 | { |
441 | if (temp != algorithm) | 440 | if (temp != algorithm) |
442 | { | 441 | { |
443 | Rest.Log.WarnFormat("{0} Authentication failed: bad algorithm value", MsgId); | 442 | Rest.Log.WarnFormat("{0} Authentication failed: bad algorithm value", MsgId); |
444 | break; | 443 | break; |
445 | } | 444 | } |
446 | } | 445 | } |
@@ -457,7 +456,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
457 | 456 | ||
458 | if (!authparms.ContainsKey("cnonce")) | 457 | if (!authparms.ContainsKey("cnonce")) |
459 | { | 458 | { |
460 | Rest.Log.WarnFormat("{0} Authentication failed: cnonce missing", MsgId); | 459 | Rest.Log.WarnFormat("{0} Authentication failed: cnonce missing", MsgId); |
461 | break; | 460 | break; |
462 | } | 461 | } |
463 | 462 | ||
@@ -465,7 +464,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
465 | 464 | ||
466 | if (!authparms.TryGetValue("nc", out nck) || nck == null) | 465 | if (!authparms.TryGetValue("nc", out nck) || nck == null) |
467 | { | 466 | { |
468 | Rest.Log.WarnFormat("{0} Authentication failed: cnonce counter missing", MsgId); | 467 | Rest.Log.WarnFormat("{0} Authentication failed: cnonce counter missing", MsgId); |
469 | break; | 468 | break; |
470 | } | 469 | } |
471 | 470 | ||
@@ -477,7 +476,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
477 | 476 | ||
478 | if (Rest.Hex2Int(ncl) >= Rest.Hex2Int(nck)) | 477 | if (Rest.Hex2Int(ncl) >= Rest.Hex2Int(nck)) |
479 | { | 478 | { |
480 | Rest.Log.WarnFormat("{0} Authentication failed: bad cnonce counter", MsgId); | 479 | Rest.Log.WarnFormat("{0} Authentication failed: bad cnonce counter", MsgId); |
481 | break; | 480 | break; |
482 | } | 481 | } |
483 | cntable[nonce] = nck; | 482 | cntable[nonce] = nck; |
@@ -497,12 +496,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
497 | // these MUST NOT be present. | 496 | // these MUST NOT be present. |
498 | if (authparms.ContainsKey("cnonce")) | 497 | if (authparms.ContainsKey("cnonce")) |
499 | { | 498 | { |
500 | Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce", MsgId); | 499 | Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce", MsgId); |
501 | break; | 500 | break; |
502 | } | 501 | } |
503 | if (authparms.ContainsKey("nc")) | 502 | if (authparms.ContainsKey("nc")) |
504 | { | 503 | { |
505 | Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce counter[2]", MsgId); | 504 | Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce counter[2]", MsgId); |
506 | break; | 505 | break; |
507 | } | 506 | } |
508 | } | 507 | } |
@@ -511,7 +510,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
511 | 510 | ||
512 | authenticated = ValidateDigest(userName, nonce, cnonce, nck, authPrefix, response); | 511 | authenticated = ValidateDigest(userName, nonce, cnonce, nck, authPrefix, response); |
513 | 512 | ||
514 | } | 513 | } |
515 | while (false); | 514 | while (false); |
516 | 515 | ||
517 | } | 516 | } |
@@ -608,7 +607,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
608 | } | 607 | } |
609 | 608 | ||
610 | // We don;t know the userid that will be used | 609 | // We don;t know the userid that will be used |
611 | // so we cannot make any authentication domain | 610 | // so we cannot make any authentication domain |
612 | // assumptions. So the prefix will determine | 611 | // assumptions. So the prefix will determine |
613 | // this. | 612 | // this. |
614 | 613 | ||
@@ -624,7 +623,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
624 | } | 623 | } |
625 | 624 | ||
626 | /// <summary> | 625 | /// <summary> |
627 | /// This method provides validation in support of the BASIC | 626 | /// This method provides validation in support of the BASIC |
628 | /// authentication method. This is not normaly expected to be | 627 | /// authentication method. This is not normaly expected to be |
629 | /// used, but is included for completeness (and because I tried | 628 | /// used, but is included for completeness (and because I tried |
630 | /// it first). | 629 | /// it first). |
@@ -650,11 +649,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
650 | /// <summary> | 649 | /// <summary> |
651 | /// This mechanism is used by the digest authetnication mechanism | 650 | /// This mechanism is used by the digest authetnication mechanism |
652 | /// to return the user's password. In fact, because the OpenSim | 651 | /// to return the user's password. In fact, because the OpenSim |
653 | /// user's passwords are already hashed, and the HTTP mechanism | 652 | /// user's passwords are already hashed, and the HTTP mechanism |
654 | /// does not supply an open password, the hashed passwords cannot | 653 | /// does not supply an open password, the hashed passwords cannot |
655 | /// be used unless the cliemt has used the same salting mechanism | 654 | /// be used unless the cliemt has used the same salting mechanism |
656 | /// to has the password before using it in the authentication | 655 | /// to has the password before using it in the authentication |
657 | /// algorithn. This is not inconceivable... | 656 | /// algorithm. This is not inconceivable... |
658 | /// </summary> | 657 | /// </summary> |
659 | 658 | ||
660 | private string getPassword(string user) | 659 | private string getPassword(string user) |
@@ -665,12 +664,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
665 | string last; | 664 | string last; |
666 | 665 | ||
667 | // Distinguish the parts, if necessary | 666 | // Distinguish the parts, if necessary |
668 | 667 | ||
669 | if ((x=user.IndexOf(Rest.C_SPACE)) != -1) | 668 | if ((x=user.IndexOf(Rest.C_SPACE)) != -1) |
670 | { | 669 | { |
671 | first = user.Substring(0,x); | 670 | first = user.Substring(0,x); |
672 | last = user.Substring(x+1); | 671 | last = user.Substring(x+1); |
673 | } | 672 | } |
674 | else | 673 | else |
675 | { | 674 | { |
676 | first = user; | 675 | first = user; |
@@ -712,12 +711,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
712 | string last; | 711 | string last; |
713 | 712 | ||
714 | // Distinguish the parts, if necessary | 713 | // Distinguish the parts, if necessary |
715 | 714 | ||
716 | if ((x=user.IndexOf(Rest.C_SPACE)) != -1) | 715 | if ((x=user.IndexOf(Rest.C_SPACE)) != -1) |
717 | { | 716 | { |
718 | first = user.Substring(0,x); | 717 | first = user.Substring(0,x); |
719 | last = user.Substring(x+1); | 718 | last = user.Substring(x+1); |
720 | } | 719 | } |
721 | else | 720 | else |
722 | { | 721 | { |
723 | first = user; | 722 | first = user; |
@@ -733,9 +732,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
733 | 732 | ||
734 | HA1 = HashToString(pass); | 733 | HA1 = HashToString(pass); |
735 | HA1 = HashToString(String.Format("{0}:{1}",HA1,udata.PasswordSalt)); | 734 | HA1 = HashToString(String.Format("{0}:{1}",HA1,udata.PasswordSalt)); |
736 | 735 | ||
737 | return (0 == sc.Compare(HA1, udata.PasswordHash)); | 736 | return (0 == sc.Compare(HA1, udata.PasswordHash)); |
738 | 737 | ||
739 | } | 738 | } |
740 | 739 | ||
741 | // Validate the request-digest | 740 | // Validate the request-digest |
@@ -784,7 +783,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
784 | HA2 = HashToString(patt); | 783 | HA2 = HashToString(patt); |
785 | 784 | ||
786 | // Generate Digest | 785 | // Generate Digest |
787 | 786 | ||
788 | if (qop != String.Empty) | 787 | if (qop != String.Empty) |
789 | { | 788 | { |
790 | patt = String.Format("{0}:{1}:{2}:{3}:{4}:{5}", HA1, nonce, nck, cnonce, qop, HA2); | 789 | patt = String.Format("{0}:{1}:{2}:{3}:{4}:{5}", HA1, nonce, nck, cnonce, qop, HA2); |
@@ -856,7 +855,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
856 | Fail(code, message, true); | 855 | Fail(code, message, true); |
857 | } | 856 | } |
858 | 857 | ||
859 | // More adventurous. This failure also includes a | 858 | // More adventurous. This failure also includes a |
860 | // specified entity. | 859 | // specified entity. |
861 | 860 | ||
862 | internal void Fail(int code, string message, string data) | 861 | internal void Fail(int code, string message, string data) |
@@ -899,7 +898,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
899 | fail = true; | 898 | fail = true; |
900 | 899 | ||
901 | Respond("Failure response"); | 900 | Respond("Failure response"); |
902 | 901 | ||
903 | RestException re = new RestException(message+" <"+code+">"); | 902 | RestException re = new RestException(message+" <"+code+">"); |
904 | 903 | ||
905 | re.statusCode = code; | 904 | re.statusCode = code; |
@@ -918,7 +917,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
918 | Fail(Rest.HttpStatusCodeNotImplemented, Rest.HttpStatusDescNotImplemented); | 917 | Fail(Rest.HttpStatusCodeNotImplemented, Rest.HttpStatusDescNotImplemented); |
919 | } | 918 | } |
920 | 919 | ||
921 | // This MUST be called by an agent handler before it returns | 920 | // This MUST be called by an agent handler before it returns |
922 | // control to Handle, otherwise the request will be ignored. | 921 | // control to Handle, otherwise the request will be ignored. |
923 | // This is called implciitly for the REST stream handlers and | 922 | // This is called implciitly for the REST stream handlers and |
924 | // is harmless if it is called twice. | 923 | // is harmless if it is called twice. |
@@ -962,7 +961,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
962 | Rest.Log.DebugFormat("{0} XML Response handler extension EXIT", MsgId); | 961 | Rest.Log.DebugFormat("{0} XML Response handler extension EXIT", MsgId); |
963 | } | 962 | } |
964 | 963 | ||
965 | // If buffer != null, then we assume that | 964 | // If buffer != null, then we assume that |
966 | // this has already been done some other | 965 | // this has already been done some other |
967 | // way. For example, transfer encoding might | 966 | // way. For example, transfer encoding might |
968 | // have been done. | 967 | // have been done. |
@@ -997,7 +996,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
997 | 996 | ||
998 | } | 997 | } |
999 | 998 | ||
1000 | // Set the status code & description. If nothing has been stored, | 999 | // Set the status code & description. If nothing has been stored, |
1001 | // we consider that a success. | 1000 | // we consider that a success. |
1002 | 1001 | ||
1003 | if (statusCode == 0) | 1002 | if (statusCode == 0) |
@@ -1011,7 +1010,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1011 | 1010 | ||
1012 | // For a redirect we need to set the relocation header accordingly | 1011 | // For a redirect we need to set the relocation header accordingly |
1013 | 1012 | ||
1014 | if (response.StatusCode == (int) Rest.HttpStatusCodeTemporaryRedirect || | 1013 | if (response.StatusCode == (int) Rest.HttpStatusCodeTemporaryRedirect || |
1015 | response.StatusCode == (int) Rest.HttpStatusCodePermanentRedirect) | 1014 | response.StatusCode == (int) Rest.HttpStatusCodePermanentRedirect) |
1016 | { | 1015 | { |
1017 | Rest.Log.DebugFormat("{0} Re-direct location is {1}", MsgId, redirectLocation); | 1016 | Rest.Log.DebugFormat("{0} Re-direct location is {1}", MsgId, redirectLocation); |
@@ -1031,7 +1030,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1031 | // We've left the setting of handled' until the | 1030 | // We've left the setting of handled' until the |
1032 | // last minute because the header settings included | 1031 | // last minute because the header settings included |
1033 | // above are pretty harmless. But everything from | 1032 | // above are pretty harmless. But everything from |
1034 | // here on down probably leaves the response | 1033 | // here on down probably leaves the response |
1035 | // element unusable by anyone else. | 1034 | // element unusable by anyone else. |
1036 | 1035 | ||
1037 | handled = true; | 1036 | handled = true; |
@@ -1046,7 +1045,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1046 | 1045 | ||
1047 | if (buffer != null && buffer.Length != 0) | 1046 | if (buffer != null && buffer.Length != 0) |
1048 | { | 1047 | { |
1049 | Rest.Log.DebugFormat("{0} Entity buffer, length = {1} : <{2}>", | 1048 | Rest.Log.DebugFormat("{0} Entity buffer, length = {1} : <{2}>", |
1050 | MsgId, buffer.Length, encoding.GetString(buffer)); | 1049 | MsgId, buffer.Length, encoding.GetString(buffer)); |
1051 | response.OutputStream.Write(buffer, 0, buffer.Length); | 1050 | response.OutputStream.Write(buffer, 0, buffer.Length); |
1052 | } | 1051 | } |
@@ -1066,17 +1065,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1066 | 1065 | ||
1067 | // Add a header to the table. We need to allow | 1066 | // Add a header to the table. We need to allow |
1068 | // multiple instances of many of the headers. | 1067 | // multiple instances of many of the headers. |
1069 | // If the | 1068 | // If the |
1070 | 1069 | ||
1071 | internal void AddHeader(string hdr, string data) | 1070 | internal void AddHeader(string hdr, string data) |
1072 | { | 1071 | { |
1073 | if (Rest.DEBUG) | 1072 | if (Rest.DEBUG) |
1074 | { | 1073 | { |
1075 | Rest.Log.DebugFormat("{0} Adding header: <{1}: {2}>", | 1074 | Rest.Log.DebugFormat("{0} Adding header: <{1}: {2}>", |
1076 | MsgId, hdr, data); | 1075 | MsgId, hdr, data); |
1077 | if (response.Headers.Get(hdr) != null) | 1076 | if (response.Headers.Get(hdr) != null) |
1078 | { | 1077 | { |
1079 | Rest.Log.DebugFormat("{0} Multipe {1} headers will be generated>", | 1078 | Rest.Log.DebugFormat("{0} Multipe {1} headers will be generated>", |
1080 | MsgId, hdr); | 1079 | MsgId, hdr); |
1081 | } | 1080 | } |
1082 | } | 1081 | } |
@@ -1093,7 +1092,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1093 | Rest.Log.DebugFormat("{0} Removing header: <{1}>", MsgId, hdr); | 1092 | Rest.Log.DebugFormat("{0} Removing header: <{1}>", MsgId, hdr); |
1094 | if (response.Headers.Get(hdr) == null) | 1093 | if (response.Headers.Get(hdr) == null) |
1095 | { | 1094 | { |
1096 | Rest.Log.DebugFormat("{0} No such header existed", | 1095 | Rest.Log.DebugFormat("{0} No such header existed", |
1097 | MsgId, hdr); | 1096 | MsgId, hdr); |
1098 | } | 1097 | } |
1099 | } | 1098 | } |
@@ -1110,7 +1109,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1110 | { | 1109 | { |
1111 | for (int i=0;i<response.Headers.Count;i++) | 1110 | for (int i=0;i<response.Headers.Count;i++) |
1112 | { | 1111 | { |
1113 | Rest.Log.DebugFormat("{0} Header[{1}] : {2}", MsgId, i, | 1112 | Rest.Log.DebugFormat("{0} Header[{1}] : {2}", MsgId, i, |
1114 | response.Headers.Get(i)); | 1113 | response.Headers.Get(i)); |
1115 | } | 1114 | } |
1116 | } | 1115 | } |
@@ -1144,7 +1143,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1144 | // If we succeeded in getting a path, perform any | 1143 | // If we succeeded in getting a path, perform any |
1145 | // additional pre-processing required. | 1144 | // additional pre-processing required. |
1146 | 1145 | ||
1147 | if (path != null) | 1146 | if (path != null) |
1148 | { | 1147 | { |
1149 | if (Rest.ExtendedEscape) | 1148 | if (Rest.ExtendedEscape) |
1150 | { | 1149 | { |
@@ -1182,14 +1181,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1182 | { | 1181 | { |
1183 | parameters = new string[0]; | 1182 | parameters = new string[0]; |
1184 | } | 1183 | } |
1185 | 1184 | ||
1186 | // Generate a debug list of the decoded parameters | 1185 | // Generate a debug list of the decoded parameters |
1187 | 1186 | ||
1188 | if (Rest.DEBUG && prfxlen < path.Length-1) | 1187 | if (Rest.DEBUG && prfxlen < path.Length-1) |
1189 | { | 1188 | { |
1190 | Rest.Log.DebugFormat("{0} URI: Parameters: {1}", MsgId, path.Substring(prfxlen)); | 1189 | Rest.Log.DebugFormat("{0} URI: Parameters: {1}", MsgId, path.Substring(prfxlen)); |
1191 | for (int i = 0; i < parameters.Length; i++) | 1190 | for (int i = 0; i < parameters.Length; i++) |
1192 | { | 1191 | { |
1193 | Rest.Log.DebugFormat("{0} Parameter[{1}]: {2}", MsgId, i, parameters[i]); | 1192 | Rest.Log.DebugFormat("{0} Parameter[{1}]: {2}", MsgId, i, parameters[i]); |
1194 | } | 1193 | } |
1195 | } | 1194 | } |
@@ -1197,11 +1196,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1197 | return parameters.Length; | 1196 | return parameters.Length; |
1198 | 1197 | ||
1199 | } | 1198 | } |
1200 | 1199 | ||
1201 | internal string[] PathNodes | 1200 | internal string[] PathNodes |
1202 | { | 1201 | { |
1203 | get | 1202 | get |
1204 | { | 1203 | { |
1205 | if (pathNodes == null) | 1204 | if (pathNodes == null) |
1206 | { | 1205 | { |
1207 | initUrl(); | 1206 | initUrl(); |
@@ -1209,10 +1208,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1209 | return pathNodes; | 1208 | return pathNodes; |
1210 | } | 1209 | } |
1211 | } | 1210 | } |
1212 | 1211 | ||
1213 | internal string BuildUrl(int first, int last) | 1212 | internal string BuildUrl(int first, int last) |
1214 | { | 1213 | { |
1215 | 1214 | ||
1216 | if (pathNodes == null) | 1215 | if (pathNodes == null) |
1217 | { | 1216 | { |
1218 | initUrl(); | 1217 | initUrl(); |
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs index 439bbb4..2bb91a4 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs | |||
@@ -23,7 +23,7 @@ | |||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
@@ -42,7 +42,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
42 | public class Rest | 42 | public class Rest |
43 | { | 43 | { |
44 | 44 | ||
45 | internal static readonly log4net.ILog Log = | 45 | internal static readonly log4net.ILog Log = |
46 | log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | internal static bool DEBUG = Log.IsDebugEnabled; | 48 | internal static bool DEBUG = Log.IsDebugEnabled; |
@@ -106,7 +106,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
106 | /// supported by all servers. See Respond | 106 | /// supported by all servers. See Respond |
107 | /// to see how these are handled. | 107 | /// to see how these are handled. |
108 | /// </summary> | 108 | /// </summary> |
109 | 109 | ||
110 | // REST AGENT 1.0 interpretations | 110 | // REST AGENT 1.0 interpretations |
111 | public const string GET = "get"; // information retrieval - server state unchanged | 111 | public const string GET = "get"; // information retrieval - server state unchanged |
112 | public const string HEAD = "head"; // same as get except only the headers are returned. | 112 | public const string HEAD = "head"; // same as get except only the headers are returned. |
@@ -138,7 +138,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
138 | public static readonly char C_PERIOD = '.'; | 138 | public static readonly char C_PERIOD = '.'; |
139 | public static readonly char C_COMMA = ','; | 139 | public static readonly char C_COMMA = ','; |
140 | public static readonly char C_DQUOTE = '"'; | 140 | public static readonly char C_DQUOTE = '"'; |
141 | 141 | ||
142 | public static readonly string CS_SPACE = " "; | 142 | public static readonly string CS_SPACE = " "; |
143 | public static readonly string CS_SLASH = "/"; | 143 | public static readonly string CS_SLASH = "/"; |
144 | public static readonly string CS_PATHSEP = "/"; | 144 | public static readonly string CS_PATHSEP = "/"; |
@@ -147,7 +147,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
147 | public static readonly string CS_PERIOD = "."; | 147 | public static readonly string CS_PERIOD = "."; |
148 | public static readonly string CS_COMMA = ","; | 148 | public static readonly string CS_COMMA = ","; |
149 | public static readonly string CS_DQUOTE = "\""; | 149 | public static readonly string CS_DQUOTE = "\""; |
150 | 150 | ||
151 | public static readonly char[] CA_SPACE = { C_SPACE }; | 151 | public static readonly char[] CA_SPACE = { C_SPACE }; |
152 | public static readonly char[] CA_SLASH = { C_SLASH }; | 152 | public static readonly char[] CA_SLASH = { C_SLASH }; |
153 | public static readonly char[] CA_PATHSEP = { C_PATHSEP }; | 153 | public static readonly char[] CA_PATHSEP = { C_PATHSEP }; |
@@ -311,7 +311,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
311 | public const string AS_DIGEST = "Digest"; | 311 | public const string AS_DIGEST = "Digest"; |
312 | 312 | ||
313 | /// Supported Digest algorithms | 313 | /// Supported Digest algorithms |
314 | 314 | ||
315 | public const string Digest_MD5 = "MD5"; // assumedd efault if omitted | 315 | public const string Digest_MD5 = "MD5"; // assumedd efault if omitted |
316 | public const string Digest_MD5Sess = "MD5-sess"; | 316 | public const string Digest_MD5Sess = "MD5-sess"; |
317 | 317 | ||
@@ -359,7 +359,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
359 | int val = 0; | 359 | int val = 0; |
360 | int sum = 0; | 360 | int sum = 0; |
361 | string tmp = null; | 361 | string tmp = null; |
362 | 362 | ||
363 | if (hex != null) | 363 | if (hex != null) |
364 | { | 364 | { |
365 | tmp = hex.ToLower(); | 365 | tmp = hex.ToLower(); |
@@ -446,20 +446,20 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
446 | { | 446 | { |
447 | if (i % 4 == 0) Console.Write(" "); | 447 | if (i % 4 == 0) Console.Write(" "); |
448 | // if (i%16 == 0) Console.Write(" "); | 448 | // if (i%16 == 0) Console.Write(" "); |
449 | Console.Write(" "); | 449 | Console.Write(" "); |
450 | buffer[i % Rest.DumpLineSize] = ' '; | 450 | buffer[i % Rest.DumpLineSize] = ' '; |
451 | } | 451 | } |
452 | Console.WriteLine(" |"+(new String(buffer))+"|"); | 452 | Console.WriteLine(" |"+(new String(buffer))+"|"); |
453 | } | 453 | } |
454 | else | 454 | else |
455 | { | 455 | { |
456 | Console.Write("\n"); | 456 | Console.Write("\n"); |
457 | } | 457 | } |
458 | 458 | ||
459 | } | 459 | } |
460 | 460 | ||
461 | } | 461 | } |
462 | 462 | ||
463 | // Local exception type | 463 | // Local exception type |
464 | 464 | ||
465 | public class RestException : Exception | 465 | public class RestException : Exception |
@@ -470,8 +470,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
470 | internal string httpmethod; | 470 | internal string httpmethod; |
471 | internal string httppath; | 471 | internal string httppath; |
472 | 472 | ||
473 | public RestException(string msg) : base(msg) | 473 | public RestException(string msg) : base(msg) |
474 | { | 474 | { |
475 | } | 475 | } |
476 | } | 476 | } |
477 | 477 | ||
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs index b4eb7db..95b0ee3 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs | |||
@@ -23,7 +23,6 @@ | |||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | ||
27 | */ | 26 | */ |
28 | 27 | ||
29 | using libsecondlife; | 28 | using libsecondlife; |
@@ -40,10 +39,8 @@ using OpenSim.Framework.Communications.Cache; | |||
40 | 39 | ||
41 | namespace OpenSim.ApplicationPlugins.Rest.Inventory | 40 | namespace OpenSim.ApplicationPlugins.Rest.Inventory |
42 | { | 41 | { |
43 | |||
44 | public class RestAssetServices : IRest | 42 | public class RestAssetServices : IRest |
45 | { | 43 | { |
46 | |||
47 | private bool enabled = false; | 44 | private bool enabled = false; |
48 | private string qPrefix = "assets"; | 45 | private string qPrefix = "assets"; |
49 | 46 | ||
@@ -52,7 +49,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
52 | 49 | ||
53 | public RestAssetServices() | 50 | public RestAssetServices() |
54 | { | 51 | { |
55 | |||
56 | Rest.Log.InfoFormat("{0} Asset services initializing", MsgId); | 52 | Rest.Log.InfoFormat("{0} Asset services initializing", MsgId); |
57 | Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version); | 53 | Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version); |
58 | 54 | ||
@@ -73,7 +69,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
73 | enabled = true; | 69 | enabled = true; |
74 | 70 | ||
75 | Rest.Log.InfoFormat("{0} Asset services initialization complete", MsgId); | 71 | Rest.Log.InfoFormat("{0} Asset services initialization complete", MsgId); |
76 | |||
77 | } | 72 | } |
78 | 73 | ||
79 | // Post-construction, pre-enabled initialization opportunity | 74 | // Post-construction, pre-enabled initialization opportunity |
@@ -84,7 +79,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
84 | } | 79 | } |
85 | 80 | ||
86 | // Called by the plug-in to halt REST processing. Local processing is | 81 | // Called by the plug-in to halt REST processing. Local processing is |
87 | // disabled, and control blocks until all current processing has | 82 | // disabled, and control blocks until all current processing has |
88 | // completed. No new processing will be started | 83 | // completed. No new processing will be started |
89 | 84 | ||
90 | public void Close() | 85 | public void Close() |
@@ -111,14 +106,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
111 | 106 | ||
112 | private void DoAsset(RequestData rparm) | 107 | private void DoAsset(RequestData rparm) |
113 | { | 108 | { |
114 | 109 | if (!enabled) | |
115 | if (!enabled) return; | 110 | return; |
116 | 111 | ||
117 | AssetRequestData rdata = (AssetRequestData) rparm; | 112 | AssetRequestData rdata = (AssetRequestData) rparm; |
118 | 113 | ||
119 | Rest.Log.DebugFormat("{0} REST Asset handler ENTRY", MsgId); | 114 | Rest.Log.DebugFormat("{0} REST Asset handler ENTRY", MsgId); |
120 | 115 | ||
121 | // Now that we know this is a serious attempt to | 116 | // Now that we know this is a serious attempt to |
122 | // access inventory data, we should find out who | 117 | // access inventory data, we should find out who |
123 | // is asking, and make sure they are authorized | 118 | // is asking, and make sure they are authorized |
124 | // to do so. We need to validate the caller's | 119 | // to do so. We need to validate the caller's |
@@ -129,9 +124,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
129 | // With the present HTTP server we can't use the | 124 | // With the present HTTP server we can't use the |
130 | // builtin authentication mechanisms because they | 125 | // builtin authentication mechanisms because they |
131 | // would be enforced for all in-bound requests. | 126 | // would be enforced for all in-bound requests. |
132 | // Instead we look at the headers ourselves and | 127 | // Instead we look at the headers ourselves and |
133 | // handle authentication directly. | 128 | // handle authentication directly. |
134 | 129 | ||
135 | try | 130 | try |
136 | { | 131 | { |
137 | if (!rdata.IsAuthenticated) | 132 | if (!rdata.IsAuthenticated) |
@@ -144,13 +139,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
144 | if (e.statusCode == Rest.HttpStatusCodeNotAuthorized) | 139 | if (e.statusCode == Rest.HttpStatusCodeNotAuthorized) |
145 | { | 140 | { |
146 | Rest.Log.WarnFormat("{0} User not authenticated", MsgId); | 141 | Rest.Log.WarnFormat("{0} User not authenticated", MsgId); |
147 | Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId, | 142 | Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId, |
148 | rdata.request.Headers.Get("Authorization")); | 143 | rdata.request.Headers.Get("Authorization")); |
149 | } | 144 | } |
150 | else | 145 | else |
151 | { | 146 | { |
152 | Rest.Log.ErrorFormat("{0} User authentication failed", MsgId); | 147 | Rest.Log.ErrorFormat("{0} User authentication failed", MsgId); |
153 | Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId, | 148 | Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId, |
154 | rdata.request.Headers.Get("Authorization")); | 149 | rdata.request.Headers.Get("Authorization")); |
155 | } | 150 | } |
156 | throw (e); | 151 | throw (e); |
@@ -173,7 +168,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
173 | case "post" : | 168 | case "post" : |
174 | case "delete" : | 169 | case "delete" : |
175 | default : | 170 | default : |
176 | Rest.Log.WarnFormat("{0} Asset: Method not supported: {1}", | 171 | Rest.Log.WarnFormat("{0} Asset: Method not supported: {1}", |
177 | MsgId, rdata.method); | 172 | MsgId, rdata.method); |
178 | rdata.Fail(Rest.HttpStatusCodeBadRequest, | 173 | rdata.Fail(Rest.HttpStatusCodeBadRequest, |
179 | Rest.HttpStatusDescBadRequest); | 174 | Rest.HttpStatusDescBadRequest); |
@@ -194,7 +189,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
194 | 189 | ||
195 | private void DoGet(AssetRequestData rdata) | 190 | private void DoGet(AssetRequestData rdata) |
196 | { | 191 | { |
197 | |||
198 | bool istexture = false; | 192 | bool istexture = false; |
199 | 193 | ||
200 | Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method); | 194 | Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method); |
@@ -204,13 +198,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
204 | 198 | ||
205 | if (rdata.parameters.Length == 1) | 199 | if (rdata.parameters.Length == 1) |
206 | { | 200 | { |
207 | |||
208 | LLUUID uuid = new LLUUID(rdata.parameters[0]); | 201 | LLUUID uuid = new LLUUID(rdata.parameters[0]); |
209 | AssetBase asset = Rest.AssetServices.GetAsset(uuid, istexture); | 202 | AssetBase asset = Rest.AssetServices.GetAsset(uuid, istexture); |
210 | 203 | ||
211 | if (asset != null) | 204 | if (asset != null) |
212 | { | 205 | { |
213 | |||
214 | Rest.Log.DebugFormat("{0} Asset located <{1}>", MsgId, rdata.parameters[0]); | 206 | Rest.Log.DebugFormat("{0} Asset located <{1}>", MsgId, rdata.parameters[0]); |
215 | 207 | ||
216 | rdata.initXmlWriter(); | 208 | rdata.initXmlWriter(); |
@@ -227,19 +219,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
227 | rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length); | 219 | rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length); |
228 | 220 | ||
229 | rdata.writer.WriteFullEndElement(); | 221 | rdata.writer.WriteFullEndElement(); |
230 | |||
231 | } | 222 | } |
232 | else | 223 | else |
233 | { | 224 | { |
234 | Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, rdata.path); | 225 | Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, rdata.path); |
235 | rdata.Fail(Rest.HttpStatusCodeNotFound, | 226 | rdata.Fail(Rest.HttpStatusCodeNotFound, |
236 | Rest.HttpStatusDescNotFound); | 227 | Rest.HttpStatusDescNotFound); |
237 | } | 228 | } |
238 | } | 229 | } |
239 | 230 | ||
240 | rdata.Complete(); | 231 | rdata.Complete(); |
241 | rdata.Respond("Asset " + rdata.method + ": Normal completion"); | 232 | rdata.Respond("Asset " + rdata.method + ": Normal completion"); |
242 | |||
243 | } | 233 | } |
244 | 234 | ||
245 | private void DoPut(AssetRequestData rdata) | 235 | private void DoPut(AssetRequestData rdata) |
@@ -257,7 +247,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
257 | if (!xml.ReadToFollowing("Asset")) | 247 | if (!xml.ReadToFollowing("Asset")) |
258 | { | 248 | { |
259 | Rest.Log.DebugFormat("{0} Invalid request data: <{1}>", MsgId, rdata.path); | 249 | Rest.Log.DebugFormat("{0} Invalid request data: <{1}>", MsgId, rdata.path); |
260 | rdata.Fail(Rest.HttpStatusCodeBadRequest, | 250 | rdata.Fail(Rest.HttpStatusCodeBadRequest, |
261 | Rest.HttpStatusDescBadRequest); | 251 | Rest.HttpStatusDescBadRequest); |
262 | } | 252 | } |
263 | 253 | ||
@@ -275,13 +265,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
275 | else | 265 | else |
276 | { | 266 | { |
277 | Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, rdata.path); | 267 | Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, rdata.path); |
278 | rdata.Fail(Rest.HttpStatusCodeNotFound, | 268 | rdata.Fail(Rest.HttpStatusCodeNotFound, |
279 | Rest.HttpStatusDescNotFound); | 269 | Rest.HttpStatusDescNotFound); |
280 | } | 270 | } |
281 | 271 | ||
282 | rdata.Complete(); | 272 | rdata.Complete(); |
283 | rdata.Respond("Asset " + rdata.method + ": Normal completion"); | 273 | rdata.Respond("Asset " + rdata.method + ": Normal completion"); |
284 | |||
285 | } | 274 | } |
286 | 275 | ||
287 | internal class AssetRequestData : RequestData | 276 | internal class AssetRequestData : RequestData |
@@ -291,6 +280,5 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
291 | { | 280 | { |
292 | } | 281 | } |
293 | } | 282 | } |
294 | |||
295 | } | 283 | } |
296 | } | 284 | } |
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs index 7bd83c1..7f4157c 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs | |||
@@ -23,7 +23,6 @@ | |||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | ||
27 | */ | 26 | */ |
28 | 27 | ||
29 | using System; | 28 | using System; |
@@ -37,7 +36,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
37 | { | 36 | { |
38 | public class RestHandler : RestPlugin, IHttpAgentHandler | 37 | public class RestHandler : RestPlugin, IHttpAgentHandler |
39 | { | 38 | { |
40 | |||
41 | /// <remarks> | 39 | /// <remarks> |
42 | /// The handler delegates are not noteworthy. The allocator allows | 40 | /// The handler delegates are not noteworthy. The allocator allows |
43 | /// a given handler to optionally subclass the base RequestData | 41 | /// a given handler to optionally subclass the base RequestData |
@@ -66,10 +64,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
66 | /// <summary> | 64 | /// <summary> |
67 | /// This static initializer scans the ASSEMBLY for classes that | 65 | /// This static initializer scans the ASSEMBLY for classes that |
68 | /// export the IRest interface and builds a list of them. These | 66 | /// export the IRest interface and builds a list of them. These |
69 | /// are later activated by the handler. To add a new handler it | 67 | /// are later activated by the handler. To add a new handler it |
70 | /// is only necessary to create a new services class that implements | 68 | /// is only necessary to create a new services class that implements |
71 | /// the IRest interface, and recompile the handler. This gives | 69 | /// the IRest interface, and recompile the handler. This gives |
72 | /// all of the build-time flexibility of a modular approach | 70 | /// all of the build-time flexibility of a modular approach |
73 | /// while not introducing yet-another module loader. Note that | 71 | /// while not introducing yet-another module loader. Note that |
74 | /// multiple assembles can still be built, each with its own set | 72 | /// multiple assembles can still be built, each with its own set |
75 | /// of handlers. Examples of services classes are RestInventoryServices | 73 | /// of handlers. Examples of services classes are RestInventoryServices |
@@ -78,13 +76,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
78 | 76 | ||
79 | static RestHandler() | 77 | static RestHandler() |
80 | { | 78 | { |
81 | |||
82 | Module[] mods = Assembly.GetExecutingAssembly().GetModules(); | 79 | Module[] mods = Assembly.GetExecutingAssembly().GetModules(); |
83 | 80 | ||
84 | foreach (Module m in mods) | 81 | foreach (Module m in mods) |
85 | { | 82 | { |
86 | Type[] types = m.GetTypes(); | 83 | Type[] types = m.GetTypes(); |
87 | foreach (Type t in types) | 84 | foreach (Type t in types) |
88 | { | 85 | { |
89 | try | 86 | try |
90 | { | 87 | { |
@@ -100,7 +97,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
100 | } | 97 | } |
101 | } | 98 | } |
102 | } | 99 | } |
103 | |||
104 | } | 100 | } |
105 | 101 | ||
106 | #endregion local static state | 102 | #endregion local static state |
@@ -109,13 +105,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
109 | 105 | ||
110 | /// <summary> | 106 | /// <summary> |
111 | /// This routine loads all of the handlers discovered during | 107 | /// This routine loads all of the handlers discovered during |
112 | /// instance initialization. | 108 | /// instance initialization. |
113 | /// A table of all loaded and successfully constructed handlers | 109 | /// A table of all loaded and successfully constructed handlers |
114 | /// is built, and this table is then used by the constructor to | 110 | /// is built, and this table is then used by the constructor to |
115 | /// initialize each of the handlers in turn. | 111 | /// initialize each of the handlers in turn. |
116 | /// NOTE: The loading process does not automatically imply that | 112 | /// NOTE: The loading process does not automatically imply that |
117 | /// the handler has registered any kind of an interface, that | 113 | /// the handler has registered any kind of an interface, that |
118 | /// may be (optionally) done by the handler either during | 114 | /// may be (optionally) done by the handler either during |
119 | /// construction, or during initialization. | 115 | /// construction, or during initialization. |
120 | /// | 116 | /// |
121 | /// I was not able to make this code work within a constructor | 117 | /// I was not able to make this code work within a constructor |
@@ -128,7 +124,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
128 | { | 124 | { |
129 | if (!handlersLoaded) | 125 | if (!handlersLoaded) |
130 | { | 126 | { |
131 | |||
132 | ConstructorInfo ci; | 127 | ConstructorInfo ci; |
133 | Object ht; | 128 | Object ht; |
134 | 129 | ||
@@ -159,8 +154,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
159 | 154 | ||
160 | // Name is used to differentiate the message header. | 155 | // Name is used to differentiate the message header. |
161 | 156 | ||
162 | public override string Name | 157 | public override string Name |
163 | { | 158 | { |
164 | get { return "HANDLER"; } | 159 | get { return "HANDLER"; } |
165 | } | 160 | } |
166 | 161 | ||
@@ -173,7 +168,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
173 | 168 | ||
174 | // We have to rename these because we want | 169 | // We have to rename these because we want |
175 | // to be able to share the values with other | 170 | // to be able to share the values with other |
176 | // classes in our assembly and the base | 171 | // classes in our assembly and the base |
177 | // names are protected. | 172 | // names are protected. |
178 | 173 | ||
179 | internal string MsgId | 174 | internal string MsgId |
@@ -203,7 +198,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
203 | { | 198 | { |
204 | try | 199 | try |
205 | { | 200 | { |
206 | |||
207 | // This plugin will only be enabled if the broader | 201 | // This plugin will only be enabled if the broader |
208 | // REST plugin mechanism is enabled. | 202 | // REST plugin mechanism is enabled. |
209 | 203 | ||
@@ -214,7 +208,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
214 | // IsEnabled is implemented by the base class and | 208 | // IsEnabled is implemented by the base class and |
215 | // reflects an overall RestPlugin status | 209 | // reflects an overall RestPlugin status |
216 | 210 | ||
217 | if (!IsEnabled) | 211 | if (!IsEnabled) |
218 | { | 212 | { |
219 | Rest.Log.WarnFormat("{0} Plugins are disabled", MsgId); | 213 | Rest.Log.WarnFormat("{0} Plugins are disabled", MsgId); |
220 | return; | 214 | return; |
@@ -263,15 +257,15 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
263 | Rest.DumpLineSize); | 257 | Rest.DumpLineSize); |
264 | } | 258 | } |
265 | 259 | ||
266 | // Load all of the handlers present in the | 260 | // Load all of the handlers present in the |
267 | // assembly | 261 | // assembly |
268 | 262 | ||
269 | // In principle, as we're an application plug-in, | 263 | // In principle, as we're an application plug-in, |
270 | // most of what needs to be done could be done using | 264 | // most of what needs to be done could be done using |
271 | // static resources, however the Open Sim plug-in | 265 | // static resources, however the Open Sim plug-in |
272 | // model makes this an instance, so that's what we | 266 | // model makes this an instance, so that's what we |
273 | // need to be. | 267 | // need to be. |
274 | // There is only one Communications manager per | 268 | // There is only one Communications manager per |
275 | // server, and by inference, only one each of the | 269 | // server, and by inference, only one each of the |
276 | // user, asset, and inventory servers. So we can cache | 270 | // user, asset, and inventory servers. So we can cache |
277 | // those using a static initializer. | 271 | // those using a static initializer. |
@@ -314,13 +308,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
314 | { | 308 | { |
315 | Rest.Log.ErrorFormat("{0} Plugin initialization has failed: {1}", MsgId, e.Message); | 309 | Rest.Log.ErrorFormat("{0} Plugin initialization has failed: {1}", MsgId, e.Message); |
316 | } | 310 | } |
317 | |||
318 | } | 311 | } |
319 | 312 | ||
320 | /// <summary> | 313 | /// <summary> |
321 | /// In the interests of efficiency, and because we cannot determine whether | 314 | /// In the interests of efficiency, and because we cannot determine whether |
322 | /// or not this instance will actually be harvested, we clobber the only | 315 | /// or not this instance will actually be harvested, we clobber the only |
323 | /// anchoring reference to the working state for this plug-in. What the | 316 | /// anchoring reference to the working state for this plug-in. What the |
324 | /// call to close does is irrelevant to this class beyond knowing that it | 317 | /// call to close does is irrelevant to this class beyond knowing that it |
325 | /// can nullify the reference when it returns. | 318 | /// can nullify the reference when it returns. |
326 | /// To make sure everything is copacetic we make sure the primary interface | 319 | /// To make sure everything is copacetic we make sure the primary interface |
@@ -329,7 +322,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
329 | 322 | ||
330 | public override void Close() | 323 | public override void Close() |
331 | { | 324 | { |
332 | |||
333 | Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId); | 325 | Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId); |
334 | 326 | ||
335 | try | 327 | try |
@@ -337,12 +329,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
337 | RemoveAgentHandler(Rest.Name, this); | 329 | RemoveAgentHandler(Rest.Name, this); |
338 | } | 330 | } |
339 | catch (KeyNotFoundException){} | 331 | catch (KeyNotFoundException){} |
340 | 332 | ||
341 | foreach (IRest handler in handlers) | 333 | foreach (IRest handler in handlers) |
342 | { | 334 | { |
343 | handler.Close(); | 335 | handler.Close(); |
344 | } | 336 | } |
345 | |||
346 | } | 337 | } |
347 | 338 | ||
348 | #endregion overriding methods | 339 | #endregion overriding methods |
@@ -380,7 +371,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
380 | return true; | 371 | return true; |
381 | } | 372 | } |
382 | } | 373 | } |
383 | |||
384 | } | 374 | } |
385 | catch (Exception e) | 375 | catch (Exception e) |
386 | { | 376 | { |
@@ -414,7 +404,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
414 | 404 | ||
415 | for (int i = 0; i < request.Headers.Count; i++) | 405 | for (int i = 0; i < request.Headers.Count; i++) |
416 | { | 406 | { |
417 | Rest.Log.DebugFormat("{0} Header [{1}] : <{2}> = <{3}>", | 407 | Rest.Log.DebugFormat("{0} Header [{1}] : <{2}> = <{3}>", |
418 | MsgId, i, request.Headers.GetKey(i), request.Headers.Get(i)); | 408 | MsgId, i, request.Headers.GetKey(i), request.Headers.Get(i)); |
419 | } | 409 | } |
420 | Rest.Log.DebugFormat("{0} URI: {1}", MsgId, request.RawUrl); | 410 | Rest.Log.DebugFormat("{0} URI: {1}", MsgId, request.RawUrl); |
@@ -425,8 +415,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
425 | 415 | ||
426 | try | 416 | try |
427 | { | 417 | { |
428 | handled = ( FindPathHandler(request, response) || | 418 | handled = FindPathHandler(request, response) || |
429 | FindStreamHandler(request, response) ); | 419 | FindStreamHandler(request, response); |
430 | } | 420 | } |
431 | catch (Exception e) | 421 | catch (Exception e) |
432 | { | 422 | { |
@@ -440,7 +430,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
440 | Rest.Log.DebugFormat("{0} EXIT", MsgId); | 430 | Rest.Log.DebugFormat("{0} EXIT", MsgId); |
441 | 431 | ||
442 | return handled; | 432 | return handled; |
443 | |||
444 | } | 433 | } |
445 | 434 | ||
446 | #endregion interface methods | 435 | #endregion interface methods |
@@ -488,7 +477,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
488 | } | 477 | } |
489 | 478 | ||
490 | return rdata.handled; | 479 | return rdata.handled; |
491 | |||
492 | } | 480 | } |
493 | 481 | ||
494 | /// <summary> | 482 | /// <summary> |
@@ -501,13 +489,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
501 | 489 | ||
502 | public void AddStreamHandler(string httpMethod, string path, RestMethod method) | 490 | public void AddStreamHandler(string httpMethod, string path, RestMethod method) |
503 | { | 491 | { |
504 | |||
505 | if (!IsEnabled) | 492 | if (!IsEnabled) |
506 | { | 493 | { |
507 | return; | 494 | return; |
508 | } | 495 | } |
509 | 496 | ||
510 | if (!path.StartsWith(Rest.Prefix)) | 497 | if (!path.StartsWith(Rest.Prefix)) |
511 | { | 498 | { |
512 | path = String.Format("{0}{1}", Rest.Prefix, path); | 499 | path = String.Format("{0}{1}", Rest.Prefix, path); |
513 | } | 500 | } |
@@ -525,7 +512,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
525 | { | 512 | { |
526 | Rest.Log.WarnFormat("{0} Ignoring duplicate handler for {1}", MsgId, path); | 513 | Rest.Log.WarnFormat("{0} Ignoring duplicate handler for {1}", MsgId, path); |
527 | } | 514 | } |
528 | |||
529 | } | 515 | } |
530 | 516 | ||
531 | /// <summary> | 517 | /// <summary> |
@@ -540,10 +526,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
540 | 526 | ||
541 | internal bool FindPathHandler(OSHttpRequest request, OSHttpResponse response) | 527 | internal bool FindPathHandler(OSHttpRequest request, OSHttpResponse response) |
542 | { | 528 | { |
543 | |||
544 | RequestData rdata = null; | 529 | RequestData rdata = null; |
545 | string bestMatch = null; | 530 | string bestMatch = null; |
546 | 531 | ||
547 | if (!IsEnabled) | 532 | if (!IsEnabled) |
548 | { | 533 | { |
549 | return false; | 534 | return false; |
@@ -566,7 +551,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
566 | 551 | ||
567 | if (!String.IsNullOrEmpty(bestMatch)) | 552 | if (!String.IsNullOrEmpty(bestMatch)) |
568 | { | 553 | { |
569 | |||
570 | rdata = pathAllocators[bestMatch](request, response); | 554 | rdata = pathAllocators[bestMatch](request, response); |
571 | 555 | ||
572 | Rest.Log.DebugFormat("{0} Path based REST handler matched with <{1}>", MsgId, bestMatch); | 556 | Rest.Log.DebugFormat("{0} Path based REST handler matched with <{1}>", MsgId, bestMatch); |
@@ -575,7 +559,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
575 | { | 559 | { |
576 | pathHandlers[bestMatch](rdata); | 560 | pathHandlers[bestMatch](rdata); |
577 | } | 561 | } |
578 | 562 | ||
579 | // A plugin generated error indicates a request-related error | 563 | // A plugin generated error indicates a request-related error |
580 | // that has been handled by the plugin. | 564 | // that has been handled by the plugin. |
581 | 565 | ||
@@ -583,11 +567,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
583 | { | 567 | { |
584 | Rest.Log.WarnFormat("{0} Request failed: {1}", MsgId, r.Message); | 568 | Rest.Log.WarnFormat("{0} Request failed: {1}", MsgId, r.Message); |
585 | } | 569 | } |
586 | |||
587 | } | 570 | } |
588 | 571 | ||
589 | return (rdata == null) ? false : rdata.handled; | 572 | return (rdata == null) ? false : rdata.handled; |
590 | |||
591 | } | 573 | } |
592 | 574 | ||
593 | /// <summary> | 575 | /// <summary> |
@@ -597,7 +579,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
597 | 579 | ||
598 | internal void AddPathHandler(RestMethodHandler mh, string path, RestMethodAllocator ra) | 580 | internal void AddPathHandler(RestMethodHandler mh, string path, RestMethodAllocator ra) |
599 | { | 581 | { |
600 | |||
601 | if (!IsEnabled) | 582 | if (!IsEnabled) |
602 | { | 583 | { |
603 | return; | 584 | return; |
@@ -619,8 +600,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
619 | 600 | ||
620 | pathHandlers.Add(path, mh); | 601 | pathHandlers.Add(path, mh); |
621 | pathAllocators.Add(path, ra); | 602 | pathAllocators.Add(path, ra); |
622 | |||
623 | } | 603 | } |
624 | } | 604 | } |
625 | |||
626 | } | 605 | } |
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 61c3ac4..0c107d5 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs | |||
@@ -23,7 +23,6 @@ | |||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | ||
27 | */ | 26 | */ |
28 | 27 | ||
29 | using System; | 28 | using System; |
@@ -42,10 +41,8 @@ using Nini.Config; | |||
42 | 41 | ||
43 | namespace OpenSim.ApplicationPlugins.Rest.Inventory | 42 | namespace OpenSim.ApplicationPlugins.Rest.Inventory |
44 | { | 43 | { |
45 | |||
46 | public class RestInventoryServices : IRest | 44 | public class RestInventoryServices : IRest |
47 | { | 45 | { |
48 | |||
49 | private bool enabled = false; | 46 | private bool enabled = false; |
50 | private string qPrefix = "inventory"; | 47 | private string qPrefix = "inventory"; |
51 | 48 | ||
@@ -56,11 +53,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
56 | 53 | ||
57 | public RestInventoryServices() | 54 | public RestInventoryServices() |
58 | { | 55 | { |
59 | |||
60 | Rest.Log.InfoFormat("{0} Inventory services initializing", MsgId); | 56 | Rest.Log.InfoFormat("{0} Inventory services initializing", MsgId); |
61 | Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version); | 57 | Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version); |
62 | 58 | ||
63 | // If a relative path was specified for the handler's domain, | 59 | // If a relative path was specified for the handler's domain, |
64 | // add the standard prefix to make it absolute, e.g. /admin | 60 | // add the standard prefix to make it absolute, e.g. /admin |
65 | 61 | ||
66 | if (!qPrefix.StartsWith(Rest.UrlPathSeparator)) | 62 | if (!qPrefix.StartsWith(Rest.UrlPathSeparator)) |
@@ -77,7 +73,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
77 | enabled = true; | 73 | enabled = true; |
78 | 74 | ||
79 | Rest.Log.InfoFormat("{0} Inventory services initialization complete", MsgId); | 75 | Rest.Log.InfoFormat("{0} Inventory services initialization complete", MsgId); |
80 | |||
81 | } | 76 | } |
82 | 77 | ||
83 | /// <summary> | 78 | /// <summary> |
@@ -91,7 +86,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
91 | 86 | ||
92 | /// <summary> | 87 | /// <summary> |
93 | /// Called by the plug-in to halt REST processing. Local processing is | 88 | /// Called by the plug-in to halt REST processing. Local processing is |
94 | /// disabled, and control blocks until all current processing has | 89 | /// disabled, and control blocks until all current processing has |
95 | /// completed. No new processing will be started | 90 | /// completed. No new processing will be started |
96 | /// </summary> | 91 | /// </summary> |
97 | 92 | ||
@@ -134,7 +129,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
134 | 129 | ||
135 | private void DoInventory(RequestData hdata) | 130 | private void DoInventory(RequestData hdata) |
136 | { | 131 | { |
137 | |||
138 | InventoryRequestData rdata = (InventoryRequestData) hdata; | 132 | InventoryRequestData rdata = (InventoryRequestData) hdata; |
139 | 133 | ||
140 | Rest.Log.DebugFormat("{0} DoInventory ENTRY", MsgId); | 134 | Rest.Log.DebugFormat("{0} DoInventory ENTRY", MsgId); |
@@ -146,7 +140,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
146 | return; | 140 | return; |
147 | } | 141 | } |
148 | 142 | ||
149 | // Now that we know this is a serious attempt to | 143 | // Now that we know this is a serious attempt to |
150 | // access inventory data, we should find out who | 144 | // access inventory data, we should find out who |
151 | // is asking, and make sure they are authorized | 145 | // is asking, and make sure they are authorized |
152 | // to do so. We need to validate the caller's | 146 | // to do so. We need to validate the caller's |
@@ -157,9 +151,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
157 | // With the present HTTP server we can't use the | 151 | // With the present HTTP server we can't use the |
158 | // builtin authentication mechanisms because they | 152 | // builtin authentication mechanisms because they |
159 | // would be enforced for all in-bound requests. | 153 | // would be enforced for all in-bound requests. |
160 | // Instead we look at the headers ourselves and | 154 | // Instead we look at the headers ourselves and |
161 | // handle authentication directly. | 155 | // handle authentication directly. |
162 | 156 | ||
163 | try | 157 | try |
164 | { | 158 | { |
165 | if (!rdata.IsAuthenticated) | 159 | if (!rdata.IsAuthenticated) |
@@ -197,7 +191,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
197 | /// | 191 | /// |
198 | /// Indicating that this is an inventory request for | 192 | /// Indicating that this is an inventory request for |
199 | /// an avatar named Arthur Dent. This is ALl that is | 193 | /// an avatar named Arthur Dent. This is ALl that is |
200 | /// required to designate a GET for an entire | 194 | /// required to designate a GET for an entire |
201 | /// inventory. | 195 | /// inventory. |
202 | /// </remarks> | 196 | /// </remarks> |
203 | 197 | ||
@@ -238,7 +232,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
238 | 232 | ||
239 | if (rdata.userProfile != null) | 233 | if (rdata.userProfile != null) |
240 | { | 234 | { |
241 | Rest.Log.DebugFormat("{0} Profile obtained for agent {1} {2}", | 235 | Rest.Log.DebugFormat("{0} Profile obtained for agent {1} {2}", |
242 | MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); | 236 | MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); |
243 | } | 237 | } |
244 | else | 238 | else |
@@ -260,18 +254,18 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
260 | // response is not recieved in a timely fashion. | 254 | // response is not recieved in a timely fashion. |
261 | 255 | ||
262 | rdata.uuid = rdata.userProfile.ID; | 256 | rdata.uuid = rdata.userProfile.ID; |
263 | 257 | ||
264 | if (Rest.InventoryServices.HasInventoryForUser(rdata.uuid)) | 258 | if (Rest.InventoryServices.HasInventoryForUser(rdata.uuid)) |
265 | { | 259 | { |
266 | 260 | ||
267 | rdata.root = Rest.InventoryServices.RequestRootFolder(rdata.uuid); | 261 | rdata.root = Rest.InventoryServices.RequestRootFolder(rdata.uuid); |
268 | 262 | ||
269 | Rest.Log.DebugFormat("{0} Inventory Root retrieved for {1} {2}", | 263 | Rest.Log.DebugFormat("{0} Inventory Root retrieved for {1} {2}", |
270 | MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); | 264 | MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); |
271 | 265 | ||
272 | Rest.InventoryServices.RequestInventoryForUser(rdata.uuid, rdata.GetUserInventory); | 266 | Rest.InventoryServices.RequestInventoryForUser(rdata.uuid, rdata.GetUserInventory); |
273 | 267 | ||
274 | Rest.Log.DebugFormat("{0} Inventory catalog requested for {1} {2}", | 268 | Rest.Log.DebugFormat("{0} Inventory catalog requested for {1} {2}", |
275 | MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); | 269 | MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); |
276 | 270 | ||
277 | lock (rdata) | 271 | lock (rdata) |
@@ -284,15 +278,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
284 | 278 | ||
285 | if (rdata.root == null) | 279 | if (rdata.root == null) |
286 | { | 280 | { |
287 | Rest.Log.DebugFormat("{0} Inventory is not available [1] for agent {1} {2}", | 281 | Rest.Log.DebugFormat("{0} Inventory is not available [1] for agent {1} {2}", |
288 | MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); | 282 | MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); |
289 | rdata.Fail(Rest.HttpStatusCodeServerError,Rest.HttpStatusDescServerError+": inventory retrieval failed"); | 283 | rdata.Fail(Rest.HttpStatusCodeServerError,Rest.HttpStatusDescServerError+": inventory retrieval failed"); |
290 | } | 284 | } |
291 | |||
292 | } | 285 | } |
293 | else | 286 | else |
294 | { | 287 | { |
295 | Rest.Log.DebugFormat("{0} Inventory is not available for agent [3] {1} {2}", | 288 | Rest.Log.DebugFormat("{0} Inventory is not available for agent [3] {1} {2}", |
296 | MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); | 289 | MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); |
297 | rdata.Fail(Rest.HttpStatusCodeNotFound,Rest.HttpStatusDescNotFound+": no inventory for user"); | 290 | rdata.Fail(Rest.HttpStatusCodeNotFound,Rest.HttpStatusDescNotFound+": no inventory for user"); |
298 | } | 291 | } |
@@ -302,7 +295,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
302 | 295 | ||
303 | switch (rdata.method) | 296 | switch (rdata.method) |
304 | { | 297 | { |
305 | |||
306 | case Rest.HEAD : // Do the processing, set the status code, suppress entity | 298 | case Rest.HEAD : // Do the processing, set the status code, suppress entity |
307 | DoGet(rdata); | 299 | DoGet(rdata); |
308 | rdata.buffer = null; | 300 | rdata.buffer = null; |
@@ -325,13 +317,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
325 | break; | 317 | break; |
326 | 318 | ||
327 | default : | 319 | default : |
328 | Rest.Log.DebugFormat("{0} Method {1} not supported for {2}", | 320 | Rest.Log.DebugFormat("{0} Method {1} not supported for {2}", |
329 | MsgId, rdata.method, rdata.path); | 321 | MsgId, rdata.method, rdata.path); |
330 | rdata.Fail(Rest.HttpStatusCodeMethodNotAllowed, | 322 | rdata.Fail(Rest.HttpStatusCodeMethodNotAllowed, |
331 | Rest.HttpStatusDescMethodNotAllowed+": "+rdata.method+" not supported"); | 323 | Rest.HttpStatusDescMethodNotAllowed+": "+rdata.method+" not supported"); |
332 | break; | 324 | break; |
333 | } | 325 | } |
334 | |||
335 | } | 326 | } |
336 | 327 | ||
337 | #endregion Interface | 328 | #endregion Interface |
@@ -346,12 +337,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
346 | 337 | ||
347 | private void DoGet(InventoryRequestData rdata) | 338 | private void DoGet(InventoryRequestData rdata) |
348 | { | 339 | { |
349 | |||
350 | rdata.initXmlWriter(); | 340 | rdata.initXmlWriter(); |
351 | 341 | ||
352 | rdata.writer.WriteStartElement(String.Empty,"Inventory",String.Empty); | 342 | rdata.writer.WriteStartElement(String.Empty,"Inventory",String.Empty); |
353 | 343 | ||
354 | // If there was only one parameter, then the entire | 344 | // If there was only one parameter, then the entire |
355 | // inventory is being requested. | 345 | // inventory is being requested. |
356 | 346 | ||
357 | if (rdata.parameters.Length == 1) | 347 | if (rdata.parameters.Length == 1) |
@@ -361,7 +351,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
361 | 351 | ||
362 | // If there are additional parameters, then these represent | 352 | // If there are additional parameters, then these represent |
363 | // a path relative to the root of the inventory. This path | 353 | // a path relative to the root of the inventory. This path |
364 | // must be traversed before we format the sub-tree thus | 354 | // must be traversed before we format the sub-tree thus |
365 | // identified. | 355 | // identified. |
366 | 356 | ||
367 | else | 357 | else |
@@ -373,9 +363,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
373 | 363 | ||
374 | rdata.Complete(); | 364 | rdata.Complete(); |
375 | rdata.Respond("Inventory " + rdata.method + ": Normal completion"); | 365 | rdata.Respond("Inventory " + rdata.method + ": Normal completion"); |
376 | |||
377 | } | 366 | } |
378 | 367 | ||
379 | /// <summary> | 368 | /// <summary> |
380 | /// In the case of the inventory, and probably in general, | 369 | /// In the case of the inventory, and probably in general, |
381 | /// the distinction between PUT and POST is not always | 370 | /// the distinction between PUT and POST is not always |
@@ -389,29 +378,28 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
389 | /// The best way to exaplain the distinction is to | 378 | /// The best way to exaplain the distinction is to |
390 | /// consider the relationship between the URI and the | 379 | /// consider the relationship between the URI and the |
391 | /// entity in question. For POST, the URI identifies the | 380 | /// entity in question. For POST, the URI identifies the |
392 | /// entity to be modified or replaced. | 381 | /// entity to be modified or replaced. |
393 | /// If the operation is PUT,then the URI describes the | 382 | /// If the operation is PUT,then the URI describes the |
394 | /// context into which the new entity will be added. | 383 | /// context into which the new entity will be added. |
395 | /// | 384 | /// |
396 | /// As an example, suppose the URI contains: | 385 | /// As an example, suppose the URI contains: |
397 | /// /admin/inventory/Clothing | 386 | /// /admin/inventory/Clothing |
398 | /// | 387 | /// |
399 | /// A POST request will result in some modification of | 388 | /// A POST request will result in some modification of |
400 | /// the folder or item named "Clothing". Whereas a PUT | 389 | /// the folder or item named "Clothing". Whereas a PUT |
401 | /// request will add some new information into the | 390 | /// request will add some new information into the |
402 | /// content identified by Clothing. It follows from this | 391 | /// content identified by Clothing. It follows from this |
403 | /// that for PUT, the element identified by the URI must | 392 | /// that for PUT, the element identified by the URI must |
404 | /// be a folder. | 393 | /// be a folder. |
405 | /// </summary> | 394 | /// </summary> |
406 | 395 | ||
407 | /// <summary> | 396 | /// <summary> |
408 | /// PUT adds new information to the inventory in the | 397 | /// PUT adds new information to the inventory in the |
409 | /// context identified by the URI. | 398 | /// context identified by the URI. |
410 | /// </summary> | 399 | /// </summary> |
411 | 400 | ||
412 | private void DoPut(InventoryRequestData rdata) | 401 | private void DoPut(InventoryRequestData rdata) |
413 | { | 402 | { |
414 | |||
415 | // Resolve the context node specified in the URI. Entity | 403 | // Resolve the context node specified in the URI. Entity |
416 | // data will be ADDED beneath this node. | 404 | // data will be ADDED beneath this node. |
417 | 405 | ||
@@ -419,11 +407,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
419 | 407 | ||
420 | // Processing depends upon the type of inventory node | 408 | // Processing depends upon the type of inventory node |
421 | // identified in the URI. This is the CONTEXT for the | 409 | // identified in the URI. This is the CONTEXT for the |
422 | // change. We either got a context or we threw an | 410 | // change. We either got a context or we threw an |
423 | // exception. | 411 | // exception. |
424 | 412 | ||
425 | // It follows that we can only add information if the URI | 413 | // It follows that we can only add information if the URI |
426 | // has identified a folder. So only a type of folder is supported | 414 | // has identified a folder. So only a type of folder is supported |
427 | // in this case. | 415 | // in this case. |
428 | 416 | ||
429 | if (typeof(InventoryFolderBase) == InventoryNode.GetType() || | 417 | if (typeof(InventoryFolderBase) == InventoryNode.GetType() || |
@@ -448,12 +436,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
448 | XmlInventoryCollection entity = ReconstituteEntity(rdata); | 436 | XmlInventoryCollection entity = ReconstituteEntity(rdata); |
449 | 437 | ||
450 | // Inlined assets can be included in entity. These must be incorporated into | 438 | // Inlined assets can be included in entity. These must be incorporated into |
451 | // the asset database before we attempt to update the inventory. If anything | 439 | // the asset database before we attempt to update the inventory. If anything |
452 | // fails, return a failure to requestor. | 440 | // fails, return a failure to requestor. |
453 | 441 | ||
454 | if (entity.Assets.Count > 0) | 442 | if (entity.Assets.Count > 0) |
455 | { | 443 | { |
456 | |||
457 | Rest.Log.DebugFormat("{0} Adding {1} assets to server", | 444 | Rest.Log.DebugFormat("{0} Adding {1} assets to server", |
458 | MsgId, entity.Assets.Count); | 445 | MsgId, entity.Assets.Count); |
459 | 446 | ||
@@ -467,9 +454,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
467 | { | 454 | { |
468 | Rest.Dump(asset.Data); | 455 | Rest.Dump(asset.Data); |
469 | } | 456 | } |
470 | |||
471 | } | 457 | } |
472 | |||
473 | } | 458 | } |
474 | 459 | ||
475 | // Modify the context using the collection of folders and items | 460 | // Modify the context using the collection of folders and items |
@@ -477,7 +462,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
477 | 462 | ||
478 | foreach (InventoryFolderBase folder in entity.Folders) | 463 | foreach (InventoryFolderBase folder in entity.Folders) |
479 | { | 464 | { |
480 | |||
481 | InventoryFolderBase found; | 465 | InventoryFolderBase found; |
482 | 466 | ||
483 | // If the parentID is zero, then this folder is going | 467 | // If the parentID is zero, then this folder is going |
@@ -519,7 +503,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
519 | Rest.Log.DebugFormat("{0} Adding new folder", MsgId); | 503 | Rest.Log.DebugFormat("{0} Adding new folder", MsgId); |
520 | Rest.InventoryServices.AddFolder(folder); | 504 | Rest.InventoryServices.AddFolder(folder); |
521 | } | 505 | } |
522 | |||
523 | } | 506 | } |
524 | 507 | ||
525 | // Now we repeat a similar process for the items included | 508 | // Now we repeat a similar process for the items included |
@@ -527,7 +510,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
527 | 510 | ||
528 | foreach (InventoryItemBase item in entity.Items) | 511 | foreach (InventoryItemBase item in entity.Items) |
529 | { | 512 | { |
530 | |||
531 | InventoryItemBase found = null; | 513 | InventoryItemBase found = null; |
532 | 514 | ||
533 | // If the parentID is zero, then this is going | 515 | // If the parentID is zero, then this is going |
@@ -538,7 +520,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
538 | item.Folder = context.ID; | 520 | item.Folder = context.ID; |
539 | } | 521 | } |
540 | 522 | ||
541 | // Determine whether this is a new item or a | 523 | // Determine whether this is a new item or a |
542 | // replacement definition. | 524 | // replacement definition. |
543 | 525 | ||
544 | foreach (InventoryItemBase xi in rdata.items) | 526 | foreach (InventoryItemBase xi in rdata.items) |
@@ -563,9 +545,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
563 | MsgId, item.ID, item.AssetID, item.InvType, item.AssetType, item.Name); | 545 | MsgId, item.ID, item.AssetID, item.InvType, item.AssetType, item.Name); |
564 | Rest.InventoryServices.AddItem(item); | 546 | Rest.InventoryServices.AddItem(item); |
565 | } | 547 | } |
566 | |||
567 | } | 548 | } |
568 | |||
569 | } | 549 | } |
570 | else | 550 | else |
571 | { | 551 | { |
@@ -577,34 +557,32 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
577 | 557 | ||
578 | rdata.Complete(); | 558 | rdata.Complete(); |
579 | rdata.Respond("Inventory " + rdata.method + ": Normal completion"); | 559 | rdata.Respond("Inventory " + rdata.method + ": Normal completion"); |
580 | |||
581 | } | 560 | } |
582 | 561 | ||
583 | /// <summary> | 562 | /// <summary> |
584 | /// POST updates the URI-identified element in the inventory. This | 563 | /// POST updates the URI-identified element in the inventory. This |
585 | /// is actually far more flexible than it might at first sound. For | 564 | /// is actually far more flexible than it might at first sound. For |
586 | /// POST the URI serves two purposes: | 565 | /// POST the URI serves two purposes: |
587 | /// [1] It identifies the user whose inventory is to be | 566 | /// [1] It identifies the user whose inventory is to be |
588 | /// processed. | 567 | /// processed. |
589 | /// [2] It optionally specifies a subtree of the inventory | 568 | /// [2] It optionally specifies a subtree of the inventory |
590 | /// that is to be used to resolve any relative subtree | 569 | /// that is to be used to resolve any relative subtree |
591 | /// specifications in the entity. If nothing is specified | 570 | /// specifications in the entity. If nothing is specified |
592 | /// then the whole inventory is implied. | 571 | /// then the whole inventory is implied. |
593 | /// Please note that the subtree specified by the URI is only relevant | 572 | /// Please note that the subtree specified by the URI is only relevant |
594 | /// to an entity containing a URI relative specification, i.e. one or | 573 | /// to an entity containing a URI relative specification, i.e. one or |
595 | /// more elements do not specify parent folder information. These | 574 | /// more elements do not specify parent folder information. These |
596 | /// elements will be implicitly referenced within the context identified | 575 | /// elements will be implicitly referenced within the context identified |
597 | /// by the URI. | 576 | /// by the URI. |
598 | /// If an element in the entity specifies an explicit parent folder, then | 577 | /// If an element in the entity specifies an explicit parent folder, then |
599 | /// that parent is effective, regardless of any value specified in the | 578 | /// that parent is effective, regardless of any value specified in the |
600 | /// URI. If the parent does not exist, then the element, and any dependent | 579 | /// URI. If the parent does not exist, then the element, and any dependent |
601 | /// elements, are ignored. This case is actually detected and handled | 580 | /// elements, are ignored. This case is actually detected and handled |
602 | /// during the reconstitution process. | 581 | /// during the reconstitution process. |
603 | /// </summary> | 582 | /// </summary> |
604 | 583 | ||
605 | private void DoPost(InventoryRequestData rdata) | 584 | private void DoPost(InventoryRequestData rdata) |
606 | { | 585 | { |
607 | |||
608 | int count = 0; | 586 | int count = 0; |
609 | 587 | ||
610 | // Resolve the inventory node that is to be modified. | 588 | // Resolve the inventory node that is to be modified. |
@@ -612,8 +590,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
612 | Object InventoryNode = getInventoryNode(rdata, rdata.root, 1); | 590 | Object InventoryNode = getInventoryNode(rdata, rdata.root, 1); |
613 | 591 | ||
614 | // As long as we have a node, then we have something | 592 | // As long as we have a node, then we have something |
615 | // meaningful to do, unlike PUT. So we reconstitute the | 593 | // meaningful to do, unlike PUT. So we reconstitute the |
616 | // subtree before doing anything else. Note that we | 594 | // subtree before doing anything else. Note that we |
617 | // etiher got a valid node or we threw an exception. | 595 | // etiher got a valid node or we threw an exception. |
618 | 596 | ||
619 | XmlInventoryCollection entity = ReconstituteEntity(rdata); | 597 | XmlInventoryCollection entity = ReconstituteEntity(rdata); |
@@ -639,7 +617,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
639 | { | 617 | { |
640 | Rest.Dump(asset.Data); | 618 | Rest.Dump(asset.Data); |
641 | } | 619 | } |
642 | |||
643 | } | 620 | } |
644 | } | 621 | } |
645 | 622 | ||
@@ -648,15 +625,15 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
648 | /// </summary> | 625 | /// </summary> |
649 | /// <remarks> | 626 | /// <remarks> |
650 | /// The root node in the entity will replace the node identified | 627 | /// The root node in the entity will replace the node identified |
651 | /// by the URI. This means the parent will remain the same, but | 628 | /// by the URI. This means the parent will remain the same, but |
652 | /// any or all attributes associated with the named element | 629 | /// any or all attributes associated with the named element |
653 | /// will change. | 630 | /// will change. |
654 | /// | 631 | /// |
655 | /// If the inventory collection contains an element with a zero | 632 | /// If the inventory collection contains an element with a zero |
656 | /// parent ID, then this is taken to be the replacement for the | 633 | /// parent ID, then this is taken to be the replacement for the |
657 | /// named node. The collection MAY also specify an explicit | 634 | /// named node. The collection MAY also specify an explicit |
658 | /// parent ID, in this case it MAY identify the same parent as | 635 | /// parent ID, in this case it MAY identify the same parent as |
659 | /// the current node, or it MAY specify a different parent, | 636 | /// the current node, or it MAY specify a different parent, |
660 | /// indicating that the folder is being moved in addition to any | 637 | /// indicating that the folder is being moved in addition to any |
661 | /// other modifications being made. | 638 | /// other modifications being made. |
662 | /// </remarks> | 639 | /// </remarks> |
@@ -664,10 +641,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
664 | if (typeof(InventoryFolderBase) == InventoryNode.GetType() || | 641 | if (typeof(InventoryFolderBase) == InventoryNode.GetType() || |
665 | typeof(InventoryFolderImpl) == InventoryNode.GetType()) | 642 | typeof(InventoryFolderImpl) == InventoryNode.GetType()) |
666 | { | 643 | { |
667 | |||
668 | InventoryFolderBase uri = (InventoryFolderBase) InventoryNode; | 644 | InventoryFolderBase uri = (InventoryFolderBase) InventoryNode; |
669 | InventoryFolderBase xml = null; | 645 | InventoryFolderBase xml = null; |
670 | 646 | ||
671 | // Scan the set of folders in the entity collection for an | 647 | // Scan the set of folders in the entity collection for an |
672 | // entry that matches the context folder. It is assumed that | 648 | // entry that matches the context folder. It is assumed that |
673 | // the only reliable indicator of this is a zero UUID ( using | 649 | // the only reliable indicator of this is a zero UUID ( using |
@@ -676,7 +652,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
676 | // ambiguity in this case because this is POST and we are | 652 | // ambiguity in this case because this is POST and we are |
677 | // supposed to be modifying a specific node. | 653 | // supposed to be modifying a specific node. |
678 | // We assign any element IDs required as an economy; we don't | 654 | // We assign any element IDs required as an economy; we don't |
679 | // want to iterate over the fodler set again if it can be | 655 | // want to iterate over the fodler set again if it can be |
680 | // helped. | 656 | // helped. |
681 | 657 | ||
682 | foreach (InventoryFolderBase folder in entity.Folders) | 658 | foreach (InventoryFolderBase folder in entity.Folders) |
@@ -701,29 +677,27 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
701 | { | 677 | { |
702 | Rest.Log.DebugFormat("{0} {1}: Request for <{2}> is ambiguous", | 678 | Rest.Log.DebugFormat("{0} {1}: Request for <{2}> is ambiguous", |
703 | MsgId, rdata.method, rdata.path); | 679 | MsgId, rdata.method, rdata.path); |
704 | rdata.Fail(Rest.HttpStatusCodeBadRequest, | 680 | rdata.Fail(Rest.HttpStatusCodeBadRequest, |
705 | Rest.HttpStatusDescBadRequest+": context is ambiguous"); | 681 | Rest.HttpStatusDescBadRequest+": context is ambiguous"); |
706 | } | 682 | } |
707 | 683 | ||
708 | // Exactly one entry means we ARE replacing the node | 684 | // Exactly one entry means we ARE replacing the node |
709 | // identified by the URI. So we delete the old folder | 685 | // identified by the URI. So we delete the old folder |
710 | // by moving it to the trash and then purging it. | 686 | // by moving it to the trash and then purging it. |
711 | // We then add all of the folders and items we | 687 | // We then add all of the folders and items we |
712 | // included in the entity. The subtree has been | 688 | // included in the entity. The subtree has been |
713 | // modified. | 689 | // modified. |
714 | 690 | ||
715 | if (count == 1) | 691 | if (count == 1) |
716 | { | 692 | { |
717 | |||
718 | InventoryFolderBase TrashCan = GetTrashCan(rdata); | 693 | InventoryFolderBase TrashCan = GetTrashCan(rdata); |
719 | 694 | ||
720 | uri.ParentID = TrashCan.ID; | 695 | uri.ParentID = TrashCan.ID; |
721 | Rest.InventoryServices.MoveFolder(uri); | 696 | Rest.InventoryServices.MoveFolder(uri); |
722 | Rest.InventoryServices.PurgeFolder(TrashCan); | 697 | Rest.InventoryServices.PurgeFolder(TrashCan); |
723 | |||
724 | } | 698 | } |
725 | 699 | ||
726 | // Now, regardelss of what they represent, we | 700 | // Now, regardelss of what they represent, we |
727 | // integrate all of the elements in the entity. | 701 | // integrate all of the elements in the entity. |
728 | 702 | ||
729 | foreach (InventoryFolderBase f in entity.Folders) | 703 | foreach (InventoryFolderBase f in entity.Folders) |
@@ -735,7 +709,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
735 | { | 709 | { |
736 | Rest.InventoryServices.AddItem(it); | 710 | Rest.InventoryServices.AddItem(it); |
737 | } | 711 | } |
738 | |||
739 | } | 712 | } |
740 | 713 | ||
741 | /// <summary> | 714 | /// <summary> |
@@ -748,7 +721,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
748 | 721 | ||
749 | else | 722 | else |
750 | { | 723 | { |
751 | |||
752 | InventoryItemBase uri = (InventoryItemBase) InventoryNode; | 724 | InventoryItemBase uri = (InventoryItemBase) InventoryNode; |
753 | InventoryItemBase xml = null; | 725 | InventoryItemBase xml = null; |
754 | 726 | ||
@@ -756,7 +728,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
756 | { | 728 | { |
757 | Rest.Log.DebugFormat("{0} {1}: Request should not contain any folders <{2}>", | 729 | Rest.Log.DebugFormat("{0} {1}: Request should not contain any folders <{2}>", |
758 | MsgId, rdata.method, rdata.path); | 730 | MsgId, rdata.method, rdata.path); |
759 | rdata.Fail(Rest.HttpStatusCodeBadRequest, | 731 | rdata.Fail(Rest.HttpStatusCodeBadRequest, |
760 | Rest.HttpStatusDescBadRequest+": folder is not allowed"); | 732 | Rest.HttpStatusDescBadRequest+": folder is not allowed"); |
761 | } | 733 | } |
762 | 734 | ||
@@ -764,12 +736,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
764 | { | 736 | { |
765 | Rest.Log.DebugFormat("{0} {1}: Entity contains too many items <{2}>", | 737 | Rest.Log.DebugFormat("{0} {1}: Entity contains too many items <{2}>", |
766 | MsgId, rdata.method, rdata.path); | 738 | MsgId, rdata.method, rdata.path); |
767 | rdata.Fail(Rest.HttpStatusCodeBadRequest, | 739 | rdata.Fail(Rest.HttpStatusCodeBadRequest, |
768 | Rest.HttpStatusDescBadRequest+": too may items"); | 740 | Rest.HttpStatusDescBadRequest+": too may items"); |
769 | } | 741 | } |
770 | 742 | ||
771 | xml = entity.Items[0]; | 743 | xml = entity.Items[0]; |
772 | 744 | ||
773 | if (xml.ID == LLUUID.Zero) | 745 | if (xml.ID == LLUUID.Zero) |
774 | { | 746 | { |
775 | xml.ID = LLUUID.Random(); | 747 | xml.ID = LLUUID.Random(); |
@@ -786,12 +758,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
786 | // Add the new item to the inventory | 758 | // Add the new item to the inventory |
787 | 759 | ||
788 | Rest.InventoryServices.AddItem(xml); | 760 | Rest.InventoryServices.AddItem(xml); |
789 | |||
790 | } | 761 | } |
791 | 762 | ||
792 | rdata.Complete(); | 763 | rdata.Complete(); |
793 | rdata.Respond("Inventory " + rdata.method + ": Normal completion"); | 764 | rdata.Respond("Inventory " + rdata.method + ": Normal completion"); |
794 | |||
795 | } | 765 | } |
796 | 766 | ||
797 | /// <summary> | 767 | /// <summary> |
@@ -804,7 +774,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
804 | /// | 774 | /// |
805 | /// Folders are deleted by moving them to another folder and then | 775 | /// Folders are deleted by moving them to another folder and then |
806 | /// purging that folder. We'll do that by creating a temporary | 776 | /// purging that folder. We'll do that by creating a temporary |
807 | /// sub-folder in the TrashCan and purging that folder's | 777 | /// sub-folder in the TrashCan and purging that folder's |
808 | /// contents. If we can't can it, we don't delete it... | 778 | /// contents. If we can't can it, we don't delete it... |
809 | /// So, if no trashcan is available, the request does nothing. | 779 | /// So, if no trashcan is available, the request does nothing. |
810 | /// Items are summarily deleted. | 780 | /// Items are summarily deleted. |
@@ -816,13 +786,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
816 | 786 | ||
817 | private void DoDelete(InventoryRequestData rdata) | 787 | private void DoDelete(InventoryRequestData rdata) |
818 | { | 788 | { |
819 | |||
820 | Object InventoryNode = getInventoryNode(rdata, rdata.root, 1); | 789 | Object InventoryNode = getInventoryNode(rdata, rdata.root, 1); |
821 | 790 | ||
822 | if (typeof(InventoryFolderBase) == InventoryNode.GetType() || | 791 | if (typeof(InventoryFolderBase) == InventoryNode.GetType() || |
823 | typeof(InventoryFolderImpl) == InventoryNode.GetType()) | 792 | typeof(InventoryFolderImpl) == InventoryNode.GetType()) |
824 | { | 793 | { |
825 | |||
826 | InventoryFolderBase TrashCan = GetTrashCan(rdata); | 794 | InventoryFolderBase TrashCan = GetTrashCan(rdata); |
827 | 795 | ||
828 | InventoryFolderBase folder = (InventoryFolderBase) InventoryNode; | 796 | InventoryFolderBase folder = (InventoryFolderBase) InventoryNode; |
@@ -831,7 +799,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
831 | folder.ParentID = TrashCan.ID; | 799 | folder.ParentID = TrashCan.ID; |
832 | Rest.InventoryServices.MoveFolder(folder); | 800 | Rest.InventoryServices.MoveFolder(folder); |
833 | Rest.InventoryServices.PurgeFolder(TrashCan); | 801 | Rest.InventoryServices.PurgeFolder(TrashCan); |
834 | |||
835 | } | 802 | } |
836 | 803 | ||
837 | // Deleting items is much more straight forward. | 804 | // Deleting items is much more straight forward. |
@@ -846,18 +813,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
846 | 813 | ||
847 | rdata.Complete(); | 814 | rdata.Complete(); |
848 | rdata.Respond("Inventory " + rdata.method + ": Normal completion"); | 815 | rdata.Respond("Inventory " + rdata.method + ": Normal completion"); |
849 | |||
850 | } | 816 | } |
851 | 817 | ||
852 | #endregion method-specific processing | 818 | #endregion method-specific processing |
853 | 819 | ||
854 | /// <summary> | 820 | /// <summary> |
855 | /// This method is called to obtain the OpenSim inventory object identified | 821 | /// This method is called to obtain the OpenSim inventory object identified |
856 | /// by the supplied URI. This may be either an Item or a Folder, so a suitably | 822 | /// by the supplied URI. This may be either an Item or a Folder, so a suitably |
857 | /// ambiguous return type is employed (Object). This method recurses as | 823 | /// ambiguous return type is employed (Object). This method recurses as |
858 | /// necessary to process the designated hierarchy. | 824 | /// necessary to process the designated hierarchy. |
859 | /// | 825 | /// |
860 | /// If we reach the end of the URI then we return the contextural folder to | 826 | /// If we reach the end of the URI then we return the contextural folder to |
861 | /// our caller. | 827 | /// our caller. |
862 | /// | 828 | /// |
863 | /// If we are not yet at the end of the URI we attempt to find a child folder | 829 | /// If we are not yet at the end of the URI we attempt to find a child folder |
@@ -869,8 +835,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
869 | /// Otherwise we fail the request on the ground of an invalid URI. | 835 | /// Otherwise we fail the request on the ground of an invalid URI. |
870 | /// | 836 | /// |
871 | /// <note> | 837 | /// <note> |
872 | /// This mechanism cannot detect the case where duplicate subtrees satisfy a | 838 | /// This mechanism cannot detect the case where duplicate subtrees satisfy a |
873 | /// request. In such a case the 1st element gets processed. If this is a | 839 | /// request. In such a case the 1st element gets processed. If this is a |
874 | /// problem, then UUID should be used to identify the end-node. This is basic | 840 | /// problem, then UUID should be used to identify the end-node. This is basic |
875 | /// premise of normal inventory processing. The name is an informational, and | 841 | /// premise of normal inventory processing. The name is an informational, and |
876 | /// not a defining, attribute. | 842 | /// not a defining, attribute. |
@@ -880,7 +846,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
880 | 846 | ||
881 | private Object getInventoryNode(InventoryRequestData rdata, InventoryFolderBase folder, int pi) | 847 | private Object getInventoryNode(InventoryRequestData rdata, InventoryFolderBase folder, int pi) |
882 | { | 848 | { |
883 | |||
884 | Rest.Log.DebugFormat("{0} Searching folder {1} {2} [{3}]", MsgId, folder.ID, folder.Name, pi); | 849 | Rest.Log.DebugFormat("{0} Searching folder {1} {2} [{3}]", MsgId, folder.ID, folder.Name, pi); |
885 | 850 | ||
886 | // We have just run off the end of the parameter sequence | 851 | // We have just run off the end of the parameter sequence |
@@ -894,17 +859,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
894 | // get us there. | 859 | // get us there. |
895 | 860 | ||
896 | if (rdata.folders != null) | 861 | if (rdata.folders != null) |
862 | { | ||
897 | foreach (InventoryFolderBase f in rdata.folders) | 863 | foreach (InventoryFolderBase f in rdata.folders) |
898 | { | 864 | { |
899 | // Look for the present node in the directory list | 865 | // Look for the present node in the directory list |
900 | if (f.ParentID == folder.ID && | 866 | if (f.ParentID == folder.ID && |
901 | (f.Name == rdata.parameters[pi] || | 867 | (f.Name == rdata.parameters[pi] || |
902 | f.ID.ToString() == rdata.parameters[pi])) | 868 | f.ID.ToString() == rdata.parameters[pi])) |
903 | { | 869 | { |
904 | return getInventoryNode(rdata, f, pi+1); | 870 | return getInventoryNode(rdata, f, pi+1); |
905 | } | 871 | } |
906 | } | 872 | } |
907 | 873 | } | |
874 | |||
908 | // No folders that match. Perhaps this parameter identifies an item? If | 875 | // No folders that match. Perhaps this parameter identifies an item? If |
909 | // it does, then it MUST also be the last name in the sequence. | 876 | // it does, then it MUST also be the last name in the sequence. |
910 | 877 | ||
@@ -916,7 +883,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
916 | InventoryItemBase li = null; | 883 | InventoryItemBase li = null; |
917 | foreach (InventoryItemBase i in rdata.items) | 884 | foreach (InventoryItemBase i in rdata.items) |
918 | { | 885 | { |
919 | if (i.Folder == folder.ID && | 886 | if (i.Folder == folder.ID && |
920 | (i.Name == rdata.parameters[pi] || | 887 | (i.Name == rdata.parameters[pi] || |
921 | i.ID.ToString() == rdata.parameters[pi])) | 888 | i.ID.ToString() == rdata.parameters[pi])) |
922 | { | 889 | { |
@@ -944,11 +911,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
944 | rdata.Fail(Rest.HttpStatusCodeNotFound, Rest.HttpStatusDescNotFound+": resource "+rdata.path+" not found"); | 911 | rdata.Fail(Rest.HttpStatusCodeNotFound, Rest.HttpStatusDescNotFound+": resource "+rdata.path+" not found"); |
945 | 912 | ||
946 | return null; /* Never reached */ | 913 | return null; /* Never reached */ |
947 | |||
948 | } | 914 | } |
949 | 915 | ||
950 | /// <summary> | 916 | /// <summary> |
951 | /// This routine traverse the inventory's structure until the end-point identified | 917 | /// This routine traverse the inventory's structure until the end-point identified |
952 | /// in the URI is reached, the remainder of the inventory (if any) is then formatted | 918 | /// in the URI is reached, the remainder of the inventory (if any) is then formatted |
953 | /// and returned to the requestor. | 919 | /// and returned to the requestor. |
954 | /// | 920 | /// |
@@ -961,14 +927,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
961 | 927 | ||
962 | private void traverseInventory(InventoryRequestData rdata, InventoryFolderBase folder, int pi) | 928 | private void traverseInventory(InventoryRequestData rdata, InventoryFolderBase folder, int pi) |
963 | { | 929 | { |
964 | |||
965 | Rest.Log.DebugFormat("{0} Folder : {1} {2} [{3}]", MsgId, folder.ID, folder.Name, pi); | 930 | Rest.Log.DebugFormat("{0} Folder : {1} {2} [{3}]", MsgId, folder.ID, folder.Name, pi); |
966 | 931 | ||
967 | if (rdata.folders != null) | 932 | if (rdata.folders != null) |
968 | { | 933 | { |
969 | foreach (InventoryFolderBase f in rdata.folders) | 934 | foreach (InventoryFolderBase f in rdata.folders) |
970 | { | 935 | { |
971 | if (f.ParentID == folder.ID && | 936 | if (f.ParentID == folder.ID && |
972 | (f.Name == rdata.parameters[pi] || | 937 | (f.Name == rdata.parameters[pi] || |
973 | f.ID.ToString() == rdata.parameters[pi])) | 938 | f.ID.ToString() == rdata.parameters[pi])) |
974 | { | 939 | { |
@@ -991,13 +956,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
991 | { | 956 | { |
992 | foreach (InventoryItemBase i in rdata.items) | 957 | foreach (InventoryItemBase i in rdata.items) |
993 | { | 958 | { |
994 | if (i.Folder == folder.ID && | 959 | if (i.Folder == folder.ID && |
995 | (i.Name == rdata.parameters[pi] || | 960 | (i.Name == rdata.parameters[pi] || |
996 | i.ID.ToString() == rdata.parameters[pi])) | 961 | i.ID.ToString() == rdata.parameters[pi])) |
997 | { | 962 | { |
998 | // Fetching an Item has a special significance. In this | 963 | // Fetching an Item has a special significance. In this |
999 | // case we also want to fetch the associated asset. | 964 | // case we also want to fetch the associated asset. |
1000 | // To make it interesting, we'll d this via redirection. | 965 | // To make it interesting, we'll d this via redirection. |
1001 | string asseturl = "http://" + rdata.hostname + ":" + rdata.port + | 966 | string asseturl = "http://" + rdata.hostname + ":" + rdata.port + |
1002 | "/admin/assets" + Rest.UrlPathSeparator + i.AssetID.ToString(); | 967 | "/admin/assets" + Rest.UrlPathSeparator + i.AssetID.ToString(); |
1003 | rdata.Redirect(asseturl,Rest.PERMANENT); | 968 | rdata.Redirect(asseturl,Rest.PERMANENT); |
@@ -1007,10 +972,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1007 | } | 972 | } |
1008 | } | 973 | } |
1009 | 974 | ||
1010 | Rest.Log.DebugFormat("{0} Inventory does not contain item/folder: <{1}>", | 975 | Rest.Log.DebugFormat("{0} Inventory does not contain item/folder: <{1}>", |
1011 | MsgId, rdata.path); | 976 | MsgId, rdata.path); |
1012 | rdata.Fail(Rest.HttpStatusCodeNotFound,Rest.HttpStatusDescNotFound+": no such item/folder"); | 977 | rdata.Fail(Rest.HttpStatusCodeNotFound,Rest.HttpStatusDescNotFound+": no such item/folder"); |
1013 | |||
1014 | } | 978 | } |
1015 | 979 | ||
1016 | /// <summary> | 980 | /// <summary> |
@@ -1023,7 +987,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1023 | 987 | ||
1024 | private void formatInventory(InventoryRequestData rdata, InventoryFolderBase folder, string indent) | 988 | private void formatInventory(InventoryRequestData rdata, InventoryFolderBase folder, string indent) |
1025 | { | 989 | { |
1026 | |||
1027 | if (Rest.DEBUG) | 990 | if (Rest.DEBUG) |
1028 | { | 991 | { |
1029 | Rest.Log.DebugFormat("{0} Folder : {1} {2} {3}", MsgId, folder.ID, indent, folder.Name); | 992 | Rest.Log.DebugFormat("{0} Folder : {1} {2} {3}", MsgId, folder.ID, indent, folder.Name); |
@@ -1064,7 +1027,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1064 | // End folder item | 1027 | // End folder item |
1065 | 1028 | ||
1066 | rdata.writer.WriteEndElement(); | 1029 | rdata.writer.WriteEndElement(); |
1067 | |||
1068 | } | 1030 | } |
1069 | 1031 | ||
1070 | /// <summary> | 1032 | /// <summary> |
@@ -1073,7 +1035,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1073 | 1035 | ||
1074 | private void formatItem(InventoryRequestData rdata, InventoryItemBase i, string indent) | 1036 | private void formatItem(InventoryRequestData rdata, InventoryItemBase i, string indent) |
1075 | { | 1037 | { |
1076 | |||
1077 | Rest.Log.DebugFormat("{0} Item : {1} {2} {3}", MsgId, i.ID, indent, i.Name); | 1038 | Rest.Log.DebugFormat("{0} Item : {1} {2} {3}", MsgId, i.ID, indent, i.Name); |
1078 | 1039 | ||
1079 | rdata.writer.WriteStartElement(String.Empty,"Item",String.Empty); | 1040 | rdata.writer.WriteStartElement(String.Empty,"Item",String.Empty); |
@@ -1102,11 +1063,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1102 | rdata.writer.WriteElementString("Asset",i.AssetID.ToString()); | 1063 | rdata.writer.WriteElementString("Asset",i.AssetID.ToString()); |
1103 | 1064 | ||
1104 | rdata.writer.WriteEndElement(); | 1065 | rdata.writer.WriteEndElement(); |
1105 | |||
1106 | } | 1066 | } |
1107 | 1067 | ||
1108 | /// <summary> | 1068 | /// <summary> |
1109 | /// This method creates a "trashcan" folder to support folder and item | 1069 | /// This method creates a "trashcan" folder to support folder and item |
1110 | /// deletions by this interface. The xisting trash folder is found and | 1070 | /// deletions by this interface. The xisting trash folder is found and |
1111 | /// this folder is created within it. It is called "tmp" to indicate to | 1071 | /// this folder is created within it. It is called "tmp" to indicate to |
1112 | /// the client that it is OK to delete this folder. The REST interface | 1072 | /// the client that it is OK to delete this folder. The REST interface |
@@ -1117,7 +1077,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1117 | 1077 | ||
1118 | private InventoryFolderBase GetTrashCan(InventoryRequestData rdata) | 1078 | private InventoryFolderBase GetTrashCan(InventoryRequestData rdata) |
1119 | { | 1079 | { |
1120 | |||
1121 | InventoryFolderBase TrashCan = null; | 1080 | InventoryFolderBase TrashCan = null; |
1122 | 1081 | ||
1123 | foreach (InventoryFolderBase f in rdata.folders) | 1082 | foreach (InventoryFolderBase f in rdata.folders) |
@@ -1144,16 +1103,15 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1144 | } | 1103 | } |
1145 | } | 1104 | } |
1146 | } | 1105 | } |
1147 | 1106 | ||
1148 | if (TrashCan == null) | 1107 | if (TrashCan == null) |
1149 | { | 1108 | { |
1150 | Rest.Log.DebugFormat("{0} No Trash Can available", MsgId); | 1109 | Rest.Log.DebugFormat("{0} No Trash Can available", MsgId); |
1151 | rdata.Fail(Rest.HttpStatusCodeServerError, | 1110 | rdata.Fail(Rest.HttpStatusCodeServerError, |
1152 | Rest.HttpStatusDescServerError+": unable to create trash can"); | 1111 | Rest.HttpStatusDescServerError+": unable to create trash can"); |
1153 | } | 1112 | } |
1154 | 1113 | ||
1155 | return TrashCan; | 1114 | return TrashCan; |
1156 | |||
1157 | } | 1115 | } |
1158 | 1116 | ||
1159 | /// <summary> | 1117 | /// <summary> |
@@ -1163,11 +1121,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1163 | 1121 | ||
1164 | private bool FolderHasChanged(InventoryFolderBase newf, InventoryFolderBase oldf) | 1122 | private bool FolderHasChanged(InventoryFolderBase newf, InventoryFolderBase oldf) |
1165 | { | 1123 | { |
1166 | return ( newf.Name != oldf.Name | 1124 | return (newf.Name != oldf.Name |
1167 | || newf.ParentID != oldf.ParentID | 1125 | || newf.ParentID != oldf.ParentID |
1168 | || newf.Owner != oldf.Owner | 1126 | || newf.Owner != oldf.Owner |
1169 | || newf.Type != oldf.Type | 1127 | || newf.Type != oldf.Type |
1170 | || newf.Version != oldf.Version | 1128 | || newf.Version != oldf.Version |
1171 | ); | 1129 | ); |
1172 | } | 1130 | } |
1173 | 1131 | ||
@@ -1178,24 +1136,24 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1178 | 1136 | ||
1179 | private bool ItemHasChanged(InventoryItemBase newf, InventoryItemBase oldf) | 1137 | private bool ItemHasChanged(InventoryItemBase newf, InventoryItemBase oldf) |
1180 | { | 1138 | { |
1181 | return ( newf.Name != oldf.Name | 1139 | return (newf.Name != oldf.Name |
1182 | || newf.Folder != oldf.Description | 1140 | || newf.Folder != oldf.Description |
1183 | || newf.Description != oldf.Description | 1141 | || newf.Description != oldf.Description |
1184 | || newf.Owner != oldf.Owner | 1142 | || newf.Owner != oldf.Owner |
1185 | || newf.Creator != oldf.Creator | 1143 | || newf.Creator != oldf.Creator |
1186 | || newf.AssetID != oldf.AssetID | 1144 | || newf.AssetID != oldf.AssetID |
1187 | || newf.GroupID != oldf.GroupID | 1145 | || newf.GroupID != oldf.GroupID |
1188 | || newf.GroupOwned != oldf.GroupOwned | 1146 | || newf.GroupOwned != oldf.GroupOwned |
1189 | || newf.InvType != oldf.InvType | 1147 | || newf.InvType != oldf.InvType |
1190 | || newf.AssetType != oldf.AssetType | 1148 | || newf.AssetType != oldf.AssetType |
1191 | ); | 1149 | ); |
1192 | } | 1150 | } |
1193 | 1151 | ||
1194 | /// <summary> | 1152 | /// <summary> |
1195 | /// This method is called by PUT and POST to create an XmlInventoryCollection | 1153 | /// This method is called by PUT and POST to create an XmlInventoryCollection |
1196 | /// instance that reflects the content of the entity supplied on the request. | 1154 | /// instance that reflects the content of the entity supplied on the request. |
1197 | /// Any elements in the completed collection whose UUID is zero, are | 1155 | /// Any elements in the completed collection whose UUID is zero, are |
1198 | /// considered to be located relative to the end-point identified int he | 1156 | /// considered to be located relative to the end-point identified int he |
1199 | /// URI. In this way, an entire sub-tree can be conveyed in a single REST | 1157 | /// URI. In this way, an entire sub-tree can be conveyed in a single REST |
1200 | /// PUT or POST request. | 1158 | /// PUT or POST request. |
1201 | /// | 1159 | /// |
@@ -1203,26 +1161,24 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1203 | /// has an entity, it is more completely initialized. thus, if no entity was | 1161 | /// has an entity, it is more completely initialized. thus, if no entity was |
1204 | /// provided the collection is valid, but empty. | 1162 | /// provided the collection is valid, but empty. |
1205 | /// | 1163 | /// |
1206 | /// The entity is then scanned and each tag is processed to produce the | 1164 | /// The entity is then scanned and each tag is processed to produce the |
1207 | /// appropriate inventory elements. At the end f the scan, teh XmlInventoryCollection | 1165 | /// appropriate inventory elements. At the end f the scan, teh XmlInventoryCollection |
1208 | /// will reflect the subtree described by the entity. | 1166 | /// will reflect the subtree described by the entity. |
1209 | /// | 1167 | /// |
1210 | /// This is a very flexible mechanism, the entity may contain arbitrary, | 1168 | /// This is a very flexible mechanism, the entity may contain arbitrary, |
1211 | /// discontiguous tree fragments, or may contain single element. The caller is | 1169 | /// discontiguous tree fragments, or may contain single element. The caller is |
1212 | /// responsible for integrating this collection (and ensuring that any | 1170 | /// responsible for integrating this collection (and ensuring that any |
1213 | /// missing parent IDs are resolved). | 1171 | /// missing parent IDs are resolved). |
1214 | /// </summary> | 1172 | /// </summary> |
1215 | 1173 | ||
1216 | internal XmlInventoryCollection ReconstituteEntity(InventoryRequestData rdata) | 1174 | internal XmlInventoryCollection ReconstituteEntity(InventoryRequestData rdata) |
1217 | { | 1175 | { |
1218 | |||
1219 | Rest.Log.DebugFormat("{0} Reconstituting entity", MsgId); | 1176 | Rest.Log.DebugFormat("{0} Reconstituting entity", MsgId); |
1220 | 1177 | ||
1221 | XmlInventoryCollection ic = new XmlInventoryCollection(); | 1178 | XmlInventoryCollection ic = new XmlInventoryCollection(); |
1222 | 1179 | ||
1223 | if (rdata.request.HasEntityBody) | 1180 | if (rdata.request.HasEntityBody) |
1224 | { | 1181 | { |
1225 | |||
1226 | Rest.Log.DebugFormat("{0} Entity present", MsgId); | 1182 | Rest.Log.DebugFormat("{0} Entity present", MsgId); |
1227 | 1183 | ||
1228 | ic.init(rdata); | 1184 | ic.init(rdata); |
@@ -1318,7 +1274,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1318 | Rest.Log.WarnFormat("{0} Unexpected XML parsing error: {1}", MsgId, e.Message); | 1274 | Rest.Log.WarnFormat("{0} Unexpected XML parsing error: {1}", MsgId, e.Message); |
1319 | throw e; | 1275 | throw e; |
1320 | } | 1276 | } |
1321 | |||
1322 | } | 1277 | } |
1323 | else | 1278 | else |
1324 | { | 1279 | { |
@@ -1334,14 +1289,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1334 | } | 1289 | } |
1335 | 1290 | ||
1336 | return ic; | 1291 | return ic; |
1337 | |||
1338 | } | 1292 | } |
1339 | 1293 | ||
1340 | /// <summary> | 1294 | /// <summary> |
1341 | /// This method creates an inventory Folder from the | 1295 | /// This method creates an inventory Folder from the |
1342 | /// information supplied in the request's entity. | 1296 | /// information supplied in the request's entity. |
1343 | /// A folder instance is created and initialized to reflect | 1297 | /// A folder instance is created and initialized to reflect |
1344 | /// default values. These values are then overridden | 1298 | /// default values. These values are then overridden |
1345 | /// by information supplied in the entity. | 1299 | /// by information supplied in the entity. |
1346 | /// If context was not explicitly provided, then the | 1300 | /// If context was not explicitly provided, then the |
1347 | /// appropriate ID values are determined. | 1301 | /// appropriate ID values are determined. |
@@ -1349,7 +1303,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1349 | 1303 | ||
1350 | private void CollectFolder(XmlInventoryCollection ic) | 1304 | private void CollectFolder(XmlInventoryCollection ic) |
1351 | { | 1305 | { |
1352 | |||
1353 | Rest.Log.DebugFormat("{0} Interpret folder element", MsgId); | 1306 | Rest.Log.DebugFormat("{0} Interpret folder element", MsgId); |
1354 | 1307 | ||
1355 | InventoryFolderBase result = new InventoryFolderBase(); | 1308 | InventoryFolderBase result = new InventoryFolderBase(); |
@@ -1389,7 +1342,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1389 | result.Version = UInt16.Parse(ic.xml.Value); | 1342 | result.Version = UInt16.Parse(ic.xml.Value); |
1390 | break; | 1343 | break; |
1391 | default : | 1344 | default : |
1392 | Rest.Log.DebugFormat("{0} Folder: unrecognized attribute: {1}:{2}", | 1345 | Rest.Log.DebugFormat("{0} Folder: unrecognized attribute: {1}:{2}", |
1393 | MsgId, ic.xml.Name, ic.xml.Value); | 1346 | MsgId, ic.xml.Name, ic.xml.Value); |
1394 | ic.Fail(Rest.HttpStatusCodeBadRequest, | 1347 | ic.Fail(Rest.HttpStatusCodeBadRequest, |
1395 | Rest.HttpStatusDescBadRequest+": unrecognized attribute"); | 1348 | Rest.HttpStatusDescBadRequest+": unrecognized attribute"); |
@@ -1411,7 +1364,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1411 | } | 1364 | } |
1412 | else | 1365 | else |
1413 | { | 1366 | { |
1414 | |||
1415 | bool found = false; | 1367 | bool found = false; |
1416 | 1368 | ||
1417 | foreach (InventoryFolderBase parent in ic.rdata.folders) | 1369 | foreach (InventoryFolderBase parent in ic.rdata.folders) |
@@ -1425,7 +1377,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1425 | 1377 | ||
1426 | if (!found) | 1378 | if (!found) |
1427 | { | 1379 | { |
1428 | Rest.Log.ErrorFormat("{0} Invalid parent ID ({1}) in folder {2}", | 1380 | Rest.Log.ErrorFormat("{0} Invalid parent ID ({1}) in folder {2}", |
1429 | MsgId, ic.Item.Folder, result.ID); | 1381 | MsgId, ic.Item.Folder, result.ID); |
1430 | ic.Fail(Rest.HttpStatusCodeBadRequest, | 1382 | ic.Fail(Rest.HttpStatusCodeBadRequest, |
1431 | Rest.HttpStatusDescBadRequest+": invalid parent"); | 1383 | Rest.HttpStatusDescBadRequest+": invalid parent"); |
@@ -1445,15 +1397,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1445 | // obsolete as a consequence. | 1397 | // obsolete as a consequence. |
1446 | 1398 | ||
1447 | ic.Push(result); | 1399 | ic.Push(result); |
1448 | |||
1449 | } | 1400 | } |
1450 | 1401 | ||
1451 | /// <summary> | 1402 | /// <summary> |
1452 | /// This method is called to handle the construction of an Item | 1403 | /// This method is called to handle the construction of an Item |
1453 | /// instance from the supplied request entity. It is called | 1404 | /// instance from the supplied request entity. It is called |
1454 | /// whenever an Item start tag is detected. | 1405 | /// whenever an Item start tag is detected. |
1455 | /// An instance of an Item is created and initialized to default | 1406 | /// An instance of an Item is created and initialized to default |
1456 | /// values. These values are then overridden from values supplied | 1407 | /// values. These values are then overridden from values supplied |
1457 | /// as attributes to the Item element. | 1408 | /// as attributes to the Item element. |
1458 | /// This item is then stored in the XmlInventoryCollection and | 1409 | /// This item is then stored in the XmlInventoryCollection and |
1459 | /// will be verified by Validate. | 1410 | /// will be verified by Validate. |
@@ -1463,7 +1414,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1463 | 1414 | ||
1464 | private void CollectItem(XmlInventoryCollection ic) | 1415 | private void CollectItem(XmlInventoryCollection ic) |
1465 | { | 1416 | { |
1466 | |||
1467 | Rest.Log.DebugFormat("{0} Interpret item element", MsgId); | 1417 | Rest.Log.DebugFormat("{0} Interpret item element", MsgId); |
1468 | 1418 | ||
1469 | InventoryItemBase result = new InventoryItemBase(); | 1419 | InventoryItemBase result = new InventoryItemBase(); |
@@ -1484,7 +1434,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1484 | { | 1434 | { |
1485 | for (int i = 0; i < ic.xml.AttributeCount; i++) | 1435 | for (int i = 0; i < ic.xml.AttributeCount; i++) |
1486 | { | 1436 | { |
1487 | |||
1488 | ic.xml.MoveToAttribute(i); | 1437 | ic.xml.MoveToAttribute(i); |
1489 | 1438 | ||
1490 | switch (ic.xml.Name) | 1439 | switch (ic.xml.Name) |
@@ -1533,37 +1482,36 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1533 | break; | 1482 | break; |
1534 | 1483 | ||
1535 | default : | 1484 | default : |
1536 | Rest.Log.DebugFormat("{0} Item: Unrecognized attribute: {1}:{2}", | 1485 | Rest.Log.DebugFormat("{0} Item: Unrecognized attribute: {1}:{2}", |
1537 | MsgId, ic.xml.Name, ic.xml.Value); | 1486 | MsgId, ic.xml.Name, ic.xml.Value); |
1538 | ic.Fail(Rest.HttpStatusCodeBadRequest, | 1487 | ic.Fail(Rest.HttpStatusCodeBadRequest, |
1539 | Rest.HttpStatusDescBadRequest+": unrecognized attribute"); | 1488 | Rest.HttpStatusDescBadRequest+": unrecognized attribute"); |
1540 | break; | 1489 | break; |
1541 | } | 1490 | } |
1542 | } | 1491 | } |
1543 | } | 1492 | } |
1544 | 1493 | ||
1545 | ic.xml.MoveToElement(); | 1494 | ic.xml.MoveToElement(); |
1546 | 1495 | ||
1547 | ic.Push(result); | 1496 | ic.Push(result); |
1548 | |||
1549 | } | 1497 | } |
1550 | 1498 | ||
1551 | /// <summary> | 1499 | /// <summary> |
1552 | /// This method assembles an asset instance from the | 1500 | /// This method assembles an asset instance from the |
1553 | /// information supplied in the request's entity. It is | 1501 | /// information supplied in the request's entity. It is |
1554 | /// called as a result of detecting a start tag for a | 1502 | /// called as a result of detecting a start tag for a |
1555 | /// type of Asset. | 1503 | /// type of Asset. |
1556 | /// The information is collected locally, and an asset | 1504 | /// The information is collected locally, and an asset |
1557 | /// instance is created only if the basic XML parsing | 1505 | /// instance is created only if the basic XML parsing |
1558 | /// completes successfully. | 1506 | /// completes successfully. |
1559 | /// Default values for all parts of the asset are | 1507 | /// Default values for all parts of the asset are |
1560 | /// established before overriding them from the supplied | 1508 | /// established before overriding them from the supplied |
1561 | /// XML. | 1509 | /// XML. |
1562 | /// If an asset has inline=true as an attribute, then | 1510 | /// If an asset has inline=true as an attribute, then |
1563 | /// the element contains the data representing the | 1511 | /// the element contains the data representing the |
1564 | /// asset. This is saved as the data component. | 1512 | /// asset. This is saved as the data component. |
1565 | /// inline=false means that the element's payload is | 1513 | /// inline=false means that the element's payload is |
1566 | /// simply the UUID of the asset referenced by the | 1514 | /// simply the UUID of the asset referenced by the |
1567 | /// item being constructed. | 1515 | /// item being constructed. |
1568 | /// An asset, if created is stored in the | 1516 | /// An asset, if created is stored in the |
1569 | /// XmlInventoryCollection | 1517 | /// XmlInventoryCollection |
@@ -1624,7 +1572,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1624 | break; | 1572 | break; |
1625 | 1573 | ||
1626 | default : | 1574 | default : |
1627 | Rest.Log.DebugFormat("{0} Asset: Unrecognized attribute: {1}:{2}", | 1575 | Rest.Log.DebugFormat("{0} Asset: Unrecognized attribute: {1}:{2}", |
1628 | MsgId, ic.xml.Name, ic.xml.Value); | 1576 | MsgId, ic.xml.Name, ic.xml.Value); |
1629 | ic.Fail(Rest.HttpStatusCodeBadRequest, | 1577 | ic.Fail(Rest.HttpStatusCodeBadRequest, |
1630 | Rest.HttpStatusDescBadRequest); | 1578 | Rest.HttpStatusDescBadRequest); |
@@ -1637,7 +1585,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1637 | 1585 | ||
1638 | // If this is a reference to an existing asset, just store the | 1586 | // If this is a reference to an existing asset, just store the |
1639 | // asset ID into the item. | 1587 | // asset ID into the item. |
1640 | 1588 | ||
1641 | if (!inline) | 1589 | if (!inline) |
1642 | { | 1590 | { |
1643 | if (ic.Item != null) | 1591 | if (ic.Item != null) |
@@ -1653,13 +1601,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1653 | } | 1601 | } |
1654 | } | 1602 | } |
1655 | 1603 | ||
1656 | // Otherwise, generate an asset ID, store that into the item, and | 1604 | // Otherwise, generate an asset ID, store that into the item, and |
1657 | // create an entry in the asset list for the inlined asset. But | 1605 | // create an entry in the asset list for the inlined asset. But |
1658 | // only if the size is non-zero. | 1606 | // only if the size is non-zero. |
1659 | 1607 | ||
1660 | else | 1608 | else |
1661 | { | 1609 | { |
1662 | |||
1663 | string b64string = null; | 1610 | string b64string = null; |
1664 | 1611 | ||
1665 | // Generate a UUID of none were given, and generally none should | 1612 | // Generate a UUID of none were given, and generally none should |
@@ -1672,17 +1619,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1672 | 1619 | ||
1673 | // Create AssetBase entity to hold the inlined asset | 1620 | // Create AssetBase entity to hold the inlined asset |
1674 | 1621 | ||
1675 | asset = new AssetBase(uuid, name); | 1622 | asset = new AssetBase(uuid, name); |
1676 | 1623 | ||
1677 | asset.Description = desc; | 1624 | asset.Description = desc; |
1678 | asset.Type = type; // type == 0 == texture | 1625 | asset.Type = type; // type == 0 == texture |
1679 | asset.Local = local; | 1626 | asset.Local = local; |
1680 | asset.Temporary = temp; | 1627 | asset.Temporary = temp; |
1681 | 1628 | ||
1682 | b64string = ic.xml.ReadElementContentAsString(); | 1629 | b64string = ic.xml.ReadElementContentAsString(); |
1683 | 1630 | ||
1684 | Rest.Log.DebugFormat("{0} Data length is {1}", MsgId, b64string.Length); | 1631 | Rest.Log.DebugFormat("{0} Data length is {1}", MsgId, b64string.Length); |
1685 | Rest.Log.DebugFormat("{0} Data content starts with: \n\t<{1}>", MsgId, | 1632 | Rest.Log.DebugFormat("{0} Data content starts with: \n\t<{1}>", MsgId, |
1686 | b64string.Substring(0, b64string.Length > 132 ? 132 : b64string.Length)); | 1633 | b64string.Substring(0, b64string.Length > 132 ? 132 : b64string.Length)); |
1687 | 1634 | ||
1688 | asset.Data = Convert.FromBase64String(b64string); | 1635 | asset.Data = Convert.FromBase64String(b64string); |
@@ -1701,22 +1648,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1701 | { | 1648 | { |
1702 | ic.Item.AssetID = uuid; | 1649 | ic.Item.AssetID = uuid; |
1703 | } | 1650 | } |
1704 | |||
1705 | } | 1651 | } |
1706 | 1652 | ||
1707 | ic.Push(asset); | 1653 | ic.Push(asset); |
1708 | |||
1709 | } | 1654 | } |
1710 | 1655 | ||
1711 | /// <summary> | 1656 | /// <summary> |
1712 | /// Store any permissions information provided by the request. | 1657 | /// Store any permissions information provided by the request. |
1713 | /// This overrides the default permissions set when the | 1658 | /// This overrides the default permissions set when the |
1714 | /// XmlInventoryCollection object was created. | 1659 | /// XmlInventoryCollection object was created. |
1715 | /// </summary> | 1660 | /// </summary> |
1716 | 1661 | ||
1717 | private void CollectPermissions(XmlInventoryCollection ic) | 1662 | private void CollectPermissions(XmlInventoryCollection ic) |
1718 | { | 1663 | { |
1719 | |||
1720 | if (ic.xml.HasAttributes) | 1664 | if (ic.xml.HasAttributes) |
1721 | { | 1665 | { |
1722 | for (int i = 0; i < ic.xml.AttributeCount; i++) | 1666 | for (int i = 0; i < ic.xml.AttributeCount; i++) |
@@ -1747,7 +1691,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1747 | } | 1691 | } |
1748 | 1692 | ||
1749 | ic.xml.MoveToElement(); | 1693 | ic.xml.MoveToElement(); |
1750 | |||
1751 | } | 1694 | } |
1752 | 1695 | ||
1753 | /// <summary> | 1696 | /// <summary> |
@@ -1762,7 +1705,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1762 | 1705 | ||
1763 | private void Validate(XmlInventoryCollection ic) | 1706 | private void Validate(XmlInventoryCollection ic) |
1764 | { | 1707 | { |
1765 | |||
1766 | // There really should be an item present if we've | 1708 | // There really should be an item present if we've |
1767 | // called validate. So fail if there is not. | 1709 | // called validate. So fail if there is not. |
1768 | 1710 | ||
@@ -1772,7 +1714,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1772 | ic.Fail(Rest.HttpStatusCodeBadRequest, | 1714 | ic.Fail(Rest.HttpStatusCodeBadRequest, |
1773 | Rest.HttpStatusDescBadRequest+": request parse error"); | 1715 | Rest.HttpStatusDescBadRequest+": request parse error"); |
1774 | } | 1716 | } |
1775 | 1717 | ||
1776 | // Every item is required to have a name (via REST anyway) | 1718 | // Every item is required to have a name (via REST anyway) |
1777 | 1719 | ||
1778 | if (ic.Item.Name == String.Empty) | 1720 | if (ic.Item.Name == String.Empty) |
@@ -1781,19 +1723,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1781 | ic.Fail(Rest.HttpStatusCodeBadRequest, | 1723 | ic.Fail(Rest.HttpStatusCodeBadRequest, |
1782 | Rest.HttpStatusDescBadRequest+": item name required"); | 1724 | Rest.HttpStatusDescBadRequest+": item name required"); |
1783 | } | 1725 | } |
1784 | 1726 | ||
1785 | // An item MUST have an asset ID. AssetID should never be zero | 1727 | // An item MUST have an asset ID. AssetID should never be zero |
1786 | // here. It should always get set from the information stored | 1728 | // here. It should always get set from the information stored |
1787 | // when the Asset element was processed. | 1729 | // when the Asset element was processed. |
1788 | 1730 | ||
1789 | if (ic.Item.AssetID == LLUUID.Zero) | 1731 | if (ic.Item.AssetID == LLUUID.Zero) |
1790 | { | 1732 | { |
1791 | |||
1792 | Rest.Log.ErrorFormat("{0} Unable to complete request", MsgId); | 1733 | Rest.Log.ErrorFormat("{0} Unable to complete request", MsgId); |
1793 | Rest.Log.InfoFormat("{0} Asset information is missing", MsgId); | 1734 | Rest.Log.InfoFormat("{0} Asset information is missing", MsgId); |
1794 | ic.Fail(Rest.HttpStatusCodeBadRequest, | 1735 | ic.Fail(Rest.HttpStatusCodeBadRequest, |
1795 | Rest.HttpStatusDescBadRequest+": asset information required"); | 1736 | Rest.HttpStatusDescBadRequest+": asset information required"); |
1796 | |||
1797 | } | 1737 | } |
1798 | 1738 | ||
1799 | // If the item is new, then assign it an ID | 1739 | // If the item is new, then assign it an ID |
@@ -1806,19 +1746,18 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1806 | // If the context is being implied, obtain the current | 1746 | // If the context is being implied, obtain the current |
1807 | // folder item's ID. If it was specified explicitly, make | 1747 | // folder item's ID. If it was specified explicitly, make |
1808 | // sure that theparent folder exists. | 1748 | // sure that theparent folder exists. |
1809 | 1749 | ||
1810 | if (ic.Item.Folder == LLUUID.Zero) | 1750 | if (ic.Item.Folder == LLUUID.Zero) |
1811 | { | 1751 | { |
1812 | ic.Item.Folder = ic.Parent(); | 1752 | ic.Item.Folder = ic.Parent(); |
1813 | } | 1753 | } |
1814 | else | 1754 | else |
1815 | { | 1755 | { |
1816 | |||
1817 | bool found = false; | 1756 | bool found = false; |
1818 | 1757 | ||
1819 | foreach (InventoryFolderBase parent in ic.rdata.folders) | 1758 | foreach (InventoryFolderBase parent in ic.rdata.folders) |
1820 | { | 1759 | { |
1821 | if ( parent.ID == ic.Item.Folder ) | 1760 | if (parent.ID == ic.Item.Folder) |
1822 | { | 1761 | { |
1823 | found = true; | 1762 | found = true; |
1824 | break; | 1763 | break; |
@@ -1827,12 +1766,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1827 | 1766 | ||
1828 | if (!found) | 1767 | if (!found) |
1829 | { | 1768 | { |
1830 | Rest.Log.ErrorFormat("{0} Invalid parent ID ({1}) in item {2}", | 1769 | Rest.Log.ErrorFormat("{0} Invalid parent ID ({1}) in item {2}", |
1831 | MsgId, ic.Item.Folder, ic.Item.ID); | 1770 | MsgId, ic.Item.Folder, ic.Item.ID); |
1832 | ic.Fail(Rest.HttpStatusCodeBadRequest, | 1771 | ic.Fail(Rest.HttpStatusCodeBadRequest, |
1833 | Rest.HttpStatusDescBadRequest+": parent information required"); | 1772 | Rest.HttpStatusDescBadRequest+": parent information required"); |
1834 | } | 1773 | } |
1835 | |||
1836 | } | 1774 | } |
1837 | 1775 | ||
1838 | // If this is an inline asset being constructed in the context | 1776 | // If this is an inline asset being constructed in the context |
@@ -1854,13 +1792,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1854 | ic.Item.NextPermissions = ic.NextPermissions; | 1792 | ic.Item.NextPermissions = ic.NextPermissions; |
1855 | 1793 | ||
1856 | // If no type was specified for this item, we can attempt to | 1794 | // If no type was specified for this item, we can attempt to |
1857 | // infer something from the file type maybe. This is NOT as | 1795 | // infer something from the file type maybe. This is NOT as |
1858 | // good as having type be specified in the XML. | 1796 | // good as having type be specified in the XML. |
1859 | 1797 | ||
1860 | if (ic.Item.AssetType == (int) AssetType.Unknown || | 1798 | if (ic.Item.AssetType == (int) AssetType.Unknown || |
1861 | ic.Item.InvType == (int) AssetType.Unknown) | 1799 | ic.Item.InvType == (int) AssetType.Unknown) |
1862 | { | 1800 | { |
1863 | |||
1864 | Rest.Log.DebugFormat("{0} Attempting to infer item type", MsgId); | 1801 | Rest.Log.DebugFormat("{0} Attempting to infer item type", MsgId); |
1865 | 1802 | ||
1866 | string[] parts = ic.Item.Name.Split(Rest.CA_PERIOD); | 1803 | string[] parts = ic.Item.Name.Split(Rest.CA_PERIOD); |
@@ -1880,7 +1817,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1880 | 1817 | ||
1881 | if (parts.Length > 1) | 1818 | if (parts.Length > 1) |
1882 | { | 1819 | { |
1883 | Rest.Log.DebugFormat("{0} File type is {1}", | 1820 | Rest.Log.DebugFormat("{0} File type is {1}", |
1884 | MsgId, parts[parts.Length - 1]); | 1821 | MsgId, parts[parts.Length - 1]); |
1885 | switch (parts[parts.Length - 1]) | 1822 | switch (parts[parts.Length - 1]) |
1886 | { | 1823 | { |
@@ -1888,7 +1825,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1888 | case "jpeg-2000" : | 1825 | case "jpeg-2000" : |
1889 | case "jpg2000" : | 1826 | case "jpg2000" : |
1890 | case "jpg-2000" : | 1827 | case "jpg-2000" : |
1891 | Rest.Log.DebugFormat("{0} Type {1} inferred", | 1828 | Rest.Log.DebugFormat("{0} Type {1} inferred", |
1892 | MsgId, parts[parts.Length-1]); | 1829 | MsgId, parts[parts.Length-1]); |
1893 | if (ic.Item.AssetType == (int) AssetType.Unknown) | 1830 | if (ic.Item.AssetType == (int) AssetType.Unknown) |
1894 | ic.Item.AssetType = (int) AssetType.ImageJPEG; | 1831 | ic.Item.AssetType = (int) AssetType.ImageJPEG; |
@@ -1897,7 +1834,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1897 | break; | 1834 | break; |
1898 | case "jpg" : | 1835 | case "jpg" : |
1899 | case "jpeg" : | 1836 | case "jpeg" : |
1900 | Rest.Log.DebugFormat("{0} Type {1} inferred", | 1837 | Rest.Log.DebugFormat("{0} Type {1} inferred", |
1901 | MsgId, parts[parts.Length - 1]); | 1838 | MsgId, parts[parts.Length - 1]); |
1902 | if (ic.Item.AssetType == (int) AssetType.Unknown) | 1839 | if (ic.Item.AssetType == (int) AssetType.Unknown) |
1903 | ic.Item.AssetType = (int) AssetType.ImageJPEG; | 1840 | ic.Item.AssetType = (int) AssetType.ImageJPEG; |
@@ -1938,16 +1875,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1938 | temp = OpenJPEGNet.LoadTGAClass.LoadTGA(tgadata); | 1875 | temp = OpenJPEGNet.LoadTGAClass.LoadTGA(tgadata); |
1939 | ic.Asset.Data = OpenJPEGNet.OpenJPEG.EncodeFromImage(temp, true); | 1876 | ic.Asset.Data = OpenJPEGNet.OpenJPEG.EncodeFromImage(temp, true); |
1940 | } | 1877 | } |
1941 | |||
1942 | ic.reset(); | ||
1943 | 1878 | ||
1879 | ic.reset(); | ||
1944 | } | 1880 | } |
1945 | 1881 | ||
1946 | #region Inventory RequestData extension | 1882 | #region Inventory RequestData extension |
1947 | 1883 | ||
1948 | internal class InventoryRequestData : RequestData | 1884 | internal class InventoryRequestData : RequestData |
1949 | { | 1885 | { |
1950 | |||
1951 | /// <summary> | 1886 | /// <summary> |
1952 | /// These are the inventory specific request/response state | 1887 | /// These are the inventory specific request/response state |
1953 | /// extensions. | 1888 | /// extensions. |
@@ -1965,7 +1900,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1965 | } | 1900 | } |
1966 | 1901 | ||
1967 | /// <summary> | 1902 | /// <summary> |
1968 | /// This is the callback method required by inventory services. The | 1903 | /// This is the callback method required by inventory services. The |
1969 | /// requestor issues an inventory request and then blocks until this | 1904 | /// requestor issues an inventory request and then blocks until this |
1970 | /// method signals the monitor. | 1905 | /// method signals the monitor. |
1971 | /// </summary> | 1906 | /// </summary> |
@@ -1981,7 +1916,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1981 | Monitor.Pulse(this); | 1916 | Monitor.Pulse(this); |
1982 | } | 1917 | } |
1983 | } | 1918 | } |
1984 | |||
1985 | } | 1919 | } |
1986 | 1920 | ||
1987 | #endregion Inventory RequestData extension | 1921 | #endregion Inventory RequestData extension |
@@ -1994,7 +1928,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1994 | 1928 | ||
1995 | internal class XmlInventoryCollection : InventoryCollection | 1929 | internal class XmlInventoryCollection : InventoryCollection |
1996 | { | 1930 | { |
1997 | |||
1998 | internal InventoryRequestData rdata; | 1931 | internal InventoryRequestData rdata; |
1999 | private Stack<InventoryFolderBase> stk; | 1932 | private Stack<InventoryFolderBase> stk; |
2000 | 1933 | ||
@@ -2087,7 +2020,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
2087 | { | 2020 | { |
2088 | rdata.Fail(code, desc); | 2021 | rdata.Fail(code, desc); |
2089 | } | 2022 | } |
2090 | |||
2091 | } | 2023 | } |
2092 | } | 2024 | } |
2093 | } | 2025 | } |
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs b/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs index 5ec2526..1f68d2b 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
57 | _xmlNs = new XmlSerializerNamespaces(); | 57 | _xmlNs = new XmlSerializerNamespaces(); |
58 | _xmlNs.Add(String.Empty, String.Empty); | 58 | _xmlNs.Add(String.Empty, String.Empty); |
59 | } | 59 | } |
60 | 60 | ||
61 | #region overriding properties | 61 | #region overriding properties |
62 | public override string Name | 62 | public override string Name |
63 | { | 63 | { |
@@ -90,7 +90,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
90 | return; | 90 | return; |
91 | } | 91 | } |
92 | m_log.InfoFormat("{0} REST region plugin enabled", MsgID); | 92 | m_log.InfoFormat("{0} REST region plugin enabled", MsgID); |
93 | 93 | ||
94 | // add REST method handlers | 94 | // add REST method handlers |
95 | AddRestStreamHandler("GET", "/regions/", GetHandler); | 95 | AddRestStreamHandler("GET", "/regions/", GetHandler); |
96 | AddRestStreamHandler("POST", "/regions/", PostHandler); | 96 | AddRestStreamHandler("POST", "/regions/", PostHandler); |
diff --git a/OpenSim/Data/GridDataBase.cs b/OpenSim/Data/GridDataBase.cs index 6480f84..0b56d07 100644 --- a/OpenSim/Data/GridDataBase.cs +++ b/OpenSim/Data/GridDataBase.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Data | |||
39 | public abstract DataResponse AddProfile(RegionProfileData profile); | 39 | public abstract DataResponse AddProfile(RegionProfileData profile); |
40 | public abstract ReservationData GetReservationAtPoint(uint x, uint y); | 40 | public abstract ReservationData GetReservationAtPoint(uint x, uint y); |
41 | public abstract DataResponse UpdateProfile(RegionProfileData profile); | 41 | public abstract DataResponse UpdateProfile(RegionProfileData profile); |
42 | 42 | ||
43 | public abstract void Initialise(); | 43 | public abstract void Initialise(); |
44 | public abstract void Initialise(string connect); | 44 | public abstract void Initialise(string connect); |
45 | public abstract void Dispose(); | 45 | public abstract void Dispose(); |
diff --git a/OpenSim/Data/IGridData.cs b/OpenSim/Data/IGridData.cs index 146288f..c77bbb7 100644 --- a/OpenSim/Data/IGridData.cs +++ b/OpenSim/Data/IGridData.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Data | |||
47 | /// Initialises the interface | 47 | /// Initialises the interface |
48 | /// </summary> | 48 | /// </summary> |
49 | void Initialise(string connect); | 49 | void Initialise(string connect); |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Returns a sim profile from a regionHandle | 52 | /// Returns a sim profile from a regionHandle |
53 | /// </summary> | 53 | /// </summary> |
@@ -100,7 +100,7 @@ namespace OpenSim.Data | |||
100 | 100 | ||
101 | ReservationData GetReservationAtPoint(uint x, uint y); | 101 | ReservationData GetReservationAtPoint(uint x, uint y); |
102 | } | 102 | } |
103 | 103 | ||
104 | public class GridDataInitialiser : PluginInitialiserBase | 104 | public class GridDataInitialiser : PluginInitialiserBase |
105 | { | 105 | { |
106 | private string connect; | 106 | private string connect; |
diff --git a/OpenSim/Data/ILogData.cs b/OpenSim/Data/ILogData.cs index cfbee88..e22fe06 100644 --- a/OpenSim/Data/ILogData.cs +++ b/OpenSim/Data/ILogData.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Data | |||
73 | /// </summary> | 73 | /// </summary> |
74 | void Initialise(string connect); | 74 | void Initialise(string connect); |
75 | } | 75 | } |
76 | 76 | ||
77 | public class LogDataInitialiser : PluginInitialiserBase | 77 | public class LogDataInitialiser : PluginInitialiserBase |
78 | { | 78 | { |
79 | private string connect; | 79 | private string connect; |
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 443907f..e10e3aa 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Data.MSSQL | |||
63 | database.ExecuteResourceSql("CreateAssetsTable.sql"); | 63 | database.ExecuteResourceSql("CreateAssetsTable.sql"); |
64 | return; | 64 | return; |
65 | } | 65 | } |
66 | 66 | ||
67 | } | 67 | } |
68 | 68 | ||
69 | /// <summary> | 69 | /// <summary> |
@@ -230,7 +230,7 @@ namespace OpenSim.Data.MSSQL | |||
230 | } | 230 | } |
231 | 231 | ||
232 | /// <summary> | 232 | /// <summary> |
233 | /// Database provider version. | 233 | /// Database provider version. |
234 | /// </summary> | 234 | /// </summary> |
235 | override public string Version | 235 | override public string Version |
236 | { | 236 | { |
@@ -238,7 +238,7 @@ namespace OpenSim.Data.MSSQL | |||
238 | } | 238 | } |
239 | 239 | ||
240 | /// <summary> | 240 | /// <summary> |
241 | /// The name of this DB provider. | 241 | /// The name of this DB provider. |
242 | /// </summary> | 242 | /// </summary> |
243 | override public string Name | 243 | override public string Name |
244 | { | 244 | { |
diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs index e1de297..423d4aa 100644 --- a/OpenSim/Data/MSSQL/MSSQLGridData.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs | |||
@@ -51,8 +51,8 @@ namespace OpenSim.Data.MSSQL | |||
51 | 51 | ||
52 | private string m_regionsTableName; | 52 | private string m_regionsTableName; |
53 | 53 | ||
54 | override public void Initialise() | 54 | override public void Initialise() |
55 | { | 55 | { |
56 | m_log.Info("[MSSQLGridData]: " + Name + " cannot be default-initialized!"); | 56 | m_log.Info("[MSSQLGridData]: " + Name + " cannot be default-initialized!"); |
57 | throw new PluginNotInitialisedException (Name); | 57 | throw new PluginNotInitialisedException (Name); |
58 | } | 58 | } |
@@ -87,7 +87,7 @@ namespace OpenSim.Data.MSSQL | |||
87 | } | 87 | } |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// | 90 | /// |
91 | /// </summary> | 91 | /// </summary> |
92 | private void TestTables() | 92 | private void TestTables() |
93 | { | 93 | { |
@@ -114,7 +114,7 @@ namespace OpenSim.Data.MSSQL | |||
114 | } | 114 | } |
115 | 115 | ||
116 | /// <summary> | 116 | /// <summary> |
117 | /// The name of this DB provider. | 117 | /// The name of this DB provider. |
118 | /// </summary> | 118 | /// </summary> |
119 | /// <returns>A string containing the storage system name</returns> | 119 | /// <returns>A string containing the storage system name</returns> |
120 | override public string Name | 120 | override public string Name |
@@ -123,7 +123,7 @@ namespace OpenSim.Data.MSSQL | |||
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// Database provider version. | 126 | /// Database provider version. |
127 | /// </summary> | 127 | /// </summary> |
128 | /// <returns>A string containing the storage system version</returns> | 128 | /// <returns>A string containing the storage system version</returns> |
129 | override public string Version | 129 | override public string Version |
@@ -209,7 +209,7 @@ namespace OpenSim.Data.MSSQL | |||
209 | { | 209 | { |
210 | return database.getRegionRow(reader); | 210 | return database.getRegionRow(reader); |
211 | } | 211 | } |
212 | 212 | ||
213 | } | 213 | } |
214 | catch (Exception e) | 214 | catch (Exception e) |
215 | { | 215 | { |
diff --git a/OpenSim/Data/MSSQL/MSSQLLogData.cs b/OpenSim/Data/MSSQL/MSSQLLogData.cs index d260e8c..b284c02 100644 --- a/OpenSim/Data/MSSQL/MSSQLLogData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLogData.cs | |||
@@ -40,14 +40,14 @@ namespace OpenSim.Data.MSSQL | |||
40 | internal class MSSQLLogData : ILogDataPlugin | 40 | internal class MSSQLLogData : ILogDataPlugin |
41 | { | 41 | { |
42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// The database manager | 45 | /// The database manager |
46 | /// </summary> | 46 | /// </summary> |
47 | public MSSQLManager database; | 47 | public MSSQLManager database; |
48 | 48 | ||
49 | public void Initialise() | 49 | public void Initialise() |
50 | { | 50 | { |
51 | m_log.Info("[MSSQLLogData]: " + Name + " cannot be default-initialized!"); | 51 | m_log.Info("[MSSQLLogData]: " + Name + " cannot be default-initialized!"); |
52 | throw new PluginNotInitialisedException (Name); | 52 | throw new PluginNotInitialisedException (Name); |
53 | } | 53 | } |
diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index 9cd9eca..1a053d5 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Data.MSSQL | |||
60 | builder.UserID = userId; | 60 | builder.UserID = userId; |
61 | builder.Password = password; | 61 | builder.Password = password; |
62 | builder.ApplicationName = Assembly.GetEntryAssembly().Location; | 62 | builder.ApplicationName = Assembly.GetEntryAssembly().Location; |
63 | 63 | ||
64 | connectionString = builder.ToString(); | 64 | connectionString = builder.ToString(); |
65 | } | 65 | } |
66 | 66 | ||
@@ -117,7 +117,7 @@ namespace OpenSim.Data.MSSQL | |||
117 | //} | 117 | //} |
118 | 118 | ||
119 | /// <summary> | 119 | /// <summary> |
120 | /// | 120 | /// |
121 | /// </summary> | 121 | /// </summary> |
122 | /// <param name="dt"></param> | 122 | /// <param name="dt"></param> |
123 | /// <param name="name"></param> | 123 | /// <param name="name"></param> |
@@ -376,7 +376,7 @@ namespace OpenSim.Data.MSSQL | |||
376 | } | 376 | } |
377 | 377 | ||
378 | /// <summary> | 378 | /// <summary> |
379 | /// | 379 | /// |
380 | /// </summary> | 380 | /// </summary> |
381 | /// <param name="reader"></param> | 381 | /// <param name="reader"></param> |
382 | /// <returns></returns> | 382 | /// <returns></returns> |
@@ -492,7 +492,7 @@ namespace OpenSim.Data.MSSQL | |||
492 | } | 492 | } |
493 | 493 | ||
494 | /// <summary> | 494 | /// <summary> |
495 | /// | 495 | /// |
496 | /// </summary> | 496 | /// </summary> |
497 | /// <param name="name"></param> | 497 | /// <param name="name"></param> |
498 | /// <returns></returns> | 498 | /// <returns></returns> |
diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index e832414..e63a9fe 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs | |||
@@ -52,8 +52,8 @@ namespace OpenSim.Data.MSSQL | |||
52 | private string m_usersTableName; | 52 | private string m_usersTableName; |
53 | private string m_userFriendsTableName; | 53 | private string m_userFriendsTableName; |
54 | 54 | ||
55 | public override void Initialise() | 55 | public override void Initialise() |
56 | { | 56 | { |
57 | m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); | 57 | m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); |
58 | throw new PluginNotInitialisedException (Name); | 58 | throw new PluginNotInitialisedException (Name); |
59 | } | 59 | } |
@@ -99,11 +99,11 @@ namespace OpenSim.Data.MSSQL | |||
99 | 99 | ||
100 | TestTables(); | 100 | TestTables(); |
101 | } | 101 | } |
102 | 102 | ||
103 | public override void Dispose () {} | 103 | public override void Dispose () {} |
104 | 104 | ||
105 | /// <summary> | 105 | /// <summary> |
106 | /// | 106 | /// |
107 | /// </summary> | 107 | /// </summary> |
108 | /// <returns></returns> | 108 | /// <returns></returns> |
109 | private bool TestTables() | 109 | private bool TestTables() |
@@ -205,7 +205,7 @@ namespace OpenSim.Data.MSSQL | |||
205 | { | 205 | { |
206 | adder.ExecuteNonQuery(); | 206 | adder.ExecuteNonQuery(); |
207 | } | 207 | } |
208 | 208 | ||
209 | using (IDbCommand adder = | 209 | using (IDbCommand adder = |
210 | database.Query( | 210 | database.Query( |
211 | "INSERT INTO " + m_userFriendsTableName + " " + | 211 | "INSERT INTO " + m_userFriendsTableName + " " + |
@@ -351,7 +351,7 @@ namespace OpenSim.Data.MSSQL | |||
351 | } | 351 | } |
352 | 352 | ||
353 | /// <summary> | 353 | /// <summary> |
354 | /// | 354 | /// |
355 | /// </summary> | 355 | /// </summary> |
356 | /// <param name="queryID"></param> | 356 | /// <param name="queryID"></param> |
357 | /// <param name="query"></param> | 357 | /// <param name="query"></param> |
@@ -379,7 +379,7 @@ namespace OpenSim.Data.MSSQL | |||
379 | user.firstName = (string)reader["username"]; | 379 | user.firstName = (string)reader["username"]; |
380 | user.lastName = (string)reader["lastname"]; | 380 | user.lastName = (string)reader["lastname"]; |
381 | returnlist.Add(user); | 381 | returnlist.Add(user); |
382 | } | 382 | } |
383 | } | 383 | } |
384 | } | 384 | } |
385 | catch (Exception e) | 385 | catch (Exception e) |
@@ -406,7 +406,7 @@ namespace OpenSim.Data.MSSQL | |||
406 | returnlist.Add(user); | 406 | returnlist.Add(user); |
407 | } | 407 | } |
408 | } | 408 | } |
409 | } | 409 | } |
410 | catch (Exception e) | 410 | catch (Exception e) |
411 | { | 411 | { |
412 | m_log.Error(e.ToString()); | 412 | m_log.Error(e.ToString()); |
diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index 6857c2c..ecd18ae 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs | |||
@@ -36,7 +36,7 @@ using log4net; | |||
36 | 36 | ||
37 | namespace OpenSim.Data | 37 | namespace OpenSim.Data |
38 | { | 38 | { |
39 | /// <summary> | 39 | /// <summary> |
40 | /// | 40 | /// |
41 | /// The Migration theory is based on the ruby on rails concept. | 41 | /// The Migration theory is based on the ruby on rails concept. |
42 | /// Each database driver is going to be allowed to have files in | 42 | /// Each database driver is going to be allowed to have files in |
@@ -77,11 +77,11 @@ namespace OpenSim.Data | |||
77 | // private string _subtype; | 77 | // private string _subtype; |
78 | private Assembly _assem; | 78 | private Assembly _assem; |
79 | private Regex _match; | 79 | private Regex _match; |
80 | 80 | ||
81 | private static readonly string _migrations_create = "create table migrations(name varchar(100), version int)"; | 81 | private static readonly string _migrations_create = "create table migrations(name varchar(100), version int)"; |
82 | // private static readonly string _migrations_init = "insert into migrations values('migrations', 1)"; | 82 | // private static readonly string _migrations_init = "insert into migrations values('migrations', 1)"; |
83 | // private static readonly string _migrations_find = "select version from migrations where name='migrations'"; | 83 | // private static readonly string _migrations_find = "select version from migrations where name='migrations'"; |
84 | 84 | ||
85 | public Migration(DbConnection conn, Assembly assem, string type) | 85 | public Migration(DbConnection conn, Assembly assem, string type) |
86 | { | 86 | { |
87 | _type = type; | 87 | _type = type; |
@@ -105,7 +105,7 @@ namespace OpenSim.Data | |||
105 | // clever, eh, we figure out which migrations version we are | 105 | // clever, eh, we figure out which migrations version we are |
106 | int migration_version = FindVersion("migrations"); | 106 | int migration_version = FindVersion("migrations"); |
107 | 107 | ||
108 | if (migration_version > 0) | 108 | if (migration_version > 0) |
109 | return; | 109 | return; |
110 | 110 | ||
111 | // If not, create the migration tables | 111 | // If not, create the migration tables |
@@ -130,14 +130,14 @@ namespace OpenSim.Data | |||
130 | m_log.Info("[MIGRATIONS] NOTE: this may take a while, don't interupt this process!"); | 130 | m_log.Info("[MIGRATIONS] NOTE: this may take a while, don't interupt this process!"); |
131 | 131 | ||
132 | DbCommand cmd = _conn.CreateCommand(); | 132 | DbCommand cmd = _conn.CreateCommand(); |
133 | foreach (KeyValuePair<int, string> kvp in migrations) | 133 | foreach (KeyValuePair<int, string> kvp in migrations) |
134 | { | 134 | { |
135 | int newversion = kvp.Key; | 135 | int newversion = kvp.Key; |
136 | cmd.CommandText = kvp.Value; | 136 | cmd.CommandText = kvp.Value; |
137 | // we need to up the command timeout to infinite as we might be doing long migrations. | 137 | // we need to up the command timeout to infinite as we might be doing long migrations. |
138 | cmd.CommandTimeout = 0; | 138 | cmd.CommandTimeout = 0; |
139 | cmd.ExecuteNonQuery(); | 139 | cmd.ExecuteNonQuery(); |
140 | 140 | ||
141 | if (version == 0) | 141 | if (version == 0) |
142 | { | 142 | { |
143 | InsertVersion(_type, newversion); | 143 | InsertVersion(_type, newversion); |
@@ -158,7 +158,7 @@ namespace OpenSim.Data | |||
158 | // foreach (string s in names) | 158 | // foreach (string s in names) |
159 | // { | 159 | // { |
160 | // Match m = _match.Match(s); | 160 | // Match m = _match.Match(s); |
161 | // if (m.Success) | 161 | // if (m.Success) |
162 | // { | 162 | // { |
163 | // int MigrationVersion = int.Parse(m.Groups[1].ToString()); | 163 | // int MigrationVersion = int.Parse(m.Groups[1].ToString()); |
164 | // if (MigrationVersion > max) | 164 | // if (MigrationVersion > max) |
@@ -168,10 +168,10 @@ namespace OpenSim.Data | |||
168 | // return max; | 168 | // return max; |
169 | // } | 169 | // } |
170 | 170 | ||
171 | public int Version | 171 | public int Version |
172 | { | 172 | { |
173 | get { return FindVersion(_type); } | 173 | get { return FindVersion(_type); } |
174 | set { | 174 | set { |
175 | if (Version < 1) | 175 | if (Version < 1) |
176 | { | 176 | { |
177 | InsertVersion(_type, value); | 177 | InsertVersion(_type, value); |
@@ -179,11 +179,11 @@ namespace OpenSim.Data | |||
179 | else | 179 | else |
180 | { | 180 | { |
181 | UpdateVersion(_type, value); | 181 | UpdateVersion(_type, value); |
182 | } | 182 | } |
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | private int FindVersion(string type) | 186 | private int FindVersion(string type) |
187 | { | 187 | { |
188 | int version = 0; | 188 | int version = 0; |
189 | DbCommand cmd = _conn.CreateCommand(); | 189 | DbCommand cmd = _conn.CreateCommand(); |
@@ -206,22 +206,22 @@ namespace OpenSim.Data | |||
206 | return version; | 206 | return version; |
207 | } | 207 | } |
208 | 208 | ||
209 | private void InsertVersion(string type, int version) | 209 | private void InsertVersion(string type, int version) |
210 | { | 210 | { |
211 | DbCommand cmd = _conn.CreateCommand(); | 211 | DbCommand cmd = _conn.CreateCommand(); |
212 | cmd.CommandText = "insert into migrations(name, version) values('" + type + "', " + version + ")"; | 212 | cmd.CommandText = "insert into migrations(name, version) values('" + type + "', " + version + ")"; |
213 | m_log.InfoFormat("[MIGRATIONS] Creating {0} at version {1}", type, version); | 213 | m_log.InfoFormat("[MIGRATIONS] Creating {0} at version {1}", type, version); |
214 | cmd.ExecuteNonQuery(); | 214 | cmd.ExecuteNonQuery(); |
215 | } | 215 | } |
216 | 216 | ||
217 | private void UpdateVersion(string type, int version) | 217 | private void UpdateVersion(string type, int version) |
218 | { | 218 | { |
219 | DbCommand cmd = _conn.CreateCommand(); | 219 | DbCommand cmd = _conn.CreateCommand(); |
220 | cmd.CommandText = "update migrations set version=" + version + " where name='" + type + "'"; | 220 | cmd.CommandText = "update migrations set version=" + version + " where name='" + type + "'"; |
221 | m_log.InfoFormat("[MIGRATIONS] Updating {0} to version {1}", type, version); | 221 | m_log.InfoFormat("[MIGRATIONS] Updating {0} to version {1}", type, version); |
222 | cmd.ExecuteNonQuery(); | 222 | cmd.ExecuteNonQuery(); |
223 | } | 223 | } |
224 | 224 | ||
225 | // private SortedList<int, string> GetAllMigrations() | 225 | // private SortedList<int, string> GetAllMigrations() |
226 | // { | 226 | // { |
227 | // return GetMigrationsAfter(0); | 227 | // return GetMigrationsAfter(0); |
@@ -261,4 +261,4 @@ namespace OpenSim.Data | |||
261 | return migrations; | 261 | return migrations; |
262 | } | 262 | } |
263 | } | 263 | } |
264 | } \ No newline at end of file | 264 | } |
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index cec736a..bdb1571 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -144,11 +144,11 @@ namespace OpenSim.Data.MySQL | |||
144 | _dbConnection.GetTableVersion(tableList); | 144 | _dbConnection.GetTableVersion(tableList); |
145 | 145 | ||
146 | // if there is no table, return, migrations will handle it. | 146 | // if there is no table, return, migrations will handle it. |
147 | if (tableList["assets"] == null) | 147 | if (tableList["assets"] == null) |
148 | return; | 148 | return; |
149 | 149 | ||
150 | // if there is a table, and we don't have a migration, set it to 1 | 150 | // if there is a table, and we don't have a migration, set it to 1 |
151 | if (m.Version == 0) | 151 | if (m.Version == 0) |
152 | m.Version = 1; | 152 | m.Version = 1; |
153 | } | 153 | } |
154 | 154 | ||
@@ -272,12 +272,12 @@ namespace OpenSim.Data.MySQL | |||
272 | lock (_dbConnection) | 272 | lock (_dbConnection) |
273 | { | 273 | { |
274 | _dbConnection.CheckConnection(); | 274 | _dbConnection.CheckConnection(); |
275 | 275 | ||
276 | MySqlCommand cmd = | 276 | MySqlCommand cmd = |
277 | new MySqlCommand( | 277 | new MySqlCommand( |
278 | "SELECT id FROM assets WHERE id=?id", | 278 | "SELECT id FROM assets WHERE id=?id", |
279 | _dbConnection.Connection); | 279 | _dbConnection.Connection); |
280 | 280 | ||
281 | cmd.Parameters.AddWithValue("?id", uuid.ToString()); | 281 | cmd.Parameters.AddWithValue("?id", uuid.ToString()); |
282 | 282 | ||
283 | try | 283 | try |
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index 8991e02..2ab7d40 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Data.MySQL | |||
51 | private string m_connectionString; | 51 | private string m_connectionString; |
52 | private long m_waitTimeout; | 52 | private long m_waitTimeout; |
53 | private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; | 53 | private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; |
54 | private long m_lastConnectionUse; | 54 | private long m_lastConnectionUse; |
55 | 55 | ||
56 | private FieldInfo[] m_Fields; | 56 | private FieldInfo[] m_Fields; |
57 | private Dictionary<string, FieldInfo> m_FieldMap = | 57 | private Dictionary<string, FieldInfo> m_FieldMap = |
@@ -83,13 +83,13 @@ namespace OpenSim.Data.MySQL | |||
83 | } | 83 | } |
84 | 84 | ||
85 | m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); | 85 | m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); |
86 | 86 | ||
87 | //m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString); | 87 | //m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString); |
88 | 88 | ||
89 | m_connection = new MySqlConnection(m_connectionString); | 89 | m_connection = new MySqlConnection(m_connectionString); |
90 | m_connection.Open(); | 90 | m_connection.Open(); |
91 | 91 | ||
92 | GetWaitTimeout(); | 92 | GetWaitTimeout(); |
93 | 93 | ||
94 | Assembly assem = GetType().Assembly; | 94 | Assembly assem = GetType().Assembly; |
95 | Migration m = new Migration(m_connection, assem, "EstateStore"); | 95 | Migration m = new Migration(m_connection, assem, "EstateStore"); |
@@ -106,7 +106,7 @@ namespace OpenSim.Data.MySQL | |||
106 | m_FieldMap[f.Name.Substring(2)] = f; | 106 | m_FieldMap[f.Name.Substring(2)] = f; |
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | private string[] FieldList | 110 | private string[] FieldList |
111 | { | 111 | { |
112 | get { return new List<string>(m_FieldMap.Keys).ToArray(); } | 112 | get { return new List<string>(m_FieldMap.Keys).ToArray(); } |
@@ -116,28 +116,28 @@ namespace OpenSim.Data.MySQL | |||
116 | { | 116 | { |
117 | MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, | 117 | MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, |
118 | m_connection); | 118 | m_connection); |
119 | 119 | ||
120 | using (MySqlDataReader dbReader = | 120 | using (MySqlDataReader dbReader = |
121 | cmd.ExecuteReader(CommandBehavior.SingleRow)) | 121 | cmd.ExecuteReader(CommandBehavior.SingleRow)) |
122 | { | 122 | { |
123 | if (dbReader.Read()) | 123 | if (dbReader.Read()) |
124 | { | 124 | { |
125 | m_waitTimeout | 125 | m_waitTimeout |
126 | = Convert.ToInt32(dbReader["@@wait_timeout"]) * | 126 | = Convert.ToInt32(dbReader["@@wait_timeout"]) * |
127 | TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; | 127 | TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; |
128 | } | 128 | } |
129 | 129 | ||
130 | dbReader.Close(); | 130 | dbReader.Close(); |
131 | cmd.Dispose(); | 131 | cmd.Dispose(); |
132 | } | 132 | } |
133 | 133 | ||
134 | m_lastConnectionUse = System.DateTime.Now.Ticks; | 134 | m_lastConnectionUse = System.DateTime.Now.Ticks; |
135 | 135 | ||
136 | m_log.DebugFormat( | 136 | m_log.DebugFormat( |
137 | "[REGION DB]: Connection wait timeout {0} seconds", | 137 | "[REGION DB]: Connection wait timeout {0} seconds", |
138 | m_waitTimeout / TimeSpan.TicksPerSecond); | 138 | m_waitTimeout / TimeSpan.TicksPerSecond); |
139 | } | 139 | } |
140 | 140 | ||
141 | protected void CheckConnection() | 141 | protected void CheckConnection() |
142 | { | 142 | { |
143 | long timeNow = System.DateTime.Now.Ticks; | 143 | long timeNow = System.DateTime.Now.Ticks; |
@@ -145,17 +145,17 @@ namespace OpenSim.Data.MySQL | |||
145 | m_connection.State != ConnectionState.Open) | 145 | m_connection.State != ConnectionState.Open) |
146 | { | 146 | { |
147 | m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); | 147 | m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); |
148 | 148 | ||
149 | lock (m_connection) | 149 | lock (m_connection) |
150 | { | 150 | { |
151 | m_connection.Close(); | 151 | m_connection.Close(); |
152 | m_connection = new MySqlConnection(m_connectionString); | 152 | m_connection = new MySqlConnection(m_connectionString); |
153 | m_connection.Open(); | 153 | m_connection.Open(); |
154 | } | 154 | } |
155 | } | 155 | } |
156 | 156 | ||
157 | m_lastConnectionUse = timeNow; | 157 | m_lastConnectionUse = timeNow; |
158 | } | 158 | } |
159 | 159 | ||
160 | public EstateSettings LoadEstateSettings(LLUUID regionID) | 160 | public EstateSettings LoadEstateSettings(LLUUID regionID) |
161 | { | 161 | { |
@@ -210,7 +210,7 @@ namespace OpenSim.Data.MySQL | |||
210 | names.Remove("EstateID"); | 210 | names.Remove("EstateID"); |
211 | 211 | ||
212 | sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( ?"+String.Join(", ?", names.ToArray())+")"; | 212 | sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( ?"+String.Join(", ?", names.ToArray())+")"; |
213 | 213 | ||
214 | cmd.CommandText = sql; | 214 | cmd.CommandText = sql; |
215 | cmd.Parameters.Clear(); | 215 | cmd.Parameters.Clear(); |
216 | 216 | ||
@@ -318,7 +318,7 @@ namespace OpenSim.Data.MySQL | |||
318 | es.ClearBans(); | 318 | es.ClearBans(); |
319 | 319 | ||
320 | CheckConnection(); | 320 | CheckConnection(); |
321 | 321 | ||
322 | MySqlCommand cmd = m_connection.CreateCommand(); | 322 | MySqlCommand cmd = m_connection.CreateCommand(); |
323 | 323 | ||
324 | cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID"; | 324 | cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID"; |
@@ -344,18 +344,18 @@ namespace OpenSim.Data.MySQL | |||
344 | private void SaveBanList(EstateSettings es) | 344 | private void SaveBanList(EstateSettings es) |
345 | { | 345 | { |
346 | CheckConnection(); | 346 | CheckConnection(); |
347 | 347 | ||
348 | MySqlCommand cmd = m_connection.CreateCommand(); | 348 | MySqlCommand cmd = m_connection.CreateCommand(); |
349 | 349 | ||
350 | cmd.CommandText = "delete from estateban where EstateID = ?EstateID"; | 350 | cmd.CommandText = "delete from estateban where EstateID = ?EstateID"; |
351 | cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); | 351 | cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); |
352 | 352 | ||
353 | cmd.ExecuteNonQuery(); | 353 | cmd.ExecuteNonQuery(); |
354 | 354 | ||
355 | cmd.Parameters.Clear(); | 355 | cmd.Parameters.Clear(); |
356 | 356 | ||
357 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )"; | 357 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )"; |
358 | 358 | ||
359 | foreach (EstateBan b in es.EstateBans) | 359 | foreach (EstateBan b in es.EstateBans) |
360 | { | 360 | { |
361 | cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); | 361 | cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); |
@@ -369,18 +369,18 @@ namespace OpenSim.Data.MySQL | |||
369 | void SaveUUIDList(uint EstateID, string table, LLUUID[] data) | 369 | void SaveUUIDList(uint EstateID, string table, LLUUID[] data) |
370 | { | 370 | { |
371 | CheckConnection(); | 371 | CheckConnection(); |
372 | 372 | ||
373 | MySqlCommand cmd = m_connection.CreateCommand(); | 373 | MySqlCommand cmd = m_connection.CreateCommand(); |
374 | 374 | ||
375 | cmd.CommandText = "delete from "+table+" where EstateID = ?EstateID"; | 375 | cmd.CommandText = "delete from "+table+" where EstateID = ?EstateID"; |
376 | cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); | 376 | cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); |
377 | 377 | ||
378 | cmd.ExecuteNonQuery(); | 378 | cmd.ExecuteNonQuery(); |
379 | 379 | ||
380 | cmd.Parameters.Clear(); | 380 | cmd.Parameters.Clear(); |
381 | 381 | ||
382 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )"; | 382 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )"; |
383 | 383 | ||
384 | foreach (LLUUID uuid in data) | 384 | foreach (LLUUID uuid in data) |
385 | { | 385 | { |
386 | cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); | 386 | cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); |
@@ -396,7 +396,7 @@ namespace OpenSim.Data.MySQL | |||
396 | List<LLUUID> uuids = new List<LLUUID>(); | 396 | List<LLUUID> uuids = new List<LLUUID>(); |
397 | 397 | ||
398 | CheckConnection(); | 398 | CheckConnection(); |
399 | 399 | ||
400 | MySqlCommand cmd = m_connection.CreateCommand(); | 400 | MySqlCommand cmd = m_connection.CreateCommand(); |
401 | 401 | ||
402 | cmd.CommandText = "select uuid from "+table+" where EstateID = ?EstateID"; | 402 | cmd.CommandText = "select uuid from "+table+" where EstateID = ?EstateID"; |
@@ -414,7 +414,7 @@ namespace OpenSim.Data.MySQL | |||
414 | uuids.Add(uuid); | 414 | uuids.Add(uuid); |
415 | } | 415 | } |
416 | r.Close(); | 416 | r.Close(); |
417 | 417 | ||
418 | return uuids.ToArray(); | 418 | return uuids.ToArray(); |
419 | } | 419 | } |
420 | } | 420 | } |
diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs index 4cddbe5..fcbceb8 100644 --- a/OpenSim/Data/MySQL/MySQLGridData.cs +++ b/OpenSim/Data/MySQL/MySQLGridData.cs | |||
@@ -49,8 +49,8 @@ namespace OpenSim.Data.MySQL | |||
49 | /// </summary> | 49 | /// </summary> |
50 | private MySQLManager database; | 50 | private MySQLManager database; |
51 | 51 | ||
52 | override public void Initialise() | 52 | override public void Initialise() |
53 | { | 53 | { |
54 | m_log.Info("[MySQLGridData]: " + Name + " cannot be default-initialized!"); | 54 | m_log.Info("[MySQLGridData]: " + Name + " cannot be default-initialized!"); |
55 | throw new PluginNotInitialisedException (Name); | 55 | throw new PluginNotInitialisedException (Name); |
56 | } | 56 | } |
@@ -253,7 +253,7 @@ namespace OpenSim.Data.MySQL | |||
253 | return null; | 253 | return null; |
254 | } | 254 | } |
255 | } | 255 | } |
256 | 256 | ||
257 | /// <summary> | 257 | /// <summary> |
258 | /// Returns a sim profile from it's UUID | 258 | /// Returns a sim profile from it's UUID |
259 | /// </summary> | 259 | /// </summary> |
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index dd4d804..4e8200b 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -48,8 +48,8 @@ namespace OpenSim.Data.MySQL | |||
48 | /// </summary> | 48 | /// </summary> |
49 | private MySQLManager database; | 49 | private MySQLManager database; |
50 | 50 | ||
51 | public void Initialise() | 51 | public void Initialise() |
52 | { | 52 | { |
53 | m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!"); | 53 | m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!"); |
54 | throw new PluginNotInitialisedException (Name); | 54 | throw new PluginNotInitialisedException (Name); |
55 | } | 55 | } |
@@ -81,7 +81,7 @@ namespace OpenSim.Data.MySQL | |||
81 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | 81 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); |
82 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | 82 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); |
83 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | 83 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); |
84 | 84 | ||
85 | database = | 85 | database = |
86 | new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, | 86 | new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, |
87 | settingPort); | 87 | settingPort); |
@@ -147,7 +147,7 @@ namespace OpenSim.Data.MySQL | |||
147 | } | 147 | } |
148 | 148 | ||
149 | /// <summary> | 149 | /// <summary> |
150 | /// | 150 | /// |
151 | /// </summary> | 151 | /// </summary> |
152 | /// <param name="conn">MySQL connection handler</param> | 152 | /// <param name="conn">MySQL connection handler</param> |
153 | /// <param name="m"></param> | 153 | /// <param name="m"></param> |
@@ -180,7 +180,7 @@ namespace OpenSim.Data.MySQL | |||
180 | // ... and set the version | 180 | // ... and set the version |
181 | if (m.Version == 0) | 181 | if (m.Version == 0) |
182 | m.Version = 1; | 182 | m.Version = 1; |
183 | 183 | ||
184 | } | 184 | } |
185 | 185 | ||
186 | #endregion | 186 | #endregion |
@@ -290,7 +290,7 @@ namespace OpenSim.Data.MySQL | |||
290 | } | 290 | } |
291 | } | 291 | } |
292 | 292 | ||
293 | 293 | ||
294 | /// <summary> | 294 | /// <summary> |
295 | /// see <see cref="InventoryItemBase.getUserRootFolder"/> | 295 | /// see <see cref="InventoryItemBase.getUserRootFolder"/> |
296 | /// </summary> | 296 | /// </summary> |
@@ -708,10 +708,10 @@ namespace OpenSim.Data.MySQL | |||
708 | * - We will only need to hit the database twice instead of n times. | 708 | * - We will only need to hit the database twice instead of n times. |
709 | * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned | 709 | * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned |
710 | * by the same person, each user only has 1 inventory heirarchy | 710 | * by the same person, each user only has 1 inventory heirarchy |
711 | * - The returned list is not ordered, instead of breadth-first ordered | 711 | * - The returned list is not ordered, instead of breadth-first ordered |
712 | There are basically 2 usage cases for getFolderHeirarchy: | 712 | There are basically 2 usage cases for getFolderHeirarchy: |
713 | 1) Getting the user's entire inventory heirarchy when they log in | 713 | 1) Getting the user's entire inventory heirarchy when they log in |
714 | 2) Finding a subfolder heirarchy to delete when emptying the trash. | 714 | 2) Finding a subfolder heirarchy to delete when emptying the trash. |
715 | This implementation will pull all inventory folders from the database, and then prune away any folder that | 715 | This implementation will pull all inventory folders from the database, and then prune away any folder that |
716 | is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the | 716 | is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the |
717 | database than to make n requests. This pays off only if requested heirarchy is large. | 717 | database than to make n requests. This pays off only if requested heirarchy is large. |
@@ -774,7 +774,7 @@ namespace OpenSim.Data.MySQL | |||
774 | while (reader.Read()) | 774 | while (reader.Read()) |
775 | { | 775 | { |
776 | InventoryFolderBase curFolder = readInventoryFolder(reader); | 776 | InventoryFolderBase curFolder = readInventoryFolder(reader); |
777 | if (hashtable.ContainsKey(curFolder.ParentID)) // Current folder already has a sibling | 777 | if (hashtable.ContainsKey(curFolder.ParentID)) // Current folder already has a sibling |
778 | hashtable[curFolder.ParentID].Add(curFolder); // append to sibling list | 778 | hashtable[curFolder.ParentID].Add(curFolder); // append to sibling list |
779 | else // else current folder has no known (yet) siblings | 779 | else // else current folder has no known (yet) siblings |
780 | { | 780 | { |
diff --git a/OpenSim/Data/MySQL/MySQLLogData.cs b/OpenSim/Data/MySQL/MySQLLogData.cs index 456cfd2..c02016c 100644 --- a/OpenSim/Data/MySQL/MySQLLogData.cs +++ b/OpenSim/Data/MySQL/MySQLLogData.cs | |||
@@ -44,12 +44,12 @@ namespace OpenSim.Data.MySQL | |||
44 | /// </summary> | 44 | /// </summary> |
45 | public MySQLManager database; | 45 | public MySQLManager database; |
46 | 46 | ||
47 | public void Initialise() | 47 | public void Initialise() |
48 | { | 48 | { |
49 | m_log.Info("[MySQLLogData]: " + Name + " cannot be default-initialized!"); | 49 | m_log.Info("[MySQLLogData]: " + Name + " cannot be default-initialized!"); |
50 | throw new PluginNotInitialisedException (Name); | 50 | throw new PluginNotInitialisedException (Name); |
51 | } | 51 | } |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Artificial constructor called when the plugin is loaded | 54 | /// Artificial constructor called when the plugin is loaded |
55 | /// Uses the obsolete mysql_connection.ini if connect string is empty. | 55 | /// Uses the obsolete mysql_connection.ini if connect string is empty. |
@@ -100,7 +100,7 @@ namespace OpenSim.Data.MySQL | |||
100 | Dictionary<string, string> tableList = new Dictionary<string, string>(); | 100 | Dictionary<string, string> tableList = new Dictionary<string, string>(); |
101 | tableList["logs"] = null; | 101 | tableList["logs"] = null; |
102 | database.GetTableVersion(tableList); | 102 | database.GetTableVersion(tableList); |
103 | 103 | ||
104 | // migrations will handle it | 104 | // migrations will handle it |
105 | if (tableList["logs"] == null) | 105 | if (tableList["logs"] == null) |
106 | return; | 106 | return; |
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 58599a8..6ad6609 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Data.MySQL | |||
55 | private string connectionString; | 55 | private string connectionString; |
56 | 56 | ||
57 | private const string m_waitTimeoutSelect = "select @@wait_timeout"; | 57 | private const string m_waitTimeoutSelect = "select @@wait_timeout"; |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Wait timeout for our connection in ticks. | 60 | /// Wait timeout for our connection in ticks. |
61 | /// </summary> | 61 | /// </summary> |
@@ -70,7 +70,7 @@ namespace OpenSim.Data.MySQL | |||
70 | /// <summary> | 70 | /// <summary> |
71 | /// Holds the last tick time that the connection was used. | 71 | /// Holds the last tick time that the connection was used. |
72 | /// </summary> | 72 | /// </summary> |
73 | private long m_lastConnectionUse; | 73 | private long m_lastConnectionUse; |
74 | 74 | ||
75 | /// <summary> | 75 | /// <summary> |
76 | /// Initialises and creates a new MySQL connection and maintains it. | 76 | /// Initialises and creates a new MySQL connection and maintains it. |
@@ -172,7 +172,7 @@ namespace OpenSim.Data.MySQL | |||
172 | // inaccuracy. | 172 | // inaccuracy. |
173 | m_lastConnectionUse = timeNow; | 173 | m_lastConnectionUse = timeNow; |
174 | } | 174 | } |
175 | 175 | ||
176 | /// <summary> | 176 | /// <summary> |
177 | /// Get the connection being used | 177 | /// Get the connection being used |
178 | /// </summary> | 178 | /// </summary> |
@@ -287,14 +287,14 @@ namespace OpenSim.Data.MySQL | |||
287 | { | 287 | { |
288 | lock (dbcon) | 288 | lock (dbcon) |
289 | { | 289 | { |
290 | CheckConnection(); | 290 | CheckConnection(); |
291 | 291 | ||
292 | MySqlCommand tablesCmd = | 292 | MySqlCommand tablesCmd = |
293 | new MySqlCommand( | 293 | new MySqlCommand( |
294 | "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", | 294 | "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", |
295 | dbcon); | 295 | dbcon); |
296 | tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); | 296 | tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); |
297 | 297 | ||
298 | using (MySqlDataReader tables = tablesCmd.ExecuteReader()) | 298 | using (MySqlDataReader tables = tablesCmd.ExecuteReader()) |
299 | { | 299 | { |
300 | while (tables.Read()) | 300 | while (tables.Read()) |
@@ -541,7 +541,7 @@ namespace OpenSim.Data.MySQL | |||
541 | LLUUID regionID = LLUUID.Zero; | 541 | LLUUID regionID = LLUUID.Zero; |
542 | LLUUID.TryParse(reader["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero | 542 | LLUUID.TryParse(reader["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero |
543 | retval.HomeRegionID = regionID; | 543 | retval.HomeRegionID = regionID; |
544 | 544 | ||
545 | retval.Created = Convert.ToInt32(reader["created"].ToString()); | 545 | retval.Created = Convert.ToInt32(reader["created"].ToString()); |
546 | retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); | 546 | retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); |
547 | 547 | ||
@@ -1124,7 +1124,7 @@ namespace OpenSim.Data.MySQL | |||
1124 | sql += "?skirt_item, ?skirt_asset)"; | 1124 | sql += "?skirt_item, ?skirt_asset)"; |
1125 | 1125 | ||
1126 | bool returnval = false; | 1126 | bool returnval = false; |
1127 | 1127 | ||
1128 | // we want to send in byte data, which means we can't just pass down strings | 1128 | // we want to send in byte data, which means we can't just pass down strings |
1129 | try { | 1129 | try { |
1130 | MySqlCommand cmd = (MySqlCommand) dbcon.CreateCommand(); | 1130 | MySqlCommand cmd = (MySqlCommand) dbcon.CreateCommand(); |
@@ -1160,7 +1160,7 @@ namespace OpenSim.Data.MySQL | |||
1160 | cmd.Parameters.AddWithValue("?underpants_asset", appearance.UnderPantsAsset.ToString()); | 1160 | cmd.Parameters.AddWithValue("?underpants_asset", appearance.UnderPantsAsset.ToString()); |
1161 | cmd.Parameters.AddWithValue("?skirt_item", appearance.SkirtItem.ToString()); | 1161 | cmd.Parameters.AddWithValue("?skirt_item", appearance.SkirtItem.ToString()); |
1162 | cmd.Parameters.AddWithValue("?skirt_asset", appearance.SkirtAsset.ToString()); | 1162 | cmd.Parameters.AddWithValue("?skirt_asset", appearance.SkirtAsset.ToString()); |
1163 | 1163 | ||
1164 | if (cmd.ExecuteNonQuery() > 0) | 1164 | if (cmd.ExecuteNonQuery() > 0) |
1165 | returnval = true; | 1165 | returnval = true; |
1166 | 1166 | ||
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 70b6d3c..85af5df 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -53,27 +53,27 @@ namespace OpenSim.Data.MySQL | |||
53 | private const string m_terrainSelect = "select * from terrain limit 1"; | 53 | private const string m_terrainSelect = "select * from terrain limit 1"; |
54 | private const string m_landSelect = "select * from land"; | 54 | private const string m_landSelect = "select * from land"; |
55 | private const string m_landAccessListSelect = "select * from landaccesslist"; | 55 | private const string m_landAccessListSelect = "select * from landaccesslist"; |
56 | private const string m_regionSettingsSelect = "select * from regionsettings"; | 56 | private const string m_regionSettingsSelect = "select * from regionsettings"; |
57 | private const string m_waitTimeoutSelect = "select @@wait_timeout"; | 57 | private const string m_waitTimeoutSelect = "select @@wait_timeout"; |
58 | 58 | ||
59 | private MySqlConnection m_connection; | 59 | private MySqlConnection m_connection; |
60 | private string m_connectionString; | 60 | private string m_connectionString; |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Wait timeout for our connection in ticks. | 63 | /// Wait timeout for our connection in ticks. |
64 | /// </summary> | 64 | /// </summary> |
65 | private long m_waitTimeout; | 65 | private long m_waitTimeout; |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// Make our storage of the timeout this amount smaller than it actually is, to give us a margin on long | 68 | /// Make our storage of the timeout this amount smaller than it actually is, to give us a margin on long |
69 | /// running database operations. | 69 | /// running database operations. |
70 | /// </summary> | 70 | /// </summary> |
71 | private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; | 71 | private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Holds the last tick time that the connection was used. | 74 | /// Holds the last tick time that the connection was used. |
75 | /// </summary> | 75 | /// </summary> |
76 | private long m_lastConnectionUse; | 76 | private long m_lastConnectionUse; |
77 | 77 | ||
78 | private DataSet m_dataSet; | 78 | private DataSet m_dataSet; |
79 | private MySqlDataAdapter m_primDataAdapter; | 79 | private MySqlDataAdapter m_primDataAdapter; |
@@ -105,7 +105,7 @@ namespace OpenSim.Data.MySQL | |||
105 | public void Initialise(string connectionString) | 105 | public void Initialise(string connectionString) |
106 | { | 106 | { |
107 | m_connectionString = connectionString; | 107 | m_connectionString = connectionString; |
108 | 108 | ||
109 | m_dataSet = new DataSet(); | 109 | m_dataSet = new DataSet(); |
110 | 110 | ||
111 | int passPosition = 0; | 111 | int passPosition = 0; |
@@ -132,8 +132,8 @@ namespace OpenSim.Data.MySQL | |||
132 | m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); | 132 | m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); |
133 | m_connection = new MySqlConnection(m_connectionString); | 133 | m_connection = new MySqlConnection(m_connectionString); |
134 | m_connection.Open(); | 134 | m_connection.Open(); |
135 | 135 | ||
136 | GetWaitTimeout(); | 136 | GetWaitTimeout(); |
137 | 137 | ||
138 | // This actually does the roll forward assembly stuff | 138 | // This actually does the roll forward assembly stuff |
139 | Assembly assem = GetType().Assembly; | 139 | Assembly assem = GetType().Assembly; |
@@ -177,12 +177,11 @@ namespace OpenSim.Data.MySQL | |||
177 | m_dataSet.Tables.Add(m_shapeTable); | 177 | m_dataSet.Tables.Add(m_shapeTable); |
178 | SetupShapeCommands(m_shapeDataAdapter, m_connection); | 178 | SetupShapeCommands(m_shapeDataAdapter, m_connection); |
179 | m_shapeDataAdapter.Fill(m_shapeTable); | 179 | m_shapeDataAdapter.Fill(m_shapeTable); |
180 | |||
181 | 180 | ||
182 | m_itemsTable = createItemsTable(); | 181 | m_itemsTable = createItemsTable(); |
183 | m_dataSet.Tables.Add(m_itemsTable); | 182 | m_dataSet.Tables.Add(m_itemsTable); |
184 | SetupItemsCommands(m_itemsDataAdapter, m_connection); | 183 | SetupItemsCommands(m_itemsDataAdapter, m_connection); |
185 | m_itemsDataAdapter.Fill(m_itemsTable); | 184 | m_itemsDataAdapter.Fill(m_itemsTable); |
186 | 185 | ||
187 | m_terrainTable = createTerrainTable(); | 186 | m_terrainTable = createTerrainTable(); |
188 | m_dataSet.Tables.Add(m_terrainTable); | 187 | m_dataSet.Tables.Add(m_terrainTable); |
@@ -205,58 +204,58 @@ namespace OpenSim.Data.MySQL | |||
205 | m_regionSettingsDataAdapter.Fill(m_regionSettingsTable); | 204 | m_regionSettingsDataAdapter.Fill(m_regionSettingsTable); |
206 | } | 205 | } |
207 | } | 206 | } |
208 | 207 | ||
209 | /// <summary> | 208 | /// <summary> |
210 | /// Get the wait_timeout value for our connection | 209 | /// Get the wait_timeout value for our connection |
211 | /// </summary> | 210 | /// </summary> |
212 | protected void GetWaitTimeout() | 211 | protected void GetWaitTimeout() |
213 | { | 212 | { |
214 | MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, m_connection); | 213 | MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, m_connection); |
215 | 214 | ||
216 | using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) | 215 | using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) |
217 | { | 216 | { |
218 | if (dbReader.Read()) | 217 | if (dbReader.Read()) |
219 | { | 218 | { |
220 | m_waitTimeout | 219 | m_waitTimeout |
221 | = Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; | 220 | = Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; |
222 | } | 221 | } |
223 | 222 | ||
224 | dbReader.Close(); | 223 | dbReader.Close(); |
225 | cmd.Dispose(); | 224 | cmd.Dispose(); |
226 | } | 225 | } |
227 | 226 | ||
228 | m_lastConnectionUse = System.DateTime.Now.Ticks; | 227 | m_lastConnectionUse = System.DateTime.Now.Ticks; |
229 | 228 | ||
230 | m_log.DebugFormat( | 229 | m_log.DebugFormat( |
231 | "[REGION DB]: Connection wait timeout {0} seconds", m_waitTimeout / TimeSpan.TicksPerSecond); | 230 | "[REGION DB]: Connection wait timeout {0} seconds", m_waitTimeout / TimeSpan.TicksPerSecond); |
232 | } | 231 | } |
233 | 232 | ||
234 | /// <summary> | 233 | /// <summary> |
235 | /// Should be called before any db operation. This checks to see if the connection has not timed out | 234 | /// Should be called before any db operation. This checks to see if the connection has not timed out |
236 | /// </summary> | 235 | /// </summary> |
237 | protected void CheckConnection() | 236 | protected void CheckConnection() |
238 | { | 237 | { |
239 | //m_log.Debug("[REGION DB]: Checking connection"); | 238 | //m_log.Debug("[REGION DB]: Checking connection"); |
240 | 239 | ||
241 | long timeNow = System.DateTime.Now.Ticks; | 240 | long timeNow = System.DateTime.Now.Ticks; |
242 | if (timeNow - m_lastConnectionUse > m_waitTimeout || m_connection.State != ConnectionState.Open) | 241 | if (timeNow - m_lastConnectionUse > m_waitTimeout || m_connection.State != ConnectionState.Open) |
243 | { | 242 | { |
244 | m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); | 243 | m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); |
245 | 244 | ||
246 | lock (m_connection) | 245 | lock (m_connection) |
247 | { | 246 | { |
248 | m_connection.Close(); | 247 | m_connection.Close(); |
249 | m_connection = new MySqlConnection(m_connectionString); | 248 | m_connection = new MySqlConnection(m_connectionString); |
250 | m_connection.Open(); | 249 | m_connection.Open(); |
251 | } | 250 | } |
252 | } | 251 | } |
253 | 252 | ||
254 | // Strictly, we should set this after the actual db operation. But it's more convenient to set here rather | 253 | // Strictly, we should set this after the actual db operation. But it's more convenient to set here rather |
255 | // than require the code to call another method - the timeout leeway should be large enough to cover the | 254 | // than require the code to call another method - the timeout leeway should be large enough to cover the |
256 | // inaccuracy. | 255 | // inaccuracy. |
257 | m_lastConnectionUse = timeNow; | 256 | m_lastConnectionUse = timeNow; |
258 | } | 257 | } |
259 | 258 | ||
260 | /// <summary> | 259 | /// <summary> |
261 | /// Given a list of tables, return the version of the tables, as seen in the database | 260 | /// Given a list of tables, return the version of the tables, as seen in the database |
262 | /// </summary> | 261 | /// </summary> |
@@ -271,7 +270,7 @@ namespace OpenSim.Data.MySQL | |||
271 | "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", | 270 | "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", |
272 | dbcon); | 271 | dbcon); |
273 | tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); | 272 | tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); |
274 | 273 | ||
275 | CheckConnection(); | 274 | CheckConnection(); |
276 | using (MySqlDataReader tables = tablesCmd.ExecuteReader()) | 275 | using (MySqlDataReader tables = tablesCmd.ExecuteReader()) |
277 | { | 276 | { |
@@ -465,7 +464,7 @@ namespace OpenSim.Data.MySQL | |||
465 | 464 | ||
466 | lock (m_dataSet) | 465 | lock (m_dataSet) |
467 | { | 466 | { |
468 | CheckConnection(); | 467 | CheckConnection(); |
469 | DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); | 468 | DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); |
470 | m_log.Info("[REGION DB]: " + | 469 | m_log.Info("[REGION DB]: " + |
471 | "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); | 470 | "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); |
@@ -587,10 +586,10 @@ namespace OpenSim.Data.MySQL | |||
587 | using (cmd) | 586 | using (cmd) |
588 | { | 587 | { |
589 | delete.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); | 588 | delete.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); |
590 | 589 | ||
591 | CheckConnection(); | 590 | CheckConnection(); |
592 | delete.ExecuteNonQuery(); | 591 | delete.ExecuteNonQuery(); |
593 | 592 | ||
594 | cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); | 593 | cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); |
595 | cmd.Parameters.Add(new MySqlParameter("?Revision", revision)); | 594 | cmd.Parameters.Add(new MySqlParameter("?Revision", revision)); |
596 | cmd.Parameters.Add(new MySqlParameter("?Heightfield", serializeTerrain(ter))); | 595 | cmd.Parameters.Add(new MySqlParameter("?Heightfield", serializeTerrain(ter))); |
@@ -774,7 +773,7 @@ namespace OpenSim.Data.MySQL | |||
774 | } | 773 | } |
775 | 774 | ||
776 | /// <summary> | 775 | /// <summary> |
777 | /// | 776 | /// |
778 | /// </summary> | 777 | /// </summary> |
779 | /// <param name="regionUUID"></param> | 778 | /// <param name="regionUUID"></param> |
780 | /// <returns></returns> | 779 | /// <returns></returns> |
@@ -805,7 +804,7 @@ namespace OpenSim.Data.MySQL | |||
805 | } | 804 | } |
806 | 805 | ||
807 | /// <summary> | 806 | /// <summary> |
808 | /// | 807 | /// |
809 | /// </summary> | 808 | /// </summary> |
810 | public void Commit() | 809 | public void Commit() |
811 | { | 810 | { |
@@ -845,7 +844,7 @@ namespace OpenSim.Data.MySQL | |||
845 | **********************************************************************/ | 844 | **********************************************************************/ |
846 | 845 | ||
847 | /// <summary> | 846 | /// <summary> |
848 | /// | 847 | /// |
849 | /// </summary> | 848 | /// </summary> |
850 | /// <param name="dt"></param> | 849 | /// <param name="dt"></param> |
851 | /// <param name="name"></param> | 850 | /// <param name="name"></param> |
@@ -1139,7 +1138,7 @@ namespace OpenSim.Data.MySQL | |||
1139 | **********************************************************************/ | 1138 | **********************************************************************/ |
1140 | 1139 | ||
1141 | /// <summary> | 1140 | /// <summary> |
1142 | /// | 1141 | /// |
1143 | /// </summary> | 1142 | /// </summary> |
1144 | /// <param name="row"></param> | 1143 | /// <param name="row"></param> |
1145 | /// <returns></returns> | 1144 | /// <returns></returns> |
@@ -1315,7 +1314,7 @@ namespace OpenSim.Data.MySQL | |||
1315 | } | 1314 | } |
1316 | 1315 | ||
1317 | /// <summary> | 1316 | /// <summary> |
1318 | /// | 1317 | /// |
1319 | /// </summary> | 1318 | /// </summary> |
1320 | /// <param name="row"></param> | 1319 | /// <param name="row"></param> |
1321 | /// <returns></returns> | 1320 | /// <returns></returns> |
@@ -1374,14 +1373,14 @@ namespace OpenSim.Data.MySQL | |||
1374 | newData.UserLookAt = LLVector3.Zero; | 1373 | newData.UserLookAt = LLVector3.Zero; |
1375 | m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); | 1374 | m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); |
1376 | } | 1375 | } |
1377 | 1376 | ||
1378 | newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); | 1377 | newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); |
1379 | 1378 | ||
1380 | return newData; | 1379 | return newData; |
1381 | } | 1380 | } |
1382 | 1381 | ||
1383 | /// <summary> | 1382 | /// <summary> |
1384 | /// | 1383 | /// |
1385 | /// </summary> | 1384 | /// </summary> |
1386 | /// <param name="row"></param> | 1385 | /// <param name="row"></param> |
1387 | /// <returns></returns> | 1386 | /// <returns></returns> |
@@ -1395,7 +1394,7 @@ namespace OpenSim.Data.MySQL | |||
1395 | } | 1394 | } |
1396 | 1395 | ||
1397 | /// <summary> | 1396 | /// <summary> |
1398 | /// | 1397 | /// |
1399 | /// </summary> | 1398 | /// </summary> |
1400 | /// <param name="val"></param> | 1399 | /// <param name="val"></param> |
1401 | /// <returns></returns> | 1400 | /// <returns></returns> |
@@ -1419,7 +1418,7 @@ namespace OpenSim.Data.MySQL | |||
1419 | } | 1418 | } |
1420 | 1419 | ||
1421 | /// <summary> | 1420 | /// <summary> |
1422 | /// | 1421 | /// |
1423 | /// </summary> | 1422 | /// </summary> |
1424 | /// <param name="row"></param> | 1423 | /// <param name="row"></param> |
1425 | /// <param name="prim"></param> | 1424 | /// <param name="prim"></param> |
@@ -1502,7 +1501,7 @@ namespace OpenSim.Data.MySQL | |||
1502 | } | 1501 | } |
1503 | 1502 | ||
1504 | /// <summary> | 1503 | /// <summary> |
1505 | /// | 1504 | /// |
1506 | /// </summary> | 1505 | /// </summary> |
1507 | /// <param name="row"></param> | 1506 | /// <param name="row"></param> |
1508 | /// <param name="taskItem"></param> | 1507 | /// <param name="taskItem"></param> |
@@ -1532,7 +1531,7 @@ namespace OpenSim.Data.MySQL | |||
1532 | } | 1531 | } |
1533 | 1532 | ||
1534 | /// <summary> | 1533 | /// <summary> |
1535 | /// | 1534 | /// |
1536 | /// </summary> | 1535 | /// </summary> |
1537 | private static void fillRegionSettingsRow(DataRow row, RegionSettings settings) | 1536 | private static void fillRegionSettingsRow(DataRow row, RegionSettings settings) |
1538 | { | 1537 | { |
@@ -1573,7 +1572,7 @@ namespace OpenSim.Data.MySQL | |||
1573 | } | 1572 | } |
1574 | 1573 | ||
1575 | /// <summary> | 1574 | /// <summary> |
1576 | /// | 1575 | /// |
1577 | /// </summary> | 1576 | /// </summary> |
1578 | /// <param name="row"></param> | 1577 | /// <param name="row"></param> |
1579 | /// <param name="land"></param> | 1578 | /// <param name="land"></param> |
@@ -1618,7 +1617,7 @@ namespace OpenSim.Data.MySQL | |||
1618 | } | 1617 | } |
1619 | 1618 | ||
1620 | /// <summary> | 1619 | /// <summary> |
1621 | /// | 1620 | /// |
1622 | /// </summary> | 1621 | /// </summary> |
1623 | /// <param name="row"></param> | 1622 | /// <param name="row"></param> |
1624 | /// <param name="entry"></param> | 1623 | /// <param name="entry"></param> |
@@ -1631,7 +1630,7 @@ namespace OpenSim.Data.MySQL | |||
1631 | } | 1630 | } |
1632 | 1631 | ||
1633 | /// <summary> | 1632 | /// <summary> |
1634 | /// | 1633 | /// |
1635 | /// </summary> | 1634 | /// </summary> |
1636 | /// <param name="row"></param> | 1635 | /// <param name="row"></param> |
1637 | /// <returns></returns> | 1636 | /// <returns></returns> |
@@ -1694,7 +1693,7 @@ namespace OpenSim.Data.MySQL | |||
1694 | } | 1693 | } |
1695 | 1694 | ||
1696 | /// <summary> | 1695 | /// <summary> |
1697 | /// | 1696 | /// |
1698 | /// </summary> | 1697 | /// </summary> |
1699 | /// <param name="row"></param> | 1698 | /// <param name="row"></param> |
1700 | /// <param name="prim"></param> | 1699 | /// <param name="prim"></param> |
@@ -1731,7 +1730,7 @@ namespace OpenSim.Data.MySQL | |||
1731 | row["ProfileHollow"] = s.ProfileHollow; | 1730 | row["ProfileHollow"] = s.ProfileHollow; |
1732 | row["Texture"] = s.TextureEntry; | 1731 | row["Texture"] = s.TextureEntry; |
1733 | row["ExtraParams"] = s.ExtraParams; | 1732 | row["ExtraParams"] = s.ExtraParams; |
1734 | 1733 | ||
1735 | try | 1734 | try |
1736 | { | 1735 | { |
1737 | row["State"] = s.State; | 1736 | row["State"] = s.State; |
@@ -1754,7 +1753,7 @@ namespace OpenSim.Data.MySQL | |||
1754 | } | 1753 | } |
1755 | 1754 | ||
1756 | /// <summary> | 1755 | /// <summary> |
1757 | /// | 1756 | /// |
1758 | /// </summary> | 1757 | /// </summary> |
1759 | /// <param name="prim"></param> | 1758 | /// <param name="prim"></param> |
1760 | /// <param name="sceneGroupID"></param> | 1759 | /// <param name="sceneGroupID"></param> |
@@ -1911,7 +1910,7 @@ namespace OpenSim.Data.MySQL | |||
1911 | } | 1910 | } |
1912 | 1911 | ||
1913 | /// <summary> | 1912 | /// <summary> |
1914 | /// | 1913 | /// |
1915 | /// </summary> | 1914 | /// </summary> |
1916 | /// <param name="dt"></param> | 1915 | /// <param name="dt"></param> |
1917 | /// <returns></returns> | 1916 | /// <returns></returns> |
@@ -1973,7 +1972,7 @@ namespace OpenSim.Data.MySQL | |||
1973 | } | 1972 | } |
1974 | 1973 | ||
1975 | /// <summary> | 1974 | /// <summary> |
1976 | /// | 1975 | /// |
1977 | /// </summary> | 1976 | /// </summary> |
1978 | /// <param name="da"></param> | 1977 | /// <param name="da"></param> |
1979 | /// <param name="conn"></param> | 1978 | /// <param name="conn"></param> |
@@ -1994,7 +1993,7 @@ namespace OpenSim.Data.MySQL | |||
1994 | } | 1993 | } |
1995 | 1994 | ||
1996 | /// <summary> | 1995 | /// <summary> |
1997 | /// | 1996 | /// |
1998 | /// </summary> | 1997 | /// </summary> |
1999 | /// <param name="da"></param> | 1998 | /// <param name="da"></param> |
2000 | /// <param name="conn"></param> | 1999 | /// <param name="conn"></param> |
@@ -2027,7 +2026,7 @@ namespace OpenSim.Data.MySQL | |||
2027 | } | 2026 | } |
2028 | 2027 | ||
2029 | /// <summary> | 2028 | /// <summary> |
2030 | /// | 2029 | /// |
2031 | /// </summary> | 2030 | /// </summary> |
2032 | /// <param name="da"></param> | 2031 | /// <param name="da"></param> |
2033 | /// <param name="conn"></param> | 2032 | /// <param name="conn"></param> |
@@ -2038,7 +2037,7 @@ namespace OpenSim.Data.MySQL | |||
2038 | } | 2037 | } |
2039 | 2038 | ||
2040 | /// <summary> | 2039 | /// <summary> |
2041 | /// | 2040 | /// |
2042 | /// </summary> | 2041 | /// </summary> |
2043 | /// <param name="da"></param> | 2042 | /// <param name="da"></param> |
2044 | /// <param name="conn"></param> | 2043 | /// <param name="conn"></param> |
@@ -2052,7 +2051,7 @@ namespace OpenSim.Data.MySQL | |||
2052 | } | 2051 | } |
2053 | 2052 | ||
2054 | /// <summary> | 2053 | /// <summary> |
2055 | /// | 2054 | /// |
2056 | /// </summary> | 2055 | /// </summary> |
2057 | /// <param name="da"></param> | 2056 | /// <param name="da"></param> |
2058 | /// <param name="conn"></param> | 2057 | /// <param name="conn"></param> |
@@ -2063,7 +2062,7 @@ namespace OpenSim.Data.MySQL | |||
2063 | } | 2062 | } |
2064 | 2063 | ||
2065 | /// <summary> | 2064 | /// <summary> |
2066 | /// | 2065 | /// |
2067 | /// </summary> | 2066 | /// </summary> |
2068 | /// <param name="da"></param> | 2067 | /// <param name="da"></param> |
2069 | /// <param name="conn"></param> | 2068 | /// <param name="conn"></param> |
@@ -2082,7 +2081,7 @@ namespace OpenSim.Data.MySQL | |||
2082 | } | 2081 | } |
2083 | 2082 | ||
2084 | /// <summary> | 2083 | /// <summary> |
2085 | /// | 2084 | /// |
2086 | /// </summary> | 2085 | /// </summary> |
2087 | /// <param name="conn">MySQL connection handler</param> | 2086 | /// <param name="conn">MySQL connection handler</param> |
2088 | // private static void InitDB(MySqlConnection conn) | 2087 | // private static void InitDB(MySqlConnection conn) |
@@ -2174,7 +2173,7 @@ namespace OpenSim.Data.MySQL | |||
2174 | // } | 2173 | // } |
2175 | 2174 | ||
2176 | /// <summary> | 2175 | /// <summary> |
2177 | /// | 2176 | /// |
2178 | /// </summary> | 2177 | /// </summary> |
2179 | /// <param name="conn"></param> | 2178 | /// <param name="conn"></param> |
2180 | /// <param name="m"></param> | 2179 | /// <param name="m"></param> |
diff --git a/OpenSim/Data/NHibernate/LLQuaternionUserType.cs b/OpenSim/Data/NHibernate/LLQuaternionUserType.cs index c4f3136..80fb9ff 100644 --- a/OpenSim/Data/NHibernate/LLQuaternionUserType.cs +++ b/OpenSim/Data/NHibernate/LLQuaternionUserType.cs | |||
@@ -72,7 +72,7 @@ namespace OpenSim.Data.NHibernate | |||
72 | public object NullSafeGet(IDataReader rs, string[] names, object owner) | 72 | public object NullSafeGet(IDataReader rs, string[] names, object owner) |
73 | { | 73 | { |
74 | object quat = null; | 74 | object quat = null; |
75 | 75 | ||
76 | int x = rs.GetOrdinal(names[0]); | 76 | int x = rs.GetOrdinal(names[0]); |
77 | int y = rs.GetOrdinal(names[1]); | 77 | int y = rs.GetOrdinal(names[1]); |
78 | int z = rs.GetOrdinal(names[2]); | 78 | int z = rs.GetOrdinal(names[2]); |
@@ -105,10 +105,10 @@ namespace OpenSim.Data.NHibernate | |||
105 | 105 | ||
106 | public SqlType[] SqlTypes | 106 | public SqlType[] SqlTypes |
107 | { | 107 | { |
108 | get { return new SqlType [] { | 108 | get { return new SqlType [] { |
109 | NHibernateUtil.Single.SqlType, | 109 | NHibernateUtil.Single.SqlType, |
110 | NHibernateUtil.Single.SqlType, | 110 | NHibernateUtil.Single.SqlType, |
111 | NHibernateUtil.Single.SqlType, | 111 | NHibernateUtil.Single.SqlType, |
112 | NHibernateUtil.Single.SqlType | 112 | NHibernateUtil.Single.SqlType |
113 | }; } | 113 | }; } |
114 | } | 114 | } |
diff --git a/OpenSim/Data/NHibernate/LLVector3UserType.cs b/OpenSim/Data/NHibernate/LLVector3UserType.cs index b040ca7d..d2df2c4 100644 --- a/OpenSim/Data/NHibernate/LLVector3UserType.cs +++ b/OpenSim/Data/NHibernate/LLVector3UserType.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Data.NHibernate | |||
70 | public object NullSafeGet(IDataReader rs, string[] names, object owner) | 70 | public object NullSafeGet(IDataReader rs, string[] names, object owner) |
71 | { | 71 | { |
72 | object vector = null; | 72 | object vector = null; |
73 | 73 | ||
74 | int x = rs.GetOrdinal(names[0]); | 74 | int x = rs.GetOrdinal(names[0]); |
75 | int y = rs.GetOrdinal(names[1]); | 75 | int y = rs.GetOrdinal(names[1]); |
76 | int z = rs.GetOrdinal(names[2]); | 76 | int z = rs.GetOrdinal(names[2]); |
diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs index 2e9e897..400451f 100644 --- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs +++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs | |||
@@ -93,7 +93,7 @@ namespace OpenSim.Data.NHibernate | |||
93 | 93 | ||
94 | factory = cfg.BuildSessionFactory(); | 94 | factory = cfg.BuildSessionFactory(); |
95 | session = factory.OpenSession(); | 95 | session = factory.OpenSession(); |
96 | 96 | ||
97 | // This actually does the roll forward assembly stuff | 97 | // This actually does the roll forward assembly stuff |
98 | Assembly assem = GetType().Assembly; | 98 | Assembly assem = GetType().Assembly; |
99 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "AssetStore"); | 99 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "AssetStore"); |
@@ -111,7 +111,7 @@ namespace OpenSim.Data.NHibernate | |||
111 | { | 111 | { |
112 | m_log.ErrorFormat("[NHIBERNATE] no such asset {0}", uuid); | 112 | m_log.ErrorFormat("[NHIBERNATE] no such asset {0}", uuid); |
113 | return null; | 113 | return null; |
114 | } | 114 | } |
115 | catch (Exception e) | 115 | catch (Exception e) |
116 | { | 116 | { |
117 | m_log.Error("[NHIBERNATE] unexpected exception: ", e); | 117 | m_log.Error("[NHIBERNATE] unexpected exception: ", e); |
@@ -121,7 +121,7 @@ namespace OpenSim.Data.NHibernate | |||
121 | 121 | ||
122 | private void Save(AssetBase asset) | 122 | private void Save(AssetBase asset) |
123 | { | 123 | { |
124 | try | 124 | try |
125 | { | 125 | { |
126 | // a is not used anywhere? | 126 | // a is not used anywhere? |
127 | // AssetBase a = session.Load(typeof(AssetBase), asset.FullID) as AssetBase; | 127 | // AssetBase a = session.Load(typeof(AssetBase), asset.FullID) as AssetBase; |
diff --git a/OpenSim/Data/NHibernate/NHibernateManager.cs b/OpenSim/Data/NHibernate/NHibernateManager.cs index 4c5ec01..161ec1d 100644 --- a/OpenSim/Data/NHibernate/NHibernateManager.cs +++ b/OpenSim/Data/NHibernate/NHibernateManager.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Data.NHibernate | |||
51 | // "NHibernate.Driver.SqliteClientDriver"; | 51 | // "NHibernate.Driver.SqliteClientDriver"; |
52 | // cfg.Properties[NHibernate.Cfg.Environment.ConnectionString] = | 52 | // cfg.Properties[NHibernate.Cfg.Environment.ConnectionString] = |
53 | // "URI=file:opensim-nh.db,version=3"; | 53 | // "URI=file:opensim-nh.db,version=3"; |
54 | 54 | ||
55 | // factory = cfg.BuildSessionFactory(); | 55 | // factory = cfg.BuildSessionFactory(); |
56 | } | 56 | } |
57 | 57 | ||
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs index 52db32d..9682d87 100644 --- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs +++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs | |||
@@ -89,10 +89,10 @@ namespace OpenSim.Data.NHibernate | |||
89 | using (MemoryStream stream = | 89 | using (MemoryStream stream = |
90 | HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) | 90 | HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) |
91 | cfg.AddInputStream(stream); | 91 | cfg.AddInputStream(stream); |
92 | 92 | ||
93 | factory = cfg.BuildSessionFactory(); | 93 | factory = cfg.BuildSessionFactory(); |
94 | session = factory.OpenSession(); | 94 | session = factory.OpenSession(); |
95 | 95 | ||
96 | // This actually does the roll forward assembly stuff | 96 | // This actually does the roll forward assembly stuff |
97 | Assembly assem = GetType().Assembly; | 97 | Assembly assem = GetType().Assembly; |
98 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "RegionStore"); | 98 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "RegionStore"); |
@@ -113,7 +113,7 @@ namespace OpenSim.Data.NHibernate | |||
113 | { | 113 | { |
114 | return null; | 114 | return null; |
115 | } | 115 | } |
116 | 116 | ||
117 | // This looks inefficient, but it turns out that it isn't | 117 | // This looks inefficient, but it turns out that it isn't |
118 | // based on trial runs with nhibernate 1.2 | 118 | // based on trial runs with nhibernate 1.2 |
119 | private void SaveOrUpdate(SceneObjectPart p) | 119 | private void SaveOrUpdate(SceneObjectPart p) |
@@ -164,7 +164,7 @@ namespace OpenSim.Data.NHibernate | |||
164 | /// <param name="regionUUID">the region UUID</param> | 164 | /// <param name="regionUUID">the region UUID</param> |
165 | public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) | 165 | public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) |
166 | { | 166 | { |
167 | try | 167 | try |
168 | { | 168 | { |
169 | foreach (SceneObjectPart part in obj.Children.Values) | 169 | foreach (SceneObjectPart part in obj.Children.Values) |
170 | { | 170 | { |
@@ -173,7 +173,7 @@ namespace OpenSim.Data.NHibernate | |||
173 | } | 173 | } |
174 | session.Flush(); | 174 | session.Flush(); |
175 | } | 175 | } |
176 | catch (Exception e) | 176 | catch (Exception e) |
177 | { | 177 | { |
178 | m_log.Error("Can't save: ", e); | 178 | m_log.Error("Can't save: ", e); |
179 | } | 179 | } |
@@ -196,7 +196,7 @@ namespace OpenSim.Data.NHibernate | |||
196 | group.AddPart(p); | 196 | group.AddPart(p); |
197 | group.RootPart = p; | 197 | group.RootPart = p; |
198 | } | 198 | } |
199 | else | 199 | else |
200 | { | 200 | { |
201 | group.AddPart(p); | 201 | group.AddPart(p); |
202 | } | 202 | } |
@@ -232,7 +232,7 @@ namespace OpenSim.Data.NHibernate | |||
232 | { | 232 | { |
233 | Dictionary<LLUUID, SceneObjectGroup> SOG = new Dictionary<LLUUID, SceneObjectGroup>(); | 233 | Dictionary<LLUUID, SceneObjectGroup> SOG = new Dictionary<LLUUID, SceneObjectGroup>(); |
234 | List<SceneObjectGroup> ret = new List<SceneObjectGroup>(); | 234 | List<SceneObjectGroup> ret = new List<SceneObjectGroup>(); |
235 | 235 | ||
236 | ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart)); | 236 | ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart)); |
237 | criteria.Add(Expression.Eq("RegionID", regionUUID)); | 237 | criteria.Add(Expression.Eq("RegionID", regionUUID)); |
238 | criteria.AddOrder( Order.Asc("ParentID") ); | 238 | criteria.AddOrder( Order.Asc("ParentID") ); |
@@ -246,12 +246,12 @@ namespace OpenSim.Data.NHibernate | |||
246 | group.RootPart = p; | 246 | group.RootPart = p; |
247 | SOG.Add(p.ParentUUID, group); | 247 | SOG.Add(p.ParentUUID, group); |
248 | } | 248 | } |
249 | else | 249 | else |
250 | { | 250 | { |
251 | SOG[p.ParentUUID].AddPart(p); | 251 | SOG[p.ParentUUID].AddPart(p); |
252 | } | 252 | } |
253 | // get the inventory | 253 | // get the inventory |
254 | 254 | ||
255 | ICriteria InvCriteria = session.CreateCriteria(typeof(TaskInventoryItem)); | 255 | ICriteria InvCriteria = session.CreateCriteria(typeof(TaskInventoryItem)); |
256 | InvCriteria.Add(Expression.Eq("ParentPartID", p.UUID)); | 256 | InvCriteria.Add(Expression.Eq("ParentPartID", p.UUID)); |
257 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); | 257 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); |
@@ -263,7 +263,7 @@ namespace OpenSim.Data.NHibernate | |||
263 | if (inventory.Count > 0) | 263 | if (inventory.Count > 0) |
264 | p.RestoreInventoryItems(inventory); | 264 | p.RestoreInventoryItems(inventory); |
265 | } | 265 | } |
266 | foreach (SceneObjectGroup g in SOG.Values) | 266 | foreach (SceneObjectGroup g in SOG.Values) |
267 | { | 267 | { |
268 | ret.Add(g); | 268 | ret.Add(g); |
269 | } | 269 | } |
@@ -304,7 +304,7 @@ namespace OpenSim.Data.NHibernate | |||
304 | } | 304 | } |
305 | 305 | ||
306 | /// <summary> | 306 | /// <summary> |
307 | /// | 307 | /// |
308 | /// </summary> | 308 | /// </summary> |
309 | /// <param name="globalID"></param> | 309 | /// <param name="globalID"></param> |
310 | public void RemoveLandObject(LLUUID globalID) | 310 | public void RemoveLandObject(LLUUID globalID) |
@@ -313,7 +313,7 @@ namespace OpenSim.Data.NHibernate | |||
313 | } | 313 | } |
314 | 314 | ||
315 | /// <summary> | 315 | /// <summary> |
316 | /// | 316 | /// |
317 | /// </summary> | 317 | /// </summary> |
318 | /// <param name="parcel"></param> | 318 | /// <param name="parcel"></param> |
319 | public void StoreLandObject(ILandObject parcel) | 319 | public void StoreLandObject(ILandObject parcel) |
@@ -322,7 +322,7 @@ namespace OpenSim.Data.NHibernate | |||
322 | } | 322 | } |
323 | 323 | ||
324 | /// <summary> | 324 | /// <summary> |
325 | /// | 325 | /// |
326 | /// </summary> | 326 | /// </summary> |
327 | /// <param name="regionUUID"></param> | 327 | /// <param name="regionUUID"></param> |
328 | /// <returns></returns> | 328 | /// <returns></returns> |
@@ -341,7 +341,7 @@ namespace OpenSim.Data.NHibernate | |||
341 | { | 341 | { |
342 | session.Flush(); | 342 | session.Flush(); |
343 | } | 343 | } |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
346 | /// Load a region banlist | 346 | /// Load a region banlist |
347 | /// </summary> | 347 | /// </summary> |
@@ -373,7 +373,7 @@ namespace OpenSim.Data.NHibernate | |||
373 | } | 373 | } |
374 | 374 | ||
375 | /// <summary> | 375 | /// <summary> |
376 | /// | 376 | /// |
377 | /// </summary> | 377 | /// </summary> |
378 | /// <param name="val"></param> | 378 | /// <param name="val"></param> |
379 | /// <returns></returns> | 379 | /// <returns></returns> |
@@ -399,17 +399,17 @@ namespace OpenSim.Data.NHibernate | |||
399 | { | 399 | { |
400 | ICriteria criteria = session.CreateCriteria(typeof(TaskInventoryItem)); | 400 | ICriteria criteria = session.CreateCriteria(typeof(TaskInventoryItem)); |
401 | criteria.Add(Expression.Eq("ParentPartID", primID)); | 401 | criteria.Add(Expression.Eq("ParentPartID", primID)); |
402 | try | 402 | try |
403 | { | 403 | { |
404 | foreach (TaskInventoryItem i in criteria.List()) | 404 | foreach (TaskInventoryItem i in criteria.List()) |
405 | { | 405 | { |
406 | session.Delete(i); | 406 | session.Delete(i); |
407 | } | 407 | } |
408 | 408 | ||
409 | foreach (TaskInventoryItem i in items) | 409 | foreach (TaskInventoryItem i in items) |
410 | { | 410 | { |
411 | session.Save(i); | 411 | session.Save(i); |
412 | 412 | ||
413 | } | 413 | } |
414 | session.Flush(); | 414 | session.Flush(); |
415 | } | 415 | } |
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index bceae7c..c776474 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs | |||
@@ -53,8 +53,8 @@ namespace OpenSim.Data.NHibernate | |||
53 | private ISessionFactory factory; | 53 | private ISessionFactory factory; |
54 | private ISession session; | 54 | private ISession session; |
55 | 55 | ||
56 | public override void Initialise() | 56 | public override void Initialise() |
57 | { | 57 | { |
58 | m_log.Info("[NHibernateUserData]: " + Name + " cannot be default-initialized!"); | 58 | m_log.Info("[NHibernateUserData]: " + Name + " cannot be default-initialized!"); |
59 | throw new PluginNotInitialisedException (Name); | 59 | throw new PluginNotInitialisedException (Name); |
60 | } | 60 | } |
@@ -83,7 +83,7 @@ namespace OpenSim.Data.NHibernate | |||
83 | 83 | ||
84 | factory = cfg.BuildSessionFactory(); | 84 | factory = cfg.BuildSessionFactory(); |
85 | session = factory.OpenSession(); | 85 | session = factory.OpenSession(); |
86 | 86 | ||
87 | // This actually does the roll forward assembly stuff | 87 | // This actually does the roll forward assembly stuff |
88 | Assembly assem = GetType().Assembly; | 88 | Assembly assem = GetType().Assembly; |
89 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "UserStore"); | 89 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "UserStore"); |
@@ -97,7 +97,7 @@ namespace OpenSim.Data.NHibernate | |||
97 | { | 97 | { |
98 | user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; | 98 | user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; |
99 | } | 99 | } |
100 | catch (ObjectNotFoundException) | 100 | catch (ObjectNotFoundException) |
101 | { | 101 | { |
102 | user = null; | 102 | user = null; |
103 | } | 103 | } |
@@ -109,12 +109,12 @@ namespace OpenSim.Data.NHibernate | |||
109 | { | 109 | { |
110 | UserProfileData user; | 110 | UserProfileData user; |
111 | // TODO: I'm sure I'll have to do something silly here | 111 | // TODO: I'm sure I'll have to do something silly here |
112 | try | 112 | try |
113 | { | 113 | { |
114 | user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; | 114 | user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; |
115 | user.CurrentAgent = GetAgentByUUID(uuid); | 115 | user.CurrentAgent = GetAgentByUUID(uuid); |
116 | } | 116 | } |
117 | catch (ObjectNotFoundException) | 117 | catch (ObjectNotFoundException) |
118 | { | 118 | { |
119 | user = null; | 119 | user = null; |
120 | } | 120 | } |
@@ -144,12 +144,12 @@ namespace OpenSim.Data.NHibernate | |||
144 | } | 144 | } |
145 | else | 145 | else |
146 | { | 146 | { |
147 | try | 147 | try |
148 | { | 148 | { |
149 | UserAgentData old = session.Load(typeof(UserAgentData), uuid) as UserAgentData; | 149 | UserAgentData old = session.Load(typeof(UserAgentData), uuid) as UserAgentData; |
150 | session.Delete(old); | 150 | session.Delete(old); |
151 | } | 151 | } |
152 | catch (ObjectNotFoundException) | 152 | catch (ObjectNotFoundException) |
153 | { | 153 | { |
154 | } | 154 | } |
155 | session.Save(agent); | 155 | session.Save(agent); |
@@ -174,12 +174,12 @@ namespace OpenSim.Data.NHibernate | |||
174 | 174 | ||
175 | override public void AddNewUserAgent(UserAgentData agent) | 175 | override public void AddNewUserAgent(UserAgentData agent) |
176 | { | 176 | { |
177 | try | 177 | try |
178 | { | 178 | { |
179 | UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData; | 179 | UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData; |
180 | session.Delete(old); | 180 | session.Delete(old); |
181 | } | 181 | } |
182 | catch (ObjectNotFoundException) | 182 | catch (ObjectNotFoundException) |
183 | { | 183 | { |
184 | } | 184 | } |
185 | session.Save(agent); | 185 | session.Save(agent); |
@@ -287,9 +287,9 @@ namespace OpenSim.Data.NHibernate | |||
287 | 287 | ||
288 | public override void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) | 288 | public override void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) |
289 | { | 289 | { |
290 | if (appearance == null) | 290 | if (appearance == null) |
291 | return; | 291 | return; |
292 | 292 | ||
293 | appearance.Owner = user; | 293 | appearance.Owner = user; |
294 | 294 | ||
295 | bool exists = ExistsAppearance(user); | 295 | bool exists = ExistsAppearance(user); |
diff --git a/OpenSim/Data/NHibernate/Terrain.cs b/OpenSim/Data/NHibernate/Terrain.cs index a95e45a..608f03e 100644 --- a/OpenSim/Data/NHibernate/Terrain.cs +++ b/OpenSim/Data/NHibernate/Terrain.cs | |||
@@ -32,21 +32,21 @@ using OpenSim.Framework; | |||
32 | using log4net; | 32 | using log4net; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | 34 | ||
35 | namespace OpenSim.Data.NHibernate | 35 | namespace OpenSim.Data.NHibernate |
36 | { | 36 | { |
37 | public class Terrain | 37 | public class Terrain |
38 | { | 38 | { |
39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
41 | private double[,] map; | 41 | private double[,] map; |
42 | private LLUUID regionID; | 42 | private LLUUID regionID; |
43 | 43 | ||
44 | public Terrain(LLUUID Region, double[,] array) | 44 | public Terrain(LLUUID Region, double[,] array) |
45 | { | 45 | { |
46 | map = array; | 46 | map = array; |
47 | regionID = Region; | 47 | regionID = Region; |
48 | } | 48 | } |
49 | 49 | ||
50 | public Terrain() | 50 | public Terrain() |
51 | { | 51 | { |
52 | map = new double[Constants.RegionSize, Constants.RegionSize]; | 52 | map = new double[Constants.RegionSize, Constants.RegionSize]; |
@@ -65,7 +65,7 @@ namespace OpenSim.Data.NHibernate | |||
65 | get { return serializeTerrain(map); } | 65 | get { return serializeTerrain(map); } |
66 | set { map = parseTerrain(value); } | 66 | set { map = parseTerrain(value); } |
67 | } | 67 | } |
68 | 68 | ||
69 | public double[,] Doubles | 69 | public double[,] Doubles |
70 | { | 70 | { |
71 | get {return map;} | 71 | get {return map;} |
@@ -76,7 +76,7 @@ namespace OpenSim.Data.NHibernate | |||
76 | { | 76 | { |
77 | double[,] terret = new double[256,256]; | 77 | double[,] terret = new double[256,256]; |
78 | terret.Initialize(); | 78 | terret.Initialize(); |
79 | 79 | ||
80 | MemoryStream str = new MemoryStream(data); | 80 | MemoryStream str = new MemoryStream(data); |
81 | BinaryReader br = new BinaryReader(str); | 81 | BinaryReader br = new BinaryReader(str); |
82 | try { | 82 | try { |
@@ -87,7 +87,7 @@ namespace OpenSim.Data.NHibernate | |||
87 | terret[x, y] = br.ReadDouble(); | 87 | terret[x, y] = br.ReadDouble(); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | } | 90 | } |
91 | catch (Exception e) | 91 | catch (Exception e) |
92 | { | 92 | { |
93 | m_log.Error("Issue parsing Map", e); | 93 | m_log.Error("Issue parsing Map", e); |
@@ -99,7 +99,7 @@ namespace OpenSim.Data.NHibernate | |||
99 | { | 99 | { |
100 | MemoryStream str = new MemoryStream((int)(65536 * sizeof (double))); | 100 | MemoryStream str = new MemoryStream((int)(65536 * sizeof (double))); |
101 | BinaryWriter bw = new BinaryWriter(str); | 101 | BinaryWriter bw = new BinaryWriter(str); |
102 | 102 | ||
103 | // TODO: COMPATIBILITY - Add byte-order conversions | 103 | // TODO: COMPATIBILITY - Add byte-order conversions |
104 | for (int x = 0; x < 256; x++) | 104 | for (int x = 0; x < 256; x++) |
105 | { | 105 | { |
@@ -108,11 +108,11 @@ namespace OpenSim.Data.NHibernate | |||
108 | double height = val[x, y]; | 108 | double height = val[x, y]; |
109 | if (height <= 0.0) | 109 | if (height <= 0.0) |
110 | height = double.Epsilon; | 110 | height = double.Epsilon; |
111 | 111 | ||
112 | bw.Write(height); | 112 | bw.Write(height); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | return str.ToArray(); | 115 | return str.ToArray(); |
116 | } | 116 | } |
117 | } | 117 | } |
118 | } \ No newline at end of file | 118 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 99de5cd..9b274f4 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Data.SQLite | |||
141 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 141 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
142 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 142 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
143 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 143 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
144 | 144 | ||
145 | cmd.ExecuteNonQuery(); | 145 | cmd.ExecuteNonQuery(); |
146 | } | 146 | } |
147 | } | 147 | } |
@@ -155,7 +155,7 @@ namespace OpenSim.Data.SQLite | |||
155 | override public void UpdateAsset(AssetBase asset) | 155 | override public void UpdateAsset(AssetBase asset) |
156 | { | 156 | { |
157 | LogAssetLoad(asset); | 157 | LogAssetLoad(asset); |
158 | 158 | ||
159 | lock (this) | 159 | lock (this) |
160 | { | 160 | { |
161 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) | 161 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) |
@@ -167,7 +167,7 @@ namespace OpenSim.Data.SQLite | |||
167 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 167 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
168 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 168 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
169 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 169 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
170 | 170 | ||
171 | cmd.ExecuteNonQuery(); | 171 | cmd.ExecuteNonQuery(); |
172 | } | 172 | } |
173 | } | 173 | } |
@@ -269,7 +269,7 @@ namespace OpenSim.Data.SQLite | |||
269 | **********************************************************************/ | 269 | **********************************************************************/ |
270 | 270 | ||
271 | /// <summary> | 271 | /// <summary> |
272 | /// | 272 | /// |
273 | /// </summary> | 273 | /// </summary> |
274 | /// <param name="row"></param> | 274 | /// <param name="row"></param> |
275 | /// <returns></returns> | 275 | /// <returns></returns> |
@@ -301,7 +301,7 @@ namespace OpenSim.Data.SQLite | |||
301 | **********************************************************************/ | 301 | **********************************************************************/ |
302 | 302 | ||
303 | /// <summary> | 303 | /// <summary> |
304 | /// | 304 | /// |
305 | /// </summary> | 305 | /// </summary> |
306 | /// <param name="conn"></param> | 306 | /// <param name="conn"></param> |
307 | // private static void InitDB(SqliteConnection conn) | 307 | // private static void InitDB(SqliteConnection conn) |
@@ -312,7 +312,7 @@ namespace OpenSim.Data.SQLite | |||
312 | // } | 312 | // } |
313 | 313 | ||
314 | /// <summary> | 314 | /// <summary> |
315 | /// | 315 | /// |
316 | /// </summary> | 316 | /// </summary> |
317 | /// <param name="conn"></param> | 317 | /// <param name="conn"></param> |
318 | /// <param name="m"></param> | 318 | /// <param name="m"></param> |
@@ -331,10 +331,10 @@ namespace OpenSim.Data.SQLite | |||
331 | m_log.Info("[ASSET DB]: SQLite Database doesn't exist... creating"); | 331 | m_log.Info("[ASSET DB]: SQLite Database doesn't exist... creating"); |
332 | return false; | 332 | return false; |
333 | } | 333 | } |
334 | 334 | ||
335 | // if the tables are here, and we don't have a migration, | 335 | // if the tables are here, and we don't have a migration, |
336 | // set it to 1, as we're migrating off of legacy bits | 336 | // set it to 1, as we're migrating off of legacy bits |
337 | if (m.Version == 0) | 337 | if (m.Version == 0) |
338 | m.Version = 1; | 338 | m.Version = 1; |
339 | 339 | ||
340 | return true; | 340 | return true; |
@@ -343,7 +343,7 @@ namespace OpenSim.Data.SQLite | |||
343 | #region IPlugin interface | 343 | #region IPlugin interface |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
346 | /// | 346 | /// |
347 | /// </summary> | 347 | /// </summary> |
348 | override public string Version | 348 | override public string Version |
349 | { | 349 | { |
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index dc5ba5e..ffe7644 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs | |||
@@ -55,12 +55,12 @@ namespace OpenSim.Data.SQLite | |||
55 | public void Initialise(string connectionString) | 55 | public void Initialise(string connectionString) |
56 | { | 56 | { |
57 | m_connectionString = connectionString; | 57 | m_connectionString = connectionString; |
58 | 58 | ||
59 | m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString); | 59 | m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString); |
60 | 60 | ||
61 | m_connection = new SqliteConnection(m_connectionString); | 61 | m_connection = new SqliteConnection(m_connectionString); |
62 | m_connection.Open(); | 62 | m_connection.Open(); |
63 | 63 | ||
64 | Assembly assem = GetType().Assembly; | 64 | Assembly assem = GetType().Assembly; |
65 | Migration m = new Migration(m_connection, assem, "EstateStore"); | 65 | Migration m = new Migration(m_connection, assem, "EstateStore"); |
66 | m.Update(); | 66 | m.Update(); |
@@ -77,7 +77,7 @@ namespace OpenSim.Data.SQLite | |||
77 | if (f.Name.Substring(0, 2) == "m_") | 77 | if (f.Name.Substring(0, 2) == "m_") |
78 | m_FieldMap[f.Name.Substring(2)] = f; | 78 | m_FieldMap[f.Name.Substring(2)] = f; |
79 | } | 79 | } |
80 | 80 | ||
81 | private string[] FieldList | 81 | private string[] FieldList |
82 | { | 82 | { |
83 | get { return new List<string>(m_FieldMap.Keys).ToArray(); } | 83 | get { return new List<string>(m_FieldMap.Keys).ToArray(); } |
@@ -134,7 +134,7 @@ namespace OpenSim.Data.SQLite | |||
134 | names.Remove("EstateID"); | 134 | names.Remove("EstateID"); |
135 | 135 | ||
136 | sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; | 136 | sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; |
137 | 137 | ||
138 | cmd.CommandText = sql; | 138 | cmd.CommandText = sql; |
139 | cmd.Parameters.Clear(); | 139 | cmd.Parameters.Clear(); |
140 | 140 | ||
@@ -272,16 +272,16 @@ namespace OpenSim.Data.SQLite | |||
272 | private void SaveBanList(EstateSettings es) | 272 | private void SaveBanList(EstateSettings es) |
273 | { | 273 | { |
274 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 274 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
275 | 275 | ||
276 | cmd.CommandText = "delete from estateban where EstateID = :EstateID"; | 276 | cmd.CommandText = "delete from estateban where EstateID = :EstateID"; |
277 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); | 277 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); |
278 | 278 | ||
279 | cmd.ExecuteNonQuery(); | 279 | cmd.ExecuteNonQuery(); |
280 | 280 | ||
281 | cmd.Parameters.Clear(); | 281 | cmd.Parameters.Clear(); |
282 | 282 | ||
283 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; | 283 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; |
284 | 284 | ||
285 | foreach (EstateBan b in es.EstateBans) | 285 | foreach (EstateBan b in es.EstateBans) |
286 | { | 286 | { |
287 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); | 287 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); |
@@ -295,16 +295,16 @@ namespace OpenSim.Data.SQLite | |||
295 | void SaveUUIDList(uint EstateID, string table, LLUUID[] data) | 295 | void SaveUUIDList(uint EstateID, string table, LLUUID[] data) |
296 | { | 296 | { |
297 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 297 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
298 | 298 | ||
299 | cmd.CommandText = "delete from "+table+" where EstateID = :EstateID"; | 299 | cmd.CommandText = "delete from "+table+" where EstateID = :EstateID"; |
300 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); | 300 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); |
301 | 301 | ||
302 | cmd.ExecuteNonQuery(); | 302 | cmd.ExecuteNonQuery(); |
303 | 303 | ||
304 | cmd.Parameters.Clear(); | 304 | cmd.Parameters.Clear(); |
305 | 305 | ||
306 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )"; | 306 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )"; |
307 | 307 | ||
308 | foreach (LLUUID uuid in data) | 308 | foreach (LLUUID uuid in data) |
309 | { | 309 | { |
310 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); | 310 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); |
@@ -336,7 +336,7 @@ namespace OpenSim.Data.SQLite | |||
336 | uuids.Add(uuid); | 336 | uuids.Add(uuid); |
337 | } | 337 | } |
338 | r.Close(); | 338 | r.Close(); |
339 | 339 | ||
340 | return uuids.ToArray(); | 340 | return uuids.ToArray(); |
341 | } | 341 | } |
342 | } | 342 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index e29b99c..125b6e7 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs | |||
@@ -50,8 +50,8 @@ namespace OpenSim.Data.SQLite | |||
50 | private SqliteDataAdapter invItemsDa; | 50 | private SqliteDataAdapter invItemsDa; |
51 | private SqliteDataAdapter invFoldersDa; | 51 | private SqliteDataAdapter invFoldersDa; |
52 | 52 | ||
53 | public void Initialise() | 53 | public void Initialise() |
54 | { | 54 | { |
55 | m_log.Info("[SQLiteInventoryData]: " + Name + " cannot be default-initialized!"); | 55 | m_log.Info("[SQLiteInventoryData]: " + Name + " cannot be default-initialized!"); |
56 | throw new PluginNotInitialisedException (Name); | 56 | throw new PluginNotInitialisedException (Name); |
57 | } | 57 | } |
@@ -105,7 +105,7 @@ namespace OpenSim.Data.SQLite | |||
105 | } | 105 | } |
106 | 106 | ||
107 | /// <summary> | 107 | /// <summary> |
108 | /// | 108 | /// |
109 | /// </summary> | 109 | /// </summary> |
110 | /// <param name="row"></param> | 110 | /// <param name="row"></param> |
111 | /// <returns></returns> | 111 | /// <returns></returns> |
@@ -150,7 +150,7 @@ namespace OpenSim.Data.SQLite | |||
150 | } | 150 | } |
151 | 151 | ||
152 | /// <summary> | 152 | /// <summary> |
153 | /// | 153 | /// |
154 | /// </summary> | 154 | /// </summary> |
155 | /// <param name="row"></param> | 155 | /// <param name="row"></param> |
156 | /// <param name="item"></param> | 156 | /// <param name="item"></param> |
@@ -302,7 +302,7 @@ namespace OpenSim.Data.SQLite | |||
302 | /// <returns>A string containing the DB provider version</returns> | 302 | /// <returns>A string containing the DB provider version</returns> |
303 | public string Version | 303 | public string Version |
304 | { | 304 | { |
305 | get | 305 | get |
306 | { | 306 | { |
307 | Module module = GetType().Module; | 307 | Module module = GetType().Module; |
308 | // string dllName = module.Assembly.ManifestModule.Name; | 308 | // string dllName = module.Assembly.ManifestModule.Name; |
@@ -419,10 +419,10 @@ namespace OpenSim.Data.SQLite | |||
419 | * - We will only need to hit the database twice instead of n times. | 419 | * - We will only need to hit the database twice instead of n times. |
420 | * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned | 420 | * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned |
421 | * by the same person, each user only has 1 inventory heirarchy | 421 | * by the same person, each user only has 1 inventory heirarchy |
422 | * - The returned list is not ordered, instead of breadth-first ordered | 422 | * - The returned list is not ordered, instead of breadth-first ordered |
423 | There are basically 2 usage cases for getFolderHeirarchy: | 423 | There are basically 2 usage cases for getFolderHeirarchy: |
424 | 1) Getting the user's entire inventory heirarchy when they log in | 424 | 1) Getting the user's entire inventory heirarchy when they log in |
425 | 2) Finding a subfolder heirarchy to delete when emptying the trash. | 425 | 2) Finding a subfolder heirarchy to delete when emptying the trash. |
426 | This implementation will pull all inventory folders from the database, and then prune away any folder that | 426 | This implementation will pull all inventory folders from the database, and then prune away any folder that |
427 | is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the | 427 | is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the |
428 | database than to make n requests. This pays off only if requested heirarchy is large. | 428 | database than to make n requests. This pays off only if requested heirarchy is large. |
@@ -449,17 +449,17 @@ namespace OpenSim.Data.SQLite | |||
449 | folderRows = inventoryFolderTable.Select(selectExp); | 449 | folderRows = inventoryFolderTable.Select(selectExp); |
450 | } | 450 | } |
451 | 451 | ||
452 | if ( folderRows!=null && folderRows.GetLength(0)>=1 ) // No result means parent folder does not exist | 452 | if (folderRows != null && folderRows.GetLength(0) >= 1) // No result means parent folder does not exist |
453 | { // or has no children | 453 | { // or has no children |
454 | /* if we're querying the root folder, just return an unordered list of all folders in the user's | 454 | /* if we're querying the root folder, just return an unordered list of all folders in the user's |
455 | * inventory | 455 | * inventory |
456 | */ | 456 | */ |
457 | if (parentFolder.ParentID == LLUUID.Zero) | 457 | if (parentFolder.ParentID == LLUUID.Zero) |
458 | { | 458 | { |
459 | foreach (DataRow row in folderRows) | 459 | foreach (DataRow row in folderRows) |
460 | { | 460 | { |
461 | InventoryFolderBase curFolder = buildFolder(row); | 461 | InventoryFolderBase curFolder = buildFolder(row); |
462 | if (curFolder.ID != parentID) // Return all folders except the parent folder of heirarchy | 462 | if (curFolder.ID != parentID) // Return all folders except the parent folder of heirarchy |
463 | folders.Add(buildFolder(row)); | 463 | folders.Add(buildFolder(row)); |
464 | } | 464 | } |
465 | } // If requesting root folder | 465 | } // If requesting root folder |
@@ -481,16 +481,16 @@ namespace OpenSim.Data.SQLite | |||
481 | InventoryFolderBase curFolder = buildFolder(row); | 481 | InventoryFolderBase curFolder = buildFolder(row); |
482 | if (curFolder.ParentID != LLUUID.Zero) // Discard root of tree - not needed | 482 | if (curFolder.ParentID != LLUUID.Zero) // Discard root of tree - not needed |
483 | { | 483 | { |
484 | if ( hashtable.ContainsKey(curFolder.ParentID ) ) | 484 | if (hashtable.ContainsKey(curFolder.ParentID)) |
485 | { | 485 | { |
486 | // Current folder already has a sibling - append to sibling list | 486 | // Current folder already has a sibling - append to sibling list |
487 | hashtable[curFolder.ParentID].Add( curFolder ); | 487 | hashtable[curFolder.ParentID].Add(curFolder); |
488 | } | 488 | } |
489 | else { | 489 | else { |
490 | List<InventoryFolderBase> siblingList = new List<InventoryFolderBase>(); | 490 | List<InventoryFolderBase> siblingList = new List<InventoryFolderBase>(); |
491 | siblingList.Add( curFolder ); | 491 | siblingList.Add(curFolder); |
492 | // Current folder has no known (yet) siblings | 492 | // Current folder has no known (yet) siblings |
493 | hashtable.Add( curFolder.ParentID, siblingList ); | 493 | hashtable.Add(curFolder.ParentID, siblingList); |
494 | } | 494 | } |
495 | } | 495 | } |
496 | } // For all inventory folders | 496 | } // For all inventory folders |
@@ -498,12 +498,12 @@ namespace OpenSim.Data.SQLite | |||
498 | // Note: Could release the ds lock here - we don't access folderRows or the database anymore. | 498 | // Note: Could release the ds lock here - we don't access folderRows or the database anymore. |
499 | // This is somewhat of a moot point as the callers of this function usually lock db anyways. | 499 | // This is somewhat of a moot point as the callers of this function usually lock db anyways. |
500 | 500 | ||
501 | if ( hashtable.ContainsKey( parentID ) ) // if requested folder does have children | 501 | if (hashtable.ContainsKey(parentID)) // if requested folder does have children |
502 | folders.AddRange( hashtable[parentID] ); | 502 | folders.AddRange(hashtable[parentID]); |
503 | 503 | ||
504 | // BreadthFirstSearch build inventory tree **Note: folders.Count is *not* static | 504 | // BreadthFirstSearch build inventory tree **Note: folders.Count is *not* static |
505 | for ( int i = 0; i < folders.Count; i++ ) | 505 | for (int i = 0; i < folders.Count; i++) |
506 | if (hashtable.ContainsKey(folders[i].ID)) | 506 | if (hashtable.ContainsKey(folders[i].ID)) |
507 | folders.AddRange(hashtable[folders[i].ID]); | 507 | folders.AddRange(hashtable[folders[i].ID]); |
508 | 508 | ||
509 | } // if requesting a subfolder heirarchy | 509 | } // if requesting a subfolder heirarchy |
@@ -601,7 +601,7 @@ namespace OpenSim.Data.SQLite | |||
601 | /// Delete all items in the specified folder | 601 | /// Delete all items in the specified folder |
602 | /// </summary> | 602 | /// </summary> |
603 | /// <param name="folderId">id of the folder, whose item content should be deleted</param> | 603 | /// <param name="folderId">id of the folder, whose item content should be deleted</param> |
604 | /// <todo>this is horribly inefficient, but I don't want to ruin the overall structure of this implementation</todo> | 604 | /// <todo>this is horribly inefficient, but I don't want to ruin the overall structure of this implementation</todo> |
605 | private void deleteItemsInFolder(LLUUID folderId) | 605 | private void deleteItemsInFolder(LLUUID folderId) |
606 | { | 606 | { |
607 | List<InventoryItemBase> items = getInventoryInFolder(Util.ToRawUuidString(folderId)); | 607 | List<InventoryItemBase> items = getInventoryInFolder(Util.ToRawUuidString(folderId)); |
@@ -743,7 +743,7 @@ namespace OpenSim.Data.SQLite | |||
743 | } | 743 | } |
744 | 744 | ||
745 | /// <summary> | 745 | /// <summary> |
746 | /// | 746 | /// |
747 | /// </summary> | 747 | /// </summary> |
748 | /// <param name="da"></param> | 748 | /// <param name="da"></param> |
749 | /// <param name="conn"></param> | 749 | /// <param name="conn"></param> |
@@ -765,7 +765,7 @@ namespace OpenSim.Data.SQLite | |||
765 | } | 765 | } |
766 | 766 | ||
767 | /// <summary> | 767 | /// <summary> |
768 | /// | 768 | /// |
769 | /// </summary> | 769 | /// </summary> |
770 | /// <param name="da"></param> | 770 | /// <param name="da"></param> |
771 | /// <param name="conn"></param> | 771 | /// <param name="conn"></param> |
@@ -787,7 +787,7 @@ namespace OpenSim.Data.SQLite | |||
787 | } | 787 | } |
788 | 788 | ||
789 | /// <summary> | 789 | /// <summary> |
790 | /// | 790 | /// |
791 | /// </summary> | 791 | /// </summary> |
792 | /// <param name="row"></param> | 792 | /// <param name="row"></param> |
793 | /// <returns></returns> | 793 | /// <returns></returns> |
@@ -804,7 +804,7 @@ namespace OpenSim.Data.SQLite | |||
804 | } | 804 | } |
805 | 805 | ||
806 | /// <summary> | 806 | /// <summary> |
807 | /// | 807 | /// |
808 | /// </summary> | 808 | /// </summary> |
809 | /// <param name="row"></param> | 809 | /// <param name="row"></param> |
810 | /// <param name="folder"></param> | 810 | /// <param name="folder"></param> |
@@ -819,7 +819,7 @@ namespace OpenSim.Data.SQLite | |||
819 | } | 819 | } |
820 | 820 | ||
821 | /// <summary> | 821 | /// <summary> |
822 | /// | 822 | /// |
823 | /// </summary> | 823 | /// </summary> |
824 | /// <param name="row"></param> | 824 | /// <param name="row"></param> |
825 | /// <param name="folder"></param> | 825 | /// <param name="folder"></param> |
@@ -836,7 +836,7 @@ namespace OpenSim.Data.SQLite | |||
836 | **********************************************************************/ | 836 | **********************************************************************/ |
837 | 837 | ||
838 | /// <summary> | 838 | /// <summary> |
839 | /// | 839 | /// |
840 | /// </summary> | 840 | /// </summary> |
841 | /// <param name="conn"></param> | 841 | /// <param name="conn"></param> |
842 | // private static void InitDB(SqliteConnection conn) | 842 | // private static void InitDB(SqliteConnection conn) |
@@ -852,7 +852,7 @@ namespace OpenSim.Data.SQLite | |||
852 | // } | 852 | // } |
853 | 853 | ||
854 | /// <summary> | 854 | /// <summary> |
855 | /// | 855 | /// |
856 | /// </summary> | 856 | /// </summary> |
857 | /// <param name="conn"></param> | 857 | /// <param name="conn"></param> |
858 | /// <param name="m"></param> | 858 | /// <param name="m"></param> |
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index b937272..a44b892 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -501,7 +501,7 @@ namespace OpenSim.Data.SQLite | |||
501 | } | 501 | } |
502 | 502 | ||
503 | /// <summary> | 503 | /// <summary> |
504 | /// | 504 | /// |
505 | /// </summary> | 505 | /// </summary> |
506 | /// <param name="globalID"></param> | 506 | /// <param name="globalID"></param> |
507 | public void RemoveLandObject(LLUUID globalID) | 507 | public void RemoveLandObject(LLUUID globalID) |
@@ -523,7 +523,7 @@ namespace OpenSim.Data.SQLite | |||
523 | } | 523 | } |
524 | 524 | ||
525 | /// <summary> | 525 | /// <summary> |
526 | /// | 526 | /// |
527 | /// </summary> | 527 | /// </summary> |
528 | /// <param name="parcel"></param> | 528 | /// <param name="parcel"></param> |
529 | public void StoreLandObject(ILandObject parcel) | 529 | public void StoreLandObject(ILandObject parcel) |
@@ -564,7 +564,7 @@ namespace OpenSim.Data.SQLite | |||
564 | } | 564 | } |
565 | 565 | ||
566 | /// <summary> | 566 | /// <summary> |
567 | /// | 567 | /// |
568 | /// </summary> | 568 | /// </summary> |
569 | /// <param name="regionUUID"></param> | 569 | /// <param name="regionUUID"></param> |
570 | /// <returns></returns> | 570 | /// <returns></returns> |
@@ -594,7 +594,7 @@ namespace OpenSim.Data.SQLite | |||
594 | } | 594 | } |
595 | 595 | ||
596 | /// <summary> | 596 | /// <summary> |
597 | /// | 597 | /// |
598 | /// </summary> | 598 | /// </summary> |
599 | public void Commit() | 599 | public void Commit() |
600 | { | 600 | { |
@@ -629,7 +629,7 @@ namespace OpenSim.Data.SQLite | |||
629 | **********************************************************************/ | 629 | **********************************************************************/ |
630 | 630 | ||
631 | /// <summary> | 631 | /// <summary> |
632 | /// | 632 | /// |
633 | /// </summary> | 633 | /// </summary> |
634 | /// <param name="dt"></param> | 634 | /// <param name="dt"></param> |
635 | /// <param name="name"></param> | 635 | /// <param name="name"></param> |
@@ -877,7 +877,7 @@ namespace OpenSim.Data.SQLite | |||
877 | **********************************************************************/ | 877 | **********************************************************************/ |
878 | 878 | ||
879 | /// <summary> | 879 | /// <summary> |
880 | /// | 880 | /// |
881 | /// </summary> | 881 | /// </summary> |
882 | /// <param name="row"></param> | 882 | /// <param name="row"></param> |
883 | /// <returns></returns> | 883 | /// <returns></returns> |
@@ -1071,7 +1071,7 @@ namespace OpenSim.Data.SQLite | |||
1071 | newData.UserLookAt = | 1071 | newData.UserLookAt = |
1072 | new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), | 1072 | new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), |
1073 | Convert.ToSingle(row["UserLookAtZ"])); | 1073 | Convert.ToSingle(row["UserLookAtZ"])); |
1074 | 1074 | ||
1075 | } | 1075 | } |
1076 | catch (InvalidCastException) | 1076 | catch (InvalidCastException) |
1077 | { | 1077 | { |
@@ -1132,7 +1132,7 @@ namespace OpenSim.Data.SQLite | |||
1132 | } | 1132 | } |
1133 | 1133 | ||
1134 | /// <summary> | 1134 | /// <summary> |
1135 | /// | 1135 | /// |
1136 | /// </summary> | 1136 | /// </summary> |
1137 | /// <param name="val"></param> | 1137 | /// <param name="val"></param> |
1138 | /// <returns></returns> | 1138 | /// <returns></returns> |
@@ -1166,7 +1166,7 @@ namespace OpenSim.Data.SQLite | |||
1166 | // } | 1166 | // } |
1167 | 1167 | ||
1168 | /// <summary> | 1168 | /// <summary> |
1169 | /// | 1169 | /// |
1170 | /// </summary> | 1170 | /// </summary> |
1171 | /// <param name="row"></param> | 1171 | /// <param name="row"></param> |
1172 | /// <param name="prim"></param> | 1172 | /// <param name="prim"></param> |
@@ -1233,7 +1233,7 @@ namespace OpenSim.Data.SQLite | |||
1233 | } | 1233 | } |
1234 | 1234 | ||
1235 | /// <summary> | 1235 | /// <summary> |
1236 | /// | 1236 | /// |
1237 | /// </summary> | 1237 | /// </summary> |
1238 | /// <param name="row"></param> | 1238 | /// <param name="row"></param> |
1239 | /// <param name="taskItem"></param> | 1239 | /// <param name="taskItem"></param> |
@@ -1263,7 +1263,7 @@ namespace OpenSim.Data.SQLite | |||
1263 | } | 1263 | } |
1264 | 1264 | ||
1265 | /// <summary> | 1265 | /// <summary> |
1266 | /// | 1266 | /// |
1267 | /// </summary> | 1267 | /// </summary> |
1268 | /// <param name="row"></param> | 1268 | /// <param name="row"></param> |
1269 | /// <param name="land"></param> | 1269 | /// <param name="land"></param> |
@@ -1308,7 +1308,7 @@ namespace OpenSim.Data.SQLite | |||
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | /// <summary> | 1310 | /// <summary> |
1311 | /// | 1311 | /// |
1312 | /// </summary> | 1312 | /// </summary> |
1313 | /// <param name="row"></param> | 1313 | /// <param name="row"></param> |
1314 | /// <param name="entry"></param> | 1314 | /// <param name="entry"></param> |
@@ -1321,7 +1321,7 @@ namespace OpenSim.Data.SQLite | |||
1321 | } | 1321 | } |
1322 | 1322 | ||
1323 | /// <summary> | 1323 | /// <summary> |
1324 | /// | 1324 | /// |
1325 | /// </summary> | 1325 | /// </summary> |
1326 | /// <param name="row"></param> | 1326 | /// <param name="row"></param> |
1327 | /// <returns></returns> | 1327 | /// <returns></returns> |
@@ -1376,7 +1376,7 @@ namespace OpenSim.Data.SQLite | |||
1376 | } | 1376 | } |
1377 | 1377 | ||
1378 | /// <summary> | 1378 | /// <summary> |
1379 | /// | 1379 | /// |
1380 | /// </summary> | 1380 | /// </summary> |
1381 | /// <param name="row"></param> | 1381 | /// <param name="row"></param> |
1382 | /// <param name="prim"></param> | 1382 | /// <param name="prim"></param> |
@@ -1418,7 +1418,7 @@ namespace OpenSim.Data.SQLite | |||
1418 | } | 1418 | } |
1419 | 1419 | ||
1420 | /// <summary> | 1420 | /// <summary> |
1421 | /// | 1421 | /// |
1422 | /// </summary> | 1422 | /// </summary> |
1423 | /// <param name="prim"></param> | 1423 | /// <param name="prim"></param> |
1424 | /// <param name="sceneGroupID"></param> | 1424 | /// <param name="sceneGroupID"></param> |
@@ -1574,7 +1574,7 @@ namespace OpenSim.Data.SQLite | |||
1574 | } | 1574 | } |
1575 | 1575 | ||
1576 | /// <summary> | 1576 | /// <summary> |
1577 | /// | 1577 | /// |
1578 | /// </summary> | 1578 | /// </summary> |
1579 | /// <param name="dt">Data Table</param> | 1579 | /// <param name="dt">Data Table</param> |
1580 | /// <returns></returns> | 1580 | /// <returns></returns> |
@@ -1631,7 +1631,7 @@ namespace OpenSim.Data.SQLite | |||
1631 | } | 1631 | } |
1632 | 1632 | ||
1633 | /// <summary> | 1633 | /// <summary> |
1634 | /// | 1634 | /// |
1635 | /// </summary> | 1635 | /// </summary> |
1636 | /// <param name="da"></param> | 1636 | /// <param name="da"></param> |
1637 | /// <param name="conn"></param> | 1637 | /// <param name="conn"></param> |
@@ -1650,7 +1650,7 @@ namespace OpenSim.Data.SQLite | |||
1650 | } | 1650 | } |
1651 | 1651 | ||
1652 | /// <summary> | 1652 | /// <summary> |
1653 | /// | 1653 | /// |
1654 | /// </summary> | 1654 | /// </summary> |
1655 | /// <param name="da"></param> | 1655 | /// <param name="da"></param> |
1656 | /// <param name="conn"></param> | 1656 | /// <param name="conn"></param> |
@@ -1669,7 +1669,7 @@ namespace OpenSim.Data.SQLite | |||
1669 | } | 1669 | } |
1670 | 1670 | ||
1671 | /// <summary> | 1671 | /// <summary> |
1672 | /// | 1672 | /// |
1673 | /// </summary> | 1673 | /// </summary> |
1674 | /// <param name="da"></param> | 1674 | /// <param name="da"></param> |
1675 | /// <param name="conn"></param> | 1675 | /// <param name="conn"></param> |
@@ -1680,7 +1680,7 @@ namespace OpenSim.Data.SQLite | |||
1680 | } | 1680 | } |
1681 | 1681 | ||
1682 | /// <summary> | 1682 | /// <summary> |
1683 | /// | 1683 | /// |
1684 | /// </summary> | 1684 | /// </summary> |
1685 | /// <param name="da"></param> | 1685 | /// <param name="da"></param> |
1686 | /// <param name="conn"></param> | 1686 | /// <param name="conn"></param> |
@@ -1694,7 +1694,7 @@ namespace OpenSim.Data.SQLite | |||
1694 | } | 1694 | } |
1695 | 1695 | ||
1696 | /// <summary> | 1696 | /// <summary> |
1697 | /// | 1697 | /// |
1698 | /// </summary> | 1698 | /// </summary> |
1699 | /// <param name="da"></param> | 1699 | /// <param name="da"></param> |
1700 | /// <param name="conn"></param> | 1700 | /// <param name="conn"></param> |
@@ -1705,7 +1705,7 @@ namespace OpenSim.Data.SQLite | |||
1705 | } | 1705 | } |
1706 | 1706 | ||
1707 | /// <summary> | 1707 | /// <summary> |
1708 | /// | 1708 | /// |
1709 | /// </summary> | 1709 | /// </summary> |
1710 | /// <param name="da"></param> | 1710 | /// <param name="da"></param> |
1711 | /// <param name="conn"></param> | 1711 | /// <param name="conn"></param> |
@@ -1799,7 +1799,7 @@ namespace OpenSim.Data.SQLite | |||
1799 | // } | 1799 | // } |
1800 | 1800 | ||
1801 | /// <summary> | 1801 | /// <summary> |
1802 | /// | 1802 | /// |
1803 | /// </summary> | 1803 | /// </summary> |
1804 | /// <param name="conn"></param> | 1804 | /// <param name="conn"></param> |
1805 | /// <param name="m"></param> | 1805 | /// <param name="m"></param> |
@@ -1845,8 +1845,8 @@ namespace OpenSim.Data.SQLite | |||
1845 | // if we've gotten this far, and our version is still 0, | 1845 | // if we've gotten this far, and our version is still 0, |
1846 | // it's because the migration was never done, so | 1846 | // it's because the migration was never done, so |
1847 | // initialize to 1 just to sync up to where we should be. | 1847 | // initialize to 1 just to sync up to where we should be. |
1848 | 1848 | ||
1849 | if (m.Version == 0) | 1849 | if (m.Version == 0) |
1850 | m.Version = 1; | 1850 | m.Version = 1; |
1851 | 1851 | ||
1852 | // pDa.Fill(tmpDS, "prims"); | 1852 | // pDa.Fill(tmpDS, "prims"); |
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index 910d313..08a97f09 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs | |||
@@ -65,8 +65,8 @@ namespace OpenSim.Data.SQLite | |||
65 | private SqliteDataAdapter daf; | 65 | private SqliteDataAdapter daf; |
66 | SqliteConnection g_conn; | 66 | SqliteConnection g_conn; |
67 | 67 | ||
68 | public override void Initialise() | 68 | public override void Initialise() |
69 | { | 69 | { |
70 | m_log.Info("[SQLiteUserData]: " + Name + " cannot be default-initialized!"); | 70 | m_log.Info("[SQLiteUserData]: " + Name + " cannot be default-initialized!"); |
71 | throw new PluginNotInitialisedException (Name); | 71 | throw new PluginNotInitialisedException (Name); |
72 | } | 72 | } |
@@ -93,7 +93,7 @@ namespace OpenSim.Data.SQLite | |||
93 | 93 | ||
94 | Assembly assem = GetType().Assembly; | 94 | Assembly assem = GetType().Assembly; |
95 | Migration m = new Migration(g_conn, assem, "UserStore"); | 95 | Migration m = new Migration(g_conn, assem, "UserStore"); |
96 | 96 | ||
97 | // TODO: remove this after rev 6000 | 97 | // TODO: remove this after rev 6000 |
98 | TestTables(conn, m); | 98 | TestTables(conn, m); |
99 | 99 | ||
@@ -130,7 +130,7 @@ namespace OpenSim.Data.SQLite | |||
130 | return; | 130 | return; |
131 | } | 131 | } |
132 | 132 | ||
133 | public override void Dispose () {} | 133 | public override void Dispose () {} |
134 | 134 | ||
135 | /// <summary> | 135 | /// <summary> |
136 | /// see IUserDataPlugin, | 136 | /// see IUserDataPlugin, |
@@ -308,7 +308,7 @@ namespace OpenSim.Data.SQLite | |||
308 | } | 308 | } |
309 | 309 | ||
310 | /// <summary> | 310 | /// <summary> |
311 | /// | 311 | /// |
312 | /// </summary> | 312 | /// </summary> |
313 | /// <param name="queryID"></param> | 313 | /// <param name="queryID"></param> |
314 | /// <param name="query"></param> | 314 | /// <param name="query"></param> |
@@ -570,7 +570,7 @@ namespace OpenSim.Data.SQLite | |||
570 | } | 570 | } |
571 | return aa; | 571 | return aa; |
572 | } | 572 | } |
573 | 573 | ||
574 | /// <summary> | 574 | /// <summary> |
575 | /// Update a user appearence | 575 | /// Update a user appearence |
576 | /// </summary> | 576 | /// </summary> |
@@ -802,7 +802,7 @@ namespace OpenSim.Data.SQLite | |||
802 | } | 802 | } |
803 | 803 | ||
804 | /// <summary> | 804 | /// <summary> |
805 | /// | 805 | /// |
806 | /// </summary> | 806 | /// </summary> |
807 | /// <param name="row"></param> | 807 | /// <param name="row"></param> |
808 | /// <param name="user"></param> | 808 | /// <param name="user"></param> |
@@ -853,7 +853,7 @@ namespace OpenSim.Data.SQLite | |||
853 | } | 853 | } |
854 | 854 | ||
855 | /// <summary> | 855 | /// <summary> |
856 | /// | 856 | /// |
857 | /// </summary> | 857 | /// </summary> |
858 | /// <param name="row"></param> | 858 | /// <param name="row"></param> |
859 | /// <returns></returns> | 859 | /// <returns></returns> |
@@ -881,7 +881,7 @@ namespace OpenSim.Data.SQLite | |||
881 | } | 881 | } |
882 | 882 | ||
883 | /// <summary> | 883 | /// <summary> |
884 | /// | 884 | /// |
885 | /// </summary> | 885 | /// </summary> |
886 | /// <param name="row"></param> | 886 | /// <param name="row"></param> |
887 | /// <param name="ua"></param> | 887 | /// <param name="ua"></param> |
@@ -914,7 +914,7 @@ namespace OpenSim.Data.SQLite | |||
914 | **********************************************************************/ | 914 | **********************************************************************/ |
915 | 915 | ||
916 | /// <summary> | 916 | /// <summary> |
917 | /// | 917 | /// |
918 | /// </summary> | 918 | /// </summary> |
919 | /// <param name="da"></param> | 919 | /// <param name="da"></param> |
920 | /// <param name="conn"></param> | 920 | /// <param name="conn"></param> |
@@ -933,7 +933,7 @@ namespace OpenSim.Data.SQLite | |||
933 | } | 933 | } |
934 | 934 | ||
935 | /// <summary> | 935 | /// <summary> |
936 | /// | 936 | /// |
937 | /// </summary> | 937 | /// </summary> |
938 | /// <param name="daf"></param> | 938 | /// <param name="daf"></param> |
939 | /// <param name="conn"></param> | 939 | /// <param name="conn"></param> |
@@ -954,7 +954,7 @@ namespace OpenSim.Data.SQLite | |||
954 | } | 954 | } |
955 | 955 | ||
956 | /// <summary> | 956 | /// <summary> |
957 | /// | 957 | /// |
958 | /// </summary> | 958 | /// </summary> |
959 | /// <param name="conn"></param> | 959 | /// <param name="conn"></param> |
960 | private static void InitDB(SqliteConnection conn) | 960 | private static void InitDB(SqliteConnection conn) |
@@ -990,7 +990,7 @@ namespace OpenSim.Data.SQLite | |||
990 | } | 990 | } |
991 | 991 | ||
992 | /// <summary> | 992 | /// <summary> |
993 | /// | 993 | /// |
994 | /// </summary> | 994 | /// </summary> |
995 | /// <param name="conn"></param> | 995 | /// <param name="conn"></param> |
996 | /// <param name="m"></param> | 996 | /// <param name="m"></param> |
@@ -1016,7 +1016,7 @@ namespace OpenSim.Data.SQLite | |||
1016 | return false; | 1016 | return false; |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | if (m.Version == 0) | 1019 | if (m.Version == 0) |
1020 | m.Version = 1; | 1020 | m.Version = 1; |
1021 | 1021 | ||
1022 | return true; | 1022 | return true; |
diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs index e604bfd..b984c10 100644 --- a/OpenSim/Data/UserDataBase.cs +++ b/OpenSim/Data/UserDataBase.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.Data | |||
75 | public abstract void AddAttachment(LLUUID user, LLUUID item); | 75 | public abstract void AddAttachment(LLUUID user, LLUUID item); |
76 | public abstract void RemoveAttachment(LLUUID user, LLUUID item); | 76 | public abstract void RemoveAttachment(LLUUID user, LLUUID item); |
77 | public abstract List<LLUUID> GetAttachments(LLUUID user); | 77 | public abstract List<LLUUID> GetAttachments(LLUUID user); |
78 | 78 | ||
79 | public abstract string Version {get;} | 79 | public abstract string Version {get;} |
80 | public abstract string Name {get;} | 80 | public abstract string Name {get;} |
81 | public abstract void Initialise(string connect); | 81 | public abstract void Initialise(string connect); |
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 4456138..3133f83 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -371,7 +371,7 @@ namespace OpenSim.Framework | |||
371 | VisualParams = (byte[])h["visual_params"]; | 371 | VisualParams = (byte[])h["visual_params"]; |
372 | Texture = new LLObject.TextureEntry((byte[])h["texture"], 0, ((byte[])h["texture"]).Length); | 372 | Texture = new LLObject.TextureEntry((byte[])h["texture"], 0, ((byte[])h["texture"]).Length); |
373 | AvatarHeight = (float)Convert.ToDouble((string)h["avatar_height"]); | 373 | AvatarHeight = (float)Convert.ToDouble((string)h["avatar_height"]); |
374 | 374 | ||
375 | m_wearables = new AvatarWearable[MAX_WEARABLES]; | 375 | m_wearables = new AvatarWearable[MAX_WEARABLES]; |
376 | for (int i = 0; i < MAX_WEARABLES; i++) | 376 | for (int i = 0; i < MAX_WEARABLES; i++) |
377 | { | 377 | { |
diff --git a/OpenSim/Framework/Cache.cs b/OpenSim/Framework/Cache.cs index d002530..427072d 100644 --- a/OpenSim/Framework/Cache.cs +++ b/OpenSim/Framework/Cache.cs | |||
@@ -380,7 +380,7 @@ namespace Opensim.Framework | |||
380 | default: | 380 | default: |
381 | return; | 381 | return; |
382 | } | 382 | } |
383 | 383 | ||
384 | Store(index, data, container); | 384 | Store(index, data, container); |
385 | } | 385 | } |
386 | 386 | ||
@@ -403,7 +403,7 @@ namespace Opensim.Framework | |||
403 | if ((m_Flags & CacheFlags.AllowUpdate) != 0) | 403 | if ((m_Flags & CacheFlags.AllowUpdate) != 0) |
404 | { | 404 | { |
405 | item = GetItem(index); | 405 | item = GetItem(index); |
406 | 406 | ||
407 | item.hits++; | 407 | item.hits++; |
408 | item.lastUsed = DateTime.Now; | 408 | item.lastUsed = DateTime.Now; |
409 | if (m_DefaultTTL.Ticks != 0) | 409 | if (m_DefaultTTL.Ticks != 0) |
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 6eff690..e924b3f 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -143,10 +143,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
143 | public void Clear() | 143 | public void Clear() |
144 | { | 144 | { |
145 | m_log.Info("[ASSET CACHE]: Clearing Asset cache"); | 145 | m_log.Info("[ASSET CACHE]: Clearing Asset cache"); |
146 | 146 | ||
147 | if (StatsManager.SimExtraStats != null) | 147 | if (StatsManager.SimExtraStats != null) |
148 | StatsManager.SimExtraStats.ClearAssetCacheStatistics(); | 148 | StatsManager.SimExtraStats.ClearAssetCacheStatistics(); |
149 | 149 | ||
150 | Initialize(); | 150 | Initialize(); |
151 | } | 151 | } |
152 | 152 | ||
@@ -365,9 +365,9 @@ namespace OpenSim.Framework.Communications.Cache | |||
365 | } | 365 | } |
366 | } | 366 | } |
367 | else | 367 | else |
368 | { | 368 | { |
369 | if (!Assets.ContainsKey(asset.FullID)) | 369 | if (!Assets.ContainsKey(asset.FullID)) |
370 | { | 370 | { |
371 | AssetInfo assetInf = new AssetInfo(asset); | 371 | AssetInfo assetInf = new AssetInfo(asset); |
372 | Assets.Add(assetInf.FullID, assetInf); | 372 | Assets.Add(assetInf.FullID, assetInf); |
373 | 373 | ||
@@ -382,7 +382,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
382 | } | 382 | } |
383 | } | 383 | } |
384 | 384 | ||
385 | /// <summary> | 385 | /// <summary> |
386 | /// Allows you to clear a specific asset by uuid out | 386 | /// Allows you to clear a specific asset by uuid out |
387 | /// of the asset cache. This is needed because the osdynamic | 387 | /// of the asset cache. This is needed because the osdynamic |
388 | /// texture code grows the asset cache without bounds. The | 388 | /// texture code grows the asset cache without bounds. The |
@@ -399,8 +399,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
399 | if (Textures.ContainsKey(uuid)) | 399 | if (Textures.ContainsKey(uuid)) |
400 | { | 400 | { |
401 | Textures.Remove(uuid); | 401 | Textures.Remove(uuid); |
402 | } | 402 | } |
403 | else if (Assets.ContainsKey(uuid)) | 403 | else if (Assets.ContainsKey(uuid)) |
404 | { | 404 | { |
405 | Assets.Remove(uuid); | 405 | Assets.Remove(uuid); |
406 | } | 406 | } |
diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index ed5b896..2c8e685 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
57 | /// <param name="req"></param> | 57 | /// <param name="req"></param> |
58 | /// <returns></returns> | 58 | /// <returns></returns> |
59 | /// <exception cref="System.Exception"> | 59 | /// <exception cref="System.Exception"> |
60 | /// Thrown if the request failed for some other reason than that the | 60 | /// Thrown if the request failed for some other reason than that the |
61 | /// asset cannot be found. | 61 | /// asset cannot be found. |
62 | /// </exception> | 62 | /// </exception> |
63 | protected abstract AssetBase GetAsset(AssetRequest req); | 63 | protected abstract AssetBase GetAsset(AssetRequest req); |
@@ -70,7 +70,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
70 | protected virtual void ProcessRequest(AssetRequest req) | 70 | protected virtual void ProcessRequest(AssetRequest req) |
71 | { | 71 | { |
72 | AssetBase asset; | 72 | AssetBase asset; |
73 | 73 | ||
74 | try | 74 | try |
75 | { | 75 | { |
76 | asset = GetAsset(req); | 76 | asset = GetAsset(req); |
@@ -78,12 +78,12 @@ namespace OpenSim.Framework.Communications.Cache | |||
78 | catch (Exception e) | 78 | catch (Exception e) |
79 | { | 79 | { |
80 | m_log.ErrorFormat("[ASSET]: Asset request for {0} threw exception {1}", req.AssetID, e); | 80 | m_log.ErrorFormat("[ASSET]: Asset request for {0} threw exception {1}", req.AssetID, e); |
81 | 81 | ||
82 | if (StatsManager.SimExtraStats != null) | 82 | if (StatsManager.SimExtraStats != null) |
83 | StatsManager.SimExtraStats.AddAssetServiceRequestFailure(); | 83 | StatsManager.SimExtraStats.AddAssetServiceRequestFailure(); |
84 | 84 | ||
85 | m_receiver.AssetNotFound(req.AssetID, req.IsTexture); | 85 | m_receiver.AssetNotFound(req.AssetID, req.IsTexture); |
86 | 86 | ||
87 | return; | 87 | return; |
88 | } | 88 | } |
89 | 89 | ||
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 57f5e76..c337907 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -91,8 +91,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
91 | get { return m_session_id; } | 91 | get { return m_session_id; } |
92 | set { m_session_id = value; } | 92 | set { m_session_id = value; } |
93 | } | 93 | } |
94 | private LLUUID m_session_id = LLUUID.Zero; | 94 | private LLUUID m_session_id = LLUUID.Zero; |
95 | 95 | ||
96 | /// <summary> | 96 | /// <summary> |
97 | /// Constructor | 97 | /// Constructor |
98 | /// </summary> | 98 | /// </summary> |
@@ -172,7 +172,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
172 | } | 172 | } |
173 | } | 173 | } |
174 | } | 174 | } |
175 | 175 | ||
176 | /// <summary> | 176 | /// <summary> |
177 | /// Drop all cached inventory. | 177 | /// Drop all cached inventory. |
178 | /// </summary> | 178 | /// </summary> |
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs index 4206cae..9cccf66 100644 --- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
60 | rc.AddQueryParameter("texture"); | 60 | rc.AddQueryParameter("texture"); |
61 | 61 | ||
62 | rc.RequestMethod = "GET"; | 62 | rc.RequestMethod = "GET"; |
63 | 63 | ||
64 | Stream s = rc.Request(); | 64 | Stream s = rc.Request(); |
65 | 65 | ||
66 | if (s.Length > 0) | 66 | if (s.Length > 0) |
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index d7de9d6..61cfc1a 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs | |||
@@ -37,19 +37,19 @@ namespace OpenSim.Framework.Communications.Cache | |||
37 | public class InventoryFolderImpl : InventoryFolderBase | 37 | public class InventoryFolderImpl : InventoryFolderBase |
38 | { | 38 | { |
39 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 39 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
41 | public static readonly string PATH_DELIMITER = "/"; | 41 | public static readonly string PATH_DELIMITER = "/"; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Items that are contained in this folder | 44 | /// Items that are contained in this folder |
45 | /// </summary> | 45 | /// </summary> |
46 | public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); | 46 | public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Child folders that are contained in this folder | 49 | /// Child folders that are contained in this folder |
50 | /// </summary> | 50 | /// </summary> |
51 | public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>(); | 51 | public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>(); |
52 | 52 | ||
53 | // Constructors | 53 | // Constructors |
54 | public InventoryFolderImpl(InventoryFolderBase folderbase) | 54 | public InventoryFolderImpl(InventoryFolderBase folderbase) |
55 | { | 55 | { |
@@ -195,15 +195,15 @@ namespace OpenSim.Framework.Communications.Cache | |||
195 | 195 | ||
196 | return null; | 196 | return null; |
197 | } | 197 | } |
198 | 198 | ||
199 | /// <summary> | 199 | /// <summary> |
200 | /// Find a folder given a PATH_DELIMITOR delimited path starting from this folder | 200 | /// Find a folder given a PATH_DELIMITOR delimited path starting from this folder |
201 | /// | 201 | /// |
202 | /// This method does not handle paths that contain multiple delimitors | 202 | /// This method does not handle paths that contain multiple delimitors |
203 | /// | 203 | /// |
204 | /// FIXME: We do not yet handle situations where folders have the same name. We could handle this by some | 204 | /// FIXME: We do not yet handle situations where folders have the same name. We could handle this by some |
205 | /// XPath like expression | 205 | /// XPath like expression |
206 | /// | 206 | /// |
207 | /// FIXME: Delimitors which occur in names themselves are not currently escapable. | 207 | /// FIXME: Delimitors which occur in names themselves are not currently escapable. |
208 | /// </summary> | 208 | /// </summary> |
209 | /// <param name="path"> | 209 | /// <param name="path"> |
@@ -214,7 +214,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
214 | { | 214 | { |
215 | if (path == string.Empty) | 215 | if (path == string.Empty) |
216 | return this; | 216 | return this; |
217 | 217 | ||
218 | string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); | 218 | string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); |
219 | 219 | ||
220 | lock (SubFolders) | 220 | lock (SubFolders) |
@@ -228,19 +228,19 @@ namespace OpenSim.Framework.Communications.Cache | |||
228 | return folder; | 228 | return folder; |
229 | } | 229 | } |
230 | } | 230 | } |
231 | 231 | ||
232 | // We didn't find a folder with the given name | 232 | // We didn't find a folder with the given name |
233 | return null; | 233 | return null; |
234 | } | 234 | } |
235 | 235 | ||
236 | /// <summary> | 236 | /// <summary> |
237 | /// Find an item given a PATH_DELIMITOR delimited path starting from this folder. | 237 | /// Find an item given a PATH_DELIMITOR delimited path starting from this folder. |
238 | /// | 238 | /// |
239 | /// This method does not handle paths that contain multiple delimitors | 239 | /// This method does not handle paths that contain multiple delimitors |
240 | /// | 240 | /// |
241 | /// FIXME: We do not yet handle situations where folders or items have the same name. We could handle this by some | 241 | /// FIXME: We do not yet handle situations where folders or items have the same name. We could handle this by some |
242 | /// XPath like expression | 242 | /// XPath like expression |
243 | /// | 243 | /// |
244 | /// FIXME: Delimitors which occur in names themselves are not currently escapable. | 244 | /// FIXME: Delimitors which occur in names themselves are not currently escapable. |
245 | /// </summary> | 245 | /// </summary> |
246 | /// <param name="path"> | 246 | /// <param name="path"> |
@@ -248,7 +248,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
248 | /// </param> | 248 | /// </param> |
249 | /// <returns>null if the item is not found</returns> | 249 | /// <returns>null if the item is not found</returns> |
250 | public InventoryItemBase FindItemByPath(string path) | 250 | public InventoryItemBase FindItemByPath(string path) |
251 | { | 251 | { |
252 | string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); | 252 | string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); |
253 | 253 | ||
254 | if (components.Length == 1) | 254 | if (components.Length == 1) |
@@ -263,7 +263,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
263 | } | 263 | } |
264 | } | 264 | } |
265 | else | 265 | else |
266 | { | 266 | { |
267 | lock (SubFolders) | 267 | lock (SubFolders) |
268 | { | 268 | { |
269 | foreach (InventoryFolderImpl folder in SubFolders.Values) | 269 | foreach (InventoryFolderImpl folder in SubFolders.Values) |
@@ -273,10 +273,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
273 | } | 273 | } |
274 | } | 274 | } |
275 | } | 275 | } |
276 | 276 | ||
277 | // We didn't find an item or intermediate folder with the given name | 277 | // We didn't find an item or intermediate folder with the given name |
278 | return null; | 278 | return null; |
279 | } | 279 | } |
280 | 280 | ||
281 | /// <summary> | 281 | /// <summary> |
282 | /// Return a copy of the list of child items in this folder | 282 | /// Return a copy of the list of child items in this folder |
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 1360aa3..4e3840b 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -90,7 +90,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
90 | 90 | ||
91 | m_log.WarnFormat( | 91 | m_log.WarnFormat( |
92 | "[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userId); | 92 | "[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userId); |
93 | 93 | ||
94 | return false; | 94 | return false; |
95 | } | 95 | } |
96 | 96 | ||
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 1aa8eb0..24fe0f4 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -422,7 +422,7 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
422 | mapLayer.Right = 5000; | 422 | mapLayer.Right = 5000; |
423 | mapLayer.Top = 5000; | 423 | mapLayer.Top = 5000; |
424 | mapLayer.ImageID = new LLUUID("00000000-0000-1111-9999-000000000006"); | 424 | mapLayer.ImageID = new LLUUID("00000000-0000-1111-9999-000000000006"); |
425 | 425 | ||
426 | return mapLayer; | 426 | return mapLayer; |
427 | } | 427 | } |
428 | 428 | ||
@@ -783,7 +783,7 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
783 | 783 | ||
784 | // TODO: probably make this a better set of extensions here | 784 | // TODO: probably make this a better set of extensions here |
785 | string extension = ".jp2"; | 785 | string extension = ".jp2"; |
786 | if (m_invType != "image") | 786 | if (m_invType != "image") |
787 | { | 787 | { |
788 | extension = ".dat"; | 788 | extension = ".dat"; |
789 | } | 789 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs b/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs index 1c8f27f..b0e2b8f 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs | |||
@@ -34,7 +34,7 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
34 | public class LLSDRemoteParcelResponse | 34 | public class LLSDRemoteParcelResponse |
35 | { | 35 | { |
36 | public LLUUID parcel_id; | 36 | public LLUUID parcel_id; |
37 | 37 | ||
38 | public LLSDRemoteParcelResponse() | 38 | public LLSDRemoteParcelResponse() |
39 | { | 39 | { |
40 | } | 40 | } |
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 2bfe045..08dbc80 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -41,26 +41,26 @@ namespace OpenSim.Framework.Communications | |||
41 | public class CommunicationsManager | 41 | public class CommunicationsManager |
42 | { | 42 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | protected Dictionary<LLUUID, string[]> m_nameRequestCache = new Dictionary<LLUUID, string[]>(); | 45 | protected Dictionary<LLUUID, string[]> m_nameRequestCache = new Dictionary<LLUUID, string[]>(); |
46 | 46 | ||
47 | public IUserService UserService | 47 | public IUserService UserService |
48 | { | 48 | { |
49 | get { return m_userService; } | 49 | get { return m_userService; } |
50 | } | 50 | } |
51 | protected IUserService m_userService; | 51 | protected IUserService m_userService; |
52 | 52 | ||
53 | public IGridServices GridService | 53 | public IGridServices GridService |
54 | { | 54 | { |
55 | get { return m_gridService; } | 55 | get { return m_gridService; } |
56 | } | 56 | } |
57 | protected IGridServices m_gridService; | 57 | protected IGridServices m_gridService; |
58 | 58 | ||
59 | public IInterRegionCommunications InterRegion | 59 | public IInterRegionCommunications InterRegion |
60 | { | 60 | { |
61 | get { return m_interRegion; } | 61 | get { return m_interRegion; } |
62 | } | 62 | } |
63 | protected IInterRegionCommunications m_interRegion; | 63 | protected IInterRegionCommunications m_interRegion; |
64 | 64 | ||
65 | public UserProfileCacheService UserProfileCacheService | 65 | public UserProfileCacheService UserProfileCacheService |
66 | { | 66 | { |
@@ -68,36 +68,36 @@ namespace OpenSim.Framework.Communications | |||
68 | } | 68 | } |
69 | protected UserProfileCacheService m_userProfileCacheService; | 69 | protected UserProfileCacheService m_userProfileCacheService; |
70 | 70 | ||
71 | // protected AgentAssetTransactionsManager m_transactionsManager; | 71 | // protected AgentAssetTransactionsManager m_transactionsManager; |
72 | 72 | ||
73 | // public AgentAssetTransactionsManager TransactionsManager | 73 | // public AgentAssetTransactionsManager TransactionsManager |
74 | // { | 74 | // { |
75 | // get { return m_transactionsManager; } | 75 | // get { return m_transactionsManager; } |
76 | // } | 76 | // } |
77 | 77 | ||
78 | public IAvatarService AvatarService | 78 | public IAvatarService AvatarService |
79 | { | 79 | { |
80 | get { return m_avatarService; } | 80 | get { return m_avatarService; } |
81 | } | 81 | } |
82 | protected IAvatarService m_avatarService; | 82 | protected IAvatarService m_avatarService; |
83 | 83 | ||
84 | public AssetCache AssetCache | 84 | public AssetCache AssetCache |
85 | { | 85 | { |
86 | get { return m_assetCache; } | 86 | get { return m_assetCache; } |
87 | } | 87 | } |
88 | protected AssetCache m_assetCache; | 88 | protected AssetCache m_assetCache; |
89 | 89 | ||
90 | public IInterServiceInventoryServices InterServiceInventoryService | 90 | public IInterServiceInventoryServices InterServiceInventoryService |
91 | { | 91 | { |
92 | get { return m_interServiceInventoryService; } | 92 | get { return m_interServiceInventoryService; } |
93 | } | 93 | } |
94 | protected IInterServiceInventoryServices m_interServiceInventoryService; | 94 | protected IInterServiceInventoryServices m_interServiceInventoryService; |
95 | 95 | ||
96 | public NetworkServersInfo NetworkServersInfo | 96 | public NetworkServersInfo NetworkServersInfo |
97 | { | 97 | { |
98 | get { return m_networkServersInfo; } | 98 | get { return m_networkServersInfo; } |
99 | } | 99 | } |
100 | protected NetworkServersInfo m_networkServersInfo; | 100 | protected NetworkServersInfo m_networkServersInfo; |
101 | 101 | ||
102 | /// <summary> | 102 | /// <summary> |
103 | /// Constructor | 103 | /// Constructor |
@@ -138,7 +138,7 @@ namespace OpenSim.Framework.Communications | |||
138 | return null; | 138 | return null; |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | public IInventoryServices InventoryService | 142 | public IInventoryServices InventoryService |
143 | { | 143 | { |
144 | get | 144 | get |
diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs index 509f408..fcc0db5 100644 --- a/OpenSim/Framework/Communications/IGridServices.cs +++ b/OpenSim/Framework/Communications/IGridServices.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim.Framework.Communications | |||
33 | public interface IGridServices | 33 | public interface IGridServices |
34 | { | 34 | { |
35 | string gdebugRegionName { get; set; } | 35 | string gdebugRegionName { get; set; } |
36 | 36 | ||
37 | /// <summary> | 37 | /// <summary> |
38 | /// Register a region with the grid service. | 38 | /// Register a region with the grid service. |
39 | /// </summary> | 39 | /// </summary> |
@@ -41,7 +41,7 @@ namespace OpenSim.Framework.Communications | |||
41 | /// <returns></returns> | 41 | /// <returns></returns> |
42 | /// <exception cref="System.Exception">Thrown if region registration failed</exception> | 42 | /// <exception cref="System.Exception">Thrown if region registration failed</exception> |
43 | RegionCommsListener RegisterRegion(RegionInfo regionInfos); | 43 | RegionCommsListener RegisterRegion(RegionInfo regionInfos); |
44 | 44 | ||
45 | bool DeregisterRegion(RegionInfo regionInfo); | 45 | bool DeregisterRegion(RegionInfo regionInfo); |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
@@ -51,7 +51,7 @@ namespace OpenSim.Framework.Communications | |||
51 | /// <param name="y"></param> | 51 | /// <param name="y"></param> |
52 | /// <returns></returns> | 52 | /// <returns></returns> |
53 | List<SimpleRegionInfo> RequestNeighbours(uint x, uint y); | 53 | List<SimpleRegionInfo> RequestNeighbours(uint x, uint y); |
54 | 54 | ||
55 | RegionInfo RequestNeighbourInfo(ulong regionHandle); | 55 | RegionInfo RequestNeighbourInfo(ulong regionHandle); |
56 | RegionInfo RequestNeighbourInfo(LLUUID regionID); | 56 | RegionInfo RequestNeighbourInfo(LLUUID regionID); |
57 | RegionInfo RequestClosestRegion(string regionName); | 57 | RegionInfo RequestClosestRegion(string regionName); |
diff --git a/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs b/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs index 24213f2..a1f4c2e 100644 --- a/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs | |||
@@ -32,22 +32,22 @@ namespace OpenSim.Framework.Communications | |||
32 | { | 32 | { |
33 | /// <summary> | 33 | /// <summary> |
34 | /// Inventory operations used between grid services. | 34 | /// Inventory operations used between grid services. |
35 | /// </summary> | 35 | /// </summary> |
36 | public interface IInterServiceInventoryServices | 36 | public interface IInterServiceInventoryServices |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// Create a new inventory for the given user. | 39 | /// Create a new inventory for the given user. |
40 | /// </summary> | 40 | /// </summary> |
41 | /// <param name="user"></param> | 41 | /// <param name="user"></param> |
42 | /// <returns>true if the inventory was successfully created, false otherwise</returns> | 42 | /// <returns>true if the inventory was successfully created, false otherwise</returns> |
43 | bool CreateNewUserInventory(LLUUID user); | 43 | bool CreateNewUserInventory(LLUUID user); |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Returns a list of all the folders in a given user's inventory. | 46 | /// Returns a list of all the folders in a given user's inventory. |
47 | /// </summary> | 47 | /// </summary> |
48 | /// <param name="userId"></param> | 48 | /// <param name="userId"></param> |
49 | /// <returns>A flat list of the user's inventory folder tree, | 49 | /// <returns>A flat list of the user's inventory folder tree, |
50 | /// null if there is no inventory for this user</returns> | 50 | /// null if there is no inventory for this user</returns> |
51 | List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId); | 51 | List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId); |
52 | } | 52 | } |
53 | } | 53 | } |
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index 08a2c5f..b00b1bf 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs | |||
@@ -41,12 +41,12 @@ namespace OpenSim.Framework.Communications | |||
41 | /// Defines all the operations one can perform on a user's inventory. | 41 | /// Defines all the operations one can perform on a user's inventory. |
42 | /// </summary> | 42 | /// </summary> |
43 | public interface IInventoryServices | 43 | public interface IInventoryServices |
44 | { | 44 | { |
45 | string Host | 45 | string Host |
46 | { | 46 | { |
47 | get; | 47 | get; |
48 | } | 48 | } |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the | 51 | /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the |
52 | /// inventory has been received | 52 | /// inventory has been received |
diff --git a/OpenSim/Framework/Communications/ISecureInventoryService.cs b/OpenSim/Framework/Communications/ISecureInventoryService.cs index 3608c56..bd962d1 100644 --- a/OpenSim/Framework/Communications/ISecureInventoryService.cs +++ b/OpenSim/Framework/Communications/ISecureInventoryService.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Framework.Communications | |||
40 | { | 40 | { |
41 | get; | 41 | get; |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the | 45 | /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the |
46 | /// inventory has been received | 46 | /// inventory has been received |
@@ -102,14 +102,14 @@ namespace OpenSim.Framework.Communications | |||
102 | /// Does the given user have an inventory structure? | 102 | /// Does the given user have an inventory structure? |
103 | /// </summary> | 103 | /// </summary> |
104 | /// <param name="userID"></param> | 104 | /// <param name="userID"></param> |
105 | /// <returns></returns> | 105 | /// <returns></returns> |
106 | bool HasInventoryForUser(LLUUID userID); | 106 | bool HasInventoryForUser(LLUUID userID); |
107 | 107 | ||
108 | /// <summary> | 108 | /// <summary> |
109 | /// Retrieve the root inventory folder for the given user. | 109 | /// Retrieve the root inventory folder for the given user. |
110 | /// </summary> | 110 | /// </summary> |
111 | /// <param name="userID"></param> | 111 | /// <param name="userID"></param> |
112 | /// <returns>null if no root folder was found</returns> | 112 | /// <returns>null if no root folder was found</returns> |
113 | InventoryFolderBase RequestRootFolder(LLUUID userID); | 113 | InventoryFolderBase RequestRootFolder(LLUUID userID); |
114 | } | 114 | } |
115 | } | 115 | } |
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 40701f0..c76c078 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs | |||
@@ -53,14 +53,14 @@ namespace OpenSim.Framework.Communications | |||
53 | /// <param name="provider">The filename to the user server plugin DLL</param> | 53 | /// <param name="provider">The filename to the user server plugin DLL</param> |
54 | public void AddPlugin(string provider, string connect) | 54 | public void AddPlugin(string provider, string connect) |
55 | { | 55 | { |
56 | PluginLoader<IInventoryDataPlugin> loader = | 56 | PluginLoader<IInventoryDataPlugin> loader = |
57 | new PluginLoader<IInventoryDataPlugin> (new InventoryDataInitialiser (connect)); | 57 | new PluginLoader<IInventoryDataPlugin> (new InventoryDataInitialiser (connect)); |
58 | 58 | ||
59 | // loader will try to load all providers (MySQL, MSSQL, etc) | 59 | // loader will try to load all providers (MySQL, MSSQL, etc) |
60 | // unless it is constrainted to the correct "Provider" entry in the addin.xml | 60 | // unless it is constrainted to the correct "Provider" entry in the addin.xml |
61 | loader.Add ("/OpenSim/InventoryData", new PluginProviderFilter (provider)); | 61 | loader.Add ("/OpenSim/InventoryData", new PluginProviderFilter (provider)); |
62 | loader.Load(); | 62 | loader.Load(); |
63 | 63 | ||
64 | m_plugins = loader.Plugins; | 64 | m_plugins = loader.Plugins; |
65 | } | 65 | } |
66 | 66 | ||
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index fd5f139..40064d3 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs | |||
@@ -79,7 +79,7 @@ namespace OpenSim.Framework.Communications | |||
79 | /// <param name="response">The existing response</param> | 79 | /// <param name="response">The existing response</param> |
80 | /// <param name="theUser">The user profile</param> | 80 | /// <param name="theUser">The user profile</param> |
81 | public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest); | 81 | public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest); |
82 | 82 | ||
83 | /// <summary> | 83 | /// <summary> |
84 | /// If the user is already logged in, try to notify the region that the user they've got is dead. | 84 | /// If the user is already logged in, try to notify the region that the user they've got is dead. |
85 | /// </summary> | 85 | /// </summary> |
@@ -206,12 +206,11 @@ namespace OpenSim.Framework.Communications | |||
206 | userProfile.CurrentAgent.AgentOnline = false; | 206 | userProfile.CurrentAgent.AgentOnline = false; |
207 | 207 | ||
208 | m_userManager.CommitAgent(ref userProfile); | 208 | m_userManager.CommitAgent(ref userProfile); |
209 | 209 | ||
210 | // try to tell the region that their user is dead. | 210 | // try to tell the region that their user is dead. |
211 | LogOffUser(userProfile, " XMLRPC You were logged off because you logged in from another location"); | 211 | LogOffUser(userProfile, " XMLRPC You were logged off because you logged in from another location"); |
212 | 212 | ||
213 | // Reject the login | 213 | // Reject the login |
214 | |||
215 | 214 | ||
216 | m_log.InfoFormat( | 215 | m_log.InfoFormat( |
217 | "[LOGIN END]: XMLRPC Notifying user {0} {1} that they are already logged in", | 216 | "[LOGIN END]: XMLRPC Notifying user {0} {1} that they are already logged in", |
@@ -293,7 +292,7 @@ namespace OpenSim.Framework.Communications | |||
293 | //return logResponse.ToXmlRpcResponse(); | 292 | //return logResponse.ToXmlRpcResponse(); |
294 | } | 293 | } |
295 | 294 | ||
296 | userProfile.LastLogin = userProfile.CurrentAgent.LoginTime; | 295 | userProfile.LastLogin = userProfile.CurrentAgent.LoginTime; |
297 | CommitAgent(ref userProfile); | 296 | CommitAgent(ref userProfile); |
298 | 297 | ||
299 | // If we reach this point, then the login has successfully logged onto the grid | 298 | // If we reach this point, then the login has successfully logged onto the grid |
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index f477df4..feeb666 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -57,11 +57,11 @@ namespace OpenSim.Framework.Communications | |||
57 | PluginLoader<IUserDataPlugin> loader = | 57 | PluginLoader<IUserDataPlugin> loader = |
58 | new PluginLoader<IUserDataPlugin> (new UserDataInitialiser (connect)); | 58 | new PluginLoader<IUserDataPlugin> (new UserDataInitialiser (connect)); |
59 | 59 | ||
60 | // loader will try to load all providers (MySQL, MSSQL, etc) | 60 | // loader will try to load all providers (MySQL, MSSQL, etc) |
61 | // unless it is constrainted to the correct "Provider" entry in the addin.xml | 61 | // unless it is constrainted to the correct "Provider" entry in the addin.xml |
62 | loader.Add ("/OpenSim/UserData", new PluginProviderFilter (provider)); | 62 | loader.Add ("/OpenSim/UserData", new PluginProviderFilter (provider)); |
63 | loader.Load(); | 63 | loader.Load(); |
64 | 64 | ||
65 | _plugins = loader.Plugins; | 65 | _plugins = loader.Plugins; |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs index 2154e1e..89f52cf 100644 --- a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs +++ b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Framework.Configuration.XML | |||
46 | 46 | ||
47 | private void LoadDataToClass() | 47 | private void LoadDataToClass() |
48 | { | 48 | { |
49 | rootNode = doc.SelectSingleNode("Root"); | 49 | rootNode = doc.SelectSingleNode("Root"); |
50 | if (null == rootNode) | 50 | if (null == rootNode) |
51 | throw new Exception("Error: Invalid .xml File. Missing <Root>"); | 51 | throw new Exception("Error: Invalid .xml File. Missing <Root>"); |
52 | 52 | ||
@@ -135,4 +135,4 @@ namespace OpenSim.Framework.Configuration.XML | |||
135 | doc = null; | 135 | doc = null; |
136 | } | 136 | } |
137 | } | 137 | } |
138 | } \ No newline at end of file | 138 | } |
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index f21127b..89fd77d 100644 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs | |||
@@ -42,7 +42,7 @@ namespace OpenSim.Framework.Console | |||
42 | private readonly object m_syncRoot = new object(); | 42 | private readonly object m_syncRoot = new object(); |
43 | 43 | ||
44 | public conscmd_callback m_cmdParser; | 44 | public conscmd_callback m_cmdParser; |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// The default prompt text. | 47 | /// The default prompt text. |
48 | /// </summary> | 48 | /// </summary> |
@@ -249,7 +249,7 @@ namespace OpenSim.Framework.Console | |||
249 | { | 249 | { |
250 | line = System.Console.ReadLine(); | 250 | line = System.Console.ReadLine(); |
251 | } | 251 | } |
252 | 252 | ||
253 | return line; | 253 | return line; |
254 | } | 254 | } |
255 | catch (Exception e) | 255 | catch (Exception e) |
diff --git a/OpenSim/Framework/Console/ConsolePluginCommand.cs b/OpenSim/Framework/Console/ConsolePluginCommand.cs index b3f1c93..bf70645 100644 --- a/OpenSim/Framework/Console/ConsolePluginCommand.cs +++ b/OpenSim/Framework/Console/ConsolePluginCommand.cs | |||
@@ -30,10 +30,10 @@ using System; | |||
30 | namespace OpenSim.Framework.Console | 30 | namespace OpenSim.Framework.Console |
31 | { | 31 | { |
32 | public delegate void ConsoleCommand(string[] comParams); | 32 | public delegate void ConsoleCommand(string[] comParams); |
33 | 33 | ||
34 | /// <summary> | 34 | /// <summary> |
35 | /// Holder object for a new console plugin command | 35 | /// Holder object for a new console plugin command |
36 | /// | 36 | /// |
37 | /// Override the methods like Run and IsHelpfull (but the defaults might work ok.) | 37 | /// Override the methods like Run and IsHelpfull (but the defaults might work ok.) |
38 | /// </summary> | 38 | /// </summary> |
39 | public class ConsolePluginCommand | 39 | public class ConsolePluginCommand |
@@ -52,10 +52,10 @@ namespace OpenSim.Framework.Console | |||
52 | private string[] m_cmdText; | 52 | private string[] m_cmdText; |
53 | 53 | ||
54 | /// <summary> | 54 | /// <summary> |
55 | /// Construct a new ConsolePluginCommand | 55 | /// Construct a new ConsolePluginCommand |
56 | /// | 56 | /// |
57 | /// for use with OpenSim.RegisterConsolePluginCommand(myCmd); | 57 | /// for use with OpenSim.RegisterConsolePluginCommand(myCmd); |
58 | /// | 58 | /// |
59 | /// </summary> | 59 | /// </summary> |
60 | /// <param name="command">in the form of "showme new commands"</param> | 60 | /// <param name="command">in the form of "showme new commands"</param> |
61 | /// <param name="dlg">ommand delegate used in running</param> | 61 | /// <param name="dlg">ommand delegate used in running</param> |
@@ -68,13 +68,13 @@ namespace OpenSim.Framework.Console | |||
68 | } | 68 | } |
69 | 69 | ||
70 | /// <summary> | 70 | /// <summary> |
71 | /// Returns the match length this command has upon the 'cmdWithParams' | 71 | /// Returns the match length this command has upon the 'cmdWithParams' |
72 | /// At least a higher number for "show plugin status" then "show" would return | 72 | /// At least a higher number for "show plugin status" then "show" would return |
73 | /// This is used to have multi length command verbs | 73 | /// This is used to have multi length command verbs |
74 | /// | 74 | /// |
75 | /// @see OopenSim.RunPluginCommands | 75 | /// @see OopenSim.RunPluginCommands |
76 | /// It will only run the one with the highest number | 76 | /// It will only run the one with the highest number |
77 | /// | 77 | /// |
78 | /// </summary> | 78 | /// </summary> |
79 | public int matchLength(string cmdWithParams) | 79 | public int matchLength(string cmdWithParams) |
80 | { | 80 | { |
@@ -106,8 +106,8 @@ namespace OpenSim.Framework.Console | |||
106 | } | 106 | } |
107 | currentParam++; | 107 | currentParam++; |
108 | } | 108 | } |
109 | 109 | ||
110 | } | 110 | } |
111 | string[] sendCmdParams = cmdParams; | 111 | string[] sendCmdParams = cmdParams; |
112 | if (skipParams > 0) | 112 | if (skipParams > 0) |
113 | { | 113 | { |
diff --git a/OpenSim/Framework/Console/OpenSimAppender.cs b/OpenSim/Framework/Console/OpenSimAppender.cs index 2527977..fa26d22 100644 --- a/OpenSim/Framework/Console/OpenSimAppender.cs +++ b/OpenSim/Framework/Console/OpenSimAppender.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Framework.Console | |||
39 | { | 39 | { |
40 | override protected void Append(LoggingEvent le) | 40 | override protected void Append(LoggingEvent le) |
41 | { | 41 | { |
42 | try | 42 | try |
43 | { | 43 | { |
44 | string loggingMessage = RenderLoggingEvent(le); | 44 | string loggingMessage = RenderLoggingEvent(le); |
45 | 45 | ||
@@ -47,7 +47,7 @@ namespace OpenSim.Framework.Console | |||
47 | 47 | ||
48 | Regex RE = new Regex(regex, RegexOptions.Multiline); | 48 | Regex RE = new Regex(regex, RegexOptions.Multiline); |
49 | MatchCollection matches = RE.Matches(loggingMessage); | 49 | MatchCollection matches = RE.Matches(loggingMessage); |
50 | 50 | ||
51 | // Get some direct matches $1 $4 is a | 51 | // Get some direct matches $1 $4 is a |
52 | if (matches.Count == 1) | 52 | if (matches.Count == 1) |
53 | { | 53 | { |
diff --git a/OpenSim/Framework/IAssetProvider.cs b/OpenSim/Framework/IAssetProvider.cs index 00d290e..ec70554 100644 --- a/OpenSim/Framework/IAssetProvider.cs +++ b/OpenSim/Framework/IAssetProvider.cs | |||
@@ -37,7 +37,7 @@ namespace OpenSim.Framework | |||
37 | bool ExistsAsset(LLUUID uuid); | 37 | bool ExistsAsset(LLUUID uuid); |
38 | void Initialise(string connect); | 38 | void Initialise(string connect); |
39 | } | 39 | } |
40 | 40 | ||
41 | public class AssetDataInitialiser : PluginInitialiserBase | 41 | public class AssetDataInitialiser : PluginInitialiserBase |
42 | { | 42 | { |
43 | private string connect; | 43 | private string connect; |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 536050c..71b8eb0 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Framework | |||
62 | public delegate void ModifyTerrain( | 62 | public delegate void ModifyTerrain( |
63 | float height, float seconds, byte size, byte action, float north, float west, float south, float east, | 63 | float height, float seconds, byte size, byte action, float north, float west, float south, float east, |
64 | IClientAPI remoteClient); | 64 | IClientAPI remoteClient); |
65 | 65 | ||
66 | public delegate void SetAppearance(byte[] texture, List<byte> visualParamList); | 66 | public delegate void SetAppearance(byte[] texture, List<byte> visualParamList); |
67 | 67 | ||
68 | public delegate void StartAnim(IClientAPI remoteClient, LLUUID animID); | 68 | public delegate void StartAnim(IClientAPI remoteClient, LLUUID animID); |
@@ -295,7 +295,7 @@ namespace OpenSim.Framework | |||
295 | public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey); | 295 | public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey); |
296 | public delegate void RegionHandleRequest(IClientAPI remoteClient, LLUUID regionID); | 296 | public delegate void RegionHandleRequest(IClientAPI remoteClient, LLUUID regionID); |
297 | public delegate void ParcelInfoRequest(IClientAPI remoteClient, LLUUID parcelID); | 297 | public delegate void ParcelInfoRequest(IClientAPI remoteClient, LLUUID parcelID); |
298 | 298 | ||
299 | public delegate void ScriptReset(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); | 299 | public delegate void ScriptReset(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); |
300 | public delegate void GetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); | 300 | public delegate void GetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); |
301 | public delegate void SetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, bool running); | 301 | public delegate void SetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, bool running); |
@@ -322,9 +322,9 @@ namespace OpenSim.Framework | |||
322 | ulong ActiveGroupPowers { get; } | 322 | ulong ActiveGroupPowers { get; } |
323 | 323 | ||
324 | ulong GetGroupPowers(LLUUID groupID); | 324 | ulong GetGroupPowers(LLUUID groupID); |
325 | 325 | ||
326 | string FirstName { get; } | 326 | string FirstName { get; } |
327 | 327 | ||
328 | string LastName { get; } | 328 | string LastName { get; } |
329 | 329 | ||
330 | IScene Scene { get; } | 330 | IScene Scene { get; } |
@@ -501,7 +501,7 @@ namespace OpenSim.Framework | |||
501 | event EstateDebugRegionRequest OnEstateDebugRegionRequest; | 501 | event EstateDebugRegionRequest OnEstateDebugRegionRequest; |
502 | event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; | 502 | event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; |
503 | event UUIDNameRequest OnUUIDGroupNameRequest; | 503 | event UUIDNameRequest OnUUIDGroupNameRequest; |
504 | 504 | ||
505 | event RegionHandleRequest OnRegionHandleRequest; | 505 | event RegionHandleRequest OnRegionHandleRequest; |
506 | event ParcelInfoRequest OnParcelInfoRequest; | 506 | event ParcelInfoRequest OnParcelInfoRequest; |
507 | 507 | ||
@@ -724,10 +724,10 @@ namespace OpenSim.Framework | |||
724 | ClientInfo GetClientInfo(); | 724 | ClientInfo GetClientInfo(); |
725 | void SetClientInfo(ClientInfo info); | 725 | void SetClientInfo(ClientInfo info); |
726 | void Terminate(); | 726 | void Terminate(); |
727 | 727 | ||
728 | void SendSetFollowCamProperties(LLUUID objectID, SortedDictionary<int, float> parameters); | 728 | void SendSetFollowCamProperties(LLUUID objectID, SortedDictionary<int, float> parameters); |
729 | void SendClearFollowCamProperties(LLUUID objectID); | 729 | void SendClearFollowCamProperties(LLUUID objectID); |
730 | 730 | ||
731 | void SendRegionHandle(LLUUID regoinID, ulong handle); | 731 | void SendRegionHandle(LLUUID regoinID, ulong handle); |
732 | void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y); | 732 | void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y); |
733 | } | 733 | } |
diff --git a/OpenSim/Framework/IInventoryData.cs b/OpenSim/Framework/IInventoryData.cs index 0d4c555..1c62b0b 100644 --- a/OpenSim/Framework/IInventoryData.cs +++ b/OpenSim/Framework/IInventoryData.cs | |||
@@ -132,7 +132,7 @@ namespace OpenSim.Framework | |||
132 | /// <param name="folder">The id of the folder</param> | 132 | /// <param name="folder">The id of the folder</param> |
133 | void deleteInventoryFolder(LLUUID folder); | 133 | void deleteInventoryFolder(LLUUID folder); |
134 | } | 134 | } |
135 | 135 | ||
136 | public class InventoryDataInitialiser : PluginInitialiserBase | 136 | public class InventoryDataInitialiser : PluginInitialiserBase |
137 | { | 137 | { |
138 | private string connect; | 138 | private string connect; |
diff --git a/OpenSim/Framework/IPlugin.cs b/OpenSim/Framework/IPlugin.cs index f739177..1eb1c06 100644 --- a/OpenSim/Framework/IPlugin.cs +++ b/OpenSim/Framework/IPlugin.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.Framework | |||
38 | public PluginNotInitialisedException (string msg) : base(msg) {} | 38 | public PluginNotInitialisedException (string msg) : base(msg) {} |
39 | public PluginNotInitialisedException (string msg, Exception e) : base(msg, e) {} | 39 | public PluginNotInitialisedException (string msg, Exception e) : base(msg, e) {} |
40 | } | 40 | } |
41 | 41 | ||
42 | /// <summary> | 42 | /// <summary> |
43 | /// This interface, describes a generic plugin | 43 | /// This interface, describes a generic plugin |
44 | /// </summary> | 44 | /// </summary> |
@@ -63,17 +63,17 @@ namespace OpenSim.Framework | |||
63 | } | 63 | } |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// Any plugins which need to pass parameters to their initialisers must | 66 | /// Any plugins which need to pass parameters to their initialisers must |
67 | /// inherit this class and use it to set the PluginLoader Initialiser property | 67 | /// inherit this class and use it to set the PluginLoader Initialiser property |
68 | /// </summary> | 68 | /// </summary> |
69 | public class PluginInitialiserBase | 69 | public class PluginInitialiserBase |
70 | { | 70 | { |
71 | // this would be a lot simpler if C# supported currying or typedefs | 71 | // this would be a lot simpler if C# supported currying or typedefs |
72 | 72 | ||
73 | // default initialisation | 73 | // default initialisation |
74 | public virtual void Initialise (IPlugin plugin) | 74 | public virtual void Initialise (IPlugin plugin) |
75 | { | 75 | { |
76 | plugin.Initialise(); | 76 | plugin.Initialise(); |
77 | } | 77 | } |
78 | } | 78 | } |
79 | 79 | ||
diff --git a/OpenSim/Framework/IUserData.cs b/OpenSim/Framework/IUserData.cs index 5ecb482..f74c0db 100644 --- a/OpenSim/Framework/IUserData.cs +++ b/OpenSim/Framework/IUserData.cs | |||
@@ -170,7 +170,7 @@ namespace OpenSim.Framework | |||
170 | void RemoveAttachment(LLUUID user, LLUUID item); | 170 | void RemoveAttachment(LLUUID user, LLUUID item); |
171 | List<LLUUID> GetAttachments(LLUUID user); | 171 | List<LLUUID> GetAttachments(LLUUID user); |
172 | } | 172 | } |
173 | 173 | ||
174 | public class UserDataInitialiser : PluginInitialiserBase | 174 | public class UserDataInitialiser : PluginInitialiserBase |
175 | { | 175 | { |
176 | private string connect; | 176 | private string connect; |
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index 8c1e1a1..a875a50 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Framework | |||
39 | private uint _auctionID = 0; //Unemplemented. If set to 0, not being auctioned | 39 | private uint _auctionID = 0; //Unemplemented. If set to 0, not being auctioned |
40 | private LLUUID _authBuyerID = LLUUID.Zero; //Unemplemented. Authorized Buyer's UUID | 40 | private LLUUID _authBuyerID = LLUUID.Zero; //Unemplemented. Authorized Buyer's UUID |
41 | private Parcel.ParcelCategory _category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category | 41 | private Parcel.ParcelCategory _category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category |
42 | private int _claimDate = 0; | 42 | private int _claimDate = 0; |
43 | private int _claimPrice = 0; //Unemplemented | 43 | private int _claimPrice = 0; //Unemplemented |
44 | private LLUUID _globalID = LLUUID.Zero; | 44 | private LLUUID _globalID = LLUUID.Zero; |
45 | private LLUUID _groupID = LLUUID.Zero; //Unemplemented | 45 | private LLUUID _groupID = LLUUID.Zero; //Unemplemented |
@@ -77,7 +77,7 @@ namespace OpenSim.Framework | |||
77 | private LLUUID _snapshotID = LLUUID.Zero; | 77 | private LLUUID _snapshotID = LLUUID.Zero; |
78 | private LLVector3 _userLocation = new LLVector3(); | 78 | private LLVector3 _userLocation = new LLVector3(); |
79 | private LLVector3 _userLookAt = new LLVector3(); | 79 | private LLVector3 _userLookAt = new LLVector3(); |
80 | 80 | ||
81 | public LLVector3 AABBMax { | 81 | public LLVector3 AABBMax { |
82 | get { | 82 | get { |
83 | return _AABBMax; | 83 | return _AABBMax; |
@@ -459,4 +459,4 @@ namespace OpenSim.Framework | |||
459 | return landData; | 459 | return landData; |
460 | } | 460 | } |
461 | } | 461 | } |
462 | } \ No newline at end of file | 462 | } |
diff --git a/OpenSim/Framework/LandStatReportItem.cs b/OpenSim/Framework/LandStatReportItem.cs index 3a92253..8c7ee7b 100644 --- a/OpenSim/Framework/LandStatReportItem.cs +++ b/OpenSim/Framework/LandStatReportItem.cs | |||
@@ -49,6 +49,6 @@ namespace OpenSim.Framework | |||
49 | { | 49 | { |
50 | 50 | ||
51 | } | 51 | } |
52 | 52 | ||
53 | } | 53 | } |
54 | } | 54 | } |
diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index 7ceb0b2..cabce1b 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Framework | |||
47 | } | 47 | } |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Classes wishing to impose constraints on plugin loading must implement | 50 | /// Classes wishing to impose constraints on plugin loading must implement |
51 | /// this class and pass it to PluginLoader AddConstraint() | 51 | /// this class and pass it to PluginLoader AddConstraint() |
52 | /// </summary> | 52 | /// </summary> |
53 | public interface IPluginConstraint | 53 | public interface IPluginConstraint |
@@ -75,46 +75,46 @@ namespace OpenSim.Framework | |||
75 | private List<T> loaded = new List<T>(); | 75 | private List<T> loaded = new List<T>(); |
76 | private List<string> extpoints = new List<string>(); | 76 | private List<string> extpoints = new List<string>(); |
77 | private PluginInitialiserBase initialiser; | 77 | private PluginInitialiserBase initialiser; |
78 | 78 | ||
79 | private Dictionary<string,IPluginConstraint> constraints | 79 | private Dictionary<string,IPluginConstraint> constraints |
80 | = new Dictionary<string,IPluginConstraint>(); | 80 | = new Dictionary<string,IPluginConstraint>(); |
81 | 81 | ||
82 | private Dictionary<string,IPluginFilter> filters | 82 | private Dictionary<string,IPluginFilter> filters |
83 | = new Dictionary<string,IPluginFilter>(); | 83 | = new Dictionary<string,IPluginFilter>(); |
84 | 84 | ||
85 | private static readonly ILog log | 85 | private static readonly ILog log |
86 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 86 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
87 | 87 | ||
88 | public PluginInitialiserBase Initialiser | 88 | public PluginInitialiserBase Initialiser |
89 | { | 89 | { |
90 | set { initialiser = value; } | 90 | set { initialiser = value; } |
91 | get { return initialiser; } | 91 | get { return initialiser; } |
92 | } | 92 | } |
93 | 93 | ||
94 | public List<T> Plugins | 94 | public List<T> Plugins |
95 | { | 95 | { |
96 | get { return loaded; } | 96 | get { return loaded; } |
97 | } | 97 | } |
98 | 98 | ||
99 | public T Plugin | 99 | public T Plugin |
100 | { | 100 | { |
101 | get { return (loaded.Count == 1)? loaded [0] : default (T); } | 101 | get { return (loaded.Count == 1)? loaded [0] : default (T); } |
102 | } | 102 | } |
103 | 103 | ||
104 | public PluginLoader () | 104 | public PluginLoader () |
105 | { | 105 | { |
106 | Initialiser = new PluginInitialiserBase(); | 106 | Initialiser = new PluginInitialiserBase(); |
107 | initialise_plugin_dir_ ("."); | 107 | initialise_plugin_dir_ ("."); |
108 | } | 108 | } |
109 | 109 | ||
110 | public PluginLoader (PluginInitialiserBase init) | 110 | public PluginLoader (PluginInitialiserBase init) |
111 | { | 111 | { |
112 | Initialiser = init; | 112 | Initialiser = init; |
113 | initialise_plugin_dir_ ("."); | 113 | initialise_plugin_dir_ ("."); |
114 | } | 114 | } |
115 | 115 | ||
116 | public PluginLoader (PluginInitialiserBase init, string dir) | 116 | public PluginLoader (PluginInitialiserBase init, string dir) |
117 | { | 117 | { |
118 | Initialiser = init; | 118 | Initialiser = init; |
119 | initialise_plugin_dir_ (dir); | 119 | initialise_plugin_dir_ (dir); |
120 | } | 120 | } |
@@ -123,7 +123,7 @@ namespace OpenSim.Framework | |||
123 | { | 123 | { |
124 | if (extpoints.Contains (extpoint)) | 124 | if (extpoints.Contains (extpoint)) |
125 | return; | 125 | return; |
126 | 126 | ||
127 | extpoints.Add (extpoint); | 127 | extpoints.Add (extpoint); |
128 | } | 128 | } |
129 | 129 | ||
@@ -156,7 +156,7 @@ namespace OpenSim.Framework | |||
156 | } | 156 | } |
157 | 157 | ||
158 | public void Load () | 158 | public void Load () |
159 | { | 159 | { |
160 | foreach (string ext in extpoints) | 160 | foreach (string ext in extpoints) |
161 | { | 161 | { |
162 | log.Info("[PLUGINS]: Loading extension point " + ext); | 162 | log.Info("[PLUGINS]: Loading extension point " + ext); |
@@ -169,17 +169,17 @@ namespace OpenSim.Framework | |||
169 | } | 169 | } |
170 | 170 | ||
171 | IPluginFilter filter = null; | 171 | IPluginFilter filter = null; |
172 | 172 | ||
173 | if (filters.ContainsKey (ext)) | 173 | if (filters.ContainsKey (ext)) |
174 | filter = filters [ext]; | 174 | filter = filters [ext]; |
175 | 175 | ||
176 | foreach (PluginExtensionNode node in AddinManager.GetExtensionNodes (ext)) | 176 | foreach (PluginExtensionNode node in AddinManager.GetExtensionNodes (ext)) |
177 | { | 177 | { |
178 | log.Info("[PLUGINS]: Trying plugin " + node.Path); | 178 | log.Info("[PLUGINS]: Trying plugin " + node.Path); |
179 | 179 | ||
180 | if ((filter != null) && (filter.Apply (node) == false)) | 180 | if ((filter != null) && (filter.Apply (node) == false)) |
181 | continue; | 181 | continue; |
182 | 182 | ||
183 | T plugin = (T) node.CreateInstance(); | 183 | T plugin = (T) node.CreateInstance(); |
184 | Initialiser.Initialise (plugin); | 184 | Initialiser.Initialise (plugin); |
185 | Plugins.Add (plugin); | 185 | Plugins.Add (plugin); |
@@ -219,7 +219,7 @@ namespace OpenSim.Framework | |||
219 | private void on_addinloaderror_(object sender, AddinErrorEventArgs args) | 219 | private void on_addinloaderror_(object sender, AddinErrorEventArgs args) |
220 | { | 220 | { |
221 | if (args.Exception == null) | 221 | if (args.Exception == null) |
222 | log.Error ("[PLUGINS]: Plugin Error: " | 222 | log.Error ("[PLUGINS]: Plugin Error: " |
223 | + args.Message); | 223 | + args.Message); |
224 | else | 224 | else |
225 | log.Error ("[PLUGINS]: Plugin Error: " | 225 | log.Error ("[PLUGINS]: Plugin Error: " |
@@ -229,7 +229,7 @@ namespace OpenSim.Framework | |||
229 | 229 | ||
230 | private void clear_registry_ () | 230 | private void clear_registry_ () |
231 | { | 231 | { |
232 | // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) | 232 | // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) |
233 | // occasionally seems to corrupt its addin cache | 233 | // occasionally seems to corrupt its addin cache |
234 | // Hence, as a temporary solution we'll remove it before each startup | 234 | // Hence, as a temporary solution we'll remove it before each startup |
235 | try | 235 | try |
@@ -252,7 +252,7 @@ namespace OpenSim.Framework | |||
252 | } | 252 | } |
253 | } | 253 | } |
254 | 254 | ||
255 | private static TextWriter prev_console_; | 255 | private static TextWriter prev_console_; |
256 | public void suppress_console_output_ (bool save) | 256 | public void suppress_console_output_ (bool save) |
257 | { | 257 | { |
258 | if (save) | 258 | if (save) |
@@ -262,7 +262,7 @@ namespace OpenSim.Framework | |||
262 | } | 262 | } |
263 | else | 263 | else |
264 | { | 264 | { |
265 | if (prev_console_ != null) | 265 | if (prev_console_ != null) |
266 | System.Console.SetOut(prev_console_); | 266 | System.Console.SetOut(prev_console_); |
267 | } | 267 | } |
268 | } | 268 | } |
@@ -283,7 +283,7 @@ namespace OpenSim.Framework | |||
283 | 283 | ||
284 | public Type TypeObject | 284 | public Type TypeObject |
285 | { | 285 | { |
286 | get | 286 | get |
287 | { | 287 | { |
288 | if (typeobj != null) | 288 | if (typeobj != null) |
289 | return typeobj; | 289 | return typeobj; |
@@ -295,9 +295,9 @@ namespace OpenSim.Framework | |||
295 | } | 295 | } |
296 | } | 296 | } |
297 | 297 | ||
298 | public object CreateInstance () | 298 | public object CreateInstance () |
299 | { | 299 | { |
300 | return Activator.CreateInstance (TypeObject); | 300 | return Activator.CreateInstance (TypeObject); |
301 | } | 301 | } |
302 | } | 302 | } |
303 | 303 | ||
@@ -305,29 +305,29 @@ namespace OpenSim.Framework | |||
305 | /// Constraint that bounds the number of plugins to be loaded. | 305 | /// Constraint that bounds the number of plugins to be loaded. |
306 | /// </summary> | 306 | /// </summary> |
307 | public class PluginCountConstraint : IPluginConstraint | 307 | public class PluginCountConstraint : IPluginConstraint |
308 | { | 308 | { |
309 | private int min; | 309 | private int min; |
310 | private int max; | 310 | private int max; |
311 | 311 | ||
312 | public PluginCountConstraint (int exact) | 312 | public PluginCountConstraint (int exact) |
313 | { | 313 | { |
314 | min = exact; | 314 | min = exact; |
315 | max = exact; | 315 | max = exact; |
316 | } | ||
317 | |||
318 | public PluginCountConstraint (int minimum, int maximum) | ||
319 | { | ||
320 | min = minimum; | ||
321 | max = maximum; | ||
316 | } | 322 | } |
317 | 323 | ||
318 | public PluginCountConstraint (int minimum, int maximum) | 324 | public string Message |
319 | { | 325 | { |
320 | min = minimum; | 326 | get |
321 | max = maximum; | 327 | { |
322 | } | 328 | return "The number of plugins is constrained to the interval [" |
323 | 329 | + min + ", " + max + "]"; | |
324 | public string Message | 330 | } |
325 | { | ||
326 | get | ||
327 | { | ||
328 | return "The number of plugins is constrained to the interval [" | ||
329 | + min + ", " + max + "]"; | ||
330 | } | ||
331 | } | 331 | } |
332 | 332 | ||
333 | public bool Apply (string extpoint) | 333 | public bool Apply (string extpoint) |
@@ -340,7 +340,7 @@ namespace OpenSim.Framework | |||
340 | return true; | 340 | return true; |
341 | } | 341 | } |
342 | } | 342 | } |
343 | 343 | ||
344 | /// <summary> | 344 | /// <summary> |
345 | /// Filters out which plugin to load based on its "Provider", which is name given by in the addin.xml | 345 | /// Filters out which plugin to load based on its "Provider", which is name given by in the addin.xml |
346 | /// </summary> | 346 | /// </summary> |
@@ -348,7 +348,7 @@ namespace OpenSim.Framework | |||
348 | { | 348 | { |
349 | private string provider; | 349 | private string provider; |
350 | 350 | ||
351 | public PluginProviderFilter (string p) | 351 | public PluginProviderFilter (string p) |
352 | { | 352 | { |
353 | provider = p; | 353 | provider = p; |
354 | } | 354 | } |
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index ef74b54..f244b51 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs | |||
@@ -128,7 +128,7 @@ namespace OpenSim.Framework | |||
128 | [XmlIgnore] private bool _flexiEntry = false; | 128 | [XmlIgnore] private bool _flexiEntry = false; |
129 | [XmlIgnore] private bool _lightEntry = false; | 129 | [XmlIgnore] private bool _lightEntry = false; |
130 | [XmlIgnore] private bool _sculptEntry = false; | 130 | [XmlIgnore] private bool _sculptEntry = false; |
131 | 131 | ||
132 | public byte ProfileCurve | 132 | public byte ProfileCurve |
133 | { | 133 | { |
134 | get { return (byte)((byte)HollowShape | (byte)ProfileShape); } | 134 | get { return (byte)((byte)HollowShape | (byte)ProfileShape); } |
@@ -185,10 +185,10 @@ namespace OpenSim.Framework | |||
185 | [XmlIgnore] | 185 | [XmlIgnore] |
186 | public LLObject.TextureEntry Textures | 186 | public LLObject.TextureEntry Textures |
187 | { | 187 | { |
188 | get | 188 | get |
189 | { | 189 | { |
190 | //m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length); | 190 | //m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length); |
191 | return new LLObject.TextureEntry(m_textureEntry, 0, m_textureEntry.Length); | 191 | return new LLObject.TextureEntry(m_textureEntry, 0, m_textureEntry.Length); |
192 | } | 192 | } |
193 | 193 | ||
194 | set { m_textureEntry = value.ToBytes(); } | 194 | set { m_textureEntry = value.ToBytes(); } |
@@ -198,12 +198,12 @@ namespace OpenSim.Framework | |||
198 | { | 198 | { |
199 | get { return m_textureEntry; } | 199 | get { return m_textureEntry; } |
200 | 200 | ||
201 | set | 201 | set |
202 | { | 202 | { |
203 | if (value == null) | 203 | if (value == null) |
204 | m_textureEntry = new byte[1]; | 204 | m_textureEntry = new byte[1]; |
205 | else | 205 | else |
206 | m_textureEntry = value; | 206 | m_textureEntry = value; |
207 | } | 207 | } |
208 | } | 208 | } |
209 | 209 | ||
@@ -302,7 +302,7 @@ namespace OpenSim.Framework | |||
302 | _profileBegin = LLObject.PackBeginCut(profileRange.X); | 302 | _profileBegin = LLObject.PackBeginCut(profileRange.X); |
303 | _profileEnd = LLObject.PackEndCut(profileRange.Y); | 303 | _profileEnd = LLObject.PackEndCut(profileRange.Y); |
304 | } | 304 | } |
305 | 305 | ||
306 | public byte[] ExtraParams | 306 | public byte[] ExtraParams |
307 | { | 307 | { |
308 | get | 308 | get |
@@ -941,7 +941,7 @@ namespace OpenSim.Framework | |||
941 | 941 | ||
942 | return data; | 942 | return data; |
943 | } | 943 | } |
944 | 944 | ||
945 | public void ReadFlexiData(byte[] data, int pos) | 945 | public void ReadFlexiData(byte[] data, int pos) |
946 | { | 946 | { |
947 | if (data.Length-pos >= 16) | 947 | if (data.Length-pos >= 16) |
@@ -972,7 +972,7 @@ namespace OpenSim.Framework | |||
972 | _flexiForceZ = 0f; | 972 | _flexiForceZ = 0f; |
973 | } | 973 | } |
974 | } | 974 | } |
975 | 975 | ||
976 | public byte[] GetFlexiBytes() | 976 | public byte[] GetFlexiBytes() |
977 | { | 977 | { |
978 | byte[] data = new byte[16]; | 978 | byte[] data = new byte[16]; |
@@ -991,7 +991,7 @@ namespace OpenSim.Framework | |||
991 | 991 | ||
992 | return data; | 992 | return data; |
993 | } | 993 | } |
994 | 994 | ||
995 | public void ReadLightData(byte[] data, int pos) | 995 | public void ReadLightData(byte[] data, int pos) |
996 | { | 996 | { |
997 | if (data.Length - pos >= 16) | 997 | if (data.Length - pos >= 16) |
@@ -1021,7 +1021,7 @@ namespace OpenSim.Framework | |||
1021 | _lightIntensity = 0f; | 1021 | _lightIntensity = 0f; |
1022 | } | 1022 | } |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | public byte[] GetLightBytes() | 1025 | public byte[] GetLightBytes() |
1026 | { | 1026 | { |
1027 | byte[] data = new byte[16]; | 1027 | byte[] data = new byte[16]; |
diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs index 0b50a81..2d0be15 100644 --- a/OpenSim/Framework/RegionCommsListener.cs +++ b/OpenSim/Framework/RegionCommsListener.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Framework | |||
47 | private RegionUp handlerRegionUp = null; // OnRegionUp; | 47 | private RegionUp handlerRegionUp = null; // OnRegionUp; |
48 | private LogOffUser handlerLogOffUser = null; | 48 | private LogOffUser handlerLogOffUser = null; |
49 | private GetLandData handlerGetLandData = null; | 49 | private GetLandData handlerGetLandData = null; |
50 | 50 | ||
51 | #region IRegionCommsListener Members | 51 | #region IRegionCommsListener Members |
52 | 52 | ||
53 | public event ExpectUserDelegate OnExpectUser; | 53 | public event ExpectUserDelegate OnExpectUser; |
@@ -228,13 +228,13 @@ namespace OpenSim.Framework | |||
228 | 228 | ||
229 | return false; | 229 | return false; |
230 | } | 230 | } |
231 | 231 | ||
232 | public LandData TriggerGetLandData(uint x, uint y) | 232 | public LandData TriggerGetLandData(uint x, uint y) |
233 | { | 233 | { |
234 | handlerGetLandData = OnGetLandData; | 234 | handlerGetLandData = OnGetLandData; |
235 | if (handlerGetLandData != null) | 235 | if (handlerGetLandData != null) |
236 | return handlerGetLandData(x, y); | 236 | return handlerGetLandData(x, y); |
237 | 237 | ||
238 | return null; | 238 | return null; |
239 | } | 239 | } |
240 | } | 240 | } |
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 1d9d9ec..716849c 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Framework | |||
50 | set { m_httpPort = value; } | 50 | set { m_httpPort = value; } |
51 | } | 51 | } |
52 | protected uint m_httpPort; | 52 | protected uint m_httpPort; |
53 | 53 | ||
54 | /// <summary> | 54 | /// <summary> |
55 | /// A well-formed URI for the host region server (namely "http://" + ExternalHostName) | 55 | /// A well-formed URI for the host region server (namely "http://" + ExternalHostName) |
56 | /// </summary> | 56 | /// </summary> |
@@ -58,17 +58,17 @@ namespace OpenSim.Framework | |||
58 | { | 58 | { |
59 | get { return m_serverURI; } | 59 | get { return m_serverURI; } |
60 | set { m_serverURI = value; } | 60 | set { m_serverURI = value; } |
61 | } | 61 | } |
62 | protected string m_serverURI; | 62 | protected string m_serverURI; |
63 | 63 | ||
64 | protected bool Allow_Alternate_Ports; | 64 | protected bool Allow_Alternate_Ports; |
65 | public bool m_allow_alternate_ports; | 65 | public bool m_allow_alternate_ports; |
66 | protected string m_externalHostName; | 66 | protected string m_externalHostName; |
67 | 67 | ||
68 | protected IPEndPoint m_internalEndPoint; | 68 | protected IPEndPoint m_internalEndPoint; |
69 | protected uint? m_regionLocX; | 69 | protected uint? m_regionLocX; |
70 | protected uint? m_regionLocY; | 70 | protected uint? m_regionLocY; |
71 | protected uint m_remotingPort; | 71 | protected uint m_remotingPort; |
72 | public LLUUID RegionID = LLUUID.Zero; | 72 | public LLUUID RegionID = LLUUID.Zero; |
73 | public string RemotingAddress; | 73 | public string RemotingAddress; |
74 | 74 | ||
@@ -404,11 +404,11 @@ namespace OpenSim.Framework | |||
404 | configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | 404 | configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, |
405 | "(Sandbox Mode Only)Password for Master Avatar account", | 405 | "(Sandbox Mode Only)Password for Master Avatar account", |
406 | MasterAvatarSandboxPassword, true); | 406 | MasterAvatarSandboxPassword, true); |
407 | configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | 407 | configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, |
408 | "Last Map UUID", lastMapUUID.ToString(), true); | 408 | "Last Map UUID", lastMapUUID.ToString(), true); |
409 | configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | 409 | configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, |
410 | "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); | 410 | "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); |
411 | 411 | ||
412 | } | 412 | } |
413 | 413 | ||
414 | public void loadConfigurationOptions() | 414 | public void loadConfigurationOptions() |
@@ -454,15 +454,14 @@ namespace OpenSim.Framework | |||
454 | shouldMasterAvatarDetailsBeAsked); | 454 | shouldMasterAvatarDetailsBeAsked); |
455 | configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | 455 | configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, |
456 | "Last Map UUID", lastMapUUID.ToString(), true); | 456 | "Last Map UUID", lastMapUUID.ToString(), true); |
457 | 457 | ||
458 | configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | 458 | configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, |
459 | "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); | 459 | "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); |
460 | |||
461 | } | 460 | } |
462 | 461 | ||
463 | public bool shouldMasterAvatarDetailsBeAsked(string configuration_key) | 462 | public bool shouldMasterAvatarDetailsBeAsked(string configuration_key) |
464 | { | 463 | { |
465 | if (MasterAvatarAssignedUUID == LLUUID.Zero) | 464 | return MasterAvatarAssignedUUID == LLUUID.Zero; |
466 | { | 465 | { |
467 | return true; | 466 | return true; |
468 | } | 467 | } |
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index d157bac..b6e466d 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs | |||
@@ -139,7 +139,7 @@ namespace OpenSim.Framework | |||
139 | { | 139 | { |
140 | case "region_flags": | 140 | case "region_flags": |
141 | Simulator.RegionFlags flags = (Simulator.RegionFlags)(uint)value; | 141 | Simulator.RegionFlags flags = (Simulator.RegionFlags)(uint)value; |
142 | 142 | ||
143 | m_BlockTerraform = | 143 | m_BlockTerraform = |
144 | (flags & Simulator.RegionFlags.BlockTerraform) != 0; | 144 | (flags & Simulator.RegionFlags.BlockTerraform) != 0; |
145 | m_BlockFly = | 145 | m_BlockFly = |
@@ -246,7 +246,7 @@ namespace OpenSim.Framework | |||
246 | } | 246 | } |
247 | 247 | ||
248 | private bool m_BlockTerraform = false; | 248 | private bool m_BlockTerraform = false; |
249 | 249 | ||
250 | public bool BlockTerraform | 250 | public bool BlockTerraform |
251 | { | 251 | { |
252 | get { return m_BlockTerraform; } | 252 | get { return m_BlockTerraform; } |
@@ -254,7 +254,7 @@ namespace OpenSim.Framework | |||
254 | } | 254 | } |
255 | 255 | ||
256 | private bool m_BlockFly = false; | 256 | private bool m_BlockFly = false; |
257 | 257 | ||
258 | public bool BlockFly | 258 | public bool BlockFly |
259 | { | 259 | { |
260 | get { return m_BlockFly; } | 260 | get { return m_BlockFly; } |
@@ -262,7 +262,7 @@ namespace OpenSim.Framework | |||
262 | } | 262 | } |
263 | 263 | ||
264 | private bool m_AllowDamage = false; | 264 | private bool m_AllowDamage = false; |
265 | 265 | ||
266 | public bool AllowDamage | 266 | public bool AllowDamage |
267 | { | 267 | { |
268 | get { return m_AllowDamage; } | 268 | get { return m_AllowDamage; } |
@@ -270,7 +270,7 @@ namespace OpenSim.Framework | |||
270 | } | 270 | } |
271 | 271 | ||
272 | private bool m_RestrictPushing = false; | 272 | private bool m_RestrictPushing = false; |
273 | 273 | ||
274 | public bool RestrictPushing | 274 | public bool RestrictPushing |
275 | { | 275 | { |
276 | get { return m_RestrictPushing; } | 276 | get { return m_RestrictPushing; } |
@@ -278,7 +278,7 @@ namespace OpenSim.Framework | |||
278 | } | 278 | } |
279 | 279 | ||
280 | private bool m_AllowLandResell = true; | 280 | private bool m_AllowLandResell = true; |
281 | 281 | ||
282 | public bool AllowLandResell | 282 | public bool AllowLandResell |
283 | { | 283 | { |
284 | get { return m_AllowLandResell; } | 284 | get { return m_AllowLandResell; } |
@@ -286,7 +286,7 @@ namespace OpenSim.Framework | |||
286 | } | 286 | } |
287 | 287 | ||
288 | private bool m_AllowLandJoinDivide = true; | 288 | private bool m_AllowLandJoinDivide = true; |
289 | 289 | ||
290 | public bool AllowLandJoinDivide | 290 | public bool AllowLandJoinDivide |
291 | { | 291 | { |
292 | get { return m_AllowLandJoinDivide; } | 292 | get { return m_AllowLandJoinDivide; } |
@@ -294,7 +294,7 @@ namespace OpenSim.Framework | |||
294 | } | 294 | } |
295 | 295 | ||
296 | private bool m_BlockShowInSearch = false; | 296 | private bool m_BlockShowInSearch = false; |
297 | 297 | ||
298 | public bool BlockShowInSearch | 298 | public bool BlockShowInSearch |
299 | { | 299 | { |
300 | get { return m_BlockShowInSearch; } | 300 | get { return m_BlockShowInSearch; } |
@@ -302,7 +302,7 @@ namespace OpenSim.Framework | |||
302 | } | 302 | } |
303 | 303 | ||
304 | private int m_AgentLimit = 40; | 304 | private int m_AgentLimit = 40; |
305 | 305 | ||
306 | public int AgentLimit | 306 | public int AgentLimit |
307 | { | 307 | { |
308 | get { return m_AgentLimit; } | 308 | get { return m_AgentLimit; } |
@@ -310,7 +310,7 @@ namespace OpenSim.Framework | |||
310 | } | 310 | } |
311 | 311 | ||
312 | private double m_ObjectBonus = 1.0; | 312 | private double m_ObjectBonus = 1.0; |
313 | 313 | ||
314 | public double ObjectBonus | 314 | public double ObjectBonus |
315 | { | 315 | { |
316 | get { return m_ObjectBonus; } | 316 | get { return m_ObjectBonus; } |
@@ -318,7 +318,7 @@ namespace OpenSim.Framework | |||
318 | } | 318 | } |
319 | 319 | ||
320 | private int m_Maturity = 1; | 320 | private int m_Maturity = 1; |
321 | 321 | ||
322 | public int Maturity | 322 | public int Maturity |
323 | { | 323 | { |
324 | get { return m_Maturity; } | 324 | get { return m_Maturity; } |
@@ -326,7 +326,7 @@ namespace OpenSim.Framework | |||
326 | } | 326 | } |
327 | 327 | ||
328 | private bool m_DisableScripts = false; | 328 | private bool m_DisableScripts = false; |
329 | 329 | ||
330 | public bool DisableScripts | 330 | public bool DisableScripts |
331 | { | 331 | { |
332 | get { return m_DisableScripts; } | 332 | get { return m_DisableScripts; } |
@@ -334,7 +334,7 @@ namespace OpenSim.Framework | |||
334 | } | 334 | } |
335 | 335 | ||
336 | private bool m_DisableCollisions = false; | 336 | private bool m_DisableCollisions = false; |
337 | 337 | ||
338 | public bool DisableCollisions | 338 | public bool DisableCollisions |
339 | { | 339 | { |
340 | get { return m_DisableCollisions; } | 340 | get { return m_DisableCollisions; } |
@@ -342,7 +342,7 @@ namespace OpenSim.Framework | |||
342 | } | 342 | } |
343 | 343 | ||
344 | private bool m_DisablePhysics = false; | 344 | private bool m_DisablePhysics = false; |
345 | 345 | ||
346 | public bool DisablePhysics | 346 | public bool DisablePhysics |
347 | { | 347 | { |
348 | get { return m_DisablePhysics; } | 348 | get { return m_DisablePhysics; } |
@@ -350,7 +350,7 @@ namespace OpenSim.Framework | |||
350 | } | 350 | } |
351 | 351 | ||
352 | private LLUUID m_TerrainTexture1 = LLUUID.Zero; | 352 | private LLUUID m_TerrainTexture1 = LLUUID.Zero; |
353 | 353 | ||
354 | public LLUUID TerrainTexture1 | 354 | public LLUUID TerrainTexture1 |
355 | { | 355 | { |
356 | get { return m_TerrainTexture1; } | 356 | get { return m_TerrainTexture1; } |
@@ -358,7 +358,7 @@ namespace OpenSim.Framework | |||
358 | } | 358 | } |
359 | 359 | ||
360 | private LLUUID m_TerrainTexture2 = LLUUID.Zero; | 360 | private LLUUID m_TerrainTexture2 = LLUUID.Zero; |
361 | 361 | ||
362 | public LLUUID TerrainTexture2 | 362 | public LLUUID TerrainTexture2 |
363 | { | 363 | { |
364 | get { return m_TerrainTexture2; } | 364 | get { return m_TerrainTexture2; } |
@@ -366,7 +366,7 @@ namespace OpenSim.Framework | |||
366 | } | 366 | } |
367 | 367 | ||
368 | private LLUUID m_TerrainTexture3 = LLUUID.Zero; | 368 | private LLUUID m_TerrainTexture3 = LLUUID.Zero; |
369 | 369 | ||
370 | public LLUUID TerrainTexture3 | 370 | public LLUUID TerrainTexture3 |
371 | { | 371 | { |
372 | get { return m_TerrainTexture3; } | 372 | get { return m_TerrainTexture3; } |
@@ -374,7 +374,7 @@ namespace OpenSim.Framework | |||
374 | } | 374 | } |
375 | 375 | ||
376 | private LLUUID m_TerrainTexture4 = LLUUID.Zero; | 376 | private LLUUID m_TerrainTexture4 = LLUUID.Zero; |
377 | 377 | ||
378 | public LLUUID TerrainTexture4 | 378 | public LLUUID TerrainTexture4 |
379 | { | 379 | { |
380 | get { return m_TerrainTexture4; } | 380 | get { return m_TerrainTexture4; } |
@@ -382,7 +382,7 @@ namespace OpenSim.Framework | |||
382 | } | 382 | } |
383 | 383 | ||
384 | private double m_Elevation1NW = 10; | 384 | private double m_Elevation1NW = 10; |
385 | 385 | ||
386 | public double Elevation1NW | 386 | public double Elevation1NW |
387 | { | 387 | { |
388 | get { return m_Elevation1NW; } | 388 | get { return m_Elevation1NW; } |
@@ -390,7 +390,7 @@ namespace OpenSim.Framework | |||
390 | } | 390 | } |
391 | 391 | ||
392 | private double m_Elevation2NW = 60; | 392 | private double m_Elevation2NW = 60; |
393 | 393 | ||
394 | public double Elevation2NW | 394 | public double Elevation2NW |
395 | { | 395 | { |
396 | get { return m_Elevation2NW; } | 396 | get { return m_Elevation2NW; } |
@@ -398,7 +398,7 @@ namespace OpenSim.Framework | |||
398 | } | 398 | } |
399 | 399 | ||
400 | private double m_Elevation1NE = 10; | 400 | private double m_Elevation1NE = 10; |
401 | 401 | ||
402 | public double Elevation1NE | 402 | public double Elevation1NE |
403 | { | 403 | { |
404 | get { return m_Elevation1NE; } | 404 | get { return m_Elevation1NE; } |
@@ -406,7 +406,7 @@ namespace OpenSim.Framework | |||
406 | } | 406 | } |
407 | 407 | ||
408 | private double m_Elevation2NE = 60; | 408 | private double m_Elevation2NE = 60; |
409 | 409 | ||
410 | public double Elevation2NE | 410 | public double Elevation2NE |
411 | { | 411 | { |
412 | get { return m_Elevation2NE; } | 412 | get { return m_Elevation2NE; } |
@@ -414,7 +414,7 @@ namespace OpenSim.Framework | |||
414 | } | 414 | } |
415 | 415 | ||
416 | private double m_Elevation1SE = 10; | 416 | private double m_Elevation1SE = 10; |
417 | 417 | ||
418 | public double Elevation1SE | 418 | public double Elevation1SE |
419 | { | 419 | { |
420 | get { return m_Elevation1SE; } | 420 | get { return m_Elevation1SE; } |
@@ -422,7 +422,7 @@ namespace OpenSim.Framework | |||
422 | } | 422 | } |
423 | 423 | ||
424 | private double m_Elevation2SE = 60; | 424 | private double m_Elevation2SE = 60; |
425 | 425 | ||
426 | public double Elevation2SE | 426 | public double Elevation2SE |
427 | { | 427 | { |
428 | get { return m_Elevation2SE; } | 428 | get { return m_Elevation2SE; } |
@@ -430,7 +430,7 @@ namespace OpenSim.Framework | |||
430 | } | 430 | } |
431 | 431 | ||
432 | private double m_Elevation1SW = 10; | 432 | private double m_Elevation1SW = 10; |
433 | 433 | ||
434 | public double Elevation1SW | 434 | public double Elevation1SW |
435 | { | 435 | { |
436 | get { return m_Elevation1SW; } | 436 | get { return m_Elevation1SW; } |
@@ -438,7 +438,7 @@ namespace OpenSim.Framework | |||
438 | } | 438 | } |
439 | 439 | ||
440 | private double m_Elevation2SW = 60; | 440 | private double m_Elevation2SW = 60; |
441 | 441 | ||
442 | public double Elevation2SW | 442 | public double Elevation2SW |
443 | { | 443 | { |
444 | get { return m_Elevation2SW; } | 444 | get { return m_Elevation2SW; } |
@@ -446,7 +446,7 @@ namespace OpenSim.Framework | |||
446 | } | 446 | } |
447 | 447 | ||
448 | private double m_WaterHeight = 20; | 448 | private double m_WaterHeight = 20; |
449 | 449 | ||
450 | public double WaterHeight | 450 | public double WaterHeight |
451 | { | 451 | { |
452 | get { return m_WaterHeight; } | 452 | get { return m_WaterHeight; } |
@@ -454,7 +454,7 @@ namespace OpenSim.Framework | |||
454 | } | 454 | } |
455 | 455 | ||
456 | private double m_TerrainRaiseLimit = 100; | 456 | private double m_TerrainRaiseLimit = 100; |
457 | 457 | ||
458 | public double TerrainRaiseLimit | 458 | public double TerrainRaiseLimit |
459 | { | 459 | { |
460 | get { return m_TerrainRaiseLimit; } | 460 | get { return m_TerrainRaiseLimit; } |
@@ -462,7 +462,7 @@ namespace OpenSim.Framework | |||
462 | } | 462 | } |
463 | 463 | ||
464 | private double m_TerrainLowerLimit = -100; | 464 | private double m_TerrainLowerLimit = -100; |
465 | 465 | ||
466 | public double TerrainLowerLimit | 466 | public double TerrainLowerLimit |
467 | { | 467 | { |
468 | get { return m_TerrainLowerLimit; } | 468 | get { return m_TerrainLowerLimit; } |
@@ -470,7 +470,7 @@ namespace OpenSim.Framework | |||
470 | } | 470 | } |
471 | 471 | ||
472 | private bool m_UseEstateSun = true; | 472 | private bool m_UseEstateSun = true; |
473 | 473 | ||
474 | public bool UseEstateSun | 474 | public bool UseEstateSun |
475 | { | 475 | { |
476 | get { return m_UseEstateSun; } | 476 | get { return m_UseEstateSun; } |
@@ -478,7 +478,7 @@ namespace OpenSim.Framework | |||
478 | } | 478 | } |
479 | 479 | ||
480 | private bool m_Sandbox = false; | 480 | private bool m_Sandbox = false; |
481 | 481 | ||
482 | public bool Sandbox | 482 | public bool Sandbox |
483 | { | 483 | { |
484 | get { return m_Sandbox; } | 484 | get { return m_Sandbox; } |
@@ -502,7 +502,7 @@ namespace OpenSim.Framework | |||
502 | } | 502 | } |
503 | 503 | ||
504 | private bool m_FixedSun = false; | 504 | private bool m_FixedSun = false; |
505 | 505 | ||
506 | public bool FixedSun | 506 | public bool FixedSun |
507 | { | 507 | { |
508 | get { return m_FixedSun; } | 508 | get { return m_FixedSun; } |
@@ -510,7 +510,7 @@ namespace OpenSim.Framework | |||
510 | } | 510 | } |
511 | 511 | ||
512 | private double m_SunPosition = 0.0; | 512 | private double m_SunPosition = 0.0; |
513 | 513 | ||
514 | public double SunPosition | 514 | public double SunPosition |
515 | { | 515 | { |
516 | get { return m_SunPosition; } | 516 | get { return m_SunPosition; } |
@@ -518,7 +518,7 @@ namespace OpenSim.Framework | |||
518 | } | 518 | } |
519 | 519 | ||
520 | private LLUUID m_Covenant = LLUUID.Zero; | 520 | private LLUUID m_Covenant = LLUUID.Zero; |
521 | 521 | ||
522 | public LLUUID Covenant | 522 | public LLUUID Covenant |
523 | { | 523 | { |
524 | get { return m_Covenant; } | 524 | get { return m_Covenant; } |
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 952fb31..c3bd085 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -172,7 +172,7 @@ namespace OpenSim.Framework.Servers | |||
172 | OSHttpResponse response = new OSHttpResponse(context.Response); | 172 | OSHttpResponse response = new OSHttpResponse(context.Response); |
173 | 173 | ||
174 | // This is the REST agent interface. We require an agent to properly identify | 174 | // This is the REST agent interface. We require an agent to properly identify |
175 | // itself. If the REST handler recognizes the prefix it will attempt to | 175 | // itself. If the REST handler recognizes the prefix it will attempt to |
176 | // satisfy the request. If it is not recognizable, and no damage has occurred | 176 | // satisfy the request. If it is not recognizable, and no damage has occurred |
177 | // the request can be passed through to the other handlers. This is a low | 177 | // the request can be passed through to the other handlers. This is a low |
178 | // probability event; if a request is matched it is normally expected to be | 178 | // probability event; if a request is matched it is normally expected to be |
@@ -650,7 +650,7 @@ namespace OpenSim.Framework.Servers | |||
650 | } | 650 | } |
651 | 651 | ||
652 | response.AddHeader("Content-type", contentType); | 652 | response.AddHeader("Content-type", contentType); |
653 | 653 | ||
654 | byte[] buffer; | 654 | byte[] buffer; |
655 | 655 | ||
656 | if (!contentType.Contains("image")) | 656 | if (!contentType.Contains("image")) |
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index e901b68..33081b9 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -89,7 +89,7 @@ namespace OpenSim.Framework.Servers | |||
89 | 89 | ||
90 | m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); | 90 | m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); |
91 | m_periodicDiagnosticsTimer.Enabled = true; | 91 | m_periodicDiagnosticsTimer.Enabled = true; |
92 | 92 | ||
93 | // Add ourselves to thread monitoring. This thread will go on to become the console listening thread | 93 | // Add ourselves to thread monitoring. This thread will go on to become the console listening thread |
94 | Thread.CurrentThread.Name = "ConsoleThread"; | 94 | Thread.CurrentThread.Name = "ConsoleThread"; |
95 | ThreadTracker.Add(Thread.CurrentThread); | 95 | ThreadTracker.Add(Thread.CurrentThread); |
@@ -102,15 +102,15 @@ namespace OpenSim.Framework.Servers | |||
102 | { | 102 | { |
103 | StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n"); | 103 | StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n"); |
104 | sb.Append(GetUptimeReport()); | 104 | sb.Append(GetUptimeReport()); |
105 | 105 | ||
106 | if (m_stats != null) | 106 | if (m_stats != null) |
107 | { | 107 | { |
108 | sb.Append(m_stats.Report()); | 108 | sb.Append(m_stats.Report()); |
109 | } | 109 | } |
110 | 110 | ||
111 | m_log.Debug(sb); | 111 | m_log.Debug(sb); |
112 | } | 112 | } |
113 | 113 | ||
114 | /// <summary> | 114 | /// <summary> |
115 | /// Return a report about the uptime of this server | 115 | /// Return a report about the uptime of this server |
116 | /// </summary> | 116 | /// </summary> |
@@ -120,10 +120,10 @@ namespace OpenSim.Framework.Servers | |||
120 | StringBuilder sb = new StringBuilder(String.Format("Time now is {0}\n", DateTime.Now)); | 120 | StringBuilder sb = new StringBuilder(String.Format("Time now is {0}\n", DateTime.Now)); |
121 | sb.Append(String.Format("Server has been running since {0}, {1}\n", m_startuptime.DayOfWeek, m_startuptime)); | 121 | sb.Append(String.Format("Server has been running since {0}, {1}\n", m_startuptime.DayOfWeek, m_startuptime)); |
122 | sb.Append(String.Format("That is an elapsed time of {0}\n", DateTime.Now - m_startuptime)); | 122 | sb.Append(String.Format("That is an elapsed time of {0}\n", DateTime.Now - m_startuptime)); |
123 | 123 | ||
124 | return sb.ToString(); | 124 | return sb.ToString(); |
125 | } | 125 | } |
126 | 126 | ||
127 | /// <summary> | 127 | /// <summary> |
128 | /// Set the level of log notices being echoed to the console | 128 | /// Set the level of log notices being echoed to the console |
129 | /// </summary> | 129 | /// </summary> |
@@ -133,7 +133,7 @@ namespace OpenSim.Framework.Servers | |||
133 | ILoggerRepository repository = LogManager.GetRepository(); | 133 | ILoggerRepository repository = LogManager.GetRepository(); |
134 | IAppender[] appenders = repository.GetAppenders(); | 134 | IAppender[] appenders = repository.GetAppenders(); |
135 | OpenSimAppender consoleAppender = null; | 135 | OpenSimAppender consoleAppender = null; |
136 | 136 | ||
137 | foreach (IAppender appender in appenders) | 137 | foreach (IAppender appender in appenders) |
138 | { | 138 | { |
139 | if (appender.Name == "Console") | 139 | if (appender.Name == "Console") |
@@ -142,13 +142,13 @@ namespace OpenSim.Framework.Servers | |||
142 | break; | 142 | break; |
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | if (null == consoleAppender) | 146 | if (null == consoleAppender) |
147 | { | 147 | { |
148 | Notice("No appender named Console found (see the log4net config file for this executable)!"); | 148 | Notice("No appender named Console found (see the log4net config file for this executable)!"); |
149 | return; | 149 | return; |
150 | } | 150 | } |
151 | 151 | ||
152 | if (setParams.Length > 0) | 152 | if (setParams.Length > 0) |
153 | { | 153 | { |
154 | Level consoleLevel = repository.LevelMap[setParams[0]]; | 154 | Level consoleLevel = repository.LevelMap[setParams[0]]; |
@@ -160,12 +160,12 @@ namespace OpenSim.Framework.Servers | |||
160 | "{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF", | 160 | "{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF", |
161 | setParams[0])); | 161 | setParams[0])); |
162 | } | 162 | } |
163 | 163 | ||
164 | // If there is no threshold set then the threshold is effectively everything. | 164 | // If there is no threshold set then the threshold is effectively everything. |
165 | Level thresholdLevel | 165 | Level thresholdLevel |
166 | = (null != consoleAppender.Threshold ? consoleAppender.Threshold : log4net.Core.Level.All); | 166 | = (null != consoleAppender.Threshold ? consoleAppender.Threshold : log4net.Core.Level.All); |
167 | 167 | ||
168 | Notice(String.Format("Console log level is {0}", thresholdLevel)); | 168 | Notice(String.Format("Console log level is {0}", thresholdLevel)); |
169 | } | 169 | } |
170 | 170 | ||
171 | /// <summary> | 171 | /// <summary> |
@@ -203,7 +203,7 @@ namespace OpenSim.Framework.Servers | |||
203 | Notice(""); | 203 | Notice(""); |
204 | Notice("quit - equivalent to shutdown."); | 204 | Notice("quit - equivalent to shutdown."); |
205 | 205 | ||
206 | Notice("set log level [level] - change the console logging level only. For example, off or debug."); | 206 | Notice("set log level [level] - change the console logging level only. For example, off or debug."); |
207 | Notice("show info - show server information (e.g. startup path)."); | 207 | Notice("show info - show server information (e.g. startup path)."); |
208 | 208 | ||
209 | if (m_stats != null) | 209 | if (m_stats != null) |
@@ -219,7 +219,7 @@ namespace OpenSim.Framework.Servers | |||
219 | case "set": | 219 | case "set": |
220 | Set(cmdparams); | 220 | Set(cmdparams); |
221 | break; | 221 | break; |
222 | 222 | ||
223 | case "show": | 223 | case "show": |
224 | if (cmdparams.Length > 0) | 224 | if (cmdparams.Length > 0) |
225 | { | 225 | { |
@@ -232,8 +232,8 @@ namespace OpenSim.Framework.Servers | |||
232 | Shutdown(); | 232 | Shutdown(); |
233 | break; | 233 | break; |
234 | } | 234 | } |
235 | } | 235 | } |
236 | 236 | ||
237 | /// <summary> | 237 | /// <summary> |
238 | /// Set an OpenSim parameter | 238 | /// Set an OpenSim parameter |
239 | /// </summary> | 239 | /// </summary> |
@@ -245,15 +245,15 @@ namespace OpenSim.Framework.Servers | |||
245 | // Temporary while we only have one command which takes at least two parameters | 245 | // Temporary while we only have one command which takes at least two parameters |
246 | if (setArgs.Length < 2) | 246 | if (setArgs.Length < 2) |
247 | return; | 247 | return; |
248 | 248 | ||
249 | if (setArgs[0] == "log" && setArgs[1] == "level") | 249 | if (setArgs[0] == "log" && setArgs[1] == "level") |
250 | { | 250 | { |
251 | string[] setParams = new string[setArgs.Length - 2]; | 251 | string[] setParams = new string[setArgs.Length - 2]; |
252 | Array.Copy(setArgs, 2, setParams, 0, setArgs.Length - 2); | 252 | Array.Copy(setArgs, 2, setParams, 0, setArgs.Length - 2); |
253 | 253 | ||
254 | SetConsoleLogLevel(setParams); | 254 | SetConsoleLogLevel(setParams); |
255 | } | 255 | } |
256 | } | 256 | } |
257 | 257 | ||
258 | /// <summary> | 258 | /// <summary> |
259 | /// Outputs to the console information about the region | 259 | /// Outputs to the console information about the region |
@@ -276,7 +276,7 @@ namespace OpenSim.Framework.Servers | |||
276 | Notice(m_stats.Report()); | 276 | Notice(m_stats.Report()); |
277 | } | 277 | } |
278 | break; | 278 | break; |
279 | 279 | ||
280 | case "threads": | 280 | case "threads": |
281 | List<Thread> threads = ThreadTracker.GetThreads(); | 281 | List<Thread> threads = ThreadTracker.GetThreads(); |
282 | if (threads == null) | 282 | if (threads == null) |
@@ -291,7 +291,7 @@ namespace OpenSim.Framework.Servers | |||
291 | Notice("ID: " + t.ManagedThreadId.ToString() + ", Name: " + t.Name + ", Alive: " + t.IsAlive.ToString() + ", Pri: " + t.Priority.ToString() + ", State: " + t.ThreadState.ToString()); | 291 | Notice("ID: " + t.ManagedThreadId.ToString() + ", Name: " + t.Name + ", Alive: " + t.IsAlive.ToString() + ", Pri: " + t.Priority.ToString() + ", State: " + t.ThreadState.ToString()); |
292 | } | 292 | } |
293 | } | 293 | } |
294 | break; | 294 | break; |
295 | 295 | ||
296 | case "uptime": | 296 | case "uptime": |
297 | Notice(GetUptimeReport()); | 297 | Notice(GetUptimeReport()); |
@@ -301,7 +301,7 @@ namespace OpenSim.Framework.Servers | |||
301 | Notice("Version: " + m_version); | 301 | Notice("Version: " + m_version); |
302 | break; | 302 | break; |
303 | } | 303 | } |
304 | } | 304 | } |
305 | 305 | ||
306 | /// <summary> | 306 | /// <summary> |
307 | /// Console output is only possible if a console has been established. | 307 | /// Console output is only possible if a console has been established. |
diff --git a/OpenSim/Framework/Servers/OSHttpHandler.cs b/OpenSim/Framework/Servers/OSHttpHandler.cs index 66fff3e..838f29a 100644 --- a/OpenSim/Framework/Servers/OSHttpHandler.cs +++ b/OpenSim/Framework/Servers/OSHttpHandler.cs | |||
@@ -72,21 +72,21 @@ namespace OpenSim.Framework.Servers | |||
72 | /// Regular expression used to match against method of | 72 | /// Regular expression used to match against method of |
73 | /// the incoming HTTP request. If you want to match any string | 73 | /// the incoming HTTP request. If you want to match any string |
74 | /// either use '.*' or null. To match on the empty string use | 74 | /// either use '.*' or null. To match on the empty string use |
75 | /// '^$'. | 75 | /// '^$'. |
76 | /// </summary> | 76 | /// </summary> |
77 | public virtual Regex Method | 77 | public virtual Regex Method |
78 | { | 78 | { |
79 | get { return _method; } | 79 | get { return _method; } |
80 | } | 80 | } |
81 | protected Regex _method; | 81 | protected Regex _method; |
82 | 82 | ||
83 | /// <summary> | 83 | /// <summary> |
84 | /// Regular expression used to match against path of the | 84 | /// Regular expression used to match against path of the |
85 | /// incoming HTTP request. If you want to match any string | 85 | /// incoming HTTP request. If you want to match any string |
86 | /// either use '.*' or null. To match on the emtpy string use | 86 | /// either use '.*' or null. To match on the emtpy string use |
87 | /// '^$'. | 87 | /// '^$'. |
88 | /// </summary> | 88 | /// </summary> |
89 | public virtual Regex Path | 89 | public virtual Regex Path |
90 | { | 90 | { |
91 | get { return _path; } | 91 | get { return _path; } |
92 | } | 92 | } |
@@ -97,7 +97,7 @@ namespace OpenSim.Framework.Servers | |||
97 | /// allowing us to match on URI query fields. | 97 | /// allowing us to match on URI query fields. |
98 | /// </summary> | 98 | /// </summary> |
99 | public virtual Dictionary<string, Regex> Query | 99 | public virtual Dictionary<string, Regex> Query |
100 | { | 100 | { |
101 | get { return _query; } | 101 | get { return _query; } |
102 | } | 102 | } |
103 | protected Dictionary<string, Regex> _query; | 103 | protected Dictionary<string, Regex> _query; |
@@ -107,7 +107,7 @@ namespace OpenSim.Framework.Servers | |||
107 | /// allowing us to match on HTTP header fields. | 107 | /// allowing us to match on HTTP header fields. |
108 | /// </summary> | 108 | /// </summary> |
109 | public virtual Dictionary<string, Regex> Headers | 109 | public virtual Dictionary<string, Regex> Headers |
110 | { | 110 | { |
111 | get { return _headers; } | 111 | get { return _headers; } |
112 | } | 112 | } |
113 | protected Dictionary<string, Regex> _headers; | 113 | protected Dictionary<string, Regex> _headers; |
@@ -137,7 +137,7 @@ namespace OpenSim.Framework.Servers | |||
137 | /// <param name="contentType">null or content type | 137 | /// <param name="contentType">null or content type |
138 | /// regex</param> | 138 | /// regex</param> |
139 | /// <param name="whitelist">null or IP address regex</param> | 139 | /// <param name="whitelist">null or IP address regex</param> |
140 | public OSHttpHandler(Regex method, Regex path, Dictionary<string, Regex> query, | 140 | public OSHttpHandler(Regex method, Regex path, Dictionary<string, Regex> query, |
141 | Dictionary<string, Regex> headers, Regex contentType, Regex whitelist) | 141 | Dictionary<string, Regex> headers, Regex contentType, Regex whitelist) |
142 | { | 142 | { |
143 | _method = method; | 143 | _method = method; |
@@ -155,7 +155,7 @@ namespace OpenSim.Framework.Servers | |||
155 | 155 | ||
156 | /// <summary> | 156 | /// <summary> |
157 | /// Process an incoming OSHttpRequest that matched our | 157 | /// Process an incoming OSHttpRequest that matched our |
158 | /// requirements. | 158 | /// requirements. |
159 | /// </summary> | 159 | /// </summary> |
160 | /// <returns> | 160 | /// <returns> |
161 | /// OSHttpHandlerResult.Pass if we are after all not | 161 | /// OSHttpHandlerResult.Pass if we are after all not |
@@ -180,4 +180,4 @@ namespace OpenSim.Framework.Servers | |||
180 | return sw.ToString(); | 180 | return sw.ToString(); |
181 | } | 181 | } |
182 | } | 182 | } |
183 | } \ No newline at end of file | 183 | } |
diff --git a/OpenSim/Framework/Servers/OSHttpHttpHandler.cs b/OpenSim/Framework/Servers/OSHttpHttpHandler.cs index 66120c3..e08df85 100644 --- a/OpenSim/Framework/Servers/OSHttpHttpHandler.cs +++ b/OpenSim/Framework/Servers/OSHttpHttpHandler.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Framework.Servers | |||
58 | /// <param name="headers">null or dictionary with header | 58 | /// <param name="headers">null or dictionary with header |
59 | /// regexs</param> | 59 | /// regexs</param> |
60 | /// <param name="whitelist">null or IP address whitelist</param> | 60 | /// <param name="whitelist">null or IP address whitelist</param> |
61 | public OSHttpHttpHandler(GenericHTTPMethod handler, Regex method, Regex path, | 61 | public OSHttpHttpHandler(GenericHTTPMethod handler, Regex method, Regex path, |
62 | Dictionary<string, Regex> query, | 62 | Dictionary<string, Regex> query, |
63 | Dictionary<string, Regex> headers, Regex whitelist) | 63 | Dictionary<string, Regex> headers, Regex whitelist) |
64 | : base(method, path, query, headers, new Regex(@"^text/html", RegexOptions.IgnoreCase | RegexOptions.Compiled), | 64 | : base(method, path, query, headers, new Regex(@"^text/html", RegexOptions.IgnoreCase | RegexOptions.Compiled), |
@@ -71,7 +71,7 @@ namespace OpenSim.Framework.Servers | |||
71 | /// Instantiate an HTTP handler. | 71 | /// Instantiate an HTTP handler. |
72 | /// </summary> | 72 | /// </summary> |
73 | /// <param name="handler">a GenericHTTPMethod</param> | 73 | /// <param name="handler">a GenericHTTPMethod</param> |
74 | public OSHttpHttpHandler(GenericHTTPMethod handler) | 74 | public OSHttpHttpHandler(GenericHTTPMethod handler) |
75 | : this(handler, new Regex(@"^GET$", RegexOptions.IgnoreCase | RegexOptions.Compiled), null, null, null, null) | 75 | : this(handler, new Regex(@"^GET$", RegexOptions.IgnoreCase | RegexOptions.Compiled), null, null, null, null) |
76 | { | 76 | { |
77 | } | 77 | } |
@@ -79,7 +79,7 @@ namespace OpenSim.Framework.Servers | |||
79 | /// <summary> | 79 | /// <summary> |
80 | /// Invoked by OSHttpRequestPump. | 80 | /// Invoked by OSHttpRequestPump. |
81 | /// </summary> | 81 | /// </summary> |
82 | public override OSHttpHandlerResult Process(OSHttpRequest request) | 82 | public override OSHttpHandlerResult Process(OSHttpRequest request) |
83 | { | 83 | { |
84 | // call handler method | 84 | // call handler method |
85 | Hashtable responseData = _handler(request.Query); | 85 | Hashtable responseData = _handler(request.Query); |
@@ -110,7 +110,7 @@ namespace OpenSim.Framework.Servers | |||
110 | } | 110 | } |
111 | 111 | ||
112 | response.AddHeader("Content-type", contentType); | 112 | response.AddHeader("Content-type", contentType); |
113 | 113 | ||
114 | byte[] buffer; | 114 | byte[] buffer; |
115 | 115 | ||
116 | if (!contentType.Contains("image")) | 116 | if (!contentType.Contains("image")) |
@@ -142,4 +142,4 @@ namespace OpenSim.Framework.Servers | |||
142 | return OSHttpHandlerResult.Done; | 142 | return OSHttpHandlerResult.Done; |
143 | } | 143 | } |
144 | } | 144 | } |
145 | } \ No newline at end of file | 145 | } |
diff --git a/OpenSim/Framework/Servers/OSHttpRequest.cs b/OpenSim/Framework/Servers/OSHttpRequest.cs index 0a82a04..01e71c8 100644 --- a/OpenSim/Framework/Servers/OSHttpRequest.cs +++ b/OpenSim/Framework/Servers/OSHttpRequest.cs | |||
@@ -38,42 +38,35 @@ namespace OpenSim.Framework.Servers | |||
38 | { | 38 | { |
39 | public class OSHttpRequest | 39 | public class OSHttpRequest |
40 | { | 40 | { |
41 | |||
42 | |||
43 | public string[] AcceptTypes | 41 | public string[] AcceptTypes |
44 | { | 42 | { |
45 | get { return _acceptTypes; } | 43 | get { return _acceptTypes; } |
46 | } | 44 | } |
47 | private string[] _acceptTypes; | 45 | private string[] _acceptTypes; |
48 | 46 | ||
49 | |||
50 | public Encoding ContentEncoding | 47 | public Encoding ContentEncoding |
51 | { | 48 | { |
52 | get { return _contentEncoding; } | 49 | get { return _contentEncoding; } |
53 | } | 50 | } |
54 | private Encoding _contentEncoding; | 51 | private Encoding _contentEncoding; |
55 | 52 | ||
56 | |||
57 | public long ContentLength | 53 | public long ContentLength |
58 | { | 54 | { |
59 | get { return _contentLength64; } | 55 | get { return _contentLength64; } |
60 | } | 56 | } |
61 | private long _contentLength64; | 57 | private long _contentLength64; |
62 | 58 | ||
63 | |||
64 | public long ContentLength64 | 59 | public long ContentLength64 |
65 | { | 60 | { |
66 | get { return ContentLength; } | 61 | get { return ContentLength; } |
67 | } | 62 | } |
68 | 63 | ||
69 | |||
70 | public string ContentType | 64 | public string ContentType |
71 | { | 65 | { |
72 | get { return _contentType; } | 66 | get { return _contentType; } |
73 | } | 67 | } |
74 | private string _contentType; | 68 | private string _contentType; |
75 | 69 | ||
76 | |||
77 | // public CookieCollection Cookies | 70 | // public CookieCollection Cookies |
78 | // { | 71 | // { |
79 | // get { return _cookies; } | 72 | // get { return _cookies; } |
@@ -92,63 +85,54 @@ namespace OpenSim.Framework.Servers | |||
92 | } | 85 | } |
93 | private string _httpMethod; | 86 | private string _httpMethod; |
94 | 87 | ||
95 | |||
96 | public Stream InputStream | 88 | public Stream InputStream |
97 | { | 89 | { |
98 | get { return _inputStream; } | 90 | get { return _inputStream; } |
99 | } | 91 | } |
100 | private Stream _inputStream; | 92 | private Stream _inputStream; |
101 | 93 | ||
102 | |||
103 | // public bool IsSecureConnection | 94 | // public bool IsSecureConnection |
104 | // { | 95 | // { |
105 | // get { return _isSecureConnection; } | 96 | // get { return _isSecureConnection; } |
106 | // } | 97 | // } |
107 | // private bool _isSecureConnection; | 98 | // private bool _isSecureConnection; |
108 | 99 | ||
109 | |||
110 | // public bool IsAuthenticated | 100 | // public bool IsAuthenticated |
111 | // { | 101 | // { |
112 | // get { return _isAuthenticated; } | 102 | // get { return _isAuthenticated; } |
113 | // } | 103 | // } |
114 | // private bool _isAuthenticated; | 104 | // private bool _isAuthenticated; |
115 | 105 | ||
116 | |||
117 | public bool HasEntityBody | 106 | public bool HasEntityBody |
118 | { | 107 | { |
119 | get { return _hasbody; } | 108 | get { return _hasbody; } |
120 | } | 109 | } |
121 | private bool _hasbody; | 110 | private bool _hasbody; |
122 | 111 | ||
123 | |||
124 | public bool KeepAlive | 112 | public bool KeepAlive |
125 | { | 113 | { |
126 | get { return _keepAlive; } | 114 | get { return _keepAlive; } |
127 | } | 115 | } |
128 | private bool _keepAlive; | 116 | private bool _keepAlive; |
129 | 117 | ||
130 | |||
131 | public string RawUrl | 118 | public string RawUrl |
132 | { | 119 | { |
133 | get { return _rawUrl; } | 120 | get { return _rawUrl; } |
134 | } | 121 | } |
135 | private string _rawUrl; | 122 | private string _rawUrl; |
136 | 123 | ||
137 | |||
138 | public Uri Url | 124 | public Uri Url |
139 | { | 125 | { |
140 | get { return _url; } | 126 | get { return _url; } |
141 | } | 127 | } |
142 | private Uri _url; | 128 | private Uri _url; |
143 | 129 | ||
144 | |||
145 | public string UserAgent | 130 | public string UserAgent |
146 | { | 131 | { |
147 | get { return _userAgent; } | 132 | get { return _userAgent; } |
148 | } | 133 | } |
149 | private string _userAgent; | 134 | private string _userAgent; |
150 | 135 | ||
151 | |||
152 | public NameValueCollection QueryString | 136 | public NameValueCollection QueryString |
153 | { | 137 | { |
154 | get { return _queryString; } | 138 | get { return _queryString; } |
@@ -161,28 +145,24 @@ namespace OpenSim.Framework.Servers | |||
161 | } | 145 | } |
162 | private Hashtable _query; | 146 | private Hashtable _query; |
163 | 147 | ||
164 | |||
165 | public IPEndPoint RemoteIPEndPoint | 148 | public IPEndPoint RemoteIPEndPoint |
166 | { | 149 | { |
167 | get { return _ipEndPoint; } | 150 | get { return _ipEndPoint; } |
168 | } | 151 | } |
169 | private IPEndPoint _ipEndPoint; | 152 | private IPEndPoint _ipEndPoint; |
170 | 153 | ||
171 | |||
172 | internal HttpRequest HttpRequest | 154 | internal HttpRequest HttpRequest |
173 | { | 155 | { |
174 | get { return _request; } | 156 | get { return _request; } |
175 | } | 157 | } |
176 | private HttpRequest _request; | 158 | private HttpRequest _request; |
177 | 159 | ||
178 | |||
179 | internal HttpClientContext HttpClientContext | 160 | internal HttpClientContext HttpClientContext |
180 | { | 161 | { |
181 | get { return _context; } | 162 | get { return _context; } |
182 | } | 163 | } |
183 | private HttpClientContext _context; | 164 | private HttpClientContext _context; |
184 | 165 | ||
185 | |||
186 | /// <summary> | 166 | /// <summary> |
187 | /// Internal whiteboard for handlers to store temporary stuff | 167 | /// Internal whiteboard for handlers to store temporary stuff |
188 | /// into. | 168 | /// into. |
@@ -193,12 +173,10 @@ namespace OpenSim.Framework.Servers | |||
193 | } | 173 | } |
194 | private Dictionary<string, object> _whiteboard = new Dictionary<string, object>(); | 174 | private Dictionary<string, object> _whiteboard = new Dictionary<string, object>(); |
195 | 175 | ||
196 | |||
197 | public OSHttpRequest() | 176 | public OSHttpRequest() |
198 | { | 177 | { |
199 | } | 178 | } |
200 | 179 | ||
201 | |||
202 | public OSHttpRequest(HttpListenerRequest req) | 180 | public OSHttpRequest(HttpListenerRequest req) |
203 | { | 181 | { |
204 | _acceptTypes = req.AcceptTypes; | 182 | _acceptTypes = req.AcceptTypes; |
diff --git a/OpenSim/Framework/Servers/OSHttpRequestPump.cs b/OpenSim/Framework/Servers/OSHttpRequestPump.cs index 8d4dc0d..b4270b3 100644 --- a/OpenSim/Framework/Servers/OSHttpRequestPump.cs +++ b/OpenSim/Framework/Servers/OSHttpRequestPump.cs | |||
@@ -39,7 +39,6 @@ using System.Threading; | |||
39 | using log4net; | 39 | using log4net; |
40 | using HttpServer; | 40 | using HttpServer; |
41 | 41 | ||
42 | |||
43 | namespace OpenSim.Framework.Servers | 42 | namespace OpenSim.Framework.Servers |
44 | { | 43 | { |
45 | /// <summary> | 44 | /// <summary> |
@@ -58,13 +57,12 @@ namespace OpenSim.Framework.Servers | |||
58 | protected Thread _engine; | 57 | protected Thread _engine; |
59 | 58 | ||
60 | private int _id; | 59 | private int _id; |
61 | 60 | ||
62 | public string EngineID | 61 | public string EngineID |
63 | { | 62 | { |
64 | get { return String.Format("{0} pump {1}", _server.EngineID, _id); } | 63 | get { return String.Format("{0} pump {1}", _server.EngineID, _id); } |
65 | } | 64 | } |
66 | 65 | ||
67 | |||
68 | public OSHttpRequestPump(OSHttpServer server, OSHttpRequestQueue queue, int id) | 66 | public OSHttpRequestPump(OSHttpServer server, OSHttpRequestQueue queue, int id) |
69 | { | 67 | { |
70 | _server = server; | 68 | _server = server; |
@@ -77,7 +75,6 @@ namespace OpenSim.Framework.Servers | |||
77 | _engine.Start(); | 75 | _engine.Start(); |
78 | 76 | ||
79 | ThreadTracker.Add(_engine); | 77 | ThreadTracker.Add(_engine); |
80 | |||
81 | } | 78 | } |
82 | 79 | ||
83 | public static OSHttpRequestPump[] Pumps(OSHttpServer server, OSHttpRequestQueue queue, int poolSize) | 80 | public static OSHttpRequestPump[] Pumps(OSHttpServer server, OSHttpRequestQueue queue, int poolSize) |
@@ -104,21 +101,22 @@ namespace OpenSim.Framework.Servers | |||
104 | public void Engine() | 101 | public void Engine() |
105 | { | 102 | { |
106 | OSHttpRequest req = null; | 103 | OSHttpRequest req = null; |
107 | 104 | ||
108 | while (true) | 105 | while (true) |
109 | { | 106 | { |
110 | try { | 107 | try |
108 | { | ||
111 | // dequeue an OSHttpRequest from OSHttpServer's | 109 | // dequeue an OSHttpRequest from OSHttpServer's |
112 | // request queue | 110 | // request queue |
113 | req = _queue.Dequeue(); | 111 | req = _queue.Dequeue(); |
114 | 112 | ||
115 | // get a copy of the list of registered handlers | 113 | // get a copy of the list of registered handlers |
116 | List<OSHttpHandler> handlers = _server.OSHttpHandlers; | 114 | List<OSHttpHandler> handlers = _server.OSHttpHandlers; |
117 | 115 | ||
118 | // prune list and have it sorted from most | 116 | // prune list and have it sorted from most |
119 | // specific to least specific | 117 | // specific to least specific |
120 | handlers = MatchHandlers(req, handlers); | 118 | handlers = MatchHandlers(req, handlers); |
121 | 119 | ||
122 | // process req: we try each handler in turn until | 120 | // process req: we try each handler in turn until |
123 | // we are either out of handlers or get back a | 121 | // we are either out of handlers or get back a |
124 | // Pass or Done | 122 | // Pass or Done |
@@ -126,18 +124,18 @@ namespace OpenSim.Framework.Servers | |||
126 | foreach (OSHttpHandler h in handlers) | 124 | foreach (OSHttpHandler h in handlers) |
127 | { | 125 | { |
128 | rc = h.Process(req); | 126 | rc = h.Process(req); |
129 | 127 | ||
130 | // Pass: handler did not process the request, | 128 | // Pass: handler did not process the request, |
131 | // try next handler | 129 | // try next handler |
132 | if (OSHttpHandlerResult.Pass == rc) continue; | 130 | if (OSHttpHandlerResult.Pass == rc) continue; |
133 | 131 | ||
134 | // Handled: handler has processed the request | 132 | // Handled: handler has processed the request |
135 | if (OSHttpHandlerResult.Done == rc) break; | 133 | if (OSHttpHandlerResult.Done == rc) break; |
136 | 134 | ||
137 | // hmm, something went wrong | 135 | // hmm, something went wrong |
138 | throw new Exception(String.Format("[{0}] got unexpected OSHttpHandlerResult {1}", EngineID, rc)); | 136 | throw new Exception(String.Format("[{0}] got unexpected OSHttpHandlerResult {1}", EngineID, rc)); |
139 | } | 137 | } |
140 | 138 | ||
141 | if (OSHttpHandlerResult.Unprocessed == rc) | 139 | if (OSHttpHandlerResult.Unprocessed == rc) |
142 | { | 140 | { |
143 | _log.InfoFormat("[{0}] OSHttpHandler: no handler registered for {1}", EngineID, req); | 141 | _log.InfoFormat("[{0}] OSHttpHandler: no handler registered for {1}", EngineID, req); |
@@ -190,7 +188,7 @@ namespace OpenSim.Framework.Servers | |||
190 | if (null != remote) | 188 | if (null != remote) |
191 | { | 189 | { |
192 | Match epm = h.IPEndPointWhitelist.Match(remote.ToString()); | 190 | Match epm = h.IPEndPointWhitelist.Match(remote.ToString()); |
193 | if (!epm.Success) | 191 | if (!epm.Success) |
194 | { | 192 | { |
195 | scoredHandlers.Remove(h); | 193 | scoredHandlers.Remove(h); |
196 | continue; | 194 | continue; |
@@ -201,7 +199,7 @@ namespace OpenSim.Framework.Servers | |||
201 | if (null != h.Method) | 199 | if (null != h.Method) |
202 | { | 200 | { |
203 | Match m = h.Method.Match(req.HttpMethod); | 201 | Match m = h.Method.Match(req.HttpMethod); |
204 | if (!m.Success) | 202 | if (!m.Success) |
205 | { | 203 | { |
206 | scoredHandlers.Remove(h); | 204 | scoredHandlers.Remove(h); |
207 | continue; | 205 | continue; |
@@ -213,7 +211,7 @@ namespace OpenSim.Framework.Servers | |||
213 | if (null != h.Path) | 211 | if (null != h.Path) |
214 | { | 212 | { |
215 | Match m = h.Path.Match(req.RawUrl); | 213 | Match m = h.Path.Match(req.RawUrl); |
216 | if (!m.Success) | 214 | if (!m.Success) |
217 | { | 215 | { |
218 | scoredHandlers.Remove(h); | 216 | scoredHandlers.Remove(h); |
219 | continue; | 217 | continue; |
@@ -272,14 +270,15 @@ namespace OpenSim.Framework.Servers | |||
272 | { | 270 | { |
273 | return 0; | 271 | return 0; |
274 | } | 272 | } |
275 | 273 | ||
276 | // does the content of collection[tag] match | 274 | // does the content of collection[tag] match |
277 | // the supplied regex? | 275 | // the supplied regex? |
278 | Match cm = regexs[tag].Match(collection[tag]); | 276 | Match cm = regexs[tag].Match(collection[tag]); |
279 | if (!cm.Success) { | 277 | if (!cm.Success) |
278 | { | ||
280 | return 0; | 279 | return 0; |
281 | } | 280 | } |
282 | 281 | ||
283 | // ok: matches | 282 | // ok: matches |
284 | matched++; | 283 | matched++; |
285 | continue; | 284 | continue; |
@@ -288,7 +287,7 @@ namespace OpenSim.Framework.Servers | |||
288 | return matched; | 287 | return matched; |
289 | } | 288 | } |
290 | 289 | ||
291 | [ConditionalAttribute("DEBUGGING")] | 290 | [ConditionalAttribute("DEBUGGING")] |
292 | private void LogDumpHandlerList(List<OSHttpHandler> l) | 291 | private void LogDumpHandlerList(List<OSHttpHandler> l) |
293 | { | 292 | { |
294 | _log.DebugFormat("[{0}] OSHttpHandlerList dump:", EngineID); | 293 | _log.DebugFormat("[{0}] OSHttpHandlerList dump:", EngineID); |
diff --git a/OpenSim/Framework/Servers/OSHttpRequestQueue.cs b/OpenSim/Framework/Servers/OSHttpRequestQueue.cs index f6f1829..94f7b32 100644 --- a/OpenSim/Framework/Servers/OSHttpRequestQueue.cs +++ b/OpenSim/Framework/Servers/OSHttpRequestQueue.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Framework.Servers | |||
40 | { | 40 | { |
41 | private object _syncObject = new object(); | 41 | private object _syncObject = new object(); |
42 | 42 | ||
43 | new public void Enqueue(OSHttpRequest req) | 43 | new public void Enqueue(OSHttpRequest req) |
44 | { | 44 | { |
45 | lock (_syncObject) | 45 | lock (_syncObject) |
46 | { | 46 | { |
@@ -48,7 +48,7 @@ namespace OpenSim.Framework.Servers | |||
48 | Monitor.Pulse(_syncObject); | 48 | Monitor.Pulse(_syncObject); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | new public OSHttpRequest Dequeue() | 52 | new public OSHttpRequest Dequeue() |
53 | { | 53 | { |
54 | OSHttpRequest req = null; | 54 | OSHttpRequest req = null; |
@@ -65,4 +65,4 @@ namespace OpenSim.Framework.Servers | |||
65 | return req; | 65 | return req; |
66 | } | 66 | } |
67 | } | 67 | } |
68 | } \ No newline at end of file | 68 | } |
diff --git a/OpenSim/Framework/Servers/OSHttpResponse.cs b/OpenSim/Framework/Servers/OSHttpResponse.cs index eb7e400..21d1e2b 100644 --- a/OpenSim/Framework/Servers/OSHttpResponse.cs +++ b/OpenSim/Framework/Servers/OSHttpResponse.cs | |||
@@ -56,15 +56,15 @@ namespace OpenSim.Framework.Servers | |||
56 | /// </summary> | 56 | /// </summary> |
57 | /// <remarks> | 57 | /// <remarks> |
58 | /// Setting this property will also set IsContentTypeSet to | 58 | /// Setting this property will also set IsContentTypeSet to |
59 | /// true. | 59 | /// true. |
60 | /// </remarks> | 60 | /// </remarks> |
61 | public string ContentType | 61 | public string ContentType |
62 | { | 62 | { |
63 | get | 63 | get |
64 | { | 64 | { |
65 | if (HttpServer) | 65 | if (HttpServer) |
66 | return _httpResponse.ContentType; | 66 | return _httpResponse.ContentType; |
67 | else | 67 | else |
68 | return _httpListenerResponse.ContentType; | 68 | return _httpListenerResponse.ContentType; |
69 | } | 69 | } |
70 | set | 70 | set |
@@ -100,11 +100,11 @@ namespace OpenSim.Framework.Servers | |||
100 | /// </summary> | 100 | /// </summary> |
101 | public long ContentLength | 101 | public long ContentLength |
102 | { | 102 | { |
103 | get | 103 | get |
104 | { | 104 | { |
105 | if (HttpServer) | 105 | if (HttpServer) |
106 | return _httpResponse.ContentLength; | 106 | return _httpResponse.ContentLength; |
107 | else | 107 | else |
108 | return _httpListenerResponse.ContentLength64; | 108 | return _httpListenerResponse.ContentLength64; |
109 | } | 109 | } |
110 | set | 110 | set |
@@ -130,11 +130,11 @@ namespace OpenSim.Framework.Servers | |||
130 | /// </summary> | 130 | /// </summary> |
131 | public Encoding ContentEncoding | 131 | public Encoding ContentEncoding |
132 | { | 132 | { |
133 | get | 133 | get |
134 | { | 134 | { |
135 | if (HttpServer) | 135 | if (HttpServer) |
136 | return _httpResponse.Encoding; | 136 | return _httpResponse.Encoding; |
137 | else | 137 | else |
138 | return _httpListenerResponse.ContentEncoding; | 138 | return _httpListenerResponse.ContentEncoding; |
139 | } | 139 | } |
140 | 140 | ||
@@ -142,7 +142,7 @@ namespace OpenSim.Framework.Servers | |||
142 | { | 142 | { |
143 | if (HttpServer) | 143 | if (HttpServer) |
144 | _httpResponse.Encoding = value; | 144 | _httpResponse.Encoding = value; |
145 | else | 145 | else |
146 | _httpListenerResponse.ContentEncoding = value; | 146 | _httpListenerResponse.ContentEncoding = value; |
147 | } | 147 | } |
148 | } | 148 | } |
@@ -152,8 +152,8 @@ namespace OpenSim.Framework.Servers | |||
152 | /// </summary> | 152 | /// </summary> |
153 | public WebHeaderCollection Headers | 153 | public WebHeaderCollection Headers |
154 | { | 154 | { |
155 | get | 155 | get |
156 | { | 156 | { |
157 | if (HttpServer) | 157 | if (HttpServer) |
158 | return null; | 158 | return null; |
159 | else | 159 | else |
@@ -166,10 +166,10 @@ namespace OpenSim.Framework.Servers | |||
166 | /// </summary> | 166 | /// </summary> |
167 | public bool KeepAlive | 167 | public bool KeepAlive |
168 | { | 168 | { |
169 | get | 169 | get |
170 | { | 170 | { |
171 | if (HttpServer) | 171 | if (HttpServer) |
172 | return _httpResponse.Connection == ConnectionType.KeepAlive; | 172 | return _httpResponse.Connection == ConnectionType.KeepAlive; |
173 | else | 173 | else |
174 | return _httpListenerResponse.KeepAlive; | 174 | return _httpListenerResponse.KeepAlive; |
175 | } | 175 | } |
@@ -178,7 +178,7 @@ namespace OpenSim.Framework.Servers | |||
178 | { | 178 | { |
179 | if (HttpServer) | 179 | if (HttpServer) |
180 | _httpResponse.Connection = ConnectionType.KeepAlive; | 180 | _httpResponse.Connection = ConnectionType.KeepAlive; |
181 | else | 181 | else |
182 | _httpListenerResponse.KeepAlive = value; | 182 | _httpListenerResponse.KeepAlive = value; |
183 | } | 183 | } |
184 | } | 184 | } |
@@ -191,8 +191,8 @@ namespace OpenSim.Framework.Servers | |||
191 | /// </remarks> | 191 | /// </remarks> |
192 | public Stream OutputStream | 192 | public Stream OutputStream |
193 | { | 193 | { |
194 | get | 194 | get |
195 | { | 195 | { |
196 | if (HttpServer) | 196 | if (HttpServer) |
197 | return _httpResponse.Body; | 197 | return _httpResponse.Body; |
198 | else | 198 | else |
@@ -205,10 +205,10 @@ namespace OpenSim.Framework.Servers | |||
205 | /// </summary> | 205 | /// </summary> |
206 | public Stream Body | 206 | public Stream Body |
207 | { | 207 | { |
208 | get | 208 | get |
209 | { | 209 | { |
210 | if (HttpServer) | 210 | if (HttpServer) |
211 | return _httpResponse.Body; | 211 | return _httpResponse.Body; |
212 | throw new Exception("[OSHttpResponse] mixed .NET and HttpServer access"); | 212 | throw new Exception("[OSHttpResponse] mixed .NET and HttpServer access"); |
213 | } | 213 | } |
214 | } | 214 | } |
@@ -228,18 +228,18 @@ namespace OpenSim.Framework.Servers | |||
228 | } | 228 | } |
229 | } | 229 | } |
230 | 230 | ||
231 | 231 | ||
232 | /// <summary> | 232 | /// <summary> |
233 | /// Chunk transfers. | 233 | /// Chunk transfers. |
234 | /// </summary> | 234 | /// </summary> |
235 | public bool SendChunked | 235 | public bool SendChunked |
236 | { | 236 | { |
237 | get | 237 | get |
238 | { | 238 | { |
239 | if (HttpServer) | 239 | if (HttpServer) |
240 | return _httpResponse.Chunked; | 240 | return _httpResponse.Chunked; |
241 | else | 241 | else |
242 | return _httpListenerResponse.SendChunked; | 242 | return _httpListenerResponse.SendChunked; |
243 | } | 243 | } |
244 | 244 | ||
245 | set | 245 | set |
@@ -256,12 +256,12 @@ namespace OpenSim.Framework.Servers | |||
256 | /// </summary> | 256 | /// </summary> |
257 | public int StatusCode | 257 | public int StatusCode |
258 | { | 258 | { |
259 | get | 259 | get |
260 | { | 260 | { |
261 | if (HttpServer) | 261 | if (HttpServer) |
262 | return (int)_httpResponse.Status; | 262 | return (int)_httpResponse.Status; |
263 | else | 263 | else |
264 | return _httpListenerResponse.StatusCode; | 264 | return _httpListenerResponse.StatusCode; |
265 | } | 265 | } |
266 | 266 | ||
267 | set | 267 | set |
@@ -279,12 +279,12 @@ namespace OpenSim.Framework.Servers | |||
279 | /// </summary> | 279 | /// </summary> |
280 | public string StatusDescription | 280 | public string StatusDescription |
281 | { | 281 | { |
282 | get | 282 | get |
283 | { | 283 | { |
284 | if (HttpServer) | 284 | if (HttpServer) |
285 | return _httpResponse.Reason; | 285 | return _httpResponse.Reason; |
286 | else | 286 | else |
287 | return _httpListenerResponse.StatusDescription; | 287 | return _httpListenerResponse.StatusDescription; |
288 | } | 288 | } |
289 | 289 | ||
290 | set | 290 | set |
@@ -331,7 +331,7 @@ namespace OpenSim.Framework.Servers | |||
331 | /// object. | 331 | /// object. |
332 | /// </summary | 332 | /// </summary |
333 | /// <param name="req">Incoming OSHttpRequest to which we are | 333 | /// <param name="req">Incoming OSHttpRequest to which we are |
334 | /// replying</param> | 334 | /// replying</param> |
335 | public OSHttpResponse(OSHttpRequest req) | 335 | public OSHttpResponse(OSHttpRequest req) |
336 | { | 336 | { |
337 | _httpResponse = new HttpResponse(req.HttpClientContext, req.HttpRequest); | 337 | _httpResponse = new HttpResponse(req.HttpClientContext, req.HttpRequest); |
@@ -343,7 +343,7 @@ namespace OpenSim.Framework.Servers | |||
343 | /// <param name="key">string containing the header field | 343 | /// <param name="key">string containing the header field |
344 | /// name</param> | 344 | /// name</param> |
345 | /// <param name="value">string containing the header field | 345 | /// <param name="value">string containing the header field |
346 | /// value</param> | 346 | /// value</param> |
347 | public void AddHeader(string key, string value) | 347 | public void AddHeader(string key, string value) |
348 | { | 348 | { |
349 | if (HttpServer) | 349 | if (HttpServer) |
@@ -361,8 +361,8 @@ namespace OpenSim.Framework.Servers | |||
361 | { | 361 | { |
362 | _httpResponse.Body.Flush(); | 362 | _httpResponse.Body.Flush(); |
363 | _httpResponse.Send(); | 363 | _httpResponse.Send(); |
364 | } | 364 | } |
365 | else | 365 | else |
366 | { | 366 | { |
367 | OutputStream.Close(); | 367 | OutputStream.Close(); |
368 | } | 368 | } |
diff --git a/OpenSim/Framework/Servers/OSHttpServer.cs b/OpenSim/Framework/Servers/OSHttpServer.cs index e0d26ff..40f4229 100644 --- a/OpenSim/Framework/Servers/OSHttpServer.cs +++ b/OpenSim/Framework/Servers/OSHttpServer.cs | |||
@@ -80,7 +80,7 @@ namespace OpenSim.Framework.Servers | |||
80 | get { return _isSecure; } | 80 | get { return _isSecure; } |
81 | } | 81 | } |
82 | 82 | ||
83 | public int QueueSize | 83 | public int QueueSize |
84 | { | 84 | { |
85 | get { return _pumps.Length; } | 85 | get { return _pumps.Length; } |
86 | } | 86 | } |
@@ -91,7 +91,7 @@ namespace OpenSim.Framework.Servers | |||
91 | protected List<OSHttpHandler> _httpHandlers = new List<OSHttpHandler>(); | 91 | protected List<OSHttpHandler> _httpHandlers = new List<OSHttpHandler>(); |
92 | public List<OSHttpHandler> OSHttpHandlers | 92 | public List<OSHttpHandler> OSHttpHandlers |
93 | { | 93 | { |
94 | get | 94 | get |
95 | { | 95 | { |
96 | lock (_httpHandlers) | 96 | lock (_httpHandlers) |
97 | { | 97 | { |
@@ -175,7 +175,7 @@ namespace OpenSim.Framework.Servers | |||
175 | _listener.RequestHandler += OnHttpRequest; | 175 | _listener.RequestHandler += OnHttpRequest; |
176 | _listener.Start(QueueSize); | 176 | _listener.Start(QueueSize); |
177 | _log.InfoFormat("[{0}] HTTP server started", EngineID); | 177 | _log.InfoFormat("[{0}] HTTP server started", EngineID); |
178 | 178 | ||
179 | lock (_syncObject) Monitor.Wait(_syncObject); | 179 | lock (_syncObject) Monitor.Wait(_syncObject); |
180 | } | 180 | } |
181 | catch (Exception ex) | 181 | catch (Exception ex) |
@@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers | |||
196 | /// and regular expressions to match against header values</param> | 196 | /// and regular expressions to match against header values</param> |
197 | public void AddHandler(OSHttpHandler handler) | 197 | public void AddHandler(OSHttpHandler handler) |
198 | { | 198 | { |
199 | lock (_httpHandlers) | 199 | lock (_httpHandlers) |
200 | { | 200 | { |
201 | if (_httpHandlers.Contains(handler)) | 201 | if (_httpHandlers.Contains(handler)) |
202 | { | 202 | { |
diff --git a/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs b/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs index f3f056a..996e5dc 100644 --- a/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs +++ b/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs | |||
@@ -54,16 +54,16 @@ namespace OpenSim.Framework.Servers | |||
54 | protected bool XmlRpcMethodMatch(OSHttpRequest req) | 54 | protected bool XmlRpcMethodMatch(OSHttpRequest req) |
55 | { | 55 | { |
56 | XmlRpcRequest xmlRpcRequest = null; | 56 | XmlRpcRequest xmlRpcRequest = null; |
57 | 57 | ||
58 | // check whether req is already reified | 58 | // check whether req is already reified |
59 | // if not: reify (and post to whiteboard) | 59 | // if not: reify (and post to whiteboard) |
60 | try | 60 | try |
61 | { | 61 | { |
62 | if (req.Whiteboard.ContainsKey("xmlrequest")) | 62 | if (req.Whiteboard.ContainsKey("xmlrequest")) |
63 | { | 63 | { |
64 | xmlRpcRequest = req.Whiteboard["xmlrequest"] as XmlRpcRequest; | 64 | xmlRpcRequest = req.Whiteboard["xmlrequest"] as XmlRpcRequest; |
65 | } | 65 | } |
66 | else | 66 | else |
67 | { | 67 | { |
68 | StreamReader body = new StreamReader(req.InputStream); | 68 | StreamReader body = new StreamReader(req.InputStream); |
69 | string requestBody = body.ReadToEnd(); | 69 | string requestBody = body.ReadToEnd(); |
@@ -76,22 +76,22 @@ namespace OpenSim.Framework.Servers | |||
76 | _log.ErrorFormat("[OSHttpXmlRpcHandler] failed to deserialize XmlRpcRequest from {0}", req.ToString()); | 76 | _log.ErrorFormat("[OSHttpXmlRpcHandler] failed to deserialize XmlRpcRequest from {0}", req.ToString()); |
77 | return false; | 77 | return false; |
78 | } | 78 | } |
79 | 79 | ||
80 | // check against methodName | 80 | // check against methodName |
81 | if ((null != xmlRpcRequest) | 81 | if ((null != xmlRpcRequest) |
82 | && !String.IsNullOrEmpty(xmlRpcRequest.MethodName) | 82 | && !String.IsNullOrEmpty(xmlRpcRequest.MethodName) |
83 | && xmlRpcRequest.MethodName == _methodName) | 83 | && xmlRpcRequest.MethodName == _methodName) |
84 | { | 84 | { |
85 | _log.DebugFormat("[OSHttpXmlRpcHandler] located handler {0} for {1}", _methodName, req.ToString()); | 85 | _log.DebugFormat("[OSHttpXmlRpcHandler] located handler {0} for {1}", _methodName, req.ToString()); |
86 | return true; | 86 | return true; |
87 | } | 87 | } |
88 | 88 | ||
89 | return false; | 89 | return false; |
90 | } | 90 | } |
91 | 91 | ||
92 | // contains handler for processing XmlRpc Request | 92 | // contains handler for processing XmlRpc Request |
93 | private XmlRpcMethod _handler; | 93 | private XmlRpcMethod _handler; |
94 | 94 | ||
95 | // contains XmlRpc method name | 95 | // contains XmlRpc method name |
96 | private string _methodName; | 96 | private string _methodName; |
97 | 97 | ||
@@ -112,9 +112,9 @@ namespace OpenSim.Framework.Servers | |||
112 | /// can be null, in which case they are not taken into account | 112 | /// can be null, in which case they are not taken into account |
113 | /// when the handler is being looked up. | 113 | /// when the handler is being looked up. |
114 | /// </remarks> | 114 | /// </remarks> |
115 | public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName, Regex path, | 115 | public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName, Regex path, |
116 | Dictionary<string, Regex> headers, Regex whitelist) | 116 | Dictionary<string, Regex> headers, Regex whitelist) |
117 | : base(new Regex(@"^POST$", RegexOptions.IgnoreCase | RegexOptions.Compiled), path, null, headers, | 117 | : base(new Regex(@"^POST$", RegexOptions.IgnoreCase | RegexOptions.Compiled), path, null, headers, |
118 | new Regex(@"^(text|application)/xml", RegexOptions.IgnoreCase | RegexOptions.Compiled), | 118 | new Regex(@"^(text|application)/xml", RegexOptions.IgnoreCase | RegexOptions.Compiled), |
119 | whitelist) | 119 | whitelist) |
120 | { | 120 | { |
@@ -138,7 +138,7 @@ namespace OpenSim.Framework.Servers | |||
138 | /// <summary> | 138 | /// <summary> |
139 | /// Invoked by OSHttpRequestPump. | 139 | /// Invoked by OSHttpRequestPump. |
140 | /// </summary> | 140 | /// </summary> |
141 | public override OSHttpHandlerResult Process(OSHttpRequest request) | 141 | public override OSHttpHandlerResult Process(OSHttpRequest request) |
142 | { | 142 | { |
143 | XmlRpcResponse xmlRpcResponse; | 143 | XmlRpcResponse xmlRpcResponse; |
144 | string responseString; | 144 | string responseString; |
@@ -148,13 +148,13 @@ namespace OpenSim.Framework.Servers | |||
148 | 148 | ||
149 | 149 | ||
150 | OSHttpResponse resp = new OSHttpResponse(request); | 150 | OSHttpResponse resp = new OSHttpResponse(request); |
151 | try | 151 | try |
152 | { | 152 | { |
153 | // reified XmlRpcRequest must still be on the whiteboard | 153 | // reified XmlRpcRequest must still be on the whiteboard |
154 | XmlRpcRequest xmlRpcRequest = request.Whiteboard["xmlrequest"] as XmlRpcRequest; | 154 | XmlRpcRequest xmlRpcRequest = request.Whiteboard["xmlrequest"] as XmlRpcRequest; |
155 | xmlRpcResponse = _handler(xmlRpcRequest); | 155 | xmlRpcResponse = _handler(xmlRpcRequest); |
156 | responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); | 156 | responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); |
157 | 157 | ||
158 | resp.ContentType = "text/xml"; | 158 | resp.ContentType = "text/xml"; |
159 | byte[] buffer = Encoding.UTF8.GetBytes(responseString); | 159 | byte[] buffer = Encoding.UTF8.GetBytes(responseString); |
160 | 160 | ||
@@ -176,4 +176,4 @@ namespace OpenSim.Framework.Servers | |||
176 | return OSHttpHandlerResult.Done; | 176 | return OSHttpHandlerResult.Done; |
177 | } | 177 | } |
178 | } | 178 | } |
179 | } \ No newline at end of file | 179 | } |
diff --git a/OpenSim/Framework/Servers/RestSessionService.cs b/OpenSim/Framework/Servers/RestSessionService.cs index 1ed349f..1cfb425 100644 --- a/OpenSim/Framework/Servers/RestSessionService.cs +++ b/OpenSim/Framework/Servers/RestSessionService.cs | |||
@@ -151,7 +151,7 @@ namespace OpenSim.Framework.Servers | |||
151 | private CheckIdentityMethod m_smethod; | 151 | private CheckIdentityMethod m_smethod; |
152 | 152 | ||
153 | public RestDeserialiseSecureHandler( | 153 | public RestDeserialiseSecureHandler( |
154 | string httpMethod, string path, | 154 | string httpMethod, string path, |
155 | RestDeserialiseMethod<TRequest, TResponse> method, CheckIdentityMethod smethod) | 155 | RestDeserialiseMethod<TRequest, TResponse> method, CheckIdentityMethod smethod) |
156 | : base(httpMethod, path) | 156 | : base(httpMethod, path) |
157 | { | 157 | { |
@@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers | |||
196 | /// <param name="method"></param> | 196 | /// <param name="method"></param> |
197 | /// <param name="tmethod"></param> | 197 | /// <param name="tmethod"></param> |
198 | private RestDeserialiseMethod<TRequest, TResponse> m_method; | 198 | private RestDeserialiseMethod<TRequest, TResponse> m_method; |
199 | 199 | ||
200 | /// <summary> | 200 | /// <summary> |
201 | /// The method used to check whether a request is trusted. | 201 | /// The method used to check whether a request is trusted. |
202 | /// </summary> | 202 | /// </summary> |
diff --git a/OpenSim/Framework/Statistics/BaseStatsCollector.cs b/OpenSim/Framework/Statistics/BaseStatsCollector.cs index c888f4c..1e59983 100644 --- a/OpenSim/Framework/Statistics/BaseStatsCollector.cs +++ b/OpenSim/Framework/Statistics/BaseStatsCollector.cs | |||
@@ -24,10 +24,10 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Text; | 29 | using System.Text; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Statistics | 31 | namespace OpenSim.Framework.Statistics |
32 | { | 32 | { |
33 | /// <summary> | 33 | /// <summary> |
@@ -44,7 +44,7 @@ namespace OpenSim.Framework.Statistics | |||
44 | string.Format( | 44 | string.Format( |
45 | "Allocated to OpenSim : {0} MB" + Environment.NewLine, | 45 | "Allocated to OpenSim : {0} MB" + Environment.NewLine, |
46 | Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0))); | 46 | Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0))); |
47 | 47 | ||
48 | return sb.ToString(); | 48 | return sb.ToString(); |
49 | } | 49 | } |
50 | } | 50 | } |
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs index 06b3185..58d5621 100644 --- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Framework.Statistics | |||
40 | public class SimExtraStatsCollector : BaseStatsCollector | 40 | public class SimExtraStatsCollector : BaseStatsCollector |
41 | { | 41 | { |
42 | private long abnormalClientThreadTerminations; | 42 | private long abnormalClientThreadTerminations; |
43 | 43 | ||
44 | private long assetsInCache; | 44 | private long assetsInCache; |
45 | private long texturesInCache; | 45 | private long texturesInCache; |
46 | private long assetCacheMemoryUsage; | 46 | private long assetCacheMemoryUsage; |
@@ -49,7 +49,7 @@ namespace OpenSim.Framework.Statistics | |||
49 | 49 | ||
50 | private long assetServiceRequestFailures; | 50 | private long assetServiceRequestFailures; |
51 | private long inventoryServiceRetrievalFailures; | 51 | private long inventoryServiceRetrievalFailures; |
52 | 52 | ||
53 | private float timeDilation; | 53 | private float timeDilation; |
54 | private float simFps; | 54 | private float simFps; |
55 | private float physicsFps; | 55 | private float physicsFps; |
@@ -70,8 +70,8 @@ namespace OpenSim.Framework.Statistics | |||
70 | private float pendingDownloads; | 70 | private float pendingDownloads; |
71 | private float pendingUploads; | 71 | private float pendingUploads; |
72 | private float activeScripts; | 72 | private float activeScripts; |
73 | private float scriptLinesPerSecond; | 73 | private float scriptLinesPerSecond; |
74 | 74 | ||
75 | /// <summary> | 75 | /// <summary> |
76 | /// Number of times that a client thread terminated because of an exception | 76 | /// Number of times that a client thread terminated because of an exception |
77 | /// </summary> | 77 | /// </summary> |
@@ -79,7 +79,7 @@ namespace OpenSim.Framework.Statistics | |||
79 | 79 | ||
80 | /// <summary> | 80 | /// <summary> |
81 | /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the | 81 | /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the |
82 | /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these | 82 | /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these |
83 | /// haven't yet been implemented... :) | 83 | /// haven't yet been implemented... :) |
84 | /// </summary> | 84 | /// </summary> |
85 | public long AssetsInCache { get { return assetsInCache; } } | 85 | public long AssetsInCache { get { return assetsInCache; } } |
@@ -101,19 +101,19 @@ namespace OpenSim.Framework.Statistics | |||
101 | /// as a failure | 101 | /// as a failure |
102 | /// </summary> | 102 | /// </summary> |
103 | public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } } | 103 | public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } } |
104 | 104 | ||
105 | /// <summary> | 105 | /// <summary> |
106 | /// Number of known failures to retrieve avatar inventory from the inventory service. This does not | 106 | /// Number of known failures to retrieve avatar inventory from the inventory service. This does not |
107 | /// cover situations where the inventory service accepts the request but never returns any data, since | 107 | /// cover situations where the inventory service accepts the request but never returns any data, since |
108 | /// we do not yet timeout this situation. | 108 | /// we do not yet timeout this situation. |
109 | /// </summary> | 109 | /// </summary> |
110 | public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } } | 110 | public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } } |
111 | 111 | ||
112 | /// <summary> | 112 | /// <summary> |
113 | /// Retrieve the total frame time (in ms) of the last frame | 113 | /// Retrieve the total frame time (in ms) of the last frame |
114 | /// </summary> | 114 | /// </summary> |
115 | //public float TotalFrameTime { get { return totalFrameTime; } } | 115 | //public float TotalFrameTime { get { return totalFrameTime; } } |
116 | 116 | ||
117 | /// <summary> | 117 | /// <summary> |
118 | /// Retrieve the physics update component (in ms) of the last frame | 118 | /// Retrieve the physics update component (in ms) of the last frame |
119 | /// </summary> | 119 | /// </summary> |
@@ -124,7 +124,7 @@ namespace OpenSim.Framework.Statistics | |||
124 | /// </summary> | 124 | /// </summary> |
125 | private IDictionary<LLUUID, PacketQueueStatsCollector> packetQueueStatsCollectors | 125 | private IDictionary<LLUUID, PacketQueueStatsCollector> packetQueueStatsCollectors |
126 | = new Dictionary<LLUUID, PacketQueueStatsCollector>(); | 126 | = new Dictionary<LLUUID, PacketQueueStatsCollector>(); |
127 | 127 | ||
128 | public void AddAbnormalClientThreadTermination() | 128 | public void AddAbnormalClientThreadTermination() |
129 | { | 129 | { |
130 | abnormalClientThreadTerminations++; | 130 | abnormalClientThreadTerminations++; |
@@ -146,7 +146,7 @@ namespace OpenSim.Framework.Statistics | |||
146 | textureCacheMemoryUsage += image.Data.Length; | 146 | textureCacheMemoryUsage += image.Data.Length; |
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
150 | /// <summary> | 150 | /// <summary> |
151 | /// Signal that the asset cache can be cleared. | 151 | /// Signal that the asset cache can be cleared. |
152 | /// </summary> | 152 | /// </summary> |
@@ -167,7 +167,7 @@ namespace OpenSim.Framework.Statistics | |||
167 | { | 167 | { |
168 | assetServiceRequestFailures++; | 168 | assetServiceRequestFailures++; |
169 | } | 169 | } |
170 | 170 | ||
171 | public void AddInventoryServiceRetrievalFailure() | 171 | public void AddInventoryServiceRetrievalFailure() |
172 | { | 172 | { |
173 | inventoryServiceRetrievalFailures++; | 173 | inventoryServiceRetrievalFailures++; |
@@ -199,18 +199,18 @@ namespace OpenSim.Framework.Statistics | |||
199 | packetQueueStatsCollectors.Remove(uuid); | 199 | packetQueueStatsCollectors.Remove(uuid); |
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
203 | /// <summary> | 203 | /// <summary> |
204 | /// This is the method on which the classic sim stats reporter (which collects stats for | 204 | /// This is the method on which the classic sim stats reporter (which collects stats for |
205 | /// client purposes) sends information to listeners. | 205 | /// client purposes) sends information to listeners. |
206 | /// </summary> | 206 | /// </summary> |
207 | /// <param name="pack"></param> | 207 | /// <param name="pack"></param> |
208 | public void ReceiveClassicSimStatsPacket(SimStatsPacket statsPacket) | 208 | public void ReceiveClassicSimStatsPacket(SimStatsPacket statsPacket) |
209 | { | 209 | { |
210 | // FIXME: Really shouldn't rely on the probably arbitrary order in which | 210 | // FIXME: Really shouldn't rely on the probably arbitrary order in which |
211 | // stats are packed into the packet | 211 | // stats are packed into the packet |
212 | timeDilation = statsPacket.Stat[0].StatValue; | 212 | timeDilation = statsPacket.Stat[0].StatValue; |
213 | simFps = statsPacket.Stat[1].StatValue; | 213 | simFps = statsPacket.Stat[1].StatValue; |
214 | physicsFps = statsPacket.Stat[2].StatValue; | 214 | physicsFps = statsPacket.Stat[2].StatValue; |
215 | agentUpdates = statsPacket.Stat[3].StatValue; | 215 | agentUpdates = statsPacket.Stat[3].StatValue; |
216 | rootAgents = statsPacket.Stat[4].StatValue; | 216 | rootAgents = statsPacket.Stat[4].StatValue; |
@@ -231,7 +231,7 @@ namespace OpenSim.Framework.Statistics | |||
231 | activeScripts = statsPacket.Stat[19].StatValue; | 231 | activeScripts = statsPacket.Stat[19].StatValue; |
232 | scriptLinesPerSecond = statsPacket.Stat[20].StatValue; | 232 | scriptLinesPerSecond = statsPacket.Stat[20].StatValue; |
233 | } | 233 | } |
234 | 234 | ||
235 | /// <summary> | 235 | /// <summary> |
236 | /// Report back collected statistical information. | 236 | /// Report back collected statistical information. |
237 | /// </summary> | 237 | /// </summary> |
@@ -248,10 +248,10 @@ Texture cache contains {2,6} texture assets using {3,10} K | |||
248 | Blocked client requests for missing textures: {4} | 248 | Blocked client requests for missing textures: {4} |
249 | Asset service request failures: {5}"+ Environment.NewLine, | 249 | Asset service request failures: {5}"+ Environment.NewLine, |
250 | AssetsInCache, Math.Round(AssetCacheMemoryUsage / 1024.0), | 250 | AssetsInCache, Math.Round(AssetCacheMemoryUsage / 1024.0), |
251 | TexturesInCache, Math.Round(TextureCacheMemoryUsage / 1024.0), | 251 | TexturesInCache, Math.Round(TextureCacheMemoryUsage / 1024.0), |
252 | BlockedMissingTextureRequests, | 252 | BlockedMissingTextureRequests, |
253 | AssetServiceRequestFailures)); | 253 | AssetServiceRequestFailures)); |
254 | 254 | ||
255 | sb.Append(Environment.NewLine); | 255 | sb.Append(Environment.NewLine); |
256 | sb.Append("CONNECTION STATISTICS"); | 256 | sb.Append("CONNECTION STATISTICS"); |
257 | sb.Append(Environment.NewLine); | 257 | sb.Append(Environment.NewLine); |
@@ -267,7 +267,7 @@ Asset service request failures: {5}"+ Environment.NewLine, | |||
267 | string.Format( | 267 | string.Format( |
268 | "Initial inventory caching failures: {0}" + Environment.NewLine, | 268 | "Initial inventory caching failures: {0}" + Environment.NewLine, |
269 | InventoryServiceRetrievalFailures)); | 269 | InventoryServiceRetrievalFailures)); |
270 | 270 | ||
271 | sb.Append(Environment.NewLine); | 271 | sb.Append(Environment.NewLine); |
272 | sb.Append("FRAME STATISTICS"); | 272 | sb.Append("FRAME STATISTICS"); |
273 | sb.Append(Environment.NewLine); | 273 | sb.Append(Environment.NewLine); |
@@ -278,18 +278,18 @@ Asset service request failures: {5}"+ Environment.NewLine, | |||
278 | "{0,6:0.00} {1,6:0} {2,6:0.0} {3,6:0.0} {4,6:0} {5,6:0} {6,6:0} {7,6:0} {8,6:0} {9,6:0}", | 278 | "{0,6:0.00} {1,6:0} {2,6:0.0} {3,6:0.0} {4,6:0} {5,6:0} {6,6:0} {7,6:0} {8,6:0} {9,6:0}", |
279 | timeDilation, simFps, physicsFps, agentUpdates, rootAgents, | 279 | timeDilation, simFps, physicsFps, agentUpdates, rootAgents, |
280 | childAgents, totalPrims, activePrims, activeScripts, scriptLinesPerSecond)); | 280 | childAgents, totalPrims, activePrims, activeScripts, scriptLinesPerSecond)); |
281 | 281 | ||
282 | sb.Append(Environment.NewLine); | 282 | sb.Append(Environment.NewLine); |
283 | sb.Append(Environment.NewLine); | 283 | sb.Append(Environment.NewLine); |
284 | // There is no script frame time currently because we don't yet collect it | 284 | // There is no script frame time currently because we don't yet collect it |
285 | sb.Append("PktsIn PktOut PendDl PendUl UnackB TotlFt NetFt PhysFt OthrFt AgntFt ImgsFt"); | 285 | sb.Append("PktsIn PktOut PendDl PendUl UnackB TotlFt NetFt PhysFt OthrFt AgntFt ImgsFt"); |
286 | sb.Append(Environment.NewLine); | 286 | sb.Append(Environment.NewLine); |
287 | sb.Append( | 287 | sb.Append( |
288 | string.Format( | 288 | string.Format( |
289 | "{0,6:0} {1,6:0} {2,6:0} {3,6:0} {4,6:0} {5,6:0.0} {6,6:0.0} {7,6:0.0} {8,6:0.0} {9,6:0.0} {10,6:0.0}", | 289 | "{0,6:0} {1,6:0} {2,6:0} {3,6:0} {4,6:0} {5,6:0.0} {6,6:0.0} {7,6:0.0} {8,6:0.0} {9,6:0.0} {10,6:0.0}", |
290 | inPacketsPerSecond, outPacketsPerSecond, pendingDownloads, pendingUploads, unackedBytes, totalFrameTime, | 290 | inPacketsPerSecond, outPacketsPerSecond, pendingDownloads, pendingUploads, unackedBytes, totalFrameTime, |
291 | netFrameTime, physicsFrameTime, otherFrameTime, agentFrameTime, imageFrameTime)); | 291 | netFrameTime, physicsFrameTime, otherFrameTime, agentFrameTime, imageFrameTime)); |
292 | sb.Append(Environment.NewLine); | 292 | sb.Append(Environment.NewLine); |
293 | 293 | ||
294 | /* | 294 | /* |
295 | sb.Append(Environment.NewLine); | 295 | sb.Append(Environment.NewLine); |
@@ -311,7 +311,7 @@ Asset service request failures: {5}"+ Environment.NewLine, | |||
311 | */ | 311 | */ |
312 | 312 | ||
313 | sb.Append(base.Report()); | 313 | sb.Append(base.Report()); |
314 | 314 | ||
315 | return sb.ToString(); | 315 | return sb.ToString(); |
316 | } | 316 | } |
317 | } | 317 | } |
diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index 9b497ab..fc84041 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs | |||
@@ -226,7 +226,7 @@ namespace OpenSim.Framework | |||
226 | private LLUUID _permsGranter; | 226 | private LLUUID _permsGranter; |
227 | private int _permsMask; | 227 | private int _permsMask; |
228 | private int _type = 0; | 228 | private int _type = 0; |
229 | 229 | ||
230 | public LLUUID AssetID { | 230 | public LLUUID AssetID { |
231 | get { | 231 | get { |
232 | return _assetID; | 232 | return _assetID; |
@@ -437,4 +437,4 @@ namespace OpenSim.Framework | |||
437 | _parentPartID = partID; | 437 | _parentPartID = partID; |
438 | } | 438 | } |
439 | } | 439 | } |
440 | } \ No newline at end of file | 440 | } |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index bc35fa6..2a21221 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -716,7 +716,7 @@ namespace OpenSim.Framework | |||
716 | XmlRpcRequest client = new XmlRpcRequest(methodName, args); | 716 | XmlRpcRequest client = new XmlRpcRequest(methodName, args); |
717 | return client.Send(url, 6000); | 717 | return client.Send(url, 6000); |
718 | } | 718 | } |
719 | 719 | ||
720 | // used for RemoteParcelRequest (for "About Landmark") | 720 | // used for RemoteParcelRequest (for "About Landmark") |
721 | public static LLUUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) { | 721 | public static LLUUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) { |
722 | byte[] bytes = { | 722 | byte[] bytes = { |
@@ -726,7 +726,7 @@ namespace OpenSim.Framework | |||
726 | (byte)(y >> 24), (byte)(y >> 16), (byte)(y >> 8), (byte)y }; | 726 | (byte)(y >> 24), (byte)(y >> 16), (byte)(y >> 8), (byte)y }; |
727 | return new LLUUID(bytes, 0); | 727 | return new LLUUID(bytes, 0); |
728 | } | 728 | } |
729 | 729 | ||
730 | public static void ParseFakeParcelID(LLUUID parcelID, out ulong regionHandle, out uint x, out uint y) { | 730 | public static void ParseFakeParcelID(LLUUID parcelID, out ulong regionHandle, out uint x, out uint y) { |
731 | byte[] bytes = parcelID.GetBytes(); | 731 | byte[] bytes = parcelID.GetBytes(); |
732 | regionHandle = Helpers.BytesToUInt64(bytes); | 732 | regionHandle = Helpers.BytesToUInt64(bytes); |
diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 4a4f8bf..6d46048 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs | |||
@@ -83,7 +83,7 @@ namespace OpenSim.Grid.AssetServer | |||
83 | public override void Startup() | 83 | public override void Startup() |
84 | { | 84 | { |
85 | base.Startup(); | 85 | base.Startup(); |
86 | 86 | ||
87 | AssetConfig config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); | 87 | AssetConfig config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); |
88 | 88 | ||
89 | m_log.Info("[ASSET]: Setting up asset DB"); | 89 | m_log.Info("[ASSET]: Setting up asset DB"); |
@@ -115,17 +115,17 @@ namespace OpenSim.Grid.AssetServer | |||
115 | 115 | ||
116 | public IAssetProviderPlugin LoadDatabasePlugin(string provider, string connect) | 116 | public IAssetProviderPlugin LoadDatabasePlugin(string provider, string connect) |
117 | { | 117 | { |
118 | PluginLoader<IAssetProviderPlugin> loader = | 118 | PluginLoader<IAssetProviderPlugin> loader = |
119 | new PluginLoader<IAssetProviderPlugin> (new AssetDataInitialiser (connect)); | 119 | new PluginLoader<IAssetProviderPlugin> (new AssetDataInitialiser (connect)); |
120 | 120 | ||
121 | // loader will try to load all providers (MySQL, MSSQL, etc) | 121 | // loader will try to load all providers (MySQL, MSSQL, etc) |
122 | // unless it is constrainted to the correct "Provider" entry in the addin.xml | 122 | // unless it is constrainted to the correct "Provider" entry in the addin.xml |
123 | loader.Add ("/OpenSim/AssetData", new PluginProviderFilter (provider)); | 123 | loader.Add ("/OpenSim/AssetData", new PluginProviderFilter (provider)); |
124 | loader.Load(); | 124 | loader.Load(); |
125 | 125 | ||
126 | return loader.Plugin; | 126 | return loader.Plugin; |
127 | } | 127 | } |
128 | 128 | ||
129 | public void setupDB(AssetConfig config) | 129 | public void setupDB(AssetConfig config) |
130 | { | 130 | { |
131 | try | 131 | try |
diff --git a/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs b/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs index eed4621..a36d396 100644 --- a/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs +++ b/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs | |||
@@ -40,17 +40,17 @@ namespace OpenSim.Grid.Communications.OGS1 | |||
40 | public class OGS1InterServiceInventoryService : IInterServiceInventoryServices | 40 | public class OGS1InterServiceInventoryService : IInterServiceInventoryServices |
41 | { | 41 | { |
42 | protected Uri m_inventoryServerUrl; | 42 | protected Uri m_inventoryServerUrl; |
43 | 43 | ||
44 | public OGS1InterServiceInventoryService(Uri inventoryServerUrl) | 44 | public OGS1InterServiceInventoryService(Uri inventoryServerUrl) |
45 | { | 45 | { |
46 | m_inventoryServerUrl = inventoryServerUrl; | 46 | m_inventoryServerUrl = inventoryServerUrl; |
47 | } | 47 | } |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/> | 50 | /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/> |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <param name="userId"></param> | 52 | /// <param name="userId"></param> |
53 | /// <returns></returns> | 53 | /// <returns></returns> |
54 | public bool CreateNewUserInventory(LLUUID userId) | 54 | public bool CreateNewUserInventory(LLUUID userId) |
55 | { | 55 | { |
56 | return SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( | 56 | return SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( |
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 3101a38..98abd53 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs | |||
@@ -61,20 +61,20 @@ namespace OpenSim.Grid.GridServer | |||
61 | /// <param name="provider">The name of the grid server plugin DLL</param> | 61 | /// <param name="provider">The name of the grid server plugin DLL</param> |
62 | public void AddPlugin(string provider, string connect) | 62 | public void AddPlugin(string provider, string connect) |
63 | { | 63 | { |
64 | PluginLoader<IGridDataPlugin> gridloader = | 64 | PluginLoader<IGridDataPlugin> gridloader = |
65 | new PluginLoader<IGridDataPlugin> (new GridDataInitialiser (connect)); | 65 | new PluginLoader<IGridDataPlugin> (new GridDataInitialiser (connect)); |
66 | 66 | ||
67 | PluginLoader<ILogDataPlugin> logloader = | 67 | PluginLoader<ILogDataPlugin> logloader = |
68 | new PluginLoader<ILogDataPlugin> (new LogDataInitialiser (connect)); | 68 | new PluginLoader<ILogDataPlugin> (new LogDataInitialiser (connect)); |
69 | 69 | ||
70 | // loader will try to load all providers (MySQL, MSSQL, etc) | 70 | // loader will try to load all providers (MySQL, MSSQL, etc) |
71 | // unless it is constrainted to the correct "Provider" entry in the addin.xml | 71 | // unless it is constrainted to the correct "Provider" entry in the addin.xml |
72 | gridloader.Add ("/OpenSim/GridData", new PluginProviderFilter (provider)); | 72 | gridloader.Add ("/OpenSim/GridData", new PluginProviderFilter (provider)); |
73 | logloader.Add ("/OpenSim/LogData", new PluginProviderFilter (provider)); | 73 | logloader.Add ("/OpenSim/LogData", new PluginProviderFilter (provider)); |
74 | 74 | ||
75 | gridloader.Load(); | 75 | gridloader.Load(); |
76 | logloader.Load(); | 76 | logloader.Load(); |
77 | 77 | ||
78 | _plugins = gridloader.Plugins; | 78 | _plugins = gridloader.Plugins; |
79 | _logplugins = logloader.Plugins; | 79 | _logplugins = logloader.Plugins; |
80 | } | 80 | } |
@@ -382,7 +382,7 @@ namespace OpenSim.Grid.GridServer | |||
382 | string logMsg = e.Message; | 382 | string logMsg = e.Message; |
383 | if (e.InnerException != null) | 383 | if (e.InnerException != null) |
384 | logMsg += ", " + e.InnerException.Message; | 384 | logMsg += ", " + e.InnerException.Message; |
385 | 385 | ||
386 | m_log.WarnFormat("[LOGIN END]: {0}", logMsg); | 386 | m_log.WarnFormat("[LOGIN END]: {0}", logMsg); |
387 | 387 | ||
388 | return e.XmlRpcErrorResponse; | 388 | return e.XmlRpcErrorResponse; |
diff --git a/OpenSim/Grid/GridServer/IGridPlugin.cs b/OpenSim/Grid/GridServer/IGridPlugin.cs index 71c357b..e2557c0 100644 --- a/OpenSim/Grid/GridServer/IGridPlugin.cs +++ b/OpenSim/Grid/GridServer/IGridPlugin.cs | |||
@@ -34,7 +34,7 @@ namespace OpenSim.Grid.GridServer | |||
34 | { | 34 | { |
35 | void Initialise(GridServerBase gridServer); | 35 | void Initialise(GridServerBase gridServer); |
36 | } | 36 | } |
37 | 37 | ||
38 | public class GridPluginInitialiser : PluginInitialiserBase | 38 | public class GridPluginInitialiser : PluginInitialiserBase |
39 | { | 39 | { |
40 | private GridServerBase server; | 40 | private GridServerBase server; |
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index 643cf4d..e4d43d4 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs | |||
@@ -84,12 +84,12 @@ namespace OpenSim.Grid.InventoryServer | |||
84 | { | 84 | { |
85 | return true; | 85 | return true; |
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | m_log.WarnFormat( | 89 | m_log.WarnFormat( |
90 | "[GRID AGENT INVENTORY]: Rejecting request since source {0} was not in the list of trusted sources", | 90 | "[GRID AGENT INVENTORY]: Rejecting request since source {0} was not in the list of trusted sources", |
91 | peer); | 91 | peer); |
92 | 92 | ||
93 | return false; | 93 | return false; |
94 | } | 94 | } |
95 | else | 95 | else |
@@ -110,7 +110,7 @@ namespace OpenSim.Grid.InventoryServer | |||
110 | if (m_doLookup) | 110 | if (m_doLookup) |
111 | { | 111 | { |
112 | m_log.InfoFormat("[GRID AGENT INVENTORY]: checking authed session {0} {1}", session_id, avatar_id); | 112 | m_log.InfoFormat("[GRID AGENT INVENTORY]: checking authed session {0} {1}", session_id, avatar_id); |
113 | 113 | ||
114 | if (m_session_cache.getCachedSession(session_id, avatar_id) == null) | 114 | if (m_session_cache.getCachedSession(session_id, avatar_id) == null) |
115 | { | 115 | { |
116 | // cache miss, ask userserver | 116 | // cache miss, ask userserver |
@@ -137,7 +137,7 @@ namespace OpenSim.Grid.InventoryServer | |||
137 | m_log.Info("[GRID AGENT INVENTORY]: got authed session from cache"); | 137 | m_log.Info("[GRID AGENT INVENTORY]: got authed session from cache"); |
138 | return true; | 138 | return true; |
139 | } | 139 | } |
140 | 140 | ||
141 | m_log.Warn("[GRID AGENT INVENTORY]: unknown session_id, request rejected"); | 141 | m_log.Warn("[GRID AGENT INVENTORY]: unknown session_id, request rejected"); |
142 | return false; | 142 | return false; |
143 | } | 143 | } |
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 7e6a29b..a77c570 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Grid.InventoryServer | |||
65 | public override void Startup() | 65 | public override void Startup() |
66 | { | 66 | { |
67 | base.Startup(); | 67 | base.Startup(); |
68 | 68 | ||
69 | InventoryConfig config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); | 69 | InventoryConfig config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); |
70 | 70 | ||
71 | m_inventoryService = new GridInventoryService(config.UserServerURL); | 71 | m_inventoryService = new GridInventoryService(config.UserServerURL); |
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs index 210e195..06bcee2 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs | |||
@@ -43,10 +43,10 @@ namespace OpenGridServices.Manager | |||
43 | { | 43 | { |
44 | case Gtk.ResponseType.Ok: | 44 | case Gtk.ResponseType.Ok: |
45 | MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text); | 45 | MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text); |
46 | break; | 46 | break; |
47 | 47 | ||
48 | case Gtk.ResponseType.Cancel: | 48 | case Gtk.ResponseType.Cancel: |
49 | break; | 49 | break; |
50 | } | 50 | } |
51 | this.Hide(); | 51 | this.Hide(); |
52 | } | 52 | } |
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs index cf44ac2..c39e72a 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs | |||
@@ -41,9 +41,9 @@ namespace OpenGridServices.Manager | |||
41 | private string ServerURL; | 41 | private string ServerURL; |
42 | public LLUUID SessionID; | 42 | public LLUUID SessionID; |
43 | public bool connected=false; | 43 | public bool connected=false; |
44 | 44 | ||
45 | public RegionBlock[][] WorldMap; | 45 | public RegionBlock[][] WorldMap; |
46 | 46 | ||
47 | public bool Connect(string GridServerURL, string username, string password) | 47 | public bool Connect(string GridServerURL, string username, string password) |
48 | { | 48 | { |
49 | try | 49 | try |
@@ -76,14 +76,14 @@ namespace OpenGridServices.Manager | |||
76 | return false; | 76 | return false; |
77 | } | 77 | } |
78 | } | 78 | } |
79 | 79 | ||
80 | public void DownloadMap() | 80 | public void DownloadMap() |
81 | { | 81 | { |
82 | System.Net.WebClient mapdownloader = new WebClient(); | 82 | System.Net.WebClient mapdownloader = new WebClient(); |
83 | Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist"); | 83 | Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist"); |
84 | 84 | ||
85 | RegionBlock TempRegionData; | 85 | RegionBlock TempRegionData; |
86 | 86 | ||
87 | XmlDocument doc = new XmlDocument(); | 87 | XmlDocument doc = new XmlDocument(); |
88 | doc.Load(regionliststream); | 88 | doc.Load(regionliststream); |
89 | regionliststream.Close(); | 89 | regionliststream.Close(); |
@@ -105,12 +105,12 @@ namespace OpenGridServices.Manager | |||
105 | } | 105 | } |
106 | } | 106 | } |
107 | } | 107 | } |
108 | 108 | ||
109 | public bool RestartServer() | 109 | public bool RestartServer() |
110 | { | 110 | { |
111 | return true; | 111 | return true; |
112 | } | 112 | } |
113 | 113 | ||
114 | public bool ShutdownServer() | 114 | public bool ShutdownServer() |
115 | { | 115 | { |
116 | try | 116 | try |
@@ -137,7 +137,7 @@ namespace OpenGridServices.Manager | |||
137 | return false; | 137 | return false; |
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | public void DisconnectServer() | 141 | public void DisconnectServer() |
142 | { | 142 | { |
143 | this.connected=false; | 143 | this.connected=false; |
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs index 7700229..f081665 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs | |||
@@ -38,9 +38,9 @@ namespace OpenGridServices.Manager | |||
38 | public static BlockingQueue<string> PendingOperations = new BlockingQueue<string>(); | 38 | public static BlockingQueue<string> PendingOperations = new BlockingQueue<string>(); |
39 | 39 | ||
40 | private static Thread OperationsRunner; | 40 | private static Thread OperationsRunner; |
41 | 41 | ||
42 | private static GridServerConnectionManager gridserverConn; | 42 | private static GridServerConnectionManager gridserverConn; |
43 | 43 | ||
44 | private static MainWindow win; | 44 | private static MainWindow win; |
45 | 45 | ||
46 | public static void DoMainLoop() | 46 | public static void DoMainLoop() |
@@ -79,7 +79,7 @@ namespace OpenGridServices.Manager | |||
79 | win.SetStatus("Could not connect"); | 79 | win.SetStatus("Could not connect"); |
80 | } | 80 | } |
81 | break; | 81 | break; |
82 | 82 | ||
83 | case "restart_gridserver": | 83 | case "restart_gridserver": |
84 | win.SetStatus("Restarting grid server..."); | 84 | win.SetStatus("Restarting grid server..."); |
85 | if (gridserverConn.RestartServer()) | 85 | if (gridserverConn.RestartServer()) |
@@ -93,7 +93,7 @@ namespace OpenGridServices.Manager | |||
93 | win.SetStatus("Error restarting grid server!!!"); | 93 | win.SetStatus("Error restarting grid server!!!"); |
94 | } | 94 | } |
95 | break; | 95 | break; |
96 | 96 | ||
97 | case "shutdown_gridserver": | 97 | case "shutdown_gridserver": |
98 | win.SetStatus("Shutting down grid server..."); | 98 | win.SetStatus("Shutting down grid server..."); |
99 | if (gridserverConn.ShutdownServer()) | 99 | if (gridserverConn.ShutdownServer()) |
@@ -108,7 +108,7 @@ namespace OpenGridServices.Manager | |||
108 | win.SetStatus("Could not shutdown grid server!!!"); | 108 | win.SetStatus("Could not shutdown grid server!!!"); |
109 | } | 109 | } |
110 | break; | 110 | break; |
111 | 111 | ||
112 | case "disconnect_gridserver": | 112 | case "disconnect_gridserver": |
113 | gridserverConn.DisconnectServer(); | 113 | gridserverConn.DisconnectServer(); |
114 | win.SetGridServerConnected(false); | 114 | win.SetGridServerConnected(false); |
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index de20d01..c80d48c 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs | |||
@@ -83,14 +83,12 @@ namespace OpenSim.Grid.MessagingServer | |||
83 | public override void Startup() | 83 | public override void Startup() |
84 | { | 84 | { |
85 | base.Startup(); | 85 | base.Startup(); |
86 | 86 | ||
87 | Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); | 87 | Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); |
88 | 88 | ||
89 | m_log.Info("[REGION]: Starting HTTP process"); | 89 | m_log.Info("[REGION]: Starting HTTP process"); |
90 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); | 90 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); |
91 | 91 | ||
92 | |||
93 | |||
94 | msgsvc = new MessageService(Cfg); | 92 | msgsvc = new MessageService(Cfg); |
95 | 93 | ||
96 | if (msgsvc.registerWithUserServer()) | 94 | if (msgsvc.registerWithUserServer()) |
@@ -123,7 +121,6 @@ namespace OpenSim.Grid.MessagingServer | |||
123 | switch (what) | 121 | switch (what) |
124 | { | 122 | { |
125 | case "user": | 123 | case "user": |
126 | |||
127 | try | 124 | try |
128 | { | 125 | { |
129 | //userID = | 126 | //userID = |
@@ -161,8 +158,6 @@ namespace OpenSim.Grid.MessagingServer | |||
161 | m_console.Notice("Region cache cleared! Cleared " + entries.ToString() + " entries"); | 158 | m_console.Notice("Region cache cleared! Cleared " + entries.ToString() + " entries"); |
162 | break; | 159 | break; |
163 | } | 160 | } |
164 | |||
165 | |||
166 | } | 161 | } |
167 | 162 | ||
168 | public override void Shutdown() | 163 | public override void Shutdown() |
diff --git a/OpenSim/Grid/MessagingServer/PresenceBackreferenceEntry.cs b/OpenSim/Grid/MessagingServer/PresenceBackreferenceEntry.cs index 5f60871..281beb9 100644 --- a/OpenSim/Grid/MessagingServer/PresenceBackreferenceEntry.cs +++ b/OpenSim/Grid/MessagingServer/PresenceBackreferenceEntry.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Grid.MessagingServer | |||
62 | } | 62 | } |
63 | return result; | 63 | return result; |
64 | } | 64 | } |
65 | 65 | ||
66 | public int Count | 66 | public int Count |
67 | { | 67 | { |
68 | get | 68 | get |
diff --git a/OpenSim/Grid/ScriptServer/FakeScene.cs b/OpenSim/Grid/ScriptServer/FakeScene.cs index 89e7efb..ef88a9d 100644 --- a/OpenSim/Grid/ScriptServer/FakeScene.cs +++ b/OpenSim/Grid/ScriptServer/FakeScene.cs | |||
@@ -45,7 +45,6 @@ namespace OpenSim.Grid.ScriptServer | |||
45 | regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, httpServer, | 45 | regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, httpServer, |
46 | moduleLoader, dumpAssetsToFile, physicalPrim, sendTasksToChild, config, "") | 46 | moduleLoader, dumpAssetsToFile, physicalPrim, sendTasksToChild, config, "") |
47 | { | 47 | { |
48 | |||
49 | } | 48 | } |
50 | 49 | ||
51 | // What does a scene have to do? :P | 50 | // What does a scene have to do? :P |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index 844f27d..63bdea8 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Grid.ScriptServer | |||
57 | internal TCPServer m_TCPServer; | 57 | internal TCPServer m_TCPServer; |
58 | internal TRPC_Remote RPC; | 58 | internal TRPC_Remote RPC; |
59 | 59 | ||
60 | public ScriptServerMain() | 60 | public ScriptServerMain() |
61 | { | 61 | { |
62 | m_console = CreateConsole(); | 62 | m_console = CreateConsole(); |
63 | 63 | ||
@@ -68,7 +68,6 @@ namespace OpenSim.Grid.ScriptServer | |||
68 | Engine = ScriptEngines.LoadEngine("DotNetEngine"); | 68 | Engine = ScriptEngines.LoadEngine("DotNetEngine"); |
69 | 69 | ||
70 | Engine.InitializeEngine(null, null, false, Engine.GetScriptManager()); | 70 | Engine.InitializeEngine(null, null, false, Engine.GetScriptManager()); |
71 | |||
72 | 71 | ||
73 | // Set up server | 72 | // Set up server |
74 | //m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine"); | 73 | //m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine"); |
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 9b74dbc..9a3e431 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs | |||
@@ -90,7 +90,7 @@ namespace OpenSim.Grid.UserServer | |||
90 | public override void Startup() | 90 | public override void Startup() |
91 | { | 91 | { |
92 | base.Startup(); | 92 | base.Startup(); |
93 | 93 | ||
94 | Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml"))); | 94 | Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml"))); |
95 | 95 | ||
96 | m_stats = StatsManager.StartCollectingUserStats(); | 96 | m_stats = StatsManager.StartCollectingUserStats(); |
@@ -101,11 +101,11 @@ namespace OpenSim.Grid.UserServer | |||
101 | 101 | ||
102 | m_gridInfoService = new GridInfoService(); | 102 | m_gridInfoService = new GridInfoService(); |
103 | 103 | ||
104 | m_interServiceInventoryService = new OGS1InterServiceInventoryService(Cfg.InventoryUrl); | 104 | m_interServiceInventoryService = new OGS1InterServiceInventoryService(Cfg.InventoryUrl); |
105 | 105 | ||
106 | m_loginService = new UserLoginService( | 106 | m_loginService = new UserLoginService( |
107 | m_userManager, m_interServiceInventoryService, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); | 107 | m_userManager, m_interServiceInventoryService, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); |
108 | 108 | ||
109 | m_messagesService = new MessageServersConnector(); | 109 | m_messagesService = new MessageServersConnector(); |
110 | 110 | ||
111 | m_loginService.OnUserLoggedInAtLocation += NotifyMessageServersUserLoggedInToLocation; | 111 | m_loginService.OnUserLoggedInAtLocation += NotifyMessageServersUserLoggedInToLocation; |
@@ -151,7 +151,6 @@ namespace OpenSim.Grid.UserServer | |||
151 | 151 | ||
152 | m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); | 152 | m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); |
153 | m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); | 153 | m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); |
154 | |||
155 | 154 | ||
156 | m_httpServer.AddStreamHandler( | 155 | m_httpServer.AddStreamHandler( |
157 | new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); | 156 | new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); |
@@ -188,7 +187,7 @@ namespace OpenSim.Grid.UserServer | |||
188 | tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); | 187 | tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); |
189 | 188 | ||
190 | LLUUID userID = new LLUUID(); | 189 | LLUUID userID = new LLUUID(); |
191 | 190 | ||
192 | try | 191 | try |
193 | { | 192 | { |
194 | userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); | 193 | userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); |
@@ -199,7 +198,7 @@ namespace OpenSim.Grid.UserServer | |||
199 | } | 198 | } |
200 | 199 | ||
201 | try | 200 | try |
202 | { | 201 | { |
203 | if (!m_interServiceInventoryService.CreateNewUserInventory(userID)) | 202 | if (!m_interServiceInventoryService.CreateNewUserInventory(userID)) |
204 | { | 203 | { |
205 | throw new Exception( | 204 | throw new Exception( |
@@ -245,9 +244,9 @@ namespace OpenSim.Grid.UserServer | |||
245 | // requester.ReturnResponseVal = TestResponse; | 244 | // requester.ReturnResponseVal = TestResponse; |
246 | // requester.BeginPostObject<LLUUID>(m_userManager._config.InventoryUrl + "RootFolders/", m_lastCreatedUser); | 245 | // requester.BeginPostObject<LLUUID>(m_userManager._config.InventoryUrl + "RootFolders/", m_lastCreatedUser); |
247 | SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>( | 246 | SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>( |
248 | "POST", Cfg.InventoryUrl + "RootFolders/", m_lastCreatedUser); | 247 | "POST", Cfg.InventoryUrl + "RootFolders/", m_lastCreatedUser); |
249 | break; | 248 | break; |
250 | 249 | ||
251 | case "logoff-user": | 250 | case "logoff-user": |
252 | 251 | ||
253 | if (cmdparams.Length >= 3) | 252 | if (cmdparams.Length >= 3) |
@@ -279,7 +278,7 @@ namespace OpenSim.Grid.UserServer | |||
279 | m_loginService.LogOffUser(theUser, message); | 278 | m_loginService.LogOffUser(theUser, message); |
280 | 279 | ||
281 | theUser.CurrentAgent.AgentOnline = false; | 280 | theUser.CurrentAgent.AgentOnline = false; |
282 | 281 | ||
283 | m_loginService.CommitAgent(ref theUser); | 282 | m_loginService.CommitAgent(ref theUser); |
284 | } | 283 | } |
285 | else | 284 | else |
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 0e61b3c..8488e22 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Grid.UserServer | |||
46 | public class UserLoginService : LoginService | 46 | public class UserLoginService : LoginService |
47 | { | 47 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | protected IInterServiceInventoryServices m_inventoryService; | 50 | protected IInterServiceInventoryServices m_inventoryService; |
51 | 51 | ||
52 | public event UserLoggedInAtLocation OnUserLoggedInAtLocation; | 52 | public event UserLoggedInAtLocation OnUserLoggedInAtLocation; |
@@ -63,7 +63,7 @@ namespace OpenSim.Grid.UserServer | |||
63 | m_config = config; | 63 | m_config = config; |
64 | m_inventoryService = inventoryService; | 64 | m_inventoryService = inventoryService; |
65 | } | 65 | } |
66 | 66 | ||
67 | public override void LogOffUser(UserProfileData theUser, string message) | 67 | public override void LogOffUser(UserProfileData theUser, string message) |
68 | { | 68 | { |
69 | RegionProfileData SimInfo = null; | 69 | RegionProfileData SimInfo = null; |
@@ -72,7 +72,7 @@ namespace OpenSim.Grid.UserServer | |||
72 | SimInfo = RegionProfileData.RequestSimProfileData( | 72 | SimInfo = RegionProfileData.RequestSimProfileData( |
73 | theUser.CurrentAgent.Handle, m_config.GridServerURL, | 73 | theUser.CurrentAgent.Handle, m_config.GridServerURL, |
74 | m_config.GridSendKey, m_config.GridRecvKey); | 74 | m_config.GridSendKey, m_config.GridRecvKey); |
75 | 75 | ||
76 | if (SimInfo == null) | 76 | if (SimInfo == null) |
77 | { | 77 | { |
78 | m_log.Error("[GRID]: Region user was in isn't currently logged in"); | 78 | m_log.Error("[GRID]: Region user was in isn't currently logged in"); |
@@ -84,7 +84,7 @@ namespace OpenSim.Grid.UserServer | |||
84 | m_log.Error("[GRID]: Unable to look up region to log user off"); | 84 | m_log.Error("[GRID]: Unable to look up region to log user off"); |
85 | return; | 85 | return; |
86 | } | 86 | } |
87 | 87 | ||
88 | // Prepare notification | 88 | // Prepare notification |
89 | Hashtable SimParams = new Hashtable(); | 89 | Hashtable SimParams = new Hashtable(); |
90 | SimParams["agent_id"] = theUser.ID.ToString(); | 90 | SimParams["agent_id"] = theUser.ID.ToString(); |
@@ -101,7 +101,7 @@ namespace OpenSim.Grid.UserServer | |||
101 | m_log.InfoFormat( | 101 | m_log.InfoFormat( |
102 | "[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}", | 102 | "[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}", |
103 | SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI, theUser.FirstName + " " + theUser.SurName); | 103 | SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI, theUser.FirstName + " " + theUser.SurName); |
104 | 104 | ||
105 | try | 105 | try |
106 | { | 106 | { |
107 | XmlRpcRequest GridReq = new XmlRpcRequest("logoff_user", SendParams); | 107 | XmlRpcRequest GridReq = new XmlRpcRequest("logoff_user", SendParams); |
@@ -306,8 +306,6 @@ namespace OpenSim.Grid.UserServer | |||
306 | theUser.FirstName, theUser.SurName); | 306 | theUser.FirstName, theUser.SurName); |
307 | } | 307 | } |
308 | } | 308 | } |
309 | |||
310 | |||
311 | } | 309 | } |
312 | } | 310 | } |
313 | catch (Exception) | 311 | catch (Exception) |
@@ -419,7 +417,7 @@ namespace OpenSim.Grid.UserServer | |||
419 | else | 417 | else |
420 | { | 418 | { |
421 | response.CreateDeadRegionResponse(); | 419 | response.CreateDeadRegionResponse(); |
422 | } | 420 | } |
423 | } | 421 | } |
424 | 422 | ||
425 | catch (Exception e) | 423 | catch (Exception e) |
@@ -432,11 +430,11 @@ namespace OpenSim.Grid.UserServer | |||
432 | 430 | ||
433 | // See LoginService | 431 | // See LoginService |
434 | protected override InventoryData GetInventorySkeleton(LLUUID userID) | 432 | protected override InventoryData GetInventorySkeleton(LLUUID userID) |
435 | { | 433 | { |
436 | m_log.DebugFormat( | 434 | m_log.DebugFormat( |
437 | "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", | 435 | "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", |
438 | m_config.InventoryUrl, userID); | 436 | m_config.InventoryUrl, userID); |
439 | 437 | ||
440 | List<InventoryFolderBase> folders = m_inventoryService.GetInventorySkeleton(userID); | 438 | List<InventoryFolderBase> folders = m_inventoryService.GetInventorySkeleton(userID); |
441 | 439 | ||
442 | if (null == folders || folders.Count == 0) | 440 | if (null == folders || folders.Count == 0) |
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index b1d95da..760dfe3 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs | |||
@@ -413,7 +413,7 @@ namespace OpenSim.Grid.UserServer | |||
413 | 413 | ||
414 | return ProfileToXmlRPCResponse(userProfile); | 414 | return ProfileToXmlRPCResponse(userProfile); |
415 | } | 415 | } |
416 | 416 | ||
417 | public XmlRpcResponse XmlRPCGetAgentMethodUUID(XmlRpcRequest request) | 417 | public XmlRpcResponse XmlRPCGetAgentMethodUUID(XmlRpcRequest request) |
418 | { | 418 | { |
419 | XmlRpcResponse response = new XmlRpcResponse(); | 419 | XmlRpcResponse response = new XmlRpcResponse(); |
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 4df6415..59ac161 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -95,7 +95,7 @@ namespace OpenSim | |||
95 | } | 95 | } |
96 | 96 | ||
97 | private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself | 97 | private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself |
98 | 98 | ||
99 | /// <summary> | 99 | /// <summary> |
100 | /// Global exception handler -- all unhandlet exceptions end up here :) | 100 | /// Global exception handler -- all unhandlet exceptions end up here :) |
101 | /// </summary> | 101 | /// </summary> |
diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs index 2e3122f..4fd93e8 100644 --- a/OpenSim/Region/Application/IApplicationPlugin.cs +++ b/OpenSim/Region/Application/IApplicationPlugin.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim | |||
33 | { | 33 | { |
34 | void Initialise(OpenSimBase openSim); | 34 | void Initialise(OpenSimBase openSim); |
35 | } | 35 | } |
36 | 36 | ||
37 | public class ApplicationPluginInitialiser : PluginInitialiserBase | 37 | public class ApplicationPluginInitialiser : PluginInitialiserBase |
38 | { | 38 | { |
39 | private OpenSimBase server; | 39 | private OpenSimBase server; |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 4664b0b..cc2d993 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -90,8 +90,8 @@ namespace OpenSim | |||
90 | m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (m_sandbox ? "sandbox" : "grid")); | 90 | m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (m_sandbox ? "sandbox" : "grid")); |
91 | 91 | ||
92 | m_console = new ConsoleBase("Region", this); | 92 | m_console = new ConsoleBase("Region", this); |
93 | MainConsole.Instance = m_console; | 93 | MainConsole.Instance = m_console; |
94 | 94 | ||
95 | base.Startup(); | 95 | base.Startup(); |
96 | 96 | ||
97 | //Run Startup Commands | 97 | //Run Startup Commands |
@@ -116,9 +116,9 @@ namespace OpenSim | |||
116 | PrintFileToConsole("startuplogo.txt"); | 116 | PrintFileToConsole("startuplogo.txt"); |
117 | RegisterCmd("echoTest", RunEchoTest, "this echos your command args to see how they are parsed"); | 117 | RegisterCmd("echoTest", RunEchoTest, "this echos your command args to see how they are parsed"); |
118 | RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving"); | 118 | RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving"); |
119 | 119 | ||
120 | // For now, start at the 'root' level by default | 120 | // For now, start at the 'root' level by default |
121 | ChangeSelectedRegion(new string[] {"root"}); | 121 | ChangeSelectedRegion(new string[] {"root"}); |
122 | } | 122 | } |
123 | 123 | ||
124 | private void RunAutoTimerScript(object sender, EventArgs e) | 124 | private void RunAutoTimerScript(object sender, EventArgs e) |
@@ -135,7 +135,7 @@ namespace OpenSim | |||
135 | { | 135 | { |
136 | for (int i = 0; i < cmdparams.Length; i++) | 136 | for (int i = 0; i < cmdparams.Length; i++) |
137 | { | 137 | { |
138 | m_log.Info("[EchoTest]: <arg" + i + ">"+cmdparams[i]+"</arg" + i + ">"); | 138 | m_log.Info("[EchoTest]: <arg" + i + ">"+cmdparams[i]+"</arg" + i + ">"); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
@@ -214,7 +214,7 @@ namespace OpenSim | |||
214 | { | 214 | { |
215 | base.RunCmd(command, cmdparams); | 215 | base.RunCmd(command, cmdparams); |
216 | RunPluginCommands(command , cmdparams); | 216 | RunPluginCommands(command , cmdparams); |
217 | 217 | ||
218 | switch (command) | 218 | switch (command) |
219 | { | 219 | { |
220 | case "clear-assets": | 220 | case "clear-assets": |
@@ -255,7 +255,7 @@ namespace OpenSim | |||
255 | m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False"); | 255 | m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False"); |
256 | m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim"); | 256 | m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim"); |
257 | m_console.Notice("export-map [filename] - save image of world map"); | 257 | m_console.Notice("export-map [filename] - save image of world map"); |
258 | m_console.Notice("force-update - force an update of prims in the scene"); | 258 | m_console.Notice("force-update - force an update of prims in the scene"); |
259 | m_console.Notice("restart - disconnects all clients and restarts the sims in the instance."); | 259 | m_console.Notice("restart - disconnects all clients and restarts the sims in the instance."); |
260 | m_console.Notice("remove-region [name] - remove a region"); | 260 | m_console.Notice("remove-region [name] - remove a region"); |
261 | m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)"); | 261 | m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)"); |
@@ -273,14 +273,14 @@ namespace OpenSim | |||
273 | m_console.Notice("config set section field value - set a config value"); | 273 | m_console.Notice("config set section field value - set a config value"); |
274 | m_console.Notice("config get section field - get a config value"); | 274 | m_console.Notice("config get section field - get a config value"); |
275 | m_console.Notice("config save - save OpenSim.ini"); | 275 | m_console.Notice("config save - save OpenSim.ini"); |
276 | m_console.Notice("terrain help - show help for terrain commands."); | 276 | m_console.Notice("terrain help - show help for terrain commands."); |
277 | ShowPluginCommandsHelp(CombineParams(cmdparams, 0), m_console); | 277 | ShowPluginCommandsHelp(CombineParams(cmdparams, 0), m_console); |
278 | 278 | ||
279 | if (m_sandbox) | 279 | if (m_sandbox) |
280 | { | 280 | { |
281 | m_console.Notice(""); | 281 | m_console.Notice(""); |
282 | m_console.Notice("create user - adds a new user."); | 282 | m_console.Notice("create user - adds a new user."); |
283 | } | 283 | } |
284 | 284 | ||
285 | break; | 285 | break; |
286 | 286 | ||
@@ -314,11 +314,11 @@ namespace OpenSim | |||
314 | case "load-oar": | 314 | case "load-oar": |
315 | LoadOar(cmdparams); | 315 | LoadOar(cmdparams); |
316 | break; | 316 | break; |
317 | 317 | ||
318 | case "save-oar": | 318 | case "save-oar": |
319 | SaveOar(cmdparams); | 319 | SaveOar(cmdparams); |
320 | break; | 320 | break; |
321 | 321 | ||
322 | case "save-inv": | 322 | case "save-inv": |
323 | SaveInv(cmdparams); | 323 | SaveInv(cmdparams); |
324 | break; | 324 | break; |
@@ -343,13 +343,13 @@ namespace OpenSim | |||
343 | break; | 343 | break; |
344 | 344 | ||
345 | case "create": | 345 | case "create": |
346 | Create(cmdparams); | 346 | Create(cmdparams); |
347 | break; | 347 | break; |
348 | 348 | ||
349 | case "create-region": | 349 | case "create-region": |
350 | CreateRegion(new RegionInfo(cmdparams[0], "Regions/" + cmdparams[1],false), true); | 350 | CreateRegion(new RegionInfo(cmdparams[0], "Regions/" + cmdparams[1],false), true); |
351 | break; | 351 | break; |
352 | 352 | ||
353 | case "remove-region": | 353 | case "remove-region": |
354 | string regName = CombineParams(cmdparams, 0); | 354 | string regName = CombineParams(cmdparams, 0); |
355 | 355 | ||
@@ -441,7 +441,7 @@ namespace OpenSim | |||
441 | } | 441 | } |
442 | } | 442 | } |
443 | break; | 443 | break; |
444 | 444 | ||
445 | case "modules": | 445 | case "modules": |
446 | if (cmdparams.Length > 0) | 446 | if (cmdparams.Length > 0) |
447 | { | 447 | { |
@@ -488,7 +488,7 @@ namespace OpenSim | |||
488 | m_commsManager.AddInventoryService(cmdparams[0]); | 488 | m_commsManager.AddInventoryService(cmdparams[0]); |
489 | } | 489 | } |
490 | break; | 490 | break; |
491 | 491 | ||
492 | default: | 492 | default: |
493 | string[] tmpPluginArgs = new string[cmdparams.Length + 1]; | 493 | string[] tmpPluginArgs = new string[cmdparams.Length + 1]; |
494 | cmdparams.CopyTo(tmpPluginArgs, 1); | 494 | cmdparams.CopyTo(tmpPluginArgs, 1); |
@@ -498,7 +498,7 @@ namespace OpenSim | |||
498 | break; | 498 | break; |
499 | } | 499 | } |
500 | } | 500 | } |
501 | 501 | ||
502 | /// <summary> | 502 | /// <summary> |
503 | /// Change the currently selected region. The selected region is that operated upon by single region commands. | 503 | /// Change the currently selected region. The selected region is that operated upon by single region commands. |
504 | /// </summary> | 504 | /// </summary> |
@@ -515,13 +515,13 @@ namespace OpenSim | |||
515 | else | 515 | else |
516 | { | 516 | { |
517 | m_console.Error("Usage: change-region <region name>"); | 517 | m_console.Error("Usage: change-region <region name>"); |
518 | } | 518 | } |
519 | 519 | ||
520 | string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); | 520 | string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); |
521 | m_console.Notice(String.Format("Currently selected region is {0}", regionName)); | 521 | m_console.Notice(String.Format("Currently selected region is {0}", regionName)); |
522 | m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); | 522 | m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); |
523 | } | 523 | } |
524 | 524 | ||
525 | /// <summary> | 525 | /// <summary> |
526 | /// Execute switch for some of the create commands | 526 | /// Execute switch for some of the create commands |
527 | /// </summary> | 527 | /// </summary> |
@@ -530,7 +530,7 @@ namespace OpenSim | |||
530 | { | 530 | { |
531 | if (args.Length == 0) | 531 | if (args.Length == 0) |
532 | return; | 532 | return; |
533 | 533 | ||
534 | switch (args[0]) | 534 | switch (args[0]) |
535 | { | 535 | { |
536 | case "user": | 536 | case "user": |
@@ -547,7 +547,7 @@ namespace OpenSim | |||
547 | { | 547 | { |
548 | if (args.Length == 0) | 548 | if (args.Length == 0) |
549 | return; | 549 | return; |
550 | 550 | ||
551 | switch (args[0]) | 551 | switch (args[0]) |
552 | { | 552 | { |
553 | case "packet": | 553 | case "packet": |
@@ -566,7 +566,7 @@ namespace OpenSim | |||
566 | } | 566 | } |
567 | 567 | ||
568 | break; | 568 | break; |
569 | 569 | ||
570 | case "scene": | 570 | case "scene": |
571 | if (args.Length == 4) | 571 | if (args.Length == 4) |
572 | { | 572 | { |
@@ -580,11 +580,11 @@ namespace OpenSim | |||
580 | bool collisionsOn = !Convert.ToBoolean(args[2]); | 580 | bool collisionsOn = !Convert.ToBoolean(args[2]); |
581 | bool physicsOn = !Convert.ToBoolean(args[3]); | 581 | bool physicsOn = !Convert.ToBoolean(args[3]); |
582 | m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); | 582 | m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); |
583 | 583 | ||
584 | m_console.Notice( | 584 | m_console.Notice( |
585 | "CONSOLE", | 585 | "CONSOLE", |
586 | String.Format( | 586 | String.Format( |
587 | "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", | 587 | "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", |
588 | !scriptingOn, !collisionsOn, !physicsOn)); | 588 | !scriptingOn, !collisionsOn, !physicsOn)); |
589 | } | 589 | } |
590 | } | 590 | } |
@@ -592,9 +592,9 @@ namespace OpenSim | |||
592 | { | 592 | { |
593 | m_console.Error("debug scene <scripting> <collisions> <physics> (where inside <> is true/false)"); | 593 | m_console.Error("debug scene <scripting> <collisions> <physics> (where inside <> is true/false)"); |
594 | } | 594 | } |
595 | 595 | ||
596 | break; | 596 | break; |
597 | 597 | ||
598 | default: | 598 | default: |
599 | m_console.Error("Unknown debug"); | 599 | m_console.Error("Unknown debug"); |
600 | break; | 600 | break; |
@@ -666,7 +666,7 @@ namespace OpenSim | |||
666 | break; | 666 | break; |
667 | } | 667 | } |
668 | } | 668 | } |
669 | 669 | ||
670 | /// <summary> | 670 | /// <summary> |
671 | /// Create a new user | 671 | /// Create a new user |
672 | /// </summary> | 672 | /// </summary> |
@@ -697,7 +697,7 @@ namespace OpenSim | |||
697 | 697 | ||
698 | if ( cmdparams.Length < 6 ) | 698 | if ( cmdparams.Length < 6 ) |
699 | regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); | 699 | regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); |
700 | else regY = Convert.ToUInt32(cmdparams[5]); | 700 | else regY = Convert.ToUInt32(cmdparams[5]); |
701 | 701 | ||
702 | if (null == m_commsManager.UserService.GetUserProfile(firstName, lastName)) | 702 | if (null == m_commsManager.UserService.GetUserProfile(firstName, lastName)) |
703 | { | 703 | { |
@@ -706,9 +706,9 @@ namespace OpenSim | |||
706 | else | 706 | else |
707 | { | 707 | { |
708 | m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName); | 708 | m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName); |
709 | } | 709 | } |
710 | } | 710 | } |
711 | 711 | ||
712 | protected void SaveXml(string[] cmdparams) | 712 | protected void SaveXml(string[] cmdparams) |
713 | { | 713 | { |
714 | m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); | 714 | m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); |
@@ -721,8 +721,8 @@ namespace OpenSim | |||
721 | { | 721 | { |
722 | m_sceneManager.SaveCurrentSceneToXml(DEFAULT_PRIM_BACKUP_FILENAME); | 722 | m_sceneManager.SaveCurrentSceneToXml(DEFAULT_PRIM_BACKUP_FILENAME); |
723 | } | 723 | } |
724 | } | 724 | } |
725 | 725 | ||
726 | protected void LoadXml(string[] cmdparams) | 726 | protected void LoadXml(string[] cmdparams) |
727 | { | 727 | { |
728 | m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); | 728 | m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); |
@@ -758,8 +758,8 @@ namespace OpenSim | |||
758 | { | 758 | { |
759 | m_sceneManager.LoadCurrentSceneFromXml(DEFAULT_PRIM_BACKUP_FILENAME, false, loadOffset); | 759 | m_sceneManager.LoadCurrentSceneFromXml(DEFAULT_PRIM_BACKUP_FILENAME, false, loadOffset); |
760 | } | 760 | } |
761 | } | 761 | } |
762 | 762 | ||
763 | protected void SaveXml2(string[] cmdparams) | 763 | protected void SaveXml2(string[] cmdparams) |
764 | { | 764 | { |
765 | if (cmdparams.Length > 0) | 765 | if (cmdparams.Length > 0) |
@@ -771,7 +771,7 @@ namespace OpenSim | |||
771 | m_sceneManager.SaveCurrentSceneToXml2(DEFAULT_PRIM_BACKUP_FILENAME); | 771 | m_sceneManager.SaveCurrentSceneToXml2(DEFAULT_PRIM_BACKUP_FILENAME); |
772 | } | 772 | } |
773 | } | 773 | } |
774 | 774 | ||
775 | protected void LoadXml2(string[] cmdparams) | 775 | protected void LoadXml2(string[] cmdparams) |
776 | { | 776 | { |
777 | if (cmdparams.Length > 0) | 777 | if (cmdparams.Length > 0) |
@@ -782,8 +782,8 @@ namespace OpenSim | |||
782 | { | 782 | { |
783 | m_sceneManager.LoadCurrentSceneFromXml2(DEFAULT_PRIM_BACKUP_FILENAME); | 783 | m_sceneManager.LoadCurrentSceneFromXml2(DEFAULT_PRIM_BACKUP_FILENAME); |
784 | } | 784 | } |
785 | } | 785 | } |
786 | 786 | ||
787 | /// <summary> | 787 | /// <summary> |
788 | /// Load a whole region from an opensim archive. | 788 | /// Load a whole region from an opensim archive. |
789 | /// </summary> | 789 | /// </summary> |
@@ -800,9 +800,9 @@ namespace OpenSim | |||
800 | else | 800 | else |
801 | { | 801 | { |
802 | m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME); | 802 | m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME); |
803 | } | 803 | } |
804 | } | 804 | } |
805 | 805 | ||
806 | /// <summary> | 806 | /// <summary> |
807 | /// Save a region to a file, including all the assets needed to restore it. | 807 | /// Save a region to a file, including all the assets needed to restore it. |
808 | /// </summary> | 808 | /// </summary> |
@@ -819,8 +819,8 @@ namespace OpenSim | |||
819 | else | 819 | else |
820 | { | 820 | { |
821 | m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); | 821 | m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); |
822 | } | 822 | } |
823 | } | 823 | } |
824 | 824 | ||
825 | private static string CombineParams(string[] commandParams, int pos) | 825 | private static string CombineParams(string[] commandParams, int pos) |
826 | { | 826 | { |
@@ -835,7 +835,7 @@ namespace OpenSim | |||
835 | 835 | ||
836 | /// <summary> | 836 | /// <summary> |
837 | /// Runs the best matching plugin command | 837 | /// Runs the best matching plugin command |
838 | /// | 838 | /// |
839 | /// returns true if a match was found, false otherwise. | 839 | /// returns true if a match was found, false otherwise. |
840 | /// </summary> | 840 | /// </summary> |
841 | public bool RunPluginCommands(string cmd, string[] withParams) | 841 | public bool RunPluginCommands(string cmd, string[] withParams) |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0ac8cd7..983773a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim | |||
70 | /// The file used to load and save an opensim archive if no filename has been specified | 70 | /// The file used to load and save an opensim archive if no filename has been specified |
71 | /// </summary> | 71 | /// </summary> |
72 | protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene_oar.tar.gz"; | 72 | protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene_oar.tar.gz"; |
73 | 73 | ||
74 | /// <summary> | 74 | /// <summary> |
75 | /// The file to load and save inventory if no filename has been specified | 75 | /// The file to load and save inventory if no filename has been specified |
76 | /// </summary> | 76 | /// </summary> |
@@ -161,7 +161,7 @@ namespace OpenSim | |||
161 | m_config = new OpenSimConfigSource(); | 161 | m_config = new OpenSimConfigSource(); |
162 | m_config.Source = new IniConfigSource(); | 162 | m_config.Source = new IniConfigSource(); |
163 | // IConfigSource icong; | 163 | // IConfigSource icong; |
164 | 164 | ||
165 | //check for .INI file (either default or name passed in command line) | 165 | //check for .INI file (either default or name passed in command line) |
166 | if (File.Exists(Application.iniFilePath)) | 166 | if (File.Exists(Application.iniFilePath)) |
167 | { | 167 | { |
@@ -338,7 +338,7 @@ namespace OpenSim | |||
338 | 338 | ||
339 | protected void LoadPlugins() | 339 | protected void LoadPlugins() |
340 | { | 340 | { |
341 | PluginLoader<IApplicationPlugin> loader = | 341 | PluginLoader<IApplicationPlugin> loader = |
342 | new PluginLoader<IApplicationPlugin> (new ApplicationPluginInitialiser (this)); | 342 | new PluginLoader<IApplicationPlugin> (new ApplicationPluginInitialiser (this)); |
343 | 343 | ||
344 | loader.Load ("/OpenSim/Startup"); | 344 | loader.Load ("/OpenSim/Startup"); |
@@ -351,7 +351,7 @@ namespace OpenSim | |||
351 | public override void Startup() | 351 | public override void Startup() |
352 | { | 352 | { |
353 | base.Startup(); | 353 | base.Startup(); |
354 | 354 | ||
355 | m_stats = StatsManager.StartCollectingSimExtraStats(); | 355 | m_stats = StatsManager.StartCollectingSimExtraStats(); |
356 | 356 | ||
357 | // StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false) | 357 | // StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false) |
@@ -586,7 +586,7 @@ namespace OpenSim | |||
586 | public void handleRestartRegion(RegionInfo whichRegion) | 586 | public void handleRestartRegion(RegionInfo whichRegion) |
587 | { | 587 | { |
588 | m_log.Error("[OPENSIM MAIN]: Got restart signal from SceneManager"); | 588 | m_log.Error("[OPENSIM MAIN]: Got restart signal from SceneManager"); |
589 | 589 | ||
590 | // Shutting down the client server | 590 | // Shutting down the client server |
591 | bool foundClientServer = false; | 591 | bool foundClientServer = false; |
592 | int clientServerElement = 0; | 592 | int clientServerElement = 0; |
@@ -660,7 +660,7 @@ namespace OpenSim | |||
660 | } | 660 | } |
661 | 661 | ||
662 | #endregion | 662 | #endregion |
663 | 663 | ||
664 | /// <summary> | 664 | /// <summary> |
665 | /// Save inventory to a file. | 665 | /// Save inventory to a file. |
666 | /// </summary> | 666 | /// </summary> |
@@ -668,49 +668,49 @@ namespace OpenSim | |||
668 | protected void SaveInv(string[] cmdparams) | 668 | protected void SaveInv(string[] cmdparams) |
669 | { | 669 | { |
670 | m_log.Error("[CONSOLE]: This command has not yet been implemented!"); | 670 | m_log.Error("[CONSOLE]: This command has not yet been implemented!"); |
671 | 671 | ||
672 | if (cmdparams.Length < 3) | 672 | if (cmdparams.Length < 3) |
673 | { | 673 | { |
674 | m_log.Error("[CONSOLE]: usage is save-inv <first name> <last name> <inventory path> [<save file path>]"); | 674 | m_log.Error("[CONSOLE]: usage is save-inv <first name> <last name> <inventory path> [<save file path>]"); |
675 | return; | 675 | return; |
676 | } | 676 | } |
677 | 677 | ||
678 | string firstName = cmdparams[0]; | 678 | string firstName = cmdparams[0]; |
679 | string lastName = cmdparams[1]; | 679 | string lastName = cmdparams[1]; |
680 | string invPath = cmdparams[2]; | 680 | string invPath = cmdparams[2]; |
681 | //string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME); | 681 | //string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME); |
682 | 682 | ||
683 | UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(firstName, lastName); | 683 | UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(firstName, lastName); |
684 | if (null == userProfile) | 684 | if (null == userProfile) |
685 | { | 685 | { |
686 | m_log.ErrorFormat("[CONSOLE]: Failed to find user {0} {1}", firstName, lastName); | 686 | m_log.ErrorFormat("[CONSOLE]: Failed to find user {0} {1}", firstName, lastName); |
687 | return; | 687 | return; |
688 | } | 688 | } |
689 | 689 | ||
690 | CachedUserInfo userInfo = m_commsManager.UserProfileCacheService.GetUserDetails(userProfile.ID); | 690 | CachedUserInfo userInfo = m_commsManager.UserProfileCacheService.GetUserDetails(userProfile.ID); |
691 | if (null == userInfo) | 691 | if (null == userInfo) |
692 | { | 692 | { |
693 | m_log.ErrorFormat("[CONSOLE]: Failed to find user info for {0} {1} {2}", firstName, lastName, userProfile.ID); | 693 | m_log.ErrorFormat("[CONSOLE]: Failed to find user info for {0} {1} {2}", firstName, lastName, userProfile.ID); |
694 | return; | 694 | return; |
695 | } | 695 | } |
696 | 696 | ||
697 | InventoryFolderImpl inventoryFolder = null; | 697 | InventoryFolderImpl inventoryFolder = null; |
698 | InventoryItemBase inventoryItem = null; | 698 | InventoryItemBase inventoryItem = null; |
699 | 699 | ||
700 | if (userInfo.HasReceivedInventory) | 700 | if (userInfo.HasReceivedInventory) |
701 | { | 701 | { |
702 | // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl | 702 | // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl |
703 | // itself (possibly at a small loss in efficiency). | 703 | // itself (possibly at a small loss in efficiency). |
704 | string[] components | 704 | string[] components |
705 | = invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); | 705 | = invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); |
706 | invPath = String.Empty; | 706 | invPath = String.Empty; |
707 | foreach (string c in components) | 707 | foreach (string c in components) |
708 | { | 708 | { |
709 | invPath += c + InventoryFolderImpl.PATH_DELIMITER; | 709 | invPath += c + InventoryFolderImpl.PATH_DELIMITER; |
710 | } | 710 | } |
711 | 711 | ||
712 | invPath = invPath.Remove(invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER)); | 712 | invPath = invPath.Remove(invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER)); |
713 | 713 | ||
714 | // Annoyingly Split actually returns the original string if the input string consists only of delimiters | 714 | // Annoyingly Split actually returns the original string if the input string consists only of delimiters |
715 | // Therefore if we still start with a / after the split, then we need the root folder | 715 | // Therefore if we still start with a / after the split, then we need the root folder |
716 | if (invPath.StartsWith(InventoryFolderImpl.PATH_DELIMITER)) | 716 | if (invPath.StartsWith(InventoryFolderImpl.PATH_DELIMITER)) |
@@ -718,10 +718,10 @@ namespace OpenSim | |||
718 | inventoryFolder = userInfo.RootFolder; | 718 | inventoryFolder = userInfo.RootFolder; |
719 | } | 719 | } |
720 | else | 720 | else |
721 | { | 721 | { |
722 | inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); | 722 | inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); |
723 | } | 723 | } |
724 | 724 | ||
725 | // The path may point to an item instead | 725 | // The path may point to an item instead |
726 | if (inventoryFolder == null) | 726 | if (inventoryFolder == null) |
727 | { | 727 | { |
@@ -733,7 +733,7 @@ namespace OpenSim | |||
733 | m_log.ErrorFormat("[CONSOLE]: Have not yet received inventory info for user {0} {1} {2}", firstName, lastName, userProfile.ID); | 733 | m_log.ErrorFormat("[CONSOLE]: Have not yet received inventory info for user {0} {1} {2}", firstName, lastName, userProfile.ID); |
734 | return; | 734 | return; |
735 | } | 735 | } |
736 | 736 | ||
737 | if (null != inventoryFolder) | 737 | if (null != inventoryFolder) |
738 | { | 738 | { |
739 | m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, invPath); | 739 | m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, invPath); |
@@ -746,8 +746,8 @@ namespace OpenSim | |||
746 | { | 746 | { |
747 | m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); | 747 | m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); |
748 | return; | 748 | return; |
749 | } | 749 | } |
750 | } | 750 | } |
751 | 751 | ||
752 | /// <summary> | 752 | /// <summary> |
753 | /// Performs any last-minute sanity checking and shuts down the region server | 753 | /// Performs any last-minute sanity checking and shuts down the region server |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index b14b3db..3c24fb6 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -230,7 +230,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
230 | 230 | ||
231 | private RegionHandleRequest handlerRegionHandleRequest = null; // OnRegionHandleRequest | 231 | private RegionHandleRequest handlerRegionHandleRequest = null; // OnRegionHandleRequest |
232 | private ParcelInfoRequest handlerParcelInfoRequest = null; // OnParcelInfoRequest | 232 | private ParcelInfoRequest handlerParcelInfoRequest = null; // OnParcelInfoRequest |
233 | 233 | ||
234 | private ScriptAnswer handlerScriptAnswer = null; | 234 | private ScriptAnswer handlerScriptAnswer = null; |
235 | private RequestPayPrice handlerRequestPayPrice = null; | 235 | private RequestPayPrice handlerRequestPayPrice = null; |
236 | private ObjectDeselect handlerObjectDetach = null; | 236 | private ObjectDeselect handlerObjectDetach = null; |
@@ -366,7 +366,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
366 | 366 | ||
367 | public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, | 367 | public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, |
368 | AgentCircuitManager authenSessions, LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP) | 368 | AgentCircuitManager authenSessions, LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP) |
369 | { | 369 | { |
370 | m_moneyBalance = 1000; | 370 | m_moneyBalance = 1000; |
371 | 371 | ||
372 | m_channelVersion = Helpers.StringToField(scene.GetSimulatorVersion()); | 372 | m_channelVersion = Helpers.StringToField(scene.GetSimulatorVersion()); |
@@ -378,7 +378,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
378 | 378 | ||
379 | m_networkServer = packServer; | 379 | m_networkServer = packServer; |
380 | // m_inventoryCache = inventoryCache; | 380 | // m_inventoryCache = inventoryCache; |
381 | m_authenticateSessionsHandler = authenSessions; | 381 | m_authenticateSessionsHandler = authenSessions; |
382 | 382 | ||
383 | m_agentId = agentId; | 383 | m_agentId = agentId; |
384 | m_sessionId = sessionId; | 384 | m_sessionId = sessionId; |
@@ -404,8 +404,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
404 | m_clientThread.IsBackground = true; | 404 | m_clientThread.IsBackground = true; |
405 | m_clientThread.Start(); | 405 | m_clientThread.Start(); |
406 | ThreadTracker.Add(m_clientThread); | 406 | ThreadTracker.Add(m_clientThread); |
407 | 407 | ||
408 | m_log.Info("[CLIENT]: Started up new thread to handle client UDP session"); | 408 | m_log.Info("[CLIENT]: Started up new thread to handle client UDP session"); |
409 | } | 409 | } |
410 | 410 | ||
411 | public void SetDebug(int newDebug) | 411 | public void SetDebug(int newDebug) |
@@ -457,9 +457,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
457 | public void Close(bool shutdownCircuit) | 457 | public void Close(bool shutdownCircuit) |
458 | { | 458 | { |
459 | m_log.DebugFormat( | 459 | m_log.DebugFormat( |
460 | "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}", | 460 | "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}", |
461 | shutdownCircuit, m_scene.RegionInfo.RegionName); | 461 | shutdownCircuit, m_scene.RegionInfo.RegionName); |
462 | 462 | ||
463 | m_PacketHandler.Flush(); | 463 | m_PacketHandler.Flush(); |
464 | 464 | ||
465 | // raise an event on the packet server to Shutdown the circuit | 465 | // raise an event on the packet server to Shutdown the circuit |
@@ -639,7 +639,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
639 | # endregion | 639 | # endregion |
640 | 640 | ||
641 | protected int m_terrainCheckerCount = 0; | 641 | protected int m_terrainCheckerCount = 0; |
642 | 642 | ||
643 | /// <summary> | 643 | /// <summary> |
644 | /// Event handler for check client timer | 644 | /// Event handler for check client timer |
645 | /// Checks to ensure that the client is still connected. If the client has failed to respond to many pings | 645 | /// Checks to ensure that the client is still connected. If the client has failed to respond to many pings |
@@ -652,15 +652,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
652 | if (m_PacketHandler.PacketsReceived == m_PacketHandler.PacketsReceivedReported) | 652 | if (m_PacketHandler.PacketsReceived == m_PacketHandler.PacketsReceivedReported) |
653 | { | 653 | { |
654 | m_probesWithNoIngressPackets++; | 654 | m_probesWithNoIngressPackets++; |
655 | if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) | 655 | if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) |
656 | || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) | 656 | || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) |
657 | { | 657 | { |
658 | if (OnConnectionClosed != null) | 658 | if (OnConnectionClosed != null) |
659 | { | 659 | { |
660 | m_log.WarnFormat( | 660 | m_log.WarnFormat( |
661 | "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection", | 661 | "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection", |
662 | Name, AgentId); | 662 | Name, AgentId); |
663 | 663 | ||
664 | OnConnectionClosed(this); | 664 | OnConnectionClosed(this); |
665 | } | 665 | } |
666 | } | 666 | } |
@@ -694,7 +694,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
694 | m_clientPingTimer = new Timer(5000); | 694 | m_clientPingTimer = new Timer(5000); |
695 | m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); | 695 | m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); |
696 | m_clientPingTimer.Enabled = true; | 696 | m_clientPingTimer.Enabled = true; |
697 | 697 | ||
698 | m_scene.AddNewClient(this, true); | 698 | m_scene.AddNewClient(this, true); |
699 | } | 699 | } |
700 | 700 | ||
@@ -764,7 +764,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
764 | 764 | ||
765 | LLQueItem item = new LLQueItem(); | 765 | LLQueItem item = new LLQueItem(); |
766 | item.Packet = packet; | 766 | item.Packet = packet; |
767 | 767 | ||
768 | m_PacketHandler.ProcessOutPacket(item); | 768 | m_PacketHandler.ProcessOutPacket(item); |
769 | 769 | ||
770 | // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to | 770 | // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to |
@@ -1091,7 +1091,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1091 | for (int y = 0; y < 16; y++) | 1091 | for (int y = 0; y < 16; y++) |
1092 | { | 1092 | { |
1093 | // For some terrains, sending more than one terrain patch at once results in a libsecondlife exception | 1093 | // For some terrains, sending more than one terrain patch at once results in a libsecondlife exception |
1094 | // see http://opensimulator.org/mantis/view.php?id=1662 | 1094 | // see http://opensimulator.org/mantis/view.php?id=1662 |
1095 | //for (int x = 0; x < 16; x += 4) | 1095 | //for (int x = 0; x < 16; x += 4) |
1096 | //{ | 1096 | //{ |
1097 | // SendLayerPacket(map, y, x); | 1097 | // SendLayerPacket(map, y, x); |
@@ -1113,7 +1113,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1113 | /// <summary> | 1113 | /// <summary> |
1114 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client | 1114 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client |
1115 | /// </summary> | 1115 | /// </summary> |
1116 | /// <param name="map">heightmap</param> | 1116 | /// <param name="map">heightmap</param> |
1117 | /// <param name="px">X coordinate for patches 0..12</param> | 1117 | /// <param name="px">X coordinate for patches 0..12</param> |
1118 | /// <param name="py">Y coordinate for patches 0..15</param> | 1118 | /// <param name="py">Y coordinate for patches 0..15</param> |
1119 | // private void SendLayerPacket(float[] map, int y, int x) | 1119 | // private void SendLayerPacket(float[] map, int y, int x) |
@@ -1147,7 +1147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1147 | 1147 | ||
1148 | LayerDataPacket layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); | 1148 | LayerDataPacket layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); |
1149 | layerpack.Header.Zerocoded = true; | 1149 | layerpack.Header.Zerocoded = true; |
1150 | 1150 | ||
1151 | OutPacket(layerpack, ThrottleOutPacketType.Land); | 1151 | OutPacket(layerpack, ThrottleOutPacketType.Land); |
1152 | } | 1152 | } |
1153 | catch (Exception e) | 1153 | catch (Exception e) |
@@ -1157,7 +1157,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | /// <summary> | 1159 | /// <summary> |
1160 | /// Tell the client that the given neighbour region is ready to receive a child agent. | 1160 | /// Tell the client that the given neighbour region is ready to receive a child agent. |
1161 | /// </summary> | 1161 | /// </summary> |
1162 | /// <param name="neighbourHandle"></param> | 1162 | /// <param name="neighbourHandle"></param> |
1163 | /// <param name="neighbourIP"></param> | 1163 | /// <param name="neighbourIP"></param> |
@@ -3405,7 +3405,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3405 | } | 3405 | } |
3406 | 3406 | ||
3407 | /// <summary> | 3407 | /// <summary> |
3408 | /// | 3408 | /// |
3409 | /// </summary> | 3409 | /// </summary> |
3410 | /// <param name="client"></param> | 3410 | /// <param name="client"></param> |
3411 | /// <returns></returns> | 3411 | /// <returns></returns> |
@@ -3682,7 +3682,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3682 | 3682 | ||
3683 | /// <summary> | 3683 | /// <summary> |
3684 | /// returns a byte array of the client set throttles Gets multiplied by the multiplier | 3684 | /// returns a byte array of the client set throttles Gets multiplied by the multiplier |
3685 | /// | 3685 | /// |
3686 | /// </summary> | 3686 | /// </summary> |
3687 | /// <param name="multiplier">non 1 multiplier for subdividing the throttles between individual regions</param> | 3687 | /// <param name="multiplier">non 1 multiplier for subdividing the throttles between individual regions</param> |
3688 | /// <returns></returns> | 3688 | /// <returns></returns> |
@@ -3691,7 +3691,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3691 | return m_PacketHandler.PacketQueue.GetThrottlesPacked(multiplier); | 3691 | return m_PacketHandler.PacketQueue.GetThrottlesPacked(multiplier); |
3692 | } | 3692 | } |
3693 | /// <summary> | 3693 | /// <summary> |
3694 | /// sets the throttles from values supplied by the client | 3694 | /// sets the throttles from values supplied by the client |
3695 | /// </summary> | 3695 | /// </summary> |
3696 | /// <param name="throttles"></param> | 3696 | /// <param name="throttles"></param> |
3697 | public void SetChildAgentThrottle(byte[] throttles) | 3697 | public void SetChildAgentThrottle(byte[] throttles) |
@@ -5291,24 +5291,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5291 | 5291 | ||
5292 | case PacketType.RegionHandleRequest: | 5292 | case PacketType.RegionHandleRequest: |
5293 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; | 5293 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; |
5294 | 5294 | ||
5295 | handlerRegionHandleRequest = OnRegionHandleRequest; | 5295 | handlerRegionHandleRequest = OnRegionHandleRequest; |
5296 | if (handlerRegionHandleRequest != null) | 5296 | if (handlerRegionHandleRequest != null) |
5297 | { | 5297 | { |
5298 | handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); | 5298 | handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); |
5299 | } | 5299 | } |
5300 | break; | 5300 | break; |
5301 | 5301 | ||
5302 | case PacketType.ParcelInfoRequest: | 5302 | case PacketType.ParcelInfoRequest: |
5303 | ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack; | 5303 | ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack; |
5304 | 5304 | ||
5305 | handlerParcelInfoRequest = OnParcelInfoRequest; | 5305 | handlerParcelInfoRequest = OnParcelInfoRequest; |
5306 | if (handlerParcelInfoRequest != null) | 5306 | if (handlerParcelInfoRequest != null) |
5307 | { | 5307 | { |
5308 | handlerParcelInfoRequest(this, pirPack.Data.ParcelID); | 5308 | handlerParcelInfoRequest(this, pirPack.Data.ParcelID); |
5309 | } | 5309 | } |
5310 | break; | 5310 | break; |
5311 | 5311 | ||
5312 | case PacketType.ParcelAccessListRequest: | 5312 | case PacketType.ParcelAccessListRequest: |
5313 | ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; | 5313 | ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; |
5314 | 5314 | ||
@@ -6277,10 +6277,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6277 | } | 6277 | } |
6278 | 6278 | ||
6279 | #endregion | 6279 | #endregion |
6280 | 6280 | ||
6281 | 6281 | ||
6282 | #region Camera | 6282 | #region Camera |
6283 | 6283 | ||
6284 | public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) | 6284 | public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) |
6285 | { | 6285 | { |
6286 | SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties); | 6286 | SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties); |
@@ -6292,7 +6292,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6292 | SetFollowCamPropertiesPacket.CameraPropertyBlock block = new SetFollowCamPropertiesPacket.CameraPropertyBlock(); | 6292 | SetFollowCamPropertiesPacket.CameraPropertyBlock block = new SetFollowCamPropertiesPacket.CameraPropertyBlock(); |
6293 | block.Type = pair.Key; | 6293 | block.Type = pair.Key; |
6294 | block.Value = pair.Value; | 6294 | block.Value = pair.Value; |
6295 | 6295 | ||
6296 | camPropBlock[idx++] = block; | 6296 | camPropBlock[idx++] = block; |
6297 | } | 6297 | } |
6298 | packet.CameraProperty = camPropBlock; | 6298 | packet.CameraProperty = camPropBlock; |
@@ -6314,7 +6314,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6314 | reply.ReplyBlock.RegionHandle = handle; | 6314 | reply.ReplyBlock.RegionHandle = handle; |
6315 | OutPacket(reply, ThrottleOutPacketType.Land); | 6315 | OutPacket(reply, ThrottleOutPacketType.Land); |
6316 | } | 6316 | } |
6317 | 6317 | ||
6318 | public void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y) | 6318 | public void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y) |
6319 | { | 6319 | { |
6320 | ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); | 6320 | ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); |
@@ -6325,16 +6325,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6325 | reply.Data.Desc = Helpers.StringToField(land.Description); | 6325 | reply.Data.Desc = Helpers.StringToField(land.Description); |
6326 | reply.Data.ActualArea = land.Area; | 6326 | reply.Data.ActualArea = land.Area; |
6327 | reply.Data.BillableArea = land.Area; // TODO: what is this? | 6327 | reply.Data.BillableArea = land.Area; // TODO: what is this? |
6328 | 6328 | ||
6329 | // Bit 0: Mature, bit 7: on sale, other bits: no idea | 6329 | // Bit 0: Mature, bit 7: on sale, other bits: no idea |
6330 | reply.Data.Flags = (byte)( | 6330 | reply.Data.Flags = (byte)( |
6331 | ((land.Flags & (uint)Parcel.ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) + | 6331 | ((land.Flags & (uint)Parcel.ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) + |
6332 | ((land.Flags & (uint)Parcel.ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); | 6332 | ((land.Flags & (uint)Parcel.ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); |
6333 | 6333 | ||
6334 | LLVector3 pos = land.UserLocation; | 6334 | LLVector3 pos = land.UserLocation; |
6335 | if (pos.Equals(LLVector3.Zero)) | 6335 | if (pos.Equals(LLVector3.Zero)) |
6336 | { | 6336 | { |
6337 | pos = (land.AABBMax + land.AABBMin) * 0.5f; | 6337 | pos = (land.AABBMax + land.AABBMin) * 0.5f; |
6338 | } | 6338 | } |
6339 | reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x; | 6339 | reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x; |
6340 | reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y; | 6340 | reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y; |
@@ -6344,7 +6344,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6344 | reply.Data.Dwell = 0; // TODO: not implemented yet | 6344 | reply.Data.Dwell = 0; // TODO: not implemented yet |
6345 | reply.Data.SalePrice = land.SalePrice; | 6345 | reply.Data.SalePrice = land.SalePrice; |
6346 | reply.Data.AuctionID = (int)land.AuctionID; | 6346 | reply.Data.AuctionID = (int)land.AuctionID; |
6347 | 6347 | ||
6348 | OutPacket(reply, ThrottleOutPacketType.Land); | 6348 | OutPacket(reply, ThrottleOutPacketType.Land); |
6349 | } | 6349 | } |
6350 | } | 6350 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 8fe9a7b..8023f58 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | |||
@@ -230,7 +230,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
230 | { | 230 | { |
231 | // Call the load balancer's hook. If this is not active here | 231 | // Call the load balancer's hook. If this is not active here |
232 | // we defer to the sim server this client is actually connected | 232 | // we defer to the sim server this client is actually connected |
233 | // to. Packet drop notifies will not be triggered in this | 233 | // to. Packet drop notifies will not be triggered in this |
234 | // configuration! | 234 | // configuration! |
235 | // | 235 | // |
236 | if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) | 236 | if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) |
@@ -282,7 +282,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
282 | } | 282 | } |
283 | } | 283 | } |
284 | } | 284 | } |
285 | 285 | ||
286 | private void QueuePacket( | 286 | private void QueuePacket( |
287 | Packet packet, ThrottleOutPacketType throttlePacketType, | 287 | Packet packet, ThrottleOutPacketType throttlePacketType, |
288 | Object id) | 288 | Object id) |
@@ -303,7 +303,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
303 | { | 303 | { |
304 | int now = System.Environment.TickCount; | 304 | int now = System.Environment.TickCount; |
305 | int lastAck = m_LastAck; | 305 | int lastAck = m_LastAck; |
306 | 306 | ||
307 | // Unless we have received at least one ack, don't bother resending | 307 | // Unless we have received at least one ack, don't bother resending |
308 | // anything. There may not be a client there, don't clog up the | 308 | // anything. There may not be a client there, don't clog up the |
309 | // pipes. | 309 | // pipes. |
@@ -558,7 +558,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
558 | 558 | ||
559 | PruneDupeTracker(); | 559 | PruneDupeTracker(); |
560 | 560 | ||
561 | // Check for duplicate packets.. packets that the client is | 561 | // Check for duplicate packets.. packets that the client is |
562 | // resending because it didn't receive our ack | 562 | // resending because it didn't receive our ack |
563 | // | 563 | // |
564 | lock (m_DupeTracker) | 564 | lock (m_DupeTracker) |
@@ -677,7 +677,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
677 | 677 | ||
678 | m_Sequence = info.sequence; | 678 | m_Sequence = info.sequence; |
679 | } | 679 | } |
680 | 680 | ||
681 | public void AddImportantPacket(PacketType type) | 681 | public void AddImportantPacket(PacketType type) |
682 | { | 682 | { |
683 | if (m_ImportantPackets.Contains(type)) | 683 | if (m_ImportantPackets.Contains(type)) |
@@ -693,7 +693,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
693 | 693 | ||
694 | m_ImportantPackets.Remove(type); | 694 | m_ImportantPackets.Remove(type); |
695 | } | 695 | } |
696 | 696 | ||
697 | private void DropResend(Object id) | 697 | private void DropResend(Object id) |
698 | { | 698 | { |
699 | foreach (AckData data in new List<AckData>(m_NeedAck.Values)) | 699 | foreach (AckData data in new List<AckData>(m_NeedAck.Values)) |
@@ -736,7 +736,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
736 | if (packet.Header.Reliable) | 736 | if (packet.Header.Reliable) |
737 | { | 737 | { |
738 | m_UnackedBytes += packet.ToBytes().Length; | 738 | m_UnackedBytes += packet.ToBytes().Length; |
739 | m_NeedAck[packet.Header.Sequence] = new AckData(packet, | 739 | m_NeedAck[packet.Header.Sequence] = new AckData(packet, |
740 | item.Identifier); | 740 | item.Identifier); |
741 | } | 741 | } |
742 | } | 742 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 5903661..7c21df2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -213,7 +213,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
213 | } | 213 | } |
214 | 214 | ||
215 | BeginReceive(); | 215 | BeginReceive(); |
216 | 216 | ||
217 | if (packet != null) | 217 | if (packet != null) |
218 | { | 218 | { |
219 | try | 219 | try |
@@ -297,11 +297,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
297 | m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, | 297 | m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, |
298 | ReceivedData, null); | 298 | ReceivedData, null); |
299 | 299 | ||
300 | // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. | 300 | // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. |
301 | // so therefore.. we've got to tell the server to BeginReceiveFrom again. | 301 | // so therefore.. we've got to tell the server to BeginReceiveFrom again. |
302 | // This will happen over and over until we've gone through all packets | 302 | // This will happen over and over until we've gone through all packets |
303 | // sent to and from this particular user. | 303 | // sent to and from this particular user. |
304 | // Stupid I know.. | 304 | // Stupid I know.. |
305 | // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. | 305 | // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. |
306 | } | 306 | } |
307 | catch (SocketException e) | 307 | catch (SocketException e) |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
329 | { | 329 | { |
330 | if (!(packet is UseCircuitCodePacket)) | 330 | if (!(packet is UseCircuitCodePacket)) |
331 | return; | 331 | return; |
332 | 332 | ||
333 | UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; | 333 | UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; |
334 | lock (clientCircuits) | 334 | lock (clientCircuits) |
335 | { | 335 | { |
@@ -424,13 +424,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
424 | public virtual void RemoveClientCircuit(uint circuitcode) | 424 | public virtual void RemoveClientCircuit(uint circuitcode) |
425 | { | 425 | { |
426 | EndPoint sendto = null; | 426 | EndPoint sendto = null; |
427 | if (clientCircuits_reverse.Contains(circuitcode)) | 427 | if (clientCircuits_reverse.Contains(circuitcode)) |
428 | { | 428 | { |
429 | sendto = (EndPoint)clientCircuits_reverse[circuitcode]; | 429 | sendto = (EndPoint)clientCircuits_reverse[circuitcode]; |
430 | 430 | ||
431 | clientCircuits_reverse.Remove(circuitcode); | 431 | clientCircuits_reverse.Remove(circuitcode); |
432 | 432 | ||
433 | lock (clientCircuits) | 433 | lock (clientCircuits) |
434 | { | 434 | { |
435 | if (sendto != null) | 435 | if (sendto != null) |
436 | { | 436 | { |
@@ -442,7 +442,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
442 | "[UDPSERVER]: endpoint for circuit code {0} in RemoveClientCircuit() was unexpectedly null!", circuitcode); | 442 | "[UDPSERVER]: endpoint for circuit code {0} in RemoveClientCircuit() was unexpectedly null!", circuitcode); |
443 | } | 443 | } |
444 | } | 444 | } |
445 | lock (proxyCircuits) | 445 | lock (proxyCircuits) |
446 | { | 446 | { |
447 | proxyCircuits.Remove(circuitcode); | 447 | proxyCircuits.Remove(circuitcode); |
448 | } | 448 | } |
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 7a552a6..91f7472 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.ClientStack | |||
74 | public override void Startup() | 74 | public override void Startup() |
75 | { | 75 | { |
76 | base.Startup(); | 76 | base.Startup(); |
77 | 77 | ||
78 | m_storageManager = CreateStorageManager(m_storageConnectionString, m_estateConnectionString); | 78 | m_storageManager = CreateStorageManager(m_storageConnectionString, m_estateConnectionString); |
79 | 79 | ||
80 | m_clientStackManager = CreateClientStackManager(); | 80 | m_clientStackManager = CreateClientStackManager(); |
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 8149bcc..7501967 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs | |||
@@ -496,13 +496,13 @@ namespace OpenSim.Region.Communications.Local | |||
496 | { | 496 | { |
497 | m_log.DebugFormat("[INTERREGION STANDALONE] requests land data in {0}, at {1}, {2}", | 497 | m_log.DebugFormat("[INTERREGION STANDALONE] requests land data in {0}, at {1}, {2}", |
498 | regionHandle, x, y); | 498 | regionHandle, x, y); |
499 | 499 | ||
500 | if (m_regionListeners.ContainsKey(regionHandle)) | 500 | if (m_regionListeners.ContainsKey(regionHandle)) |
501 | { | 501 | { |
502 | LandData land = m_regionListeners[regionHandle].TriggerGetLandData(x, y); | 502 | LandData land = m_regionListeners[regionHandle].TriggerGetLandData(x, y); |
503 | return land; | 503 | return land; |
504 | } | 504 | } |
505 | 505 | ||
506 | m_log.Debug("[INTERREGION STANDALONE] didn't find land data locally."); | 506 | m_log.Debug("[INTERREGION STANDALONE] didn't find land data locally."); |
507 | return null; | 507 | return null; |
508 | } | 508 | } |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 9a4c166..7baaa16 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
139 | try | 139 | try |
140 | { | 140 | { |
141 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); | 141 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); |
142 | 142 | ||
143 | // The timeout should always be significantly larger than the timeout for the grid server to request | 143 | // The timeout should always be significantly larger than the timeout for the grid server to request |
144 | // the initial status of the region before confirming registration. | 144 | // the initial status of the region before confirming registration. |
145 | GridResp = GridReq.Send(serversInfo.GridURL, 90000); | 145 | GridResp = GridReq.Send(serversInfo.GridURL, 90000); |
@@ -630,7 +630,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
630 | } | 630 | } |
631 | 631 | ||
632 | XmlRpcResponse resp = new XmlRpcResponse(); | 632 | XmlRpcResponse resp = new XmlRpcResponse(); |
633 | 633 | ||
634 | if (banned) | 634 | if (banned) |
635 | { | 635 | { |
636 | m_log.InfoFormat("[OGS1 GRID SERVICES]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname); | 636 | m_log.InfoFormat("[OGS1 GRID SERVICES]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname); |
@@ -645,7 +645,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
645 | m_log.Debug("[CONNECTION DEBUGGING]: Triggering welcome for " + agentData.AgentID.ToString() + " into " + regionHandle.ToString()); | 645 | m_log.Debug("[CONNECTION DEBUGGING]: Triggering welcome for " + agentData.AgentID.ToString() + " into " + regionHandle.ToString()); |
646 | m_localBackend.TriggerExpectUser(regionHandle, agentData); | 646 | m_localBackend.TriggerExpectUser(regionHandle, agentData); |
647 | m_log.Info("[OGS1 GRID SERVICES]: Welcoming new user..."); | 647 | m_log.Info("[OGS1 GRID SERVICES]: Welcoming new user..."); |
648 | Hashtable respdata = new Hashtable(); | 648 | Hashtable respdata = new Hashtable(); |
649 | respdata["success"] = "TRUE"; | 649 | respdata["success"] = "TRUE"; |
650 | resp.Value = respdata; | 650 | resp.Value = respdata; |
651 | 651 | ||
@@ -1638,10 +1638,10 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1638 | hash["region_handle"] = regionHandle.ToString(); | 1638 | hash["region_handle"] = regionHandle.ToString(); |
1639 | hash["x"] = x.ToString(); | 1639 | hash["x"] = x.ToString(); |
1640 | hash["y"] = y.ToString(); | 1640 | hash["y"] = y.ToString(); |
1641 | 1641 | ||
1642 | IList paramList = new ArrayList(); | 1642 | IList paramList = new ArrayList(); |
1643 | paramList.Add(hash); | 1643 | paramList.Add(hash); |
1644 | 1644 | ||
1645 | // this might be cached, as we probably requested it just a moment ago... | 1645 | // this might be cached, as we probably requested it just a moment ago... |
1646 | RegionInfo info = RequestNeighbourInfo(regionHandle); | 1646 | RegionInfo info = RequestNeighbourInfo(regionHandle); |
1647 | 1647 | ||
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 06a28d0..1d86646 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | |||
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
252 | IList parameters = new ArrayList(); | 252 | IList parameters = new ArrayList(); |
253 | parameters.Add(param); | 253 | parameters.Add(param); |
254 | XmlRpcRequest req = new XmlRpcRequest("logout_of_simulator", parameters); | 254 | XmlRpcRequest req = new XmlRpcRequest("logout_of_simulator", parameters); |
255 | 255 | ||
256 | try | 256 | try |
257 | { | 257 | { |
258 | req.Send(m_parent.NetworkServersInfo.UserURL, 3000); | 258 | req.Send(m_parent.NetworkServersInfo.UserURL, 3000); |
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
262 | m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff"); | 262 | m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff"); |
263 | } | 263 | } |
264 | } | 264 | } |
265 | 265 | ||
266 | public UserProfileData GetUserProfile(string firstName, string lastName) | 266 | public UserProfileData GetUserProfile(string firstName, string lastName) |
267 | { | 267 | { |
268 | return GetUserProfile(firstName + " " + lastName); | 268 | return GetUserProfile(firstName + " " + lastName); |
@@ -711,7 +711,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
711 | public AvatarAppearance GetUserAppearance(LLUUID user) | 711 | public AvatarAppearance GetUserAppearance(LLUUID user) |
712 | { | 712 | { |
713 | AvatarAppearance appearance = null; | 713 | AvatarAppearance appearance = null; |
714 | 714 | ||
715 | try | 715 | try |
716 | { | 716 | { |
717 | Hashtable param = new Hashtable(); | 717 | Hashtable param = new Hashtable(); |
@@ -722,14 +722,14 @@ namespace OpenSim.Region.Communications.OGS1 | |||
722 | XmlRpcRequest req = new XmlRpcRequest("get_avatar_appearance", parameters); | 722 | XmlRpcRequest req = new XmlRpcRequest("get_avatar_appearance", parameters); |
723 | XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 8000); | 723 | XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 8000); |
724 | Hashtable respData = (Hashtable) resp.Value; | 724 | Hashtable respData = (Hashtable) resp.Value; |
725 | 725 | ||
726 | return ConvertXMLRPCDataToAvatarAppearance(respData); | 726 | return ConvertXMLRPCDataToAvatarAppearance(respData); |
727 | } | 727 | } |
728 | catch (WebException e) | 728 | catch (WebException e) |
729 | { | 729 | { |
730 | m_log.ErrorFormat("[OGS1 USER SERVICES]: Network problems when trying to fetch appearance for avatar {0}, {1}", user, e.Message); | 730 | m_log.ErrorFormat("[OGS1 USER SERVICES]: Network problems when trying to fetch appearance for avatar {0}, {1}", user, e.Message); |
731 | } | 731 | } |
732 | 732 | ||
733 | return appearance; | 733 | return appearance; |
734 | } | 734 | } |
735 | 735 | ||
diff --git a/OpenSim/Region/Environment/Interfaces/ICommander.cs b/OpenSim/Region/Environment/Interfaces/ICommander.cs index f2260c3..c4102af 100644 --- a/OpenSim/Region/Environment/Interfaces/ICommander.cs +++ b/OpenSim/Region/Environment/Interfaces/ICommander.cs | |||
@@ -27,8 +27,6 @@ | |||
27 | 27 | ||
28 | namespace OpenSim.Region.Environment.Interfaces | 28 | namespace OpenSim.Region.Environment.Interfaces |
29 | { | 29 | { |
30 | |||
31 | |||
32 | public interface ICommander | 30 | public interface ICommander |
33 | { | 31 | { |
34 | void ProcessConsoleCommand(string function, string[] args); | 32 | void ProcessConsoleCommand(string function, string[] args); |
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs index ad5983c..4e716a2 100644 --- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
47 | /// <param name="obj"></param> | 47 | /// <param name="obj"></param> |
48 | /// <param name="regionUUID"></param> | 48 | /// <param name="regionUUID"></param> |
49 | void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); | 49 | void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Entirely removes the object, including inventory | 52 | /// Entirely removes the object, including inventory |
53 | /// </summary> | 53 | /// </summary> |
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
55 | /// <param name="regionUUID"></param> | 55 | /// <param name="regionUUID"></param> |
56 | /// <returns></returns> | 56 | /// <returns></returns> |
57 | void RemoveObject(LLUUID uuid, LLUUID regionUUID); | 57 | void RemoveObject(LLUUID uuid, LLUUID regionUUID); |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Store a prim's inventory | 60 | /// Store a prim's inventory |
61 | /// </summary> | 61 | /// </summary> |
diff --git a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs index aa34c45..4bcb14b 100644 --- a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
38 | /// </summary> | 38 | /// </summary> |
39 | /// <returns></returns> | 39 | /// <returns></returns> |
40 | float[] GetFloatsSerialised(); | 40 | float[] GetFloatsSerialised(); |
41 | 41 | ||
42 | double[,] GetDoubles(); | 42 | double[,] GetDoubles(); |
43 | bool Tainted(int x, int y); | 43 | bool Tainted(int x, int y); |
44 | ITerrainChannel MakeCopy(); | 44 | ITerrainChannel MakeCopy(); |
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index 3f8b9ff..09f2dda 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs | |||
@@ -320,7 +320,7 @@ namespace OpenSim.Region.Environment | |||
320 | public void UnloadModule(IRegionModule rm) | 320 | public void UnloadModule(IRegionModule rm) |
321 | { | 321 | { |
322 | rm.Close(); | 322 | rm.Close(); |
323 | 323 | ||
324 | m_loadedModules.Remove(rm); | 324 | m_loadedModules.Remove(rm); |
325 | } | 325 | } |
326 | } | 326 | } |
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index 10ef766..e6ee75f 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
46 | { | 46 | { |
47 | private static readonly ILog m_log | 47 | private static readonly ILog m_log |
48 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// True if the service has been closed, probably because a user with texture requests still queued | 51 | /// True if the service has been closed, probably because a user with texture requests still queued |
52 | /// logged out. | 52 | /// logged out. |
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
175 | public void TextureCallback(LLUUID textureID, AssetBase texture) | 175 | public void TextureCallback(LLUUID textureID, AssetBase texture) |
176 | { | 176 | { |
177 | //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); | 177 | //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); |
178 | 178 | ||
179 | // There may still be texture requests pending for a logged out client | 179 | // There may still be texture requests pending for a logged out client |
180 | if (closed) | 180 | if (closed) |
181 | return; | 181 | return; |
@@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
247 | internal void Close() | 247 | internal void Close() |
248 | { | 248 | { |
249 | closed = true; | 249 | closed = true; |
250 | 250 | ||
251 | lock (m_textureSenders) | 251 | lock (m_textureSenders) |
252 | { | 252 | { |
253 | foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) | 253 | foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) |
@@ -257,7 +257,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
257 | 257 | ||
258 | m_textureSenders.Clear(); | 258 | m_textureSenders.Clear(); |
259 | } | 259 | } |
260 | 260 | ||
261 | // XXX: It might be possible to also remove pending texture requests from the asset cache queues, | 261 | // XXX: It might be possible to also remove pending texture requests from the asset cache queues, |
262 | // though this might also be more trouble than it's worth. | 262 | // though this might also be more trouble than it's worth. |
263 | } | 263 | } |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index c5a4a96..4a98622 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs | |||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
186 | client.OnTerminateFriendship += OnTerminateFriendship; | 186 | client.OnTerminateFriendship += OnTerminateFriendship; |
187 | 187 | ||
188 | doFriendListUpdateOnline(client.AgentId); | 188 | doFriendListUpdateOnline(client.AgentId); |
189 | 189 | ||
190 | } | 190 | } |
191 | 191 | ||
192 | private void doFriendListUpdateOnline(LLUUID AgentId) | 192 | private void doFriendListUpdateOnline(LLUUID AgentId) |
@@ -386,7 +386,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
386 | { | 386 | { |
387 | m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); | 387 | m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); |
388 | m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); | 388 | m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); |
389 | 389 | ||
390 | List<StoredFriendListUpdate> updateme = new List<StoredFriendListUpdate>(); | 390 | List<StoredFriendListUpdate> updateme = new List<StoredFriendListUpdate>(); |
391 | lock (StoredFriendListUpdates) | 391 | lock (StoredFriendListUpdates) |
392 | { | 392 | { |
@@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
546 | 546 | ||
547 | SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); | 547 | SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); |
548 | SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); | 548 | SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); |
549 | 549 | ||
550 | 550 | ||
551 | //LLUUID[] Agents = new LLUUID[1]; | 551 | //LLUUID[] Agents = new LLUUID[1]; |
552 | //Agents[0] = msg.toAgentID; | 552 | //Agents[0] = msg.toAgentID; |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs index a83730e..eaa5013 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
62 | scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; | 62 | scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; |
63 | lock (m_groupUUIDGroup) | 63 | lock (m_groupUUIDGroup) |
64 | { | 64 | { |
65 | 65 | ||
66 | GroupData OpenSimulatorGroup = new GroupData(); | 66 | GroupData OpenSimulatorGroup = new GroupData(); |
67 | OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; | 67 | OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; |
68 | OpenSimulatorGroup.GroupID = opensimulatorGroupID; | 68 | OpenSimulatorGroup.GroupID = opensimulatorGroupID; |
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
136 | } | 136 | } |
137 | 137 | ||
138 | } | 138 | } |
139 | 139 | ||
140 | lock (m_groupmap) | 140 | lock (m_groupmap) |
141 | { | 141 | { |
142 | if (!m_groupmap.ContainsKey(client.AgentId)) | 142 | if (!m_groupmap.ContainsKey(client.AgentId)) |
@@ -159,8 +159,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
159 | updateGroups[0] = OpenSimulatorGroup; | 159 | updateGroups[0] = OpenSimulatorGroup; |
160 | 160 | ||
161 | client.SendGroupMembership(updateGroups); | 161 | client.SendGroupMembership(updateGroups); |
162 | |||
163 | |||
164 | } | 162 | } |
165 | 163 | ||
166 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) | 164 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) |
@@ -275,6 +273,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
275 | GC.Collect(); | 273 | GC.Collect(); |
276 | } | 274 | } |
277 | } | 275 | } |
278 | 276 | } | |
279 | |||
280 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs index a3452ab..15ce584 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
208 | SceneObjectPart part = scene.GetSceneObjectPart(PrimID); | 208 | SceneObjectPart part = scene.GetSceneObjectPart(PrimID); |
209 | byte[] assetData; | 209 | byte[] assetData; |
210 | AssetBase oldAsset = null; | 210 | AssetBase oldAsset = null; |
211 | 211 | ||
212 | if (BlendWithOldTexture) | 212 | if (BlendWithOldTexture) |
213 | { | 213 | { |
214 | LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; | 214 | LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; |
@@ -228,7 +228,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
228 | assetData = new byte[data.Length]; | 228 | assetData = new byte[data.Length]; |
229 | Array.Copy(data, assetData, data.Length); | 229 | Array.Copy(data, assetData, data.Length); |
230 | } | 230 | } |
231 | 231 | ||
232 | // Create a new asset for user | 232 | // Create a new asset for user |
233 | AssetBase asset = new AssetBase(); | 233 | AssetBase asset = new AssetBase(); |
234 | asset.FullID = LLUUID.Random(); | 234 | asset.FullID = LLUUID.Random(); |
@@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
244 | 244 | ||
245 | // mostly keep the values from before | 245 | // mostly keep the values from before |
246 | LLObject.TextureEntry tmptex = part.Shape.Textures; | 246 | LLObject.TextureEntry tmptex = part.Shape.Textures; |
247 | 247 | ||
248 | // remove the old asset from the cache | 248 | // remove the old asset from the cache |
249 | LLUUID oldID = tmptex.DefaultTexture.TextureID; | 249 | LLUUID oldID = tmptex.DefaultTexture.TextureID; |
250 | scene.AssetCache.ExpireAsset(oldID); | 250 | scene.AssetCache.ExpireAsset(oldID); |
@@ -298,4 +298,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
298 | 298 | ||
299 | #endregion | 299 | #endregion |
300 | } | 300 | } |
301 | } \ No newline at end of file | 301 | } |
diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index 1162c25..bcf3e76 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs | |||
@@ -68,14 +68,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
68 | { | 68 | { |
69 | m_Config = config; | 69 | m_Config = config; |
70 | IConfig SMTPConfig; | 70 | IConfig SMTPConfig; |
71 | 71 | ||
72 | //FIXME: RegionName is correct?? | 72 | //FIXME: RegionName is correct?? |
73 | //m_RegionName = scene.RegionInfo.RegionName; | 73 | //m_RegionName = scene.RegionInfo.RegionName; |
74 | 74 | ||
75 | IConfig startupConfig = m_Config.Configs["Startup"]; | 75 | IConfig startupConfig = m_Config.Configs["Startup"]; |
76 | 76 | ||
77 | m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); | 77 | m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); |
78 | 78 | ||
79 | //Load SMTP SERVER config | 79 | //Load SMTP SERVER config |
80 | try | 80 | try |
81 | { | 81 | { |
@@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
85 | m_Enabled = false; | 85 | m_Enabled = false; |
86 | return; | 86 | return; |
87 | } | 87 | } |
88 | 88 | ||
89 | if (!SMTPConfig.GetBoolean("enabled", false)) | 89 | if (!SMTPConfig.GetBoolean("enabled", false)) |
90 | { | 90 | { |
91 | m_log.InfoFormat("[SMTP] module disabled in configuration"); | 91 | m_log.InfoFormat("[SMTP] module disabled in configuration"); |
92 | m_Enabled = false; | 92 | m_Enabled = false; |
93 | return; | 93 | return; |
94 | } | 94 | } |
95 | 95 | ||
96 | m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); | 96 | m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); |
97 | SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); | 97 | SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); |
98 | SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); | 98 | SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); |
99 | SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); | 99 | SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); |
100 | SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); | 100 | SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); |
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
124 | m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); | 124 | m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | m_log.Info("[EMAIL] Activated DefaultEmailModule"); | 128 | m_log.Info("[EMAIL] Activated DefaultEmailModule"); |
129 | } | 129 | } |
130 | } | 130 | } |
@@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
146 | { | 146 | { |
147 | get { return true; } | 147 | get { return true; } |
148 | } | 148 | } |
149 | 149 | ||
150 | /// <summary> | 150 | /// <summary> |
151 | /// | 151 | /// |
152 | /// </summary> | 152 | /// </summary> |
153 | /// <param name="seconds"></param> | 153 | /// <param name="seconds"></param> |
154 | private void DelayInSeconds(int seconds) | 154 | private void DelayInSeconds(int seconds) |
@@ -156,11 +156,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
156 | TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); | 156 | TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); |
157 | DateTime EndDelay = DateTime.Now.Add(DiffDelay); | 157 | DateTime EndDelay = DateTime.Now.Add(DiffDelay); |
158 | while (DateTime.Now < EndDelay) | 158 | while (DateTime.Now < EndDelay) |
159 | { | 159 | { |
160 | ;//Do nothing!! | 160 | ;//Do nothing!! |
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) | 164 | private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) |
165 | { | 165 | { |
166 | lock (m_Scenes) | 166 | lock (m_Scenes) |
@@ -187,7 +187,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
187 | { | 187 | { |
188 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); | 188 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); |
189 | ObjectName = part.Name; | 189 | ObjectName = part.Name; |
190 | ObjectRegionName = m_ObjectRegionName; | 190 | ObjectRegionName = m_ObjectRegionName; |
191 | return; | 191 | return; |
192 | } | 192 | } |
193 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); | 193 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
195 | ObjectRegionName = m_ObjectRegionName; | 195 | ObjectRegionName = m_ObjectRegionName; |
196 | return; | 196 | return; |
197 | } | 197 | } |
198 | 198 | ||
199 | /// <summary> | 199 | /// <summary> |
200 | /// SendMail function utilized by llEMail | 200 | /// SendMail function utilized by llEMail |
201 | /// </summary> | 201 | /// </summary> |
@@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
206 | public void SendEmail(LLUUID objectID, string address, string subject, string body) | 206 | public void SendEmail(LLUUID objectID, string address, string subject, string body) |
207 | { | 207 | { |
208 | //Check if address is empty | 208 | //Check if address is empty |
209 | if (address == string.Empty) | 209 | if (address == string.Empty) |
210 | return; | 210 | return; |
211 | 211 | ||
212 | //FIXED:Check the email is correct form in REGEX | 212 | //FIXED:Check the email is correct form in REGEX |
213 | string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" | 213 | string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" |
214 | + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" | 214 | + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" |
215 | + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | 215 | + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" |
216 | + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" | 216 | + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" |
217 | + @"[a-zA-Z]{2,}))$"; | 217 | + @"[a-zA-Z]{2,}))$"; |
218 | Regex EMailreStrict = new Regex(EMailpatternStrict); | 218 | Regex EMailreStrict = new Regex(EMailpatternStrict); |
219 | bool isEMailStrictMatch = EMailreStrict.IsMatch(address); | 219 | bool isEMailStrictMatch = EMailreStrict.IsMatch(address); |
@@ -226,9 +226,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
226 | if ((subject.Length + body.Length) > 1024) | 226 | if ((subject.Length + body.Length) > 1024) |
227 | { | 227 | { |
228 | m_log.Error("[EMAIL] subject + body > 1024 Byte"); | 228 | m_log.Error("[EMAIL] subject + body > 1024 Byte"); |
229 | return; | 229 | return; |
230 | } | 230 | } |
231 | 231 | ||
232 | try | 232 | try |
233 | { | 233 | { |
234 | string LastObjectName = string.Empty; | 234 | string LastObjectName = string.Empty; |
@@ -242,21 +242,21 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
242 | //From | 242 | //From |
243 | emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); | 243 | emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); |
244 | //To - Only One | 244 | //To - Only One |
245 | emailMessage.AddToAddress(new EmailAddress(address)); | 245 | emailMessage.AddToAddress(new EmailAddress(address)); |
246 | //Subject | 246 | //Subject |
247 | emailMessage.Subject = subject; | 247 | emailMessage.Subject = subject; |
248 | //TEXT Body | 248 | //TEXT Body |
249 | resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); | 249 | resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); |
250 | emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + | 250 | emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + |
251 | "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + | 251 | "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + |
252 | LastObjectPosition+"\r\n\r\n\r\n" + body); | 252 | LastObjectPosition+"\r\n\r\n\r\n" + body); |
253 | //HTML Body | 253 | //HTML Body |
254 | emailMessage.HtmlPart = new HtmlAttachment("<html><body><p>" + | 254 | emailMessage.HtmlPart = new HtmlAttachment("<html><body><p>" + |
255 | "<BR>Object-Name: " + LastObjectName + | 255 | "<BR>Object-Name: " + LastObjectName + |
256 | "<BR>Region: " + LastObjectRegionName + | 256 | "<BR>Region: " + LastObjectRegionName + |
257 | "<BR>Local-Position: " + LastObjectPosition + "<BR><BR><BR>" | 257 | "<BR>Local-Position: " + LastObjectPosition + "<BR><BR><BR>" |
258 | +body+"\r\n</p></body><html>"); | 258 | +body+"\r\n</p></body><html>"); |
259 | 259 | ||
260 | //Set SMTP SERVER config | 260 | //Set SMTP SERVER config |
261 | SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); | 261 | SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); |
262 | //Authentication | 262 | //Authentication |
@@ -272,9 +272,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
272 | return; | 272 | return; |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | /// <summary> | 276 | /// <summary> |
277 | /// | 277 | /// |
278 | /// </summary> | 278 | /// </summary> |
279 | /// <param name="objectID"></param> | 279 | /// <param name="objectID"></param> |
280 | /// <param name="sender"></param> | 280 | /// <param name="sender"></param> |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index a5688ef..a76ff0d 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs | |||
@@ -39,33 +39,33 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
39 | /// The location of the archive control file | 39 | /// The location of the archive control file |
40 | /// </summary> | 40 | /// </summary> |
41 | public static readonly string CONTROL_FILE_PATH = "archive.xml"; | 41 | public static readonly string CONTROL_FILE_PATH = "archive.xml"; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Path for the assets held in an archive | 44 | /// Path for the assets held in an archive |
45 | /// </summary> | 45 | /// </summary> |
46 | public static readonly string ASSETS_PATH = "assets/"; | 46 | public static readonly string ASSETS_PATH = "assets/"; |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Path for the assets metadata file | 49 | /// Path for the assets metadata file |
50 | /// </summary> | 50 | /// </summary> |
51 | //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; | 51 | //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Path for the prims file | 54 | /// Path for the prims file |
55 | /// </summary> | 55 | /// </summary> |
56 | public static readonly string OBJECTS_PATH = "objects/"; | 56 | public static readonly string OBJECTS_PATH = "objects/"; |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. | 59 | /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. |
60 | /// </summary> | 60 | /// </summary> |
61 | public static readonly string TERRAINS_PATH = "terrains/"; | 61 | public static readonly string TERRAINS_PATH = "terrains/"; |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Extensions used for asset types in the archive | 64 | /// Extensions used for asset types in the archive |
65 | /// </summary> | 65 | /// </summary> |
66 | public static readonly IDictionary<sbyte, string> ASSET_TYPE_TO_EXTENSION = new Dictionary<sbyte, string>(); | 66 | public static readonly IDictionary<sbyte, string> ASSET_TYPE_TO_EXTENSION = new Dictionary<sbyte, string>(); |
67 | public static readonly IDictionary<string, sbyte> EXTENSION_TO_ASSET_TYPE = new Dictionary<string, sbyte>(); | 67 | public static readonly IDictionary<string, sbyte> EXTENSION_TO_ASSET_TYPE = new Dictionary<string, sbyte>(); |
68 | 68 | ||
69 | static ArchiveConstants() | 69 | static ArchiveConstants() |
70 | { | 70 | { |
71 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh"; | 71 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh"; |
@@ -79,11 +79,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
79 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this | 79 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this |
80 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso"; | 80 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso"; |
81 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl"; | 81 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl"; |
82 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; | 82 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; |
83 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml"; | 83 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml"; |
84 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this | 84 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this |
85 | // disable warning: we know Script is obsolete, but need to support it | 85 | // disable warning: we know Script is obsolete, but need to support it |
86 | // anyhow | 86 | // anyhow |
87 | #pragma warning disable 0612 | 87 | #pragma warning disable 0612 |
88 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this | 88 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this |
89 | #pragma warning restore 0612 | 89 | #pragma warning restore 0612 |
@@ -93,8 +93,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
93 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav"; | 93 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav"; |
94 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2"; | 94 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2"; |
95 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga"; | 95 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga"; |
96 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this | 96 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this |
97 | 97 | ||
98 | EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation; | 98 | EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation; |
99 | EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart; | 99 | EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart; |
100 | EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard; | 100 | EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard; |
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
110 | EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object; | 110 | EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object; |
111 | EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder; | 111 | EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder; |
112 | // disable warning: we know Script is obsolete, but need to support it | 112 | // disable warning: we know Script is obsolete, but need to support it |
113 | // anyhow | 113 | // anyhow |
114 | #pragma warning disable 0612 | 114 | #pragma warning disable 0612 |
115 | EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script; | 115 | EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script; |
116 | #pragma warning restore 0612 | 116 | #pragma warning restore 0612 |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 1340f8b..87106fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
53 | 53 | ||
54 | private Scene m_scene; | 54 | private Scene m_scene; |
55 | private string m_loadPath; | 55 | private string m_loadPath; |
56 | 56 | ||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Used to cache lookups for valid uuids. | 58 | /// Used to cache lookups for valid uuids. |
59 | /// </summary> | 59 | /// </summary> |
@@ -68,15 +68,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
68 | } | 68 | } |
69 | 69 | ||
70 | private void DearchiveRegion() | 70 | private void DearchiveRegion() |
71 | { | 71 | { |
72 | TarArchiveReader archive | 72 | TarArchiveReader archive |
73 | = new TarArchiveReader( | 73 | = new TarArchiveReader( |
74 | new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); | 74 | new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); |
75 | //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); | 75 | //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); |
76 | 76 | ||
77 | List<string> serialisedSceneObjects = new List<string>(); | 77 | List<string> serialisedSceneObjects = new List<string>(); |
78 | string filePath = "ERROR"; | 78 | string filePath = "ERROR"; |
79 | 79 | ||
80 | int successfulAssetRestores = 0; | 80 | int successfulAssetRestores = 0; |
81 | int failedAssetRestores = 0; | 81 | int failedAssetRestores = 0; |
82 | 82 | ||
@@ -111,30 +111,30 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
111 | //m_log.Debug("[ARCHIVER]: Reached end of archive"); | 111 | //m_log.Debug("[ARCHIVER]: Reached end of archive"); |
112 | 112 | ||
113 | archive.Close(); | 113 | archive.Close(); |
114 | 114 | ||
115 | m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores); | 115 | m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores); |
116 | 116 | ||
117 | if (failedAssetRestores > 0) | 117 | if (failedAssetRestores > 0) |
118 | m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); | 118 | m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); |
119 | 119 | ||
120 | m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); | 120 | m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); |
121 | m_scene.DeleteAllSceneObjects(); | 121 | m_scene.DeleteAllSceneObjects(); |
122 | 122 | ||
123 | // Reload serialized prims | 123 | // Reload serialized prims |
124 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); | 124 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); |
125 | 125 | ||
126 | IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); | 126 | IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); |
127 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 127 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
128 | 128 | ||
129 | foreach (string serialisedSceneObject in serialisedSceneObjects) | 129 | foreach (string serialisedSceneObject in serialisedSceneObjects) |
130 | { | 130 | { |
131 | SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); | 131 | SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); |
132 | 132 | ||
133 | // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned | 133 | // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned |
134 | // on the same region server and multiple examples a single object archive to be imported | 134 | // on the same region server and multiple examples a single object archive to be imported |
135 | // to the same scene (when this is possible). | 135 | // to the same scene (when this is possible). |
136 | sceneObject.ResetIDs(); | 136 | sceneObject.ResetIDs(); |
137 | 137 | ||
138 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | 138 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid |
139 | // otherwise, use the master avatar uuid instead | 139 | // otherwise, use the master avatar uuid instead |
140 | LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 140 | LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
@@ -144,41 +144,41 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
144 | { | 144 | { |
145 | if (!resolveUserUuid(part.CreatorID)) | 145 | if (!resolveUserUuid(part.CreatorID)) |
146 | part.CreatorID = masterAvatarId; | 146 | part.CreatorID = masterAvatarId; |
147 | 147 | ||
148 | if (!resolveUserUuid(part.OwnerID)) | 148 | if (!resolveUserUuid(part.OwnerID)) |
149 | part.OwnerID = masterAvatarId; | 149 | part.OwnerID = masterAvatarId; |
150 | 150 | ||
151 | if (!resolveUserUuid(part.LastOwnerID)) | 151 | if (!resolveUserUuid(part.LastOwnerID)) |
152 | part.LastOwnerID = masterAvatarId; | 152 | part.LastOwnerID = masterAvatarId; |
153 | 153 | ||
154 | // And zap any troublesome sit target information | 154 | // And zap any troublesome sit target information |
155 | part.SitTargetOrientation = new Quaternion(0,0,0,1); | 155 | part.SitTargetOrientation = new Quaternion(0,0,0,1); |
156 | part.SitTargetPosition = new Vector3(0,0,0); | 156 | part.SitTargetPosition = new Vector3(0,0,0); |
157 | } | 157 | } |
158 | 158 | ||
159 | if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) | 159 | if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) |
160 | { | 160 | { |
161 | sceneObjects.Add(sceneObject); | 161 | sceneObjects.Add(sceneObject); |
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); | 165 | m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); |
166 | 166 | ||
167 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; | 167 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; |
168 | 168 | ||
169 | if (ignoredObjects > 0) | 169 | if (ignoredObjects > 0) |
170 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); | 170 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); |
171 | 171 | ||
172 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); | 172 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); |
173 | 173 | ||
174 | m_log.Debug("[ARCHIVER]: Starting scripts"); | 174 | m_log.Debug("[ARCHIVER]: Starting scripts"); |
175 | 175 | ||
176 | foreach (SceneObjectGroup sceneObject in sceneObjects) | 176 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
177 | { | 177 | { |
178 | sceneObject.CreateScriptInstances(0, true); | 178 | sceneObject.CreateScriptInstances(0, true); |
179 | } | 179 | } |
180 | } | 180 | } |
181 | 181 | ||
182 | /// <summary> | 182 | /// <summary> |
183 | /// Look up the given user id to check whether it's one that is valid for this grid. | 183 | /// Look up the given user id to check whether it's one that is valid for this grid. |
184 | /// </summary> | 184 | /// </summary> |
@@ -194,13 +194,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
194 | else | 194 | else |
195 | m_validUserUuids.Add(uuid, false); | 195 | m_validUserUuids.Add(uuid, false); |
196 | } | 196 | } |
197 | 197 | ||
198 | if (m_validUserUuids[uuid]) | 198 | if (m_validUserUuids[uuid]) |
199 | return true; | 199 | return true; |
200 | else | 200 | else |
201 | return false; | 201 | return false; |
202 | } | 202 | } |
203 | 203 | ||
204 | /// <summary> | 204 | /// <summary> |
205 | /// Load an asset | 205 | /// Load an asset |
206 | /// </summary> | 206 | /// </summary> |
@@ -212,20 +212,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
212 | // Right now we're nastily obtaining the lluuid from the filename | 212 | // Right now we're nastily obtaining the lluuid from the filename |
213 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); | 213 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); |
214 | string extension = filename.Substring(filename.LastIndexOf("_")); | 214 | string extension = filename.Substring(filename.LastIndexOf("_")); |
215 | string uuid = filename.Remove(filename.Length - extension.Length); | 215 | string uuid = filename.Remove(filename.Length - extension.Length); |
216 | 216 | ||
217 | if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) | 217 | if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) |
218 | { | 218 | { |
219 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | 219 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; |
220 | 220 | ||
221 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 221 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
222 | 222 | ||
223 | AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); | 223 | AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); |
224 | asset.Type = assetType; | 224 | asset.Type = assetType; |
225 | asset.Data = data; | 225 | asset.Data = data; |
226 | 226 | ||
227 | m_scene.AssetCache.AddAsset(asset); | 227 | m_scene.AssetCache.AddAsset(asset); |
228 | 228 | ||
229 | return true; | 229 | return true; |
230 | } | 230 | } |
231 | else | 231 | else |
@@ -233,11 +233,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
233 | m_log.ErrorFormat( | 233 | m_log.ErrorFormat( |
234 | "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}", | 234 | "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}", |
235 | assetPath, extension); | 235 | assetPath, extension); |
236 | 236 | ||
237 | return false; | 237 | return false; |
238 | } | 238 | } |
239 | } | 239 | } |
240 | 240 | ||
241 | /// <summary> | 241 | /// <summary> |
242 | /// Load terrain data | 242 | /// Load terrain data |
243 | /// </summary> | 243 | /// </summary> |
@@ -249,13 +249,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
249 | private bool LoadTerrain(string terrainPath, byte[] data) | 249 | private bool LoadTerrain(string terrainPath, byte[] data) |
250 | { | 250 | { |
251 | ITerrainModule terrainModule = m_scene.RequestModuleInterface<ITerrainModule>(); | 251 | ITerrainModule terrainModule = m_scene.RequestModuleInterface<ITerrainModule>(); |
252 | 252 | ||
253 | MemoryStream ms = new MemoryStream(data); | 253 | MemoryStream ms = new MemoryStream(data); |
254 | terrainModule.LoadFromStream(terrainPath, ms); | 254 | terrainModule.LoadFromStream(terrainPath, ms); |
255 | ms.Close(); | 255 | ms.Close(); |
256 | 256 | ||
257 | m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); | 257 | m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); |
258 | 258 | ||
259 | return true; | 259 | return true; |
260 | } | 260 | } |
261 | } | 261 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index 0341a70..26d4797 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -61,8 +61,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
61 | 61 | ||
62 | public ArchiveWriteRequestExecution( | 62 | public ArchiveWriteRequestExecution( |
63 | List<SceneObjectGroup> sceneObjects, | 63 | List<SceneObjectGroup> sceneObjects, |
64 | ITerrainModule terrainModule, | 64 | ITerrainModule terrainModule, |
65 | IRegionSerialiser serialiser, | 65 | IRegionSerialiser serialiser, |
66 | string sceneName, | 66 | string sceneName, |
67 | string savePath) | 67 | string savePath) |
68 | { | 68 | { |
@@ -79,37 +79,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
79 | { | 79 | { |
80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); | 80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); |
81 | } | 81 | } |
82 | 82 | ||
83 | m_log.InfoFormat( | 83 | m_log.InfoFormat( |
84 | "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); | 84 | "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); |
85 | 85 | ||
86 | TarArchiveWriter archive = new TarArchiveWriter(); | 86 | TarArchiveWriter archive = new TarArchiveWriter(); |
87 | 87 | ||
88 | // Write out control file | 88 | // Write out control file |
89 | archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); | 89 | archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); |
90 | 90 | ||
91 | // Write out terrain | 91 | // Write out terrain |
92 | string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); | 92 | string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); |
93 | MemoryStream ms = new MemoryStream(); | 93 | MemoryStream ms = new MemoryStream(); |
94 | m_terrainModule.SaveToStream(terrainPath, ms); | 94 | m_terrainModule.SaveToStream(terrainPath, ms); |
95 | archive.AddFile(terrainPath, ms.ToArray()); | 95 | archive.AddFile(terrainPath, ms.ToArray()); |
96 | ms.Close(); | 96 | ms.Close(); |
97 | 97 | ||
98 | // Write out scene object metadata | 98 | // Write out scene object metadata |
99 | foreach (SceneObjectGroup sceneObject in m_sceneObjects) | 99 | foreach (SceneObjectGroup sceneObject in m_sceneObjects) |
100 | { | 100 | { |
101 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); | 101 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); |
102 | 102 | ||
103 | LLVector3 position = sceneObject.AbsolutePosition; | 103 | LLVector3 position = sceneObject.AbsolutePosition; |
104 | 104 | ||
105 | string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); | 105 | string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); |
106 | string filename | 106 | string filename |
107 | = string.Format( | 107 | = string.Format( |
108 | "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", | 108 | "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", |
109 | ArchiveConstants.OBJECTS_PATH, sceneObject.Name, | 109 | ArchiveConstants.OBJECTS_PATH, sceneObject.Name, |
110 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), | 110 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), |
111 | sceneObject.UUID); | 111 | sceneObject.UUID); |
112 | 112 | ||
113 | archive.AddFile(filename, serializedObject); | 113 | archive.AddFile(filename, serializedObject); |
114 | } | 114 | } |
115 | 115 | ||
@@ -120,8 +120,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
120 | archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); | 120 | archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); |
121 | 121 | ||
122 | m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); | 122 | m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); |
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// Create the control file for this archive | 126 | /// Create the control file for this archive |
127 | /// </summary> | 127 | /// </summary> |
@@ -136,13 +136,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
136 | xtw.WriteAttributeString("major_version", "0"); | 136 | xtw.WriteAttributeString("major_version", "0"); |
137 | xtw.WriteAttributeString("minor_version", "1"); | 137 | xtw.WriteAttributeString("minor_version", "1"); |
138 | xtw.WriteEndElement(); | 138 | xtw.WriteEndElement(); |
139 | 139 | ||
140 | xtw.Flush(); | 140 | xtw.Flush(); |
141 | xtw.Close(); | 141 | xtw.Close(); |
142 | 142 | ||
143 | String s = sw.ToString(); | 143 | String s = sw.ToString(); |
144 | sw.Close(); | 144 | sw.Close(); |
145 | 145 | ||
146 | return s; | 146 | return s; |
147 | } | 147 | } |
148 | } | 148 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index 327808a..20e15ab 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -52,14 +52,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
52 | 52 | ||
53 | protected Scene m_scene; | 53 | protected Scene m_scene; |
54 | protected string m_savePath; | 54 | protected string m_savePath; |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// Used for identifying uuids embedded in scripts | 57 | /// Used for identifying uuids embedded in scripts |
58 | /// </summary> | 58 | /// </summary> |
59 | protected static readonly Regex m_uuidRegex | 59 | protected static readonly Regex m_uuidRegex |
60 | = new Regex( | 60 | = new Regex( |
61 | "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", | 61 | "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", |
62 | RegexOptions.Compiled); | 62 | RegexOptions.Compiled); |
63 | 63 | ||
64 | /// <summary> | 64 | /// <summary> |
65 | /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate | 65 | /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate |
@@ -93,9 +93,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
93 | Monitor.Pulse(this); | 93 | Monitor.Pulse(this); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | /// <summary> | 97 | /// <summary> |
98 | /// Get an asset synchronously, potentially using an asynchronous callback. If the | 98 | /// Get an asset synchronously, potentially using an asynchronous callback. If the |
99 | /// asynchronous callback is used, we will wait for it to complete. | 99 | /// asynchronous callback is used, we will wait for it to complete. |
100 | /// </summary> | 100 | /// </summary> |
101 | /// <param name="uuid"></param> | 101 | /// <param name="uuid"></param> |
@@ -118,11 +118,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
118 | Monitor.Wait(this); | 118 | Monitor.Wait(this); |
119 | m_waitingForObjectAsset = false; | 119 | m_waitingForObjectAsset = false; |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | return m_requestedObjectAsset; | 123 | return m_requestedObjectAsset; |
124 | } | 124 | } |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Record the asset uuids embedded within the given script. | 127 | /// Record the asset uuids embedded within the given script. |
128 | /// </summary> | 128 | /// </summary> |
@@ -138,16 +138,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
138 | //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); | 138 | //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); |
139 | MatchCollection uuidMatches = m_uuidRegex.Matches(script); | 139 | MatchCollection uuidMatches = m_uuidRegex.Matches(script); |
140 | //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); | 140 | //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); |
141 | 141 | ||
142 | foreach (Match uuidMatch in uuidMatches) | 142 | foreach (Match uuidMatch in uuidMatches) |
143 | { | 143 | { |
144 | LLUUID uuid = new LLUUID(uuidMatch.Value); | 144 | LLUUID uuid = new LLUUID(uuidMatch.Value); |
145 | //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); | 145 | //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); |
146 | assetUuids[uuid] = 1; | 146 | assetUuids[uuid] = 1; |
147 | } | 147 | } |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | /// <summary> | 151 | /// <summary> |
152 | /// Record the uuids referenced by the given wearable asset | 152 | /// Record the uuids referenced by the given wearable asset |
153 | /// </summary> | 153 | /// </summary> |
@@ -159,25 +159,25 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
159 | //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); | 159 | //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); |
160 | AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); | 160 | AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); |
161 | wearableAsset.Decode(); | 161 | wearableAsset.Decode(); |
162 | 162 | ||
163 | //m_log.DebugFormat( | 163 | //m_log.DebugFormat( |
164 | // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); | 164 | // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); |
165 | 165 | ||
166 | foreach (LLUUID uuid in wearableAsset.Textures.Values) | 166 | foreach (LLUUID uuid in wearableAsset.Textures.Values) |
167 | { | 167 | { |
168 | //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); | 168 | //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); |
169 | assetUuids[uuid] = 1; | 169 | assetUuids[uuid] = 1; |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
173 | /// <summary> | 173 | /// <summary> |
174 | /// Get all the asset uuids associated with a given object. This includes both those directly associated with | 174 | /// Get all the asset uuids associated with a given object. This includes both those directly associated with |
175 | /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained | 175 | /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained |
176 | /// within this object). | 176 | /// within this object). |
177 | /// </summary> | 177 | /// </summary> |
178 | /// <param name="sceneObject"></param> | 178 | /// <param name="sceneObject"></param> |
179 | /// <param name="assetUuids"></param> | 179 | /// <param name="assetUuids"></param> |
180 | protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids) | 180 | protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids) |
181 | { | 181 | { |
182 | AssetBase objectAsset = GetAsset(sceneObjectUuid); | 182 | AssetBase objectAsset = GetAsset(sceneObjectUuid); |
183 | 183 | ||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
186 | string xml = Helpers.FieldToUTF8String(objectAsset.Data); | 186 | string xml = Helpers.FieldToUTF8String(objectAsset.Data); |
187 | SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); | 187 | SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); |
188 | GetSceneObjectAssetUuids(sog, assetUuids); | 188 | GetSceneObjectAssetUuids(sog, assetUuids); |
189 | } | 189 | } |
190 | } | 190 | } |
191 | 191 | ||
192 | /// <summary> | 192 | /// <summary> |
@@ -209,10 +209,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
209 | try | 209 | try |
210 | { | 210 | { |
211 | LLObject.TextureEntry textureEntry = part.Shape.Textures; | 211 | LLObject.TextureEntry textureEntry = part.Shape.Textures; |
212 | 212 | ||
213 | // Get the prim's default texture. This will be used for faces which don't have their own texture | 213 | // Get the prim's default texture. This will be used for faces which don't have their own texture |
214 | assetUuids[textureEntry.DefaultTexture.TextureID] = 1; | 214 | assetUuids[textureEntry.DefaultTexture.TextureID] = 1; |
215 | 215 | ||
216 | // XXX: Not a great way to iterate through face textures, but there's no | 216 | // XXX: Not a great way to iterate through face textures, but there's no |
217 | // other method available to tell how many faces there actually are | 217 | // other method available to tell how many faces there actually are |
218 | //int i = 0; | 218 | //int i = 0; |
@@ -224,15 +224,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
224 | assetUuids[texture.TextureID] = 1; | 224 | assetUuids[texture.TextureID] = 1; |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | foreach (TaskInventoryItem tii in part.TaskInventory.Values) | 228 | foreach (TaskInventoryItem tii in part.TaskInventory.Values) |
229 | { | 229 | { |
230 | //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); | 230 | //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); |
231 | 231 | ||
232 | if (!assetUuids.ContainsKey(tii.AssetID)) | 232 | if (!assetUuids.ContainsKey(tii.AssetID)) |
233 | { | 233 | { |
234 | assetUuids[tii.AssetID] = 1; | 234 | assetUuids[tii.AssetID] = 1; |
235 | 235 | ||
236 | if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) | 236 | if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) |
237 | { | 237 | { |
238 | GetWearableAssetUuids(tii.AssetID, assetUuids); | 238 | GetWearableAssetUuids(tii.AssetID, assetUuids); |
@@ -275,20 +275,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
275 | if (entity is SceneObjectGroup) | 275 | if (entity is SceneObjectGroup) |
276 | sceneObjects.Add((SceneObjectGroup)entity); | 276 | sceneObjects.Add((SceneObjectGroup)entity); |
277 | } | 277 | } |
278 | 278 | ||
279 | foreach (SceneObjectGroup sceneObject in sceneObjects) | 279 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
280 | { | 280 | { |
281 | GetSceneObjectAssetUuids(sceneObject, assetUuids); | 281 | GetSceneObjectAssetUuids(sceneObject, assetUuids); |
282 | } | 282 | } |
283 | 283 | ||
284 | m_log.DebugFormat( | 284 | m_log.DebugFormat( |
285 | "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", | 285 | "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", |
286 | sceneObjects.Count, assetUuids.Count); | 286 | sceneObjects.Count, assetUuids.Count); |
287 | 287 | ||
288 | // Asynchronously request all the assets required to perform this archive operation | 288 | // Asynchronously request all the assets required to perform this archive operation |
289 | ArchiveWriteRequestExecution awre | 289 | ArchiveWriteRequestExecution awre |
290 | = new ArchiveWriteRequestExecution( | 290 | = new ArchiveWriteRequestExecution( |
291 | sceneObjects, | 291 | sceneObjects, |
292 | m_scene.RequestModuleInterface<ITerrainModule>(), | 292 | m_scene.RequestModuleInterface<ITerrainModule>(), |
293 | m_scene.RequestModuleInterface<IRegionSerialiser>(), | 293 | m_scene.RequestModuleInterface<IRegionSerialiser>(), |
294 | m_scene.RegionInfo.RegionName, | 294 | m_scene.RegionInfo.RegionName, |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 2704224..708bed3 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs | |||
@@ -41,17 +41,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
41 | public class AssetsArchiver | 41 | public class AssetsArchiver |
42 | { | 42 | { |
43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Archive assets | 46 | /// Archive assets |
47 | /// </summary> | 47 | /// </summary> |
48 | protected IDictionary<LLUUID, AssetBase> m_assets; | 48 | protected IDictionary<LLUUID, AssetBase> m_assets; |
49 | 49 | ||
50 | public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets) | 50 | public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets) |
51 | { | 51 | { |
52 | m_assets = assets; | 52 | m_assets = assets; |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Archive the assets given to this archiver to the given archive. | 56 | /// Archive the assets given to this archiver to the given archive. |
57 | /// </summary> | 57 | /// </summary> |
@@ -70,44 +70,44 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
70 | { | 70 | { |
71 | StringWriter sw = new StringWriter(); | 71 | StringWriter sw = new StringWriter(); |
72 | XmlTextWriter xtw = new XmlTextWriter(sw); | 72 | XmlTextWriter xtw = new XmlTextWriter(sw); |
73 | 73 | ||
74 | xtw.Formatting = Formatting.Indented; | 74 | xtw.Formatting = Formatting.Indented; |
75 | xtw.WriteStartDocument(); | 75 | xtw.WriteStartDocument(); |
76 | 76 | ||
77 | xtw.WriteStartElement("assets"); | 77 | xtw.WriteStartElement("assets"); |
78 | 78 | ||
79 | foreach (LLUUID uuid in m_assets.Keys) | 79 | foreach (LLUUID uuid in m_assets.Keys) |
80 | { | 80 | { |
81 | AssetBase asset = m_assets[uuid]; | 81 | AssetBase asset = m_assets[uuid]; |
82 | 82 | ||
83 | if (asset != null) | 83 | if (asset != null) |
84 | { | 84 | { |
85 | xtw.WriteStartElement("asset"); | 85 | xtw.WriteStartElement("asset"); |
86 | 86 | ||
87 | string extension = string.Empty; | 87 | string extension = string.Empty; |
88 | 88 | ||
89 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) | 89 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
90 | { | 90 | { |
91 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; | 91 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
92 | } | 92 | } |
93 | 93 | ||
94 | xtw.WriteElementString("filename", uuid.ToString() + extension); | 94 | xtw.WriteElementString("filename", uuid.ToString() + extension); |
95 | 95 | ||
96 | xtw.WriteElementString("name", asset.Name); | 96 | xtw.WriteElementString("name", asset.Name); |
97 | xtw.WriteElementString("description", asset.Description); | 97 | xtw.WriteElementString("description", asset.Description); |
98 | xtw.WriteElementString("asset-type", asset.Type.ToString()); | 98 | xtw.WriteElementString("asset-type", asset.Type.ToString()); |
99 | 99 | ||
100 | xtw.WriteEndElement(); | 100 | xtw.WriteEndElement(); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | xtw.WriteEndElement(); | 104 | xtw.WriteEndElement(); |
105 | 105 | ||
106 | xtw.WriteEndDocument(); | 106 | xtw.WriteEndDocument(); |
107 | 107 | ||
108 | archive.AddFile("assets.xml", sw.ToString()); | 108 | archive.AddFile("assets.xml", sw.ToString()); |
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// Write asset data files to the given archive | 112 | /// Write asset data files to the given archive |
113 | /// </summary> | 113 | /// </summary> |
@@ -116,18 +116,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
116 | { | 116 | { |
117 | // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar | 117 | // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar |
118 | //archive.AddDir("assets"); | 118 | //archive.AddDir("assets"); |
119 | 119 | ||
120 | foreach (LLUUID uuid in m_assets.Keys) | 120 | foreach (LLUUID uuid in m_assets.Keys) |
121 | { | 121 | { |
122 | AssetBase asset = m_assets[uuid]; | 122 | AssetBase asset = m_assets[uuid]; |
123 | 123 | ||
124 | string extension = string.Empty; | 124 | string extension = string.Empty; |
125 | 125 | ||
126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) | 126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
127 | { | 127 | { |
128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; | 128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
129 | } | 129 | } |
130 | 130 | ||
131 | archive.AddFile( | 131 | archive.AddFile( |
132 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, | 132 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, |
133 | asset.Data); | 133 | asset.Data); |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs index 284a39e..17abb24 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs | |||
@@ -43,9 +43,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
43 | public class AssetsDearchiver | 43 | public class AssetsDearchiver |
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); | 47 | protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Store for asset data we received before we get the metadata | 50 | /// Store for asset data we received before we get the metadata |
51 | /// </summary> | 51 | /// </summary> |
@@ -55,17 +55,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
55 | /// Asset metadata. Is null if asset metadata isn't yet available. | 55 | /// Asset metadata. Is null if asset metadata isn't yet available. |
56 | /// </summary> | 56 | /// </summary> |
57 | protected Dictionary<string, AssetMetadata> m_metadata; | 57 | protected Dictionary<string, AssetMetadata> m_metadata; |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Cache to which dearchived assets will be added | 60 | /// Cache to which dearchived assets will be added |
61 | /// </summary> | 61 | /// </summary> |
62 | protected AssetCache m_cache; | 62 | protected AssetCache m_cache; |
63 | 63 | ||
64 | public AssetsDearchiver(AssetCache cache) | 64 | public AssetsDearchiver(AssetCache cache) |
65 | { | 65 | { |
66 | m_cache = cache; | 66 | m_cache = cache; |
67 | } | 67 | } |
68 | 68 | ||
69 | /// <summary> | 69 | /// <summary> |
70 | /// Add asset data to the dearchiver | 70 | /// Add asset data to the dearchiver |
71 | /// </summary> | 71 | /// </summary> |
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
82 | ResolveAssetData(assetFilename, data); | 82 | ResolveAssetData(assetFilename, data); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// Add asset metadata xml | 87 | /// Add asset metadata xml |
88 | /// </summary> | 88 | /// </summary> |
@@ -90,39 +90,39 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
90 | public void AddAssetMetadata(string xml) | 90 | public void AddAssetMetadata(string xml) |
91 | { | 91 | { |
92 | m_metadata = new Dictionary<string, AssetMetadata>(); | 92 | m_metadata = new Dictionary<string, AssetMetadata>(); |
93 | 93 | ||
94 | StringReader sr = new StringReader(xml); | 94 | StringReader sr = new StringReader(xml); |
95 | XmlTextReader reader = new XmlTextReader(sr); | 95 | XmlTextReader reader = new XmlTextReader(sr); |
96 | 96 | ||
97 | reader.ReadStartElement("assets"); | 97 | reader.ReadStartElement("assets"); |
98 | reader.Read(); | 98 | reader.Read(); |
99 | 99 | ||
100 | while (reader.Name.Equals("asset")) | 100 | while (reader.Name.Equals("asset")) |
101 | { | 101 | { |
102 | reader.Read(); | 102 | reader.Read(); |
103 | 103 | ||
104 | AssetMetadata metadata = new AssetMetadata(); | 104 | AssetMetadata metadata = new AssetMetadata(); |
105 | 105 | ||
106 | string filename = reader.ReadElementString("filename"); | 106 | string filename = reader.ReadElementString("filename"); |
107 | m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename); | 107 | m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename); |
108 | 108 | ||
109 | metadata.Name = reader.ReadElementString("name"); | 109 | metadata.Name = reader.ReadElementString("name"); |
110 | metadata.Description = reader.ReadElementString("description"); | 110 | metadata.Description = reader.ReadElementString("description"); |
111 | metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type")); | 111 | metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type")); |
112 | 112 | ||
113 | m_metadata[filename] = metadata; | 113 | m_metadata[filename] = metadata; |
114 | 114 | ||
115 | // Read asset end tag | 115 | // Read asset end tag |
116 | reader.ReadEndElement(); | 116 | reader.ReadEndElement(); |
117 | 117 | ||
118 | reader.Read(); | 118 | reader.Read(); |
119 | } | 119 | } |
120 | 120 | ||
121 | m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count); | 121 | m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count); |
122 | 122 | ||
123 | ResolvePendingAssetData(); | 123 | ResolvePendingAssetData(); |
124 | } | 124 | } |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Resolve asset data that we collected before receiving the metadata | 127 | /// Resolve asset data that we collected before receiving the metadata |
128 | /// </summary> | 128 | /// </summary> |
@@ -133,7 +133,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
133 | ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]); | 133 | ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]); |
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | /// <summary> | 137 | /// <summary> |
138 | /// Resolve a new piece of asset data against stored metadata | 138 | /// Resolve a new piece of asset data against stored metadata |
139 | /// </summary> | 139 | /// </summary> |
@@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
143 | { | 143 | { |
144 | // Right now we're nastily obtaining the lluuid from the filename | 144 | // Right now we're nastily obtaining the lluuid from the filename |
145 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); | 145 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); |
146 | 146 | ||
147 | if (m_metadata.ContainsKey(filename)) | 147 | if (m_metadata.ContainsKey(filename)) |
148 | { | 148 | { |
149 | AssetMetadata metadata = m_metadata[filename]; | 149 | AssetMetadata metadata = m_metadata[filename]; |
150 | 150 | ||
151 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType)) | 151 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType)) |
152 | { | 152 | { |
153 | string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType]; | 153 | string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType]; |
@@ -166,11 +166,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
166 | else | 166 | else |
167 | { | 167 | { |
168 | m_log.ErrorFormat( | 168 | m_log.ErrorFormat( |
169 | "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", | 169 | "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", |
170 | assetPath); | 170 | assetPath); |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | /// <summary> | 174 | /// <summary> |
175 | /// Metadata for an asset | 175 | /// Metadata for an asset |
176 | /// </summary> | 176 | /// </summary> |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs index 6ffbcbb..2164f7e 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs | |||
@@ -43,12 +43,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
43 | class AssetsRequest | 43 | class AssetsRequest |
44 | { | 44 | { |
45 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// uuids to request | 48 | /// uuids to request |
49 | /// </summary> | 49 | /// </summary> |
50 | protected ICollection<LLUUID> m_uuids; | 50 | protected ICollection<LLUUID> m_uuids; |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Callback used when all the assets requested have been received. | 53 | /// Callback used when all the assets requested have been received. |
54 | /// </summary> | 54 | /// </summary> |
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
58 | /// Assets retrieved in this request | 58 | /// Assets retrieved in this request |
59 | /// </summary> | 59 | /// </summary> |
60 | protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); | 60 | protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. | 63 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. |
64 | /// </summary> | 64 | /// </summary> |
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
81 | m_assetCache = assetCache; | 81 | m_assetCache = assetCache; |
82 | m_repliesRequired = uuids.Count; | 82 | m_repliesRequired = uuids.Count; |
83 | } | 83 | } |
84 | 84 | ||
85 | protected internal void Execute() | 85 | protected internal void Execute() |
86 | { | 86 | { |
87 | // We can stop here if there are no assets to fetch | 87 | // We can stop here if there are no assets to fetch |
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
105 | m_assets[assetID] = asset; | 105 | m_assets[assetID] = asset; |
106 | else | 106 | else |
107 | m_notFoundAssetUuids.Add(assetID); | 107 | m_notFoundAssetUuids.Add(assetID); |
108 | 108 | ||
109 | //m_log.DebugFormat( | 109 | //m_log.DebugFormat( |
110 | // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); | 110 | // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); |
111 | 111 | ||
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs index 585d1d4..4e000cc 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs | |||
@@ -69,9 +69,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
69 | public byte[] ReadEntry(out string filePath) | 69 | public byte[] ReadEntry(out string filePath) |
70 | { | 70 | { |
71 | filePath = String.Empty; | 71 | filePath = String.Empty; |
72 | 72 | ||
73 | TarHeader header = ReadHeader(); | 73 | TarHeader header = ReadHeader(); |
74 | 74 | ||
75 | if (null == header) | 75 | if (null == header) |
76 | return null; | 76 | return null; |
77 | 77 | ||
@@ -98,14 +98,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
98 | /// </summary> | 98 | /// </summary> |
99 | /// <returns>A tar header struct. null if we have reached the end of the archive.</returns> | 99 | /// <returns>A tar header struct. null if we have reached the end of the archive.</returns> |
100 | protected TarHeader ReadHeader() | 100 | protected TarHeader ReadHeader() |
101 | { | 101 | { |
102 | byte[] header = m_br.ReadBytes(512); | 102 | byte[] header = m_br.ReadBytes(512); |
103 | 103 | ||
104 | // If we've reached the end of the archive we'll be in null block territory, which means | 104 | // If we've reached the end of the archive we'll be in null block territory, which means |
105 | // the next byte will be 0 | 105 | // the next byte will be 0 |
106 | if (header[0] == 0) | 106 | if (header[0] == 0) |
107 | return null; | 107 | return null; |
108 | 108 | ||
109 | TarHeader tarHeader = new TarHeader(); | 109 | TarHeader tarHeader = new TarHeader(); |
110 | 110 | ||
111 | tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); | 111 | tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs index f70a93d..83b9250 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs | |||
@@ -54,10 +54,10 @@ namespace OpenSim.Region.Environment | |||
54 | // Directories are signalled by a final / | 54 | // Directories are signalled by a final / |
55 | if (!dirName.EndsWith("/")) | 55 | if (!dirName.EndsWith("/")) |
56 | dirName += "/"; | 56 | dirName += "/"; |
57 | 57 | ||
58 | AddFile(dirName, new byte[0]); | 58 | AddFile(dirName, new byte[0]); |
59 | } | 59 | } |
60 | 60 | ||
61 | /// <summary> | 61 | /// <summary> |
62 | /// Add a file to the tar archive | 62 | /// Add a file to the tar archive |
63 | /// </summary> | 63 | /// </summary> |
@@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment | |||
161 | if (data.Length % 512 != 0) | 161 | if (data.Length % 512 != 0) |
162 | { | 162 | { |
163 | int paddingRequired = 512 - (data.Length % 512); | 163 | int paddingRequired = 512 - (data.Length % 512); |
164 | 164 | ||
165 | //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); | 165 | //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); |
166 | 166 | ||
167 | byte[] padding = new byte[paddingRequired]; | 167 | byte[] padding = new byte[paddingRequired]; |
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 1e622be..28347d0 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs | |||
@@ -223,7 +223,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
223 | if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) | 223 | if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) |
224 | { | 224 | { |
225 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | 225 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; |
226 | 226 | ||
227 | bool alreadyInList = false; | 227 | bool alreadyInList = false; |
228 | 228 | ||
229 | for (int i = 0; i < banlistcheck.Length; i++) | 229 | for (int i = 0; i < banlistcheck.Length; i++) |
@@ -407,8 +407,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
407 | args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; | 407 | args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; |
408 | args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; | 408 | args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; |
409 | args.simName = m_scene.RegionInfo.RegionName; | 409 | args.simName = m_scene.RegionInfo.RegionName; |
410 | 410 | ||
411 | |||
412 | remote_client.SendRegionInfoToEstateMenu(args); | 411 | remote_client.SendRegionInfoToEstateMenu(args); |
413 | } | 412 | } |
414 | 413 | ||
@@ -416,6 +415,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
416 | { | 415 | { |
417 | remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); | 416 | remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); |
418 | } | 417 | } |
418 | |||
419 | private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) | 419 | private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) |
420 | { | 420 | { |
421 | Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); | 421 | Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); |
@@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
472 | continue; | 472 | continue; |
473 | } | 473 | } |
474 | } | 474 | } |
475 | 475 | ||
476 | SceneReport.Add(lsri); | 476 | SceneReport.Add(lsri); |
477 | } | 477 | } |
478 | } | 478 | } |
@@ -481,7 +481,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
481 | } | 481 | } |
482 | } | 482 | } |
483 | remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); | 483 | remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); |
484 | 484 | ||
485 | if (uuidNameLookupList.Count > 0) | 485 | if (uuidNameLookupList.Count > 0) |
486 | LookupUUID(uuidNameLookupList); | 486 | LookupUUID(uuidNameLookupList); |
487 | } | 487 | } |
@@ -502,7 +502,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
502 | private void LookupUUIDsAsync(List<LLUUID> uuidLst) | 502 | private void LookupUUIDsAsync(List<LLUUID> uuidLst) |
503 | { | 503 | { |
504 | LLUUID[] uuidarr = new LLUUID[0]; | 504 | LLUUID[] uuidarr = new LLUUID[0]; |
505 | 505 | ||
506 | lock (uuidLst) | 506 | lock (uuidLst) |
507 | { | 507 | { |
508 | uuidarr = uuidLst.ToArray(); | 508 | uuidarr = uuidLst.ToArray(); |
@@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
539 | if (EstateManagers[i] == remoteClient.AgentId) | 539 | if (EstateManagers[i] == remoteClient.AgentId) |
540 | estatemanager = true; | 540 | estatemanager = true; |
541 | } | 541 | } |
542 | 542 | ||
543 | args.isEstateManager = estatemanager; | 543 | args.isEstateManager = estatemanager; |
544 | 544 | ||
545 | args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; | 545 | args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; |
@@ -729,11 +729,11 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
729 | client.OnLandStatRequest += HandleLandStatRequest; | 729 | client.OnLandStatRequest += HandleLandStatRequest; |
730 | sendRegionHandshake(client); | 730 | sendRegionHandshake(client); |
731 | } | 731 | } |
732 | 732 | ||
733 | public uint GetRegionFlags() | 733 | public uint GetRegionFlags() |
734 | { | 734 | { |
735 | Simulator.RegionFlags flags = Simulator.RegionFlags.None; | 735 | Simulator.RegionFlags flags = Simulator.RegionFlags.None; |
736 | 736 | ||
737 | // Fully implemented | 737 | // Fully implemented |
738 | // | 738 | // |
739 | if (m_scene.RegionInfo.RegionSettings.AllowDamage) | 739 | if (m_scene.RegionInfo.RegionSettings.AllowDamage) |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 9b1b9b5..00994fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | |||
@@ -47,14 +47,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
47 | { | 47 | { |
48 | private static readonly ILog m_log = | 48 | private static readonly ILog m_log = |
49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | private static readonly string remoteParcelRequestPath = "0009/"; | 51 | private static readonly string remoteParcelRequestPath = "0009/"; |
52 | 52 | ||
53 | private LandChannel landChannel; | 53 | private LandChannel landChannel; |
54 | private Scene m_scene; | 54 | private Scene m_scene; |
55 | 55 | ||
56 | |||
57 | |||
58 | private readonly int[,] landIDList = new int[64, 64]; | 56 | private readonly int[,] landIDList = new int[64, 64]; |
59 | private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); | 57 | private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); |
60 | 58 | ||
@@ -115,8 +113,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
115 | } | 113 | } |
116 | } | 114 | } |
117 | 115 | ||
118 | |||
119 | |||
120 | public void PostInitialise() | 116 | public void PostInitialise() |
121 | { | 117 | { |
122 | } | 118 | } |
@@ -153,8 +149,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
153 | } | 149 | } |
154 | } | 150 | } |
155 | 151 | ||
156 | |||
157 | |||
158 | public bool AllowedForcefulBans | 152 | public bool AllowedForcefulBans |
159 | { | 153 | { |
160 | get { return m_allowedForcefulBans; } | 154 | get { return m_allowedForcefulBans; } |
@@ -185,11 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
185 | public List<ILandObject> ParcelsNearPoint(LLVector3 position) | 179 | public List<ILandObject> ParcelsNearPoint(LLVector3 position) |
186 | { | 180 | { |
187 | List<ILandObject> parcelsNear = new List<ILandObject>(); | 181 | List<ILandObject> parcelsNear = new List<ILandObject>(); |
188 | int x; | 182 | for (int x = -4; x <= 4; x += 4) |
189 | for (x = -4; x <= 4; x += 4) | ||
190 | { | 183 | { |
191 | int y; | 184 | for (int y = -4; y <= 4; y += 4) |
192 | for (y = -4; y <= 4; y += 4) | ||
193 | { | 185 | { |
194 | ILandObject check = GetLandObject(position.X + x, position.Y + y); | 186 | ILandObject check = GetLandObject(position.X + x, position.Y + y); |
195 | if (check != null) | 187 | if (check != null) |
@@ -286,7 +278,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
286 | ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), | 278 | ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), |
287 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); | 279 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); |
288 | 280 | ||
289 | |||
290 | if (over != null) | 281 | if (over != null) |
291 | { | 282 | { |
292 | if (force) | 283 | if (force) |
@@ -387,6 +378,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
387 | Console.WriteLine("INVALID LOCAL LAND ID"); | 378 | Console.WriteLine("INVALID LOCAL LAND ID"); |
388 | } | 379 | } |
389 | } | 380 | } |
381 | |||
390 | /// <summary> | 382 | /// <summary> |
391 | /// Creates a basic Parcel object without an owner (a zeroed key) | 383 | /// Creates a basic Parcel object without an owner (a zeroed key) |
392 | /// </summary> | 384 | /// </summary> |
@@ -406,13 +398,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
406 | new_land.landData.LocalID = lastLandLocalID; | 398 | new_land.landData.LocalID = lastLandLocalID; |
407 | landList.Add(lastLandLocalID, new_land.Copy()); | 399 | landList.Add(lastLandLocalID, new_land.Copy()); |
408 | 400 | ||
409 | |||
410 | bool[,] landBitmap = new_land.getLandBitmap(); | 401 | bool[,] landBitmap = new_land.getLandBitmap(); |
411 | int x; | 402 | for (int x = 0; x < 64; x++) |
412 | for (x = 0; x < 64; x++) | ||
413 | { | 403 | { |
414 | int y; | 404 | for (int y = 0; y < 64; y++) |
415 | for (y = 0; y < 64; y++) | ||
416 | { | 405 | { |
417 | if (landBitmap[x, y]) | 406 | if (landBitmap[x, y]) |
418 | { | 407 | { |
@@ -431,11 +420,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
431 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> | 420 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> |
432 | public void removeLandObject(int local_id) | 421 | public void removeLandObject(int local_id) |
433 | { | 422 | { |
434 | int x; | 423 | for (int x = 0; x < 64; x++) |
435 | for (x = 0; x < 64; x++) | ||
436 | { | 424 | { |
437 | int y; | 425 | for (int y = 0; y < 64; y++) |
438 | for (y = 0; y < 64; y++) | ||
439 | { | 426 | { |
440 | if (landIDList[x, y] == local_id) | 427 | if (landIDList[x, y] == local_id) |
441 | { | 428 | { |
@@ -451,12 +438,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
451 | 438 | ||
452 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 439 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
453 | { | 440 | { |
454 | int x; | ||
455 | bool[,] landBitmapSlave = slave.getLandBitmap(); | 441 | bool[,] landBitmapSlave = slave.getLandBitmap(); |
456 | for (x = 0; x < 64; x++) | 442 | for (int x = 0; x < 64; x++) |
457 | { | 443 | { |
458 | int y; | 444 | for (int y = 0; y < 64; y++) |
459 | for (y = 0; y < 64; y++) | ||
460 | { | 445 | { |
461 | if (landBitmapSlave[x, y]) | 446 | if (landBitmapSlave[x, y]) |
462 | { | 447 | { |
@@ -519,6 +504,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
519 | } | 504 | } |
520 | return landList[landIDList[x / 4, y / 4]]; | 505 | return landList[landIDList[x / 4, y / 4]]; |
521 | } | 506 | } |
507 | |||
522 | #endregion | 508 | #endregion |
523 | 509 | ||
524 | #region Parcel Modification | 510 | #region Parcel Modification |
@@ -601,7 +587,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
601 | ResetAllLandPrimCounts(); | 587 | ResetAllLandPrimCounts(); |
602 | lock (m_scene.Entities) | 588 | lock (m_scene.Entities) |
603 | { | 589 | { |
604 | foreach (EntityBase obj in m_scene.Entities.Values) | 590 | foreach (EntityBase obj in m_scene.Entities.Values) |
605 | { | 591 | { |
606 | if (obj != null) | 592 | if (obj != null) |
607 | { | 593 | { |
@@ -647,11 +633,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
647 | { | 633 | { |
648 | int totalX = end_x - start_x; | 634 | int totalX = end_x - start_x; |
649 | int totalY = end_y - start_y; | 635 | int totalY = end_y - start_y; |
650 | int y; | 636 | for (int y = 0; y < totalY; y++) |
651 | for (y = 0; y < totalY; y++) | ||
652 | { | 637 | { |
653 | int x; | 638 | for (int x = 0; x < totalX; x++) |
654 | for (x = 0; x < totalX; x++) | ||
655 | { | 639 | { |
656 | ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); | 640 | ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); |
657 | if (tempLandObject == null) return; | 641 | if (tempLandObject == null) return; |
@@ -690,9 +674,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
690 | ILandObject result = AddLandObject(newLand); | 674 | ILandObject result = AddLandObject(newLand); |
691 | UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); | 675 | UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); |
692 | result.sendLandUpdateToAvatarsOverMe(); | 676 | result.sendLandUpdateToAvatarsOverMe(); |
693 | |||
694 | |||
695 | return; | ||
696 | } | 677 | } |
697 | 678 | ||
698 | /// <summary> | 679 | /// <summary> |
@@ -730,7 +711,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
730 | ILandObject masterLandObject = selectedLandObjects[0]; | 711 | ILandObject masterLandObject = selectedLandObjects[0]; |
731 | selectedLandObjects.RemoveAt(0); | 712 | selectedLandObjects.RemoveAt(0); |
732 | 713 | ||
733 | |||
734 | if (selectedLandObjects.Count < 1) | 714 | if (selectedLandObjects.Count < 1) |
735 | { | 715 | { |
736 | return; | 716 | return; |
@@ -753,12 +733,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
753 | performFinalLandJoin(masterLandObject, slaveLandObject); | 733 | performFinalLandJoin(masterLandObject, slaveLandObject); |
754 | } | 734 | } |
755 | 735 | ||
756 | |||
757 | SetPrimsTainted(); | 736 | SetPrimsTainted(); |
758 | 737 | ||
759 | masterLandObject.sendLandUpdateToAvatarsOverMe(); | 738 | masterLandObject.sendLandUpdateToAvatarsOverMe(); |
760 | |||
761 | return; | ||
762 | } | 739 | } |
763 | 740 | ||
764 | #endregion | 741 | #endregion |
@@ -777,17 +754,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
777 | int byteArrayCount = 0; | 754 | int byteArrayCount = 0; |
778 | int sequenceID = 0; | 755 | int sequenceID = 0; |
779 | 756 | ||
780 | int y; | 757 | for (int y = 0; y < 64; y++) |
781 | for (y = 0; y < 64; y++) | ||
782 | { | 758 | { |
783 | int x; | 759 | for (int x = 0; x < 64; x++) |
784 | for (x = 0; x < 64; x++) | ||
785 | { | 760 | { |
786 | byte tempByte = 0; //This represents the byte for the current 4x4 | 761 | byte tempByte = 0; //This represents the byte for the current 4x4 |
787 | 762 | ||
788 | ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); | 763 | ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); |
789 | 764 | ||
790 | |||
791 | if (currentParcelBlock != null) | 765 | if (currentParcelBlock != null) |
792 | { | 766 | { |
793 | if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) | 767 | if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) |
@@ -813,7 +787,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
813 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); | 787 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); |
814 | } | 788 | } |
815 | 789 | ||
816 | |||
817 | //Now for border control | 790 | //Now for border control |
818 | 791 | ||
819 | ILandObject westParcel = null; | 792 | ILandObject westParcel = null; |
@@ -864,14 +837,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
864 | { | 837 | { |
865 | //Get the land objects within the bounds | 838 | //Get the land objects within the bounds |
866 | List<ILandObject> temp = new List<ILandObject>(); | 839 | List<ILandObject> temp = new List<ILandObject>(); |
867 | int x; | ||
868 | int i; | ||
869 | int inc_x = end_x - start_x; | 840 | int inc_x = end_x - start_x; |
870 | int inc_y = end_y - start_y; | 841 | int inc_y = end_y - start_y; |
871 | for (x = 0; x < inc_x; x++) | 842 | for (int x = 0; x < inc_x; x++) |
872 | { | 843 | { |
873 | int y; | 844 | for (int y = 0; y < inc_y; y++) |
874 | for (y = 0; y < inc_y; y++) | ||
875 | { | 845 | { |
876 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); | 846 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); |
877 | 847 | ||
@@ -892,12 +862,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
892 | requestResult = LandChannel.LAND_RESULT_MULTIPLE; | 862 | requestResult = LandChannel.LAND_RESULT_MULTIPLE; |
893 | } | 863 | } |
894 | 864 | ||
895 | for (i = 0; i < temp.Count; i++) | 865 | for (int i = 0; i < temp.Count; i++) |
896 | { | 866 | { |
897 | temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); | 867 | temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); |
898 | } | 868 | } |
899 | 869 | ||
900 | |||
901 | SendParcelOverlay(remote_client); | 870 | SendParcelOverlay(remote_client); |
902 | } | 871 | } |
903 | 872 | ||
@@ -921,7 +890,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
921 | 890 | ||
922 | public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) | 891 | public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) |
923 | { | 892 | { |
924 | |||
925 | landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); | 893 | landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); |
926 | } | 894 | } |
927 | 895 | ||
@@ -954,7 +922,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
954 | landList[local_id].sendLandUpdateToClient(remote_client); | 922 | landList[local_id].sendLandUpdateToClient(remote_client); |
955 | } | 923 | } |
956 | } | 924 | } |
957 | |||
958 | } | 925 | } |
959 | 926 | ||
960 | public void handleParcelReclaim(int local_id, IClientAPI remote_client) | 927 | public void handleParcelReclaim(int local_id, IClientAPI remote_client) |
@@ -972,7 +939,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
972 | landList[local_id].sendLandUpdateToClient(remote_client); | 939 | landList[local_id].sendLandUpdateToClient(remote_client); |
973 | } | 940 | } |
974 | } | 941 | } |
975 | |||
976 | } | 942 | } |
977 | #endregion | 943 | #endregion |
978 | 944 | ||
@@ -1076,7 +1042,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1076 | { | 1042 | { |
1077 | selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); | 1043 | selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); |
1078 | } | 1044 | } |
1079 | |||
1080 | } | 1045 | } |
1081 | 1046 | ||
1082 | public void NoLandDataFromStorage() | 1047 | public void NoLandDataFromStorage() |
@@ -1093,11 +1058,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1093 | obj.setParcelObjectMaxOverride(overrideDel); | 1058 | obj.setParcelObjectMaxOverride(overrideDel); |
1094 | } | 1059 | } |
1095 | } | 1060 | } |
1061 | |||
1096 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) | 1062 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) |
1097 | { | 1063 | { |
1098 | } | 1064 | } |
1099 | 1065 | ||
1100 | #region CAPS handler | 1066 | #region CAPS handler |
1067 | |||
1101 | private void OnRegisterCaps(LLUUID agentID, Caps caps) | 1068 | private void OnRegisterCaps(LLUUID agentID, Caps caps) |
1102 | { | 1069 | { |
1103 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 1070 | string capsBase = "/CAPS/" + caps.CapsObjectPath; |
@@ -1109,7 +1076,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1109 | return RemoteParcelRequest(request, path, param, agentID, caps); | 1076 | return RemoteParcelRequest(request, path, param, agentID, caps); |
1110 | })); | 1077 | })); |
1111 | } | 1078 | } |
1112 | 1079 | ||
1113 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the | 1080 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the |
1114 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. | 1081 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. |
1115 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x | 1082 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x |
@@ -1171,11 +1138,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1171 | { | 1138 | { |
1172 | m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); | 1139 | m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); |
1173 | } | 1140 | } |
1174 | 1141 | ||
1175 | LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); | 1142 | LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); |
1176 | response.parcel_id = parcelID; | 1143 | response.parcel_id = parcelID; |
1177 | m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); | 1144 | m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); |
1178 | 1145 | ||
1179 | return LLSDHelpers.SerialiseLLSDReply(response); | 1146 | return LLSDHelpers.SerialiseLLSDReply(response); |
1180 | } | 1147 | } |
1181 | 1148 | ||
@@ -1191,7 +1158,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1191 | uint x, y; | 1158 | uint x, y; |
1192 | Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); | 1159 | Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); |
1193 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); | 1160 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); |
1194 | 1161 | ||
1195 | LandData landData; | 1162 | LandData landData; |
1196 | if (regionHandle == m_scene.RegionInfo.RegionHandle) | 1163 | if (regionHandle == m_scene.RegionInfo.RegionHandle) |
1197 | landData = this.GetLandObject(x, y).landData; | 1164 | landData = this.GetLandObject(x, y).landData; |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 305e236..6388a1c 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs | |||
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
116 | return newLand; | 116 | return newLand; |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; | 120 | static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; |
121 | static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; | 121 | static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; |
122 | 122 | ||
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | #endregion | 158 | #endregion |
159 | 159 | ||
160 | #region Packet Request Handling | 160 | #region Packet Request Handling |
161 | 161 | ||
162 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) | 162 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) |
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 7b05027..09f12b2 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | |||
@@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
305 | 305 | ||
306 | public event RegionHandleRequest OnRegionHandleRequest; | 306 | public event RegionHandleRequest OnRegionHandleRequest; |
307 | public event ParcelInfoRequest OnParcelInfoRequest; | 307 | public event ParcelInfoRequest OnParcelInfoRequest; |
308 | 308 | ||
309 | #pragma warning restore 67 | 309 | #pragma warning restore 67 |
310 | 310 | ||
311 | #endregion | 311 | #endregion |
@@ -368,7 +368,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
368 | { | 368 | { |
369 | get { return 0; } | 369 | get { return 0; } |
370 | } | 370 | } |
371 | 371 | ||
372 | public ulong GetGroupPowers(LLUUID groupID) | 372 | public ulong GetGroupPowers(LLUUID groupID) |
373 | { | 373 | { |
374 | return 0; | 374 | return 0; |
@@ -820,13 +820,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
820 | 820 | ||
821 | 821 | ||
822 | public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) | 822 | public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) |
823 | { | 823 | { |
824 | } | 824 | } |
825 | 825 | ||
826 | public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, | 826 | public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, |
827 | byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, | 827 | byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, |
828 | byte mediaLoop) | 828 | byte mediaLoop) |
829 | { | 829 | { |
830 | } | 830 | } |
831 | 831 | ||
832 | public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) | 832 | public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) |
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 6107f48..071e3af 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs | |||
@@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
146 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); | 146 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); |
147 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); | 147 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); |
148 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); | 148 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); |
149 | 149 | ||
150 | if (m_bypassPermissions) | 150 | if (m_bypassPermissions) |
151 | m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); | 151 | m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); |
152 | else | 152 | else |
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs index 0df19d9..22c9b29 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
44 | public class SceneXmlLoader | 44 | public class SceneXmlLoader |
45 | { | 45 | { |
46 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) | 48 | public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) |
49 | { | 49 | { |
50 | XmlDocument doc = new XmlDocument(); | 50 | XmlDocument doc = new XmlDocument(); |
@@ -114,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
114 | doc.Load(reader); | 114 | doc.Load(reader); |
115 | reader.Close(); | 115 | reader.Close(); |
116 | rootNode = doc.FirstChild; | 116 | rootNode = doc.FirstChild; |
117 | 117 | ||
118 | // This is to deal with neighbouring regions that are still surrounding the group xml with the <scene> | 118 | // This is to deal with neighbouring regions that are still surrounding the group xml with the <scene> |
119 | // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or | 119 | // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or |
120 | // when some other changes forces all regions to upgrade). | 120 | // when some other changes forces all regions to upgrade). |
@@ -127,13 +127,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
127 | // There is only ever one prim. This oddity should be removeable post 0.5.9 | 127 | // There is only ever one prim. This oddity should be removeable post 0.5.9 |
128 | return new SceneObjectGroup(aPrimNode.OuterXml); | 128 | return new SceneObjectGroup(aPrimNode.OuterXml); |
129 | } | 129 | } |
130 | 130 | ||
131 | return null; | 131 | return null; |
132 | } | 132 | } |
133 | else | 133 | else |
134 | { | 134 | { |
135 | return new SceneObjectGroup(rootNode.OuterXml); | 135 | return new SceneObjectGroup(rootNode.OuterXml); |
136 | } | 136 | } |
137 | } | 137 | } |
138 | 138 | ||
139 | /// <summary> | 139 | /// <summary> |
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
171 | reader.Close(); | 171 | reader.Close(); |
172 | XmlNode rootNode = doc.FirstChild; | 172 | XmlNode rootNode = doc.FirstChild; |
173 | 173 | ||
174 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 174 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
175 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) | 175 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) |
176 | { | 176 | { |
177 | SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml); | 177 | SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml); |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
195 | { | 195 | { |
196 | SceneObjectGroup obj = new SceneObjectGroup(xmlData); | 196 | SceneObjectGroup obj = new SceneObjectGroup(xmlData); |
197 | 197 | ||
198 | if (scene.AddRestoredSceneObject(obj, true, false)) | 198 | if (scene.AddRestoredSceneObject(obj, true, false)) |
199 | return obj; | 199 | return obj; |
200 | else | 200 | else |
201 | return null; | 201 | return null; |
@@ -254,7 +254,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
254 | if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) | 254 | if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) |
255 | continue; | 255 | continue; |
256 | } | 256 | } |
257 | 257 | ||
258 | stream.WriteLine(g.ToXmlString2()); | 258 | stream.WriteLine(g.ToXmlString2()); |
259 | primCount++; | 259 | primCount++; |
260 | } | 260 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 5682de3..9690433 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules | |||
94 | private LLVector3 Position = new LLVector3(0,0,0); | 94 | private LLVector3 Position = new LLVector3(0,0,0); |
95 | private LLVector3 Velocity = new LLVector3(0,0,0); | 95 | private LLVector3 Velocity = new LLVector3(0,0,0); |
96 | private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); | 96 | private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); |
97 | 97 | ||
98 | private long LindenHourOffset = 0; | 98 | private long LindenHourOffset = 0; |
99 | private bool sunFixed = false; | 99 | private bool sunFixed = false; |
100 | 100 | ||
@@ -111,7 +111,7 @@ namespace OpenSim.Region.Environment.Modules | |||
111 | private float GetLindenEstateHourFromCurrentTime() | 111 | private float GetLindenEstateHourFromCurrentTime() |
112 | { | 112 | { |
113 | float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle); | 113 | float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle); |
114 | 114 | ||
115 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6; | 115 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6; |
116 | 116 | ||
117 | return hour; | 117 | return hour; |
@@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules | |||
132 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)); | 132 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)); |
133 | 133 | ||
134 | float offsethours = 0; | 134 | float offsethours = 0; |
135 | 135 | ||
136 | if (LindenHour - 6 > hour) | 136 | if (LindenHour - 6 > hour) |
137 | { | 137 | { |
138 | offsethours = hour + ((LindenHour-6) - hour); | 138 | offsethours = hour + ((LindenHour-6) - hour); |
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Environment.Modules | |||
142 | offsethours = hour - (hour - (LindenHour - 6)); | 142 | offsethours = hour - (hour - (LindenHour - 6)); |
143 | } | 143 | } |
144 | //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString()); | 144 | //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString()); |
145 | 145 | ||
146 | LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); | 146 | LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); |
147 | m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); | 147 | m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); |
148 | 148 | ||
@@ -422,7 +422,7 @@ namespace OpenSim.Region.Environment.Modules | |||
422 | } | 422 | } |
423 | } | 423 | } |
424 | } | 424 | } |
425 | 425 | ||
426 | public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) | 426 | public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) |
427 | { | 427 | { |
428 | if (m_scene.RegionInfo.RegionHandle == regionHandle) | 428 | if (m_scene.RegionInfo.RegionHandle == regionHandle) |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs index 34bbf78..48da96d 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | 51 | ||
52 | colours.Save(filename, ImageFormat.Bmp); | 52 | colours.Save(filename, ImageFormat.Bmp); |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Exports a stream using a System.Drawing exporter. | 56 | /// Exports a stream using a System.Drawing exporter. |
57 | /// </summary> | 57 | /// </summary> |
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
62 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 62 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
63 | 63 | ||
64 | colours.Save(stream, ImageFormat.Png); | 64 | colours.Save(stream, ImageFormat.Png); |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// The human readable version of the file format(s) this loader handles | 68 | /// The human readable version of the file format(s) this loader handles |
@@ -73,4 +73,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
73 | return "BMP"; | 73 | return "BMP"; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | } \ No newline at end of file | 76 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs index 0cd9000..accffd2 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
40 | 40 | ||
41 | colours.Save(filename, ImageFormat.Gif); | 41 | colours.Save(filename, ImageFormat.Gif); |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Exports a stream using a System.Drawing exporter. | 45 | /// Exports a stream using a System.Drawing exporter. |
46 | /// </summary> | 46 | /// </summary> |
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
52 | 52 | ||
53 | colours.Save(stream, ImageFormat.Gif); | 53 | colours.Save(stream, ImageFormat.Gif); |
54 | } | 54 | } |
55 | 55 | ||
56 | public override string ToString() | 56 | public override string ToString() |
57 | { | 57 | { |
58 | return "GIF"; | 58 | return "GIF"; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } \ No newline at end of file | 61 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index 4d213e0..983ad29 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs | |||
@@ -58,19 +58,19 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
58 | /// <returns>A terrain channel generated from the image.</returns> | 58 | /// <returns>A terrain channel generated from the image.</returns> |
59 | public virtual ITerrainChannel LoadFile(string filename) | 59 | public virtual ITerrainChannel LoadFile(string filename) |
60 | { | 60 | { |
61 | return LoadBitmap(new Bitmap(filename)); | 61 | return LoadBitmap(new Bitmap(filename)); |
62 | } | 62 | } |
63 | 63 | ||
64 | public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) | 64 | public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) |
65 | { | 65 | { |
66 | throw new NotImplementedException(); | 66 | throw new NotImplementedException(); |
67 | } | 67 | } |
68 | 68 | ||
69 | public virtual ITerrainChannel LoadStream(Stream stream) | 69 | public virtual ITerrainChannel LoadStream(Stream stream) |
70 | { | 70 | { |
71 | return LoadBitmap(new Bitmap(stream)); | 71 | return LoadBitmap(new Bitmap(stream)); |
72 | } | 72 | } |
73 | 73 | ||
74 | protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap) | 74 | protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap) |
75 | { | 75 | { |
76 | ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height); | 76 | ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height); |
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
88 | return retval; | 88 | return retval; |
89 | } | 89 | } |
90 | 90 | ||
91 | /// <summary> | 91 | /// <summary> |
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
99 | 99 | ||
100 | colours.Save(filename, ImageFormat.Png); | 100 | colours.Save(filename, ImageFormat.Png); |
101 | } | 101 | } |
102 | 102 | ||
103 | /// <summary> | 103 | /// <summary> |
104 | /// Exports a stream using a System.Drawing exporter. | 104 | /// Exports a stream using a System.Drawing exporter. |
105 | /// </summary> | 105 | /// </summary> |
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
110 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 110 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
111 | 111 | ||
112 | colours.Save(stream, ImageFormat.Png); | 112 | colours.Save(stream, ImageFormat.Png); |
113 | } | 113 | } |
114 | 114 | ||
115 | #endregion | 115 | #endregion |
116 | 116 | ||
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs index 9886b81..35576c7 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs | |||
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | { | 51 | { |
52 | throw new NotImplementedException(); | 52 | throw new NotImplementedException(); |
53 | } | 53 | } |
54 | 54 | ||
55 | public ITerrainChannel LoadStream(Stream stream) | 55 | public ITerrainChannel LoadStream(Stream stream) |
56 | { | 56 | { |
57 | throw new NotImplementedException(); | 57 | throw new NotImplementedException(); |
58 | } | 58 | } |
59 | 59 | ||
60 | public void SaveFile(string filename, ITerrainChannel map) | 60 | public void SaveFile(string filename, ITerrainChannel map) |
61 | { | 61 | { |
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
63 | 63 | ||
64 | colours.Save(filename, ImageFormat.Jpeg); | 64 | colours.Save(filename, ImageFormat.Jpeg); |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// Exports a stream using a System.Drawing exporter. | 68 | /// Exports a stream using a System.Drawing exporter. |
69 | /// </summary> | 69 | /// </summary> |
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
74 | Bitmap colours = CreateBitmapFromMap(map); | 74 | Bitmap colours = CreateBitmapFromMap(map); |
75 | 75 | ||
76 | colours.Save(stream, ImageFormat.Jpeg); | 76 | colours.Save(stream, ImageFormat.Jpeg); |
77 | } | 77 | } |
78 | 78 | ||
79 | #endregion | 79 | #endregion |
80 | 80 | ||
@@ -109,4 +109,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
109 | return bmp; | 109 | return bmp; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | } \ No newline at end of file | 112 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs index 21fba2b..5f13d01 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
74 | FileInfo file = new FileInfo(filename); | 74 | FileInfo file = new FileInfo(filename); |
75 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); | 75 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); |
76 | ITerrainChannel retval = LoadStream(s); | 76 | ITerrainChannel retval = LoadStream(s); |
77 | 77 | ||
78 | s.Close(); | 78 | s.Close(); |
79 | 79 | ||
80 | return retval; | 80 | return retval; |
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
113 | // i.e. eat X upto where we start | 113 | // i.e. eat X upto where we start |
114 | while (currFileXOffset < offsetX) | 114 | while (currFileXOffset < offsetX) |
115 | { | 115 | { |
116 | bs.ReadBytes(sectionWidth * 13); | 116 | bs.ReadBytes(sectionWidth * 13); |
117 | currFileXOffset++; | 117 | currFileXOffset++; |
118 | } | 118 | } |
119 | 119 | ||
@@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
143 | 143 | ||
144 | return retval; | 144 | return retval; |
145 | } | 145 | } |
146 | 146 | ||
147 | public ITerrainChannel LoadStream(Stream s) | 147 | public ITerrainChannel LoadStream(Stream s) |
148 | { | 148 | { |
149 | TerrainChannel retval = new TerrainChannel(); | 149 | TerrainChannel retval = new TerrainChannel(); |
150 | 150 | ||
151 | BinaryReader bs = new BinaryReader(s); | 151 | BinaryReader bs = new BinaryReader(s); |
152 | int y; | 152 | int y; |
153 | for (y = 0; y < retval.Height; y++) | 153 | for (y = 0; y < retval.Height; y++) |
@@ -160,8 +160,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | bs.Close(); | 163 | bs.Close(); |
164 | 164 | ||
165 | return retval; | 165 | return retval; |
166 | } | 166 | } |
167 | 167 | ||
@@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
173 | 173 | ||
174 | s.Close(); | 174 | s.Close(); |
175 | } | 175 | } |
176 | 176 | ||
177 | public void SaveStream(Stream s, ITerrainChannel map) | 177 | public void SaveStream(Stream s, ITerrainChannel map) |
178 | { | 178 | { |
179 | BinaryWriter binStream = new BinaryWriter(s); | 179 | BinaryWriter binStream = new BinaryWriter(s); |
@@ -224,9 +224,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | binStream.Close(); | 227 | binStream.Close(); |
228 | } | 228 | } |
229 | 229 | ||
230 | public string FileExtension | 230 | public string FileExtension |
231 | { | 231 | { |
232 | get { return ".raw"; } | 232 | get { return ".raw"; } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs index cf95486..19e181e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
40 | 40 | ||
41 | colours.Save(filename, ImageFormat.Png); | 41 | colours.Save(filename, ImageFormat.Png); |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Exports a stream using a System.Drawing exporter. | 45 | /// Exports a stream using a System.Drawing exporter. |
46 | /// </summary> | 46 | /// </summary> |
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
52 | 52 | ||
53 | colours.Save(stream, ImageFormat.Png); | 53 | colours.Save(stream, ImageFormat.Png); |
54 | } | 54 | } |
55 | 55 | ||
56 | public override string ToString() | 56 | public override string ToString() |
57 | { | 57 | { |
58 | return "PNG"; | 58 | return "PNG"; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } \ No newline at end of file | 61 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs index bb8b0f7..758821a 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs | |||
@@ -112,11 +112,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
112 | 112 | ||
113 | return retval; | 113 | return retval; |
114 | } | 114 | } |
115 | 115 | ||
116 | public ITerrainChannel LoadStream(Stream s) | 116 | public ITerrainChannel LoadStream(Stream s) |
117 | { | 117 | { |
118 | TerrainChannel retval = new TerrainChannel(); | 118 | TerrainChannel retval = new TerrainChannel(); |
119 | 119 | ||
120 | BinaryReader bs = new BinaryReader(s); | 120 | BinaryReader bs = new BinaryReader(s); |
121 | int y; | 121 | int y; |
122 | for (y = 0; y < retval.Height; y++) | 122 | for (y = 0; y < retval.Height; y++) |
@@ -129,10 +129,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
129 | } | 129 | } |
130 | 130 | ||
131 | bs.Close(); | 131 | bs.Close(); |
132 | 132 | ||
133 | return retval; | 133 | return retval; |
134 | } | 134 | } |
135 | 135 | ||
136 | public void SaveFile(string filename, ITerrainChannel map) | 136 | public void SaveFile(string filename, ITerrainChannel map) |
137 | { | 137 | { |
138 | FileInfo file = new FileInfo(filename); | 138 | FileInfo file = new FileInfo(filename); |
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
141 | 141 | ||
142 | s.Close(); | 142 | s.Close(); |
143 | } | 143 | } |
144 | 144 | ||
145 | public void SaveStream(Stream s, ITerrainChannel map) | 145 | public void SaveStream(Stream s, ITerrainChannel map) |
146 | { | 146 | { |
147 | BinaryWriter bs = new BinaryWriter(s); | 147 | BinaryWriter bs = new BinaryWriter(s); |
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | bs.Close(); | 159 | bs.Close(); |
160 | } | 160 | } |
161 | 161 | ||
162 | #endregion | 162 | #endregion |
@@ -166,4 +166,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
166 | return "RAW32"; | 166 | return "RAW32"; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | } \ No newline at end of file | 169 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs index 3f98f40..95b43b0 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
40 | 40 | ||
41 | colours.Save(filename, ImageFormat.Tiff); | 41 | colours.Save(filename, ImageFormat.Tiff); |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Exports a stream using a System.Drawing exporter. | 45 | /// Exports a stream using a System.Drawing exporter. |
46 | /// </summary> | 46 | /// </summary> |
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
52 | 52 | ||
53 | colours.Save(stream, ImageFormat.Tiff); | 53 | colours.Save(stream, ImageFormat.Tiff); |
54 | } | 54 | } |
55 | 55 | ||
56 | public override string ToString() | 56 | public override string ToString() |
57 | { | 57 | { |
58 | return "TIFF"; | 58 | return "TIFF"; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } \ No newline at end of file | 61 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs index 5dc2aa5..2bf029e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs | |||
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | 51 | ||
52 | return retval; | 52 | return retval; |
53 | } | 53 | } |
54 | 54 | ||
55 | public ITerrainChannel LoadStream(Stream s) | 55 | public ITerrainChannel LoadStream(Stream s) |
56 | { | 56 | { |
57 | TerrainChannel retval = new TerrainChannel(); | 57 | TerrainChannel retval = new TerrainChannel(); |
58 | 58 | ||
59 | BinaryReader bs = new BinaryReader(s); | 59 | BinaryReader bs = new BinaryReader(s); |
60 | 60 | ||
61 | bool eof = false; | 61 | bool eof = false; |
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
107 | } | 107 | } |
108 | 108 | ||
109 | bs.Close(); | 109 | bs.Close(); |
110 | 110 | ||
111 | return retval; | 111 | return retval; |
112 | } | 112 | } |
113 | 113 | ||
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
115 | { | 115 | { |
116 | throw new NotImplementedException(); | 116 | throw new NotImplementedException(); |
117 | } | 117 | } |
118 | 118 | ||
119 | public void SaveStream(Stream stream, ITerrainChannel map) | 119 | public void SaveStream(Stream stream, ITerrainChannel map) |
120 | { | 120 | { |
121 | throw new NotImplementedException(); | 121 | throw new NotImplementedException(); |
@@ -138,4 +138,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
138 | return "Terragen"; | 138 | return "Terragen"; |
139 | } | 139 | } |
140 | } | 140 | } |
141 | } \ No newline at end of file | 141 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs index e255515..beeff03 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
33 | { | 33 | { |
34 | void LoadFromFile(string filename); | 34 | void LoadFromFile(string filename); |
35 | void SaveToFile(string filename); | 35 | void SaveToFile(string filename); |
36 | 36 | ||
37 | /// <summary> | 37 | /// <summary> |
38 | /// Load a terrain from a stream. | 38 | /// Load a terrain from a stream. |
39 | /// </summary> | 39 | /// </summary> |
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
42 | /// </param> | 42 | /// </param> |
43 | /// <param name="stream"></param> | 43 | /// <param name="stream"></param> |
44 | void LoadFromStream(string filename, Stream stream); | 44 | void LoadFromStream(string filename, Stream stream); |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// Save a terrain to a stream. | 47 | /// Save a terrain to a stream. |
48 | /// </summary> | 48 | /// </summary> |
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
51 | /// </param> | 51 | /// </param> |
52 | /// <param name="stream"></param> | 52 | /// <param name="stream"></param> |
53 | void SaveToStream(string filename, Stream stream); | 53 | void SaveToStream(string filename, Stream stream); |
54 | 54 | ||
55 | void InstallPlugin(string name, ITerrainEffect plug); | 55 | void InstallPlugin(string name, ITerrainEffect plug); |
56 | } | 56 | } |
57 | } | 57 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index 8fbc62e..4a62446 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs | |||
@@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
221 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); | 221 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | /// <summary> | 225 | /// <summary> |
226 | /// Loads a terrain file from a stream and installs it in the scene. | 226 | /// Loads a terrain file from a stream and installs it in the scene. |
227 | /// </summary> | 227 | /// </summary> |
@@ -281,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
281 | m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); | 281 | m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); |
282 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); | 282 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); |
283 | } | 283 | } |
284 | } | 284 | } |
285 | 285 | ||
286 | #region Plugin Loading Methods | 286 | #region Plugin Loading Methods |
287 | 287 | ||
@@ -450,7 +450,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
450 | m_tainted = false; | 450 | m_tainted = false; |
451 | m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); | 451 | m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); |
452 | m_scene.SaveTerrain(); | 452 | m_scene.SaveTerrain(); |
453 | 453 | ||
454 | // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. | 454 | // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. |
455 | //m_scene.CreateTerrainTexture(true); | 455 | //m_scene.CreateTerrainTexture(true); |
456 | } | 456 | } |
@@ -517,11 +517,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
517 | // fixup and height deltas that don't respect them | 517 | // fixup and height deltas that don't respect them |
518 | if (respectEstateSettings && LimitChannelChanges(x, y)) | 518 | if (respectEstateSettings && LimitChannelChanges(x, y)) |
519 | { | 519 | { |
520 | // this has been vetoed, so update | 520 | // this has been vetoed, so update |
521 | // what we are going to send to the client | 521 | // what we are going to send to the client |
522 | serialised = m_channel.GetFloatsSerialised(); | 522 | serialised = m_channel.GetFloatsSerialised(); |
523 | } | 523 | } |
524 | 524 | ||
525 | SendToClients(serialised, x, y); | 525 | SendToClients(serialised, x, y); |
526 | shouldTaint = true; | 526 | shouldTaint = true; |
527 | } | 527 | } |
@@ -580,9 +580,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
580 | private void SendToClients(float[] serialised, int x, int y) | 580 | private void SendToClients(float[] serialised, int x, int y) |
581 | { | 581 | { |
582 | m_scene.ForEachClient( | 582 | m_scene.ForEachClient( |
583 | delegate(IClientAPI controller) | 583 | delegate(IClientAPI controller) |
584 | { controller.SendLayerData( | 584 | { controller.SendLayerData( |
585 | x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); | 585 | x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); |
586 | } | 586 | } |
587 | ); | 587 | ); |
588 | } | 588 | } |
@@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
647 | { | 647 | { |
648 | // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. | 648 | // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. |
649 | // for now check a point in the centre of the region | 649 | // for now check a point in the centre of the region |
650 | 650 | ||
651 | if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) | 651 | if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) |
652 | { | 652 | { |
653 | InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter | 653 | InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter |
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs index a331d37..9b8dc75 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs | |||
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
162 | { | 162 | { |
163 | int tc = System.Environment.TickCount; | 163 | int tc = System.Environment.TickCount; |
164 | m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain"); | 164 | m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain"); |
165 | 165 | ||
166 | double[,] hm = whichScene.Heightmap.GetDoubles(); | 166 | double[,] hm = whichScene.Heightmap.GetDoubles(); |
167 | bool ShadowDebugContinue = true; | 167 | bool ShadowDebugContinue = true; |
168 | //Color prim = Color.FromArgb(120, 120, 120); | 168 | //Color prim = Color.FromArgb(120, 120, 120); |
@@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
247 | //X | 247 | //X |
248 | // . | 248 | // . |
249 | // | 249 | // |
250 | // Shade the terrain for shadows | 250 | // Shade the terrain for shadows |
251 | if ((x - 1 > 0) && (y - 1 > 0)) | 251 | if ((x - 1 > 0) && (y - 1 > 0)) |
252 | { | 252 | { |
253 | hfvalue = (float)hm[x, y]; | 253 | hfvalue = (float)hm[x, y]; |
@@ -268,7 +268,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
268 | else if (hfdiff < -0.3f) | 268 | else if (hfdiff < -0.3f) |
269 | { | 269 | { |
270 | // We have to desaturate and blacken the land at the same time | 270 | // We have to desaturate and blacken the land at the same time |
271 | // we use floats, colors use bytes, so shrink are space down to | 271 | // we use floats, colors use bytes, so shrink are space down to |
272 | // 0-255 | 272 | // 0-255 |
273 | 273 | ||
274 | 274 | ||
@@ -368,8 +368,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
368 | 368 | ||
369 | return mapbmp; | 369 | return mapbmp; |
370 | } | 370 | } |
371 | 371 | ||
372 | 372 | ||
373 | private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) | 373 | private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) |
374 | { | 374 | { |
375 | int tc = 0; | 375 | int tc = 0; |
@@ -570,4 +570,4 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
570 | } | 570 | } |
571 | #endregion | 571 | #endregion |
572 | } | 572 | } |
573 | } \ No newline at end of file | 573 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 2a7af87..2430822 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | |||
@@ -54,13 +54,13 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
54 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | 55 | ||
56 | private static readonly string m_mapLayerPath = "0001/"; | 56 | private static readonly string m_mapLayerPath = "0001/"; |
57 | 57 | ||
58 | //private IConfig m_config; | 58 | //private IConfig m_config; |
59 | private Scene m_scene; | 59 | private Scene m_scene; |
60 | private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); | 60 | private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); |
61 | private int cachedTime = 0; | 61 | private int cachedTime = 0; |
62 | private byte[] myMapImageJPEG; | 62 | private byte[] myMapImageJPEG; |
63 | 63 | ||
64 | //private int CacheRegionsDistance = 256; | 64 | //private int CacheRegionsDistance = 256; |
65 | 65 | ||
66 | #region IRegionModule Members | 66 | #region IRegionModule Members |
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
85 | } | 85 | } |
86 | public void PostInitialise() | 86 | public void PostInitialise() |
87 | { | 87 | { |
88 | 88 | ||
89 | } | 89 | } |
90 | 90 | ||
91 | public void Close() | 91 | public void Close() |
@@ -102,10 +102,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
102 | } | 102 | } |
103 | 103 | ||
104 | #endregion | 104 | #endregion |
105 | |||
106 | |||
107 | |||
108 | |||
109 | 105 | ||
110 | public void OnRegisterCaps(LLUUID agentID, Caps caps) | 106 | public void OnRegisterCaps(LLUUID agentID, Caps caps) |
111 | { | 107 | { |
@@ -117,9 +113,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
117 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 113 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
118 | { | 114 | { |
119 | return MapLayerRequest(request, path, param, | 115 | return MapLayerRequest(request, path, param, |
120 | agentID, caps); | 116 | agentID, caps); |
121 | })); | 117 | })); |
122 | |||
123 | } | 118 | } |
124 | 119 | ||
125 | /// <summary> | 120 | /// <summary> |
@@ -138,12 +133,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
138 | //{ | 133 | //{ |
139 | //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", | 134 | //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", |
140 | //request, path, param,agentID.ToString()); | 135 | //request, path, param,agentID.ToString()); |
141 | 136 | ||
142 | // this is here because CAPS map requests work even beyond the 10,000 limit. | 137 | // this is here because CAPS map requests work even beyond the 10,000 limit. |
143 | ScenePresence avatarPresence = null; | 138 | ScenePresence avatarPresence = null; |
144 | 139 | ||
145 | m_scene.TryGetAvatar(agentID, out avatarPresence); | 140 | m_scene.TryGetAvatar(agentID, out avatarPresence); |
146 | 141 | ||
147 | if (avatarPresence != null) | 142 | if (avatarPresence != null) |
148 | { | 143 | { |
149 | bool lookup = false; | 144 | bool lookup = false; |
@@ -168,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
168 | 163 | ||
169 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); | 164 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); |
170 | avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); | 165 | avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); |
171 | 166 | ||
172 | lock (cachedMapBlocks) | 167 | lock (cachedMapBlocks) |
173 | cachedMapBlocks = mapBlocks; | 168 | cachedMapBlocks = mapBlocks; |
174 | 169 | ||
@@ -262,18 +257,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
262 | MemoryStream imgstream = new MemoryStream(); | 257 | MemoryStream imgstream = new MemoryStream(); |
263 | Bitmap mapTexture = new Bitmap(1,1); | 258 | Bitmap mapTexture = new Bitmap(1,1); |
264 | System.Drawing.Image image = (System.Drawing.Image)mapTexture; | 259 | System.Drawing.Image image = (System.Drawing.Image)mapTexture; |
265 | 260 | ||
266 | |||
267 | try | 261 | try |
268 | { | 262 | { |
269 | // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data | 263 | // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data |
270 | 264 | ||
271 | |||
272 | imgstream = new MemoryStream(); | 265 | imgstream = new MemoryStream(); |
273 | 266 | ||
274 | // non-async because we know we have the asset immediately. | 267 | // non-async because we know we have the asset immediately. |
275 | AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); | 268 | AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); |
276 | 269 | ||
277 | // Decode image to System.Drawing.Image | 270 | // Decode image to System.Drawing.Image |
278 | image = OpenJPEG.DecodeToImage(mapasset.Data); | 271 | image = OpenJPEG.DecodeToImage(mapasset.Data); |
279 | 272 | ||
@@ -293,7 +286,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
293 | 286 | ||
294 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); | 287 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); |
295 | myEncoderParameters.Param[0] = myEncoderParameter; | 288 | myEncoderParameters.Param[0] = myEncoderParameter; |
296 | 289 | ||
297 | // Save bitmap to stream | 290 | // Save bitmap to stream |
298 | mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); | 291 | mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); |
299 | 292 | ||
@@ -332,16 +325,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
332 | // From msdn | 325 | // From msdn |
333 | private static ImageCodecInfo GetEncoderInfo(String mimeType) | 326 | private static ImageCodecInfo GetEncoderInfo(String mimeType) |
334 | { | 327 | { |
335 | int j; | ||
336 | ImageCodecInfo[] encoders; | 328 | ImageCodecInfo[] encoders; |
337 | encoders = ImageCodecInfo.GetImageEncoders(); | 329 | encoders = ImageCodecInfo.GetImageEncoders(); |
338 | for (j = 0; j < encoders.Length; ++j) | 330 | for (int j = 0; j < encoders.Length; ++j) |
339 | { | 331 | { |
340 | if (encoders[j].MimeType == mimeType) | 332 | if (encoders[j].MimeType == mimeType) |
341 | return encoders[j]; | 333 | return encoders[j]; |
342 | } | 334 | } |
343 | return null; | 335 | return null; |
344 | } | 336 | } |
345 | |||
346 | } | 337 | } |
347 | } | 338 | } |
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index bc3e06c..40caabc 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
63 | get { return m_name; } | 63 | get { return m_name; } |
64 | set { m_name = value; } | 64 | set { m_name = value; } |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// Signals whether this group was in a scene but has since been deleted from it. | 68 | /// Signals whether this group was in a scene but has since been deleted from it. |
69 | /// </summary> | 69 | /// </summary> |
@@ -71,7 +71,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
71 | { | 71 | { |
72 | get { return m_isDeleted; } | 72 | get { return m_isDeleted; } |
73 | } | 73 | } |
74 | protected bool m_isDeleted; | 74 | protected bool m_isDeleted; |
75 | 75 | ||
76 | protected LLVector3 m_pos; | 76 | protected LLVector3 m_pos; |
77 | 77 | ||
diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index 2b1adee..1dd2273 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs | |||
@@ -131,13 +131,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
131 | 131 | ||
132 | public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; | 132 | public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; |
133 | 133 | ||
134 | |||
135 | public delegate void SignificantClientMovement(IClientAPI remote_client); | 134 | public delegate void SignificantClientMovement(IClientAPI remote_client); |
136 | 135 | ||
137 | public event SignificantClientMovement OnSignificantClientMovement; | 136 | public event SignificantClientMovement OnSignificantClientMovement; |
138 | 137 | ||
139 | |||
140 | |||
141 | public delegate void NewGridInstantMessage(GridInstantMessage message); | 138 | public delegate void NewGridInstantMessage(GridInstantMessage message); |
142 | 139 | ||
143 | public event NewGridInstantMessage OnGridInstantMessageToIMModule; | 140 | public event NewGridInstantMessage OnGridInstantMessageToIMModule; |
@@ -163,7 +160,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
163 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; | 160 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; |
164 | 161 | ||
165 | public delegate void ScriptNotAtTargetEvent(uint localID); | 162 | public delegate void ScriptNotAtTargetEvent(uint localID); |
166 | 163 | ||
167 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; | 164 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; |
168 | 165 | ||
169 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); | 166 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); |
@@ -172,8 +169,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
172 | public event ScriptColliding OnScriptColliding; | 169 | public event ScriptColliding OnScriptColliding; |
173 | public event ScriptColliding OnScriptCollidingEnd; | 170 | public event ScriptColliding OnScriptCollidingEnd; |
174 | 171 | ||
175 | |||
176 | |||
177 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); | 172 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); |
178 | public event OnMakeChildAgentDelegate OnMakeChildAgent; | 173 | public event OnMakeChildAgentDelegate OnMakeChildAgent; |
179 | 174 | ||
@@ -289,7 +284,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
289 | public int transactionID = 0; | 284 | public int transactionID = 0; |
290 | public int amountDebited = 0; | 285 | public int amountDebited = 0; |
291 | 286 | ||
292 | |||
293 | public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, | 287 | public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, |
294 | bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, | 288 | bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, |
295 | bool pauthenticated) | 289 | bool pauthenticated) |
@@ -306,8 +300,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
306 | } | 300 | } |
307 | } | 301 | } |
308 | 302 | ||
309 | |||
310 | |||
311 | public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); | 303 | public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); |
312 | 304 | ||
313 | public delegate void LandBuy(Object sender, LandBuyArgs e); | 305 | public delegate void LandBuy(Object sender, LandBuyArgs e); |
@@ -377,7 +369,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
377 | private ScriptColliding handlerColliding = null; | 369 | private ScriptColliding handlerColliding = null; |
378 | private ScriptColliding handlerCollidingEnd = null; | 370 | private ScriptColliding handlerCollidingEnd = null; |
379 | 371 | ||
380 | |||
381 | private SunLindenHour handlerSunGetLindenHour = null; | 372 | private SunLindenHour handlerSunGetLindenHour = null; |
382 | 373 | ||
383 | public void TriggerOnScriptChangedEvent(uint localID, uint change) | 374 | public void TriggerOnScriptChangedEvent(uint localID, uint change) |
@@ -491,7 +482,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
491 | if (handlerObjectBeingRemovedFromScene != null) | 482 | if (handlerObjectBeingRemovedFromScene != null) |
492 | { | 483 | { |
493 | handlerObjectBeingRemovedFromScene(obj); | 484 | handlerObjectBeingRemovedFromScene(obj); |
494 | |||
495 | } | 485 | } |
496 | } | 486 | } |
497 | 487 | ||
@@ -641,7 +631,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
641 | { | 631 | { |
642 | handlerGridInstantMessageToFriends(message); | 632 | handlerGridInstantMessageToFriends(message); |
643 | } | 633 | } |
644 | |||
645 | } | 634 | } |
646 | } | 635 | } |
647 | 636 | ||
@@ -698,7 +687,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
698 | handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); | 687 | handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); |
699 | } | 688 | } |
700 | } | 689 | } |
701 | public void TriggerLandBuy (Object sender, LandBuyArgs e) | 690 | |
691 | public void TriggerLandBuy(Object sender, LandBuyArgs e) | ||
702 | { | 692 | { |
703 | handlerLandBuy = OnLandBuy; | 693 | handlerLandBuy = OnLandBuy; |
704 | if (handlerLandBuy != null) | 694 | if (handlerLandBuy != null) |
@@ -706,6 +696,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
706 | handlerLandBuy(sender, e); | 696 | handlerLandBuy(sender, e); |
707 | } | 697 | } |
708 | } | 698 | } |
699 | |||
709 | public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) | 700 | public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) |
710 | { | 701 | { |
711 | handlerValidateLandBuy = OnValidateLandBuy; | 702 | handlerValidateLandBuy = OnValidateLandBuy; |
@@ -741,6 +732,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
741 | handlerRequestChangeWaterHeight(height); | 732 | handlerRequestChangeWaterHeight(height); |
742 | } | 733 | } |
743 | } | 734 | } |
735 | |||
744 | public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) | 736 | public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) |
745 | { | 737 | { |
746 | handlerAvatarKill = OnAvatarKilled; | 738 | handlerAvatarKill = OnAvatarKilled; |
@@ -756,7 +748,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
756 | if (handlerSignificantClientMovement != null) | 748 | if (handlerSignificantClientMovement != null) |
757 | { | 749 | { |
758 | handlerSignificantClientMovement(client); | 750 | handlerSignificantClientMovement(client); |
759 | |||
760 | } | 751 | } |
761 | } | 752 | } |
762 | 753 | ||
@@ -787,7 +778,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
787 | } | 778 | } |
788 | } | 779 | } |
789 | 780 | ||
790 | |||
791 | public void TriggerNoticeNoLandDataFromStorage() | 781 | public void TriggerNoticeNoLandDataFromStorage() |
792 | { | 782 | { |
793 | handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; | 783 | handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; |
@@ -818,26 +808,24 @@ namespace OpenSim.Region.Environment.Scenes | |||
818 | } | 808 | } |
819 | } | 809 | } |
820 | 810 | ||
821 | |||
822 | |||
823 | public void TriggerRequestParcelPrimCountUpdate() | 811 | public void TriggerRequestParcelPrimCountUpdate() |
824 | { | 812 | { |
825 | handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; | 813 | handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; |
826 | if (handlerRequestParcelPrimCountUpdate != null) | 814 | if (handlerRequestParcelPrimCountUpdate != null) |
827 | { | 815 | { |
828 | handlerRequestParcelPrimCountUpdate(); | 816 | handlerRequestParcelPrimCountUpdate(); |
829 | |||
830 | } | 817 | } |
831 | } | 818 | } |
819 | |||
832 | public void TriggerParcelPrimCountTainted() | 820 | public void TriggerParcelPrimCountTainted() |
833 | { | 821 | { |
834 | handlerParcelPrimCountTainted = OnParcelPrimCountTainted; | 822 | handlerParcelPrimCountTainted = OnParcelPrimCountTainted; |
835 | if (handlerParcelPrimCountTainted != null) | 823 | if (handlerParcelPrimCountTainted != null) |
836 | { | 824 | { |
837 | handlerParcelPrimCountTainted(); | 825 | handlerParcelPrimCountTainted(); |
838 | |||
839 | } | 826 | } |
840 | } | 827 | } |
828 | |||
841 | // this lets us keep track of nasty script events like timer, etc. | 829 | // this lets us keep track of nasty script events like timer, etc. |
842 | public void TriggerTimerEvent(uint objLocalID, double Interval) | 830 | public void TriggerTimerEvent(uint objLocalID, double Interval) |
843 | { | 831 | { |
@@ -845,9 +833,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
845 | if (handlerScriptTimerEvent != null) | 833 | if (handlerScriptTimerEvent != null) |
846 | { | 834 | { |
847 | handlerScriptTimerEvent(objLocalID, Interval); | 835 | handlerScriptTimerEvent(objLocalID, Interval); |
848 | |||
849 | } | 836 | } |
850 | |||
851 | } | 837 | } |
852 | 838 | ||
853 | public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) | 839 | public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) |
@@ -875,19 +861,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
875 | if (handlerCollidingStart != null) | 861 | if (handlerCollidingStart != null) |
876 | handlerCollidingStart(localId, colliders); | 862 | handlerCollidingStart(localId, colliders); |
877 | } | 863 | } |
864 | |||
878 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) | 865 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) |
879 | { | 866 | { |
880 | |||
881 | handlerColliding = OnScriptColliding; | 867 | handlerColliding = OnScriptColliding; |
882 | if (handlerColliding != null) | 868 | if (handlerColliding != null) |
883 | handlerColliding(localId, colliders); | 869 | handlerColliding(localId, colliders); |
884 | } | 870 | } |
871 | |||
885 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) | 872 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) |
886 | { | 873 | { |
887 | handlerCollidingEnd = OnScriptCollidingEnd; | 874 | handlerCollidingEnd = OnScriptCollidingEnd; |
888 | if (handlerCollidingEnd != null) | 875 | if (handlerCollidingEnd != null) |
889 | handlerCollidingEnd(localId, colliders); | 876 | handlerCollidingEnd(localId, colliders); |
890 | } | 877 | } |
891 | |||
892 | } | 878 | } |
893 | } | 879 | } |
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 3021891..6695dbf 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -96,7 +96,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
96 | // Then we've got to remove the previous | 96 | // Then we've got to remove the previous |
97 | // event handler | 97 | // event handler |
98 | 98 | ||
99 | if (_PhyScene != null) | 99 | if (_PhyScene != null) |
100 | _PhyScene.OnPhysicsCrash -= physicsBasedCrash; | 100 | _PhyScene.OnPhysicsCrash -= physicsBasedCrash; |
101 | 101 | ||
102 | _PhyScene = value; | 102 | _PhyScene = value; |
@@ -194,7 +194,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
194 | /// </param> | 194 | /// </param> |
195 | /// <returns> | 195 | /// <returns> |
196 | /// true if the object was added, false if an object with the same uuid was already in the scene | 196 | /// true if the object was added, false if an object with the same uuid was already in the scene |
197 | /// </returns> | 197 | /// </returns> |
198 | protected internal bool AddRestoredSceneObject( | 198 | protected internal bool AddRestoredSceneObject( |
199 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 199 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
200 | { | 200 | { |
@@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
205 | { | 205 | { |
206 | part.LocalId = m_parentScene.PrimIDAllocate(); | 206 | part.LocalId = m_parentScene.PrimIDAllocate(); |
207 | } | 207 | } |
208 | 208 | ||
209 | sceneObject.UpdateParentIDs(); | 209 | sceneObject.UpdateParentIDs(); |
210 | 210 | ||
211 | if (!alreadyPersisted) | 211 | if (!alreadyPersisted) |
@@ -213,10 +213,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
213 | sceneObject.ForceInventoryPersistence(); | 213 | sceneObject.ForceInventoryPersistence(); |
214 | sceneObject.HasGroupChanged = true; | 214 | sceneObject.HasGroupChanged = true; |
215 | } | 215 | } |
216 | 216 | ||
217 | return AddSceneObject(sceneObject, attachToBackup); | 217 | return AddSceneObject(sceneObject, attachToBackup); |
218 | } | 218 | } |
219 | 219 | ||
220 | /// <summary> | 220 | /// <summary> |
221 | /// Add a newly created object to the scene. This will both update the scene, and send information about the | 221 | /// Add a newly created object to the scene. This will both update the scene, and send information about the |
222 | /// new object to all clients interested in the scene. | 222 | /// new object to all clients interested in the scene. |
@@ -228,12 +228,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
228 | /// </param> | 228 | /// </param> |
229 | /// <returns> | 229 | /// <returns> |
230 | /// true if the object was added, false if an object with the same uuid was already in the scene | 230 | /// true if the object was added, false if an object with the same uuid was already in the scene |
231 | /// </returns> | 231 | /// </returns> |
232 | protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) | 232 | protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) |
233 | { | 233 | { |
234 | // Ensure that we persist this new scene object | 234 | // Ensure that we persist this new scene object |
235 | sceneObject.HasGroupChanged = true; | 235 | sceneObject.HasGroupChanged = true; |
236 | 236 | ||
237 | return AddSceneObject(sceneObject, attachToBackup); | 237 | return AddSceneObject(sceneObject, attachToBackup); |
238 | } | 238 | } |
239 | 239 | ||
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
252 | { | 252 | { |
253 | sceneObject.ApplyPhysics(m_parentScene.m_physicalPrim); | 253 | sceneObject.ApplyPhysics(m_parentScene.m_physicalPrim); |
254 | sceneObject.ScheduleGroupForFullUpdate(); | 254 | sceneObject.ScheduleGroupForFullUpdate(); |
255 | 255 | ||
256 | lock (Entities) | 256 | lock (Entities) |
257 | { | 257 | { |
258 | if (!Entities.ContainsKey(sceneObject.UUID)) | 258 | if (!Entities.ContainsKey(sceneObject.UUID)) |
@@ -261,8 +261,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
261 | Entities.Add(sceneObject.UUID, sceneObject); | 261 | Entities.Add(sceneObject.UUID, sceneObject); |
262 | m_numPrim += sceneObject.Children.Count; | 262 | m_numPrim += sceneObject.Children.Count; |
263 | 263 | ||
264 | if (attachToBackup) | 264 | if (attachToBackup) |
265 | sceneObject.AttachToBackup(); | 265 | sceneObject.AttachToBackup(); |
266 | 266 | ||
267 | return true; | 267 | return true; |
268 | } | 268 | } |
@@ -342,7 +342,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
342 | "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e); | 342 | "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e); |
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
346 | m_updateList.Clear(); | 346 | m_updateList.Clear(); |
347 | } | 347 | } |
348 | } | 348 | } |
@@ -555,7 +555,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
555 | protected internal void AddScenePresence(ScenePresence presence) | 555 | protected internal void AddScenePresence(ScenePresence presence) |
556 | { | 556 | { |
557 | bool child = presence.IsChildAgent; | 557 | bool child = presence.IsChildAgent; |
558 | 558 | ||
559 | if (child) | 559 | if (child) |
560 | { | 560 | { |
561 | m_numChildAgents++; | 561 | m_numChildAgents++; |
@@ -598,7 +598,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
598 | { | 598 | { |
599 | if (!ScenePresences.Remove(agentID)) | 599 | if (!ScenePresences.Remove(agentID)) |
600 | { | 600 | { |
601 | m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); | 601 | m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); |
602 | } | 602 | } |
603 | // else | 603 | // else |
604 | // { | 604 | // { |
@@ -774,7 +774,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
774 | /// Get a scene object group that contains the prim with the given uuid | 774 | /// Get a scene object group that contains the prim with the given uuid |
775 | /// </summary> | 775 | /// </summary> |
776 | /// <param name="fullID"></param> | 776 | /// <param name="fullID"></param> |
777 | /// <returns>null if no scene object group containing that prim is found</returns> | 777 | /// <returns>null if no scene object group containing that prim is found</returns> |
778 | private SceneObjectGroup GetGroupByPrim(LLUUID fullID) | 778 | private SceneObjectGroup GetGroupByPrim(LLUUID fullID) |
779 | { | 779 | { |
780 | List<EntityBase> EntityList = GetEntities(); | 780 | List<EntityBase> EntityList = GetEntities(); |
@@ -823,7 +823,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
823 | protected internal SceneObjectPart GetSceneObjectPart(uint localID) | 823 | protected internal SceneObjectPart GetSceneObjectPart(uint localID) |
824 | { | 824 | { |
825 | SceneObjectGroup group = GetGroupByPrim(localID); | 825 | SceneObjectGroup group = GetGroupByPrim(localID); |
826 | 826 | ||
827 | if (group != null) | 827 | if (group != null) |
828 | return group.GetChildPart(localID); | 828 | return group.GetChildPart(localID); |
829 | else | 829 | else |
@@ -834,7 +834,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
834 | /// Get a part contained in this scene. | 834 | /// Get a part contained in this scene. |
835 | /// </summary> | 835 | /// </summary> |
836 | /// <param name="fullID"></param> | 836 | /// <param name="fullID"></param> |
837 | /// <returns>null if the part was not found</returns> | 837 | /// <returns>null if the part was not found</returns> |
838 | protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) | 838 | protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) |
839 | { | 839 | { |
840 | SceneObjectGroup group = GetGroupByPrim(fullID); | 840 | SceneObjectGroup group = GetGroupByPrim(fullID); |
@@ -1089,7 +1089,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1089 | group.SendGroupTerseUpdate(); | 1089 | group.SendGroupTerseUpdate(); |
1090 | return; | 1090 | return; |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) | 1093 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) |
1094 | { | 1094 | { |
1095 | group.UpdateSinglePosition(pos, localID); | 1095 | group.UpdateSinglePosition(pos, localID); |
@@ -1119,7 +1119,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1119 | if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) | 1119 | if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) |
1120 | { | 1120 | { |
1121 | group.SendGroupTerseUpdate(); | 1121 | group.SendGroupTerseUpdate(); |
1122 | 1122 | ||
1123 | return; | 1123 | return; |
1124 | } | 1124 | } |
1125 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) | 1125 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) |
@@ -1397,14 +1397,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1397 | if (sendEvents) | 1397 | if (sendEvents) |
1398 | parenPrim.TriggerScriptChangedEvent(Changed.LINK); | 1398 | parenPrim.TriggerScriptChangedEvent(Changed.LINK); |
1399 | } | 1399 | } |
1400 | else | 1400 | else |
1401 | { | 1401 | { |
1402 | // The link set has prims remaining. This path is taken | 1402 | // The link set has prims remaining. This path is taken |
1403 | // when a subset of a link set's prims are selected | 1403 | // when a subset of a link set's prims are selected |
1404 | // and the root prim is part of that selection | 1404 | // and the root prim is part of that selection |
1405 | // | 1405 | // |
1406 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parenPrim.Children.Values); | 1406 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parenPrim.Children.Values); |
1407 | 1407 | ||
1408 | List<uint> unlink_ids = new List<uint>(); | 1408 | List<uint> unlink_ids = new List<uint>(); |
1409 | foreach (SceneObjectPart unlink_part in parts) | 1409 | foreach (SceneObjectPart unlink_part in parts) |
1410 | unlink_ids.Add(unlink_part.LocalId); | 1410 | unlink_ids.Add(unlink_part.LocalId); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index fe66dd5..0148d76 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -242,9 +242,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
242 | 242 | ||
243 | // Retrieve item | 243 | // Retrieve item |
244 | TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); | 244 | TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); |
245 | 245 | ||
246 | if (null == item) | 246 | if (null == item) |
247 | { | 247 | { |
248 | m_log.ErrorFormat( | 248 | m_log.ErrorFormat( |
249 | "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " | 249 | "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " |
250 | + " but the item does not exist in this inventory", | 250 | + " but the item does not exist in this inventory", |
@@ -338,7 +338,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
338 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 338 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
339 | else | 339 | else |
340 | item.CreationDate = itemUpd.CreationDate; | 340 | item.CreationDate = itemUpd.CreationDate; |
341 | |||
342 | 341 | ||
343 | // TODO: Check if folder changed and move item | 342 | // TODO: Check if folder changed and move item |
344 | //item.NextPermissions = itemUpd.Folder; | 343 | //item.NextPermissions = itemUpd.Folder; |
@@ -577,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
577 | asset.Type = assetType; | 576 | asset.Type = assetType; |
578 | asset.FullID = LLUUID.Random(); | 577 | asset.FullID = LLUUID.Random(); |
579 | asset.Data = (data == null) ? new byte[1] : data; | 578 | asset.Data = (data == null) ? new byte[1] : data; |
580 | 579 | ||
581 | return asset; | 580 | return asset; |
582 | } | 581 | } |
583 | 582 | ||
@@ -958,7 +957,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
958 | agentItem.Folder = folderId; | 957 | agentItem.Folder = folderId; |
959 | AddInventoryItem(remoteClient, agentItem); | 958 | AddInventoryItem(remoteClient, agentItem); |
960 | } | 959 | } |
961 | 960 | ||
962 | /// <summary> | 961 | /// <summary> |
963 | /// <see>ClientMoveTaskInventoryItem</see> | 962 | /// <see>ClientMoveTaskInventoryItem</see> |
964 | /// </summary> | 963 | /// </summary> |
@@ -981,13 +980,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
981 | } | 980 | } |
982 | 981 | ||
983 | TaskInventoryItem taskItem = part.GetInventoryItem(itemId); | 982 | TaskInventoryItem taskItem = part.GetInventoryItem(itemId); |
984 | 983 | ||
985 | if (null == taskItem) | 984 | if (null == taskItem) |
986 | { | 985 | { |
987 | m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" | 986 | m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" |
988 | + " because the inventory item could not be found", | 987 | + " because the inventory item could not be found", |
989 | itemId, primLocalId); | 988 | itemId, primLocalId); |
990 | 989 | ||
991 | return; | 990 | return; |
992 | } | 991 | } |
993 | 992 | ||
@@ -997,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
997 | 996 | ||
998 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | 997 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); |
999 | } | 998 | } |
1000 | 999 | ||
1001 | /// <summary> | 1000 | /// <summary> |
1002 | /// <see>MoveTaskInventoryItem</see> | 1001 | /// <see>MoveTaskInventoryItem</see> |
1003 | /// </summary> | 1002 | /// </summary> |
@@ -1029,7 +1028,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1029 | AddInventoryItem(avatarId, agentItem); | 1028 | AddInventoryItem(avatarId, agentItem); |
1030 | } | 1029 | } |
1031 | } | 1030 | } |
1032 | 1031 | ||
1033 | /// <summary> | 1032 | /// <summary> |
1034 | /// Copy a task (prim) inventory item to another task (prim) | 1033 | /// Copy a task (prim) inventory item to another task (prim) |
1035 | /// </summary> | 1034 | /// </summary> |
@@ -1049,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1049 | 1048 | ||
1050 | return; | 1049 | return; |
1051 | } | 1050 | } |
1052 | 1051 | ||
1053 | SceneObjectPart destPart = GetSceneObjectPart(destId); | 1052 | SceneObjectPart destPart = GetSceneObjectPart(destId); |
1054 | 1053 | ||
1055 | if (destPart == null) | 1054 | if (destPart == null) |
@@ -1060,7 +1059,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1060 | destId); | 1059 | destId); |
1061 | return; | 1060 | return; |
1062 | } | 1061 | } |
1063 | 1062 | ||
1064 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) | 1063 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) |
1065 | { | 1064 | { |
1066 | // object cannot copy items to an object owned by a different owner | 1065 | // object cannot copy items to an object owned by a different owner |
@@ -1076,7 +1075,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1076 | } | 1075 | } |
1077 | 1076 | ||
1078 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); | 1077 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); |
1079 | 1078 | ||
1080 | destTaskItem.ItemID = LLUUID.Random(); | 1079 | destTaskItem.ItemID = LLUUID.Random(); |
1081 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | 1080 | destTaskItem.CreatorID = srcTaskItem.CreatorID; |
1082 | destTaskItem.AssetID = srcTaskItem.AssetID; | 1081 | destTaskItem.AssetID = srcTaskItem.AssetID; |
@@ -1091,7 +1090,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1091 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; | 1090 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; |
1092 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; | 1091 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; |
1093 | destTaskItem.Flags = srcTaskItem.Flags; | 1092 | destTaskItem.Flags = srcTaskItem.Flags; |
1094 | 1093 | ||
1095 | if (destPart.OwnerID != part.OwnerID) | 1094 | if (destPart.OwnerID != part.OwnerID) |
1096 | { | 1095 | { |
1097 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 1096 | if (ExternalChecks.ExternalChecksPropagatePermissions()) |
@@ -1112,20 +1111,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
1112 | destTaskItem.Name = srcTaskItem.Name; | 1111 | destTaskItem.Name = srcTaskItem.Name; |
1113 | destTaskItem.InvType = srcTaskItem.InvType; | 1112 | destTaskItem.InvType = srcTaskItem.InvType; |
1114 | destTaskItem.Type = srcTaskItem.Type; | 1113 | destTaskItem.Type = srcTaskItem.Type; |
1115 | 1114 | ||
1116 | destPart.AddInventoryItem(destTaskItem); | 1115 | destPart.AddInventoryItem(destTaskItem); |
1117 | 1116 | ||
1118 | if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1117 | if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1119 | part.RemoveInventoryItem(itemId); | 1118 | part.RemoveInventoryItem(itemId); |
1120 | 1119 | ||
1121 | ScenePresence avatar; | 1120 | ScenePresence avatar; |
1122 | 1121 | ||
1123 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) | 1122 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) |
1124 | { | 1123 | { |
1125 | destPart.GetProperties(avatar.ControllingClient); | 1124 | destPart.GetProperties(avatar.ControllingClient); |
1126 | } | 1125 | } |
1127 | } | 1126 | } |
1128 | 1127 | ||
1129 | public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List<LLUUID> items) | 1128 | public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List<LLUUID> items) |
1130 | { | 1129 | { |
1131 | CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); | 1130 | CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); |
@@ -1139,7 +1138,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1139 | } | 1138 | } |
1140 | 1139 | ||
1141 | LLUUID newFolderID = LLUUID.Random(); | 1140 | LLUUID newFolderID = LLUUID.Random(); |
1142 | 1141 | ||
1143 | profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); | 1142 | profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); |
1144 | 1143 | ||
1145 | foreach (LLUUID itemID in items) | 1144 | foreach (LLUUID itemID in items) |
@@ -1346,7 +1345,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1346 | 1345 | ||
1347 | part.AddInventoryItem(taskItem); | 1346 | part.AddInventoryItem(taskItem); |
1348 | part.GetProperties(remoteClient); | 1347 | part.GetProperties(remoteClient); |
1349 | 1348 | ||
1350 | part.CreateScriptInstance(taskItem, 0, false); | 1349 | part.CreateScriptInstance(taskItem, 0, false); |
1351 | } | 1350 | } |
1352 | } | 1351 | } |
@@ -1370,7 +1369,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1370 | 1369 | ||
1371 | return; | 1370 | return; |
1372 | } | 1371 | } |
1373 | 1372 | ||
1374 | SceneObjectPart destPart = GetSceneObjectPart(destId); | 1373 | SceneObjectPart destPart = GetSceneObjectPart(destId); |
1375 | 1374 | ||
1376 | if (destPart == null) | 1375 | if (destPart == null) |
@@ -1381,7 +1380,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1381 | destId); | 1380 | destId); |
1382 | return; | 1381 | return; |
1383 | } | 1382 | } |
1384 | 1383 | ||
1385 | // Must own the object, and have modify rights | 1384 | // Must own the object, and have modify rights |
1386 | if (srcPart.OwnerID != destPart.OwnerID) | 1385 | if (srcPart.OwnerID != destPart.OwnerID) |
1387 | return; | 1386 | return; |
@@ -1395,14 +1394,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1395 | "[PRIM INVENTORY]: " + | 1394 | "[PRIM INVENTORY]: " + |
1396 | "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", | 1395 | "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", |
1397 | srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); | 1396 | srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); |
1398 | // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - | 1397 | // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - |
1399 | // "Object: Task Object trying to illegally load script onto task Other_Object!" | 1398 | // "Object: Task Object trying to illegally load script onto task Other_Object!" |
1400 | // How do we shout from in here? | 1399 | // How do we shout from in here? |
1401 | return; | 1400 | return; |
1402 | } | 1401 | } |
1403 | 1402 | ||
1404 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); | 1403 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); |
1405 | 1404 | ||
1406 | destTaskItem.ItemID = LLUUID.Random(); | 1405 | destTaskItem.ItemID = LLUUID.Random(); |
1407 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | 1406 | destTaskItem.CreatorID = srcTaskItem.CreatorID; |
1408 | destTaskItem.AssetID = srcTaskItem.AssetID; | 1407 | destTaskItem.AssetID = srcTaskItem.AssetID; |
@@ -1417,7 +1416,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1417 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; | 1416 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; |
1418 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; | 1417 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; |
1419 | destTaskItem.Flags = srcTaskItem.Flags; | 1418 | destTaskItem.Flags = srcTaskItem.Flags; |
1420 | 1419 | ||
1421 | if (destPart.OwnerID != srcPart.OwnerID) | 1420 | if (destPart.OwnerID != srcPart.OwnerID) |
1422 | { | 1421 | { |
1423 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 1422 | if (ExternalChecks.ExternalChecksPropagatePermissions()) |
@@ -1438,22 +1437,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
1438 | destTaskItem.Name = srcTaskItem.Name; | 1437 | destTaskItem.Name = srcTaskItem.Name; |
1439 | destTaskItem.InvType = srcTaskItem.InvType; | 1438 | destTaskItem.InvType = srcTaskItem.InvType; |
1440 | destTaskItem.Type = srcTaskItem.Type; | 1439 | destTaskItem.Type = srcTaskItem.Type; |
1441 | 1440 | ||
1442 | destPart.AddInventoryItemExclusive(destTaskItem); | 1441 | destPart.AddInventoryItemExclusive(destTaskItem); |
1443 | 1442 | ||
1444 | if (running > 0) | 1443 | if (running > 0) |
1445 | { | 1444 | { |
1446 | destPart.CreateScriptInstance(destTaskItem, 0, false); | 1445 | destPart.CreateScriptInstance(destTaskItem, 0, false); |
1447 | } | 1446 | } |
1448 | 1447 | ||
1449 | ScenePresence avatar; | 1448 | ScenePresence avatar; |
1450 | 1449 | ||
1451 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) | 1450 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) |
1452 | { | 1451 | { |
1453 | destPart.GetProperties(avatar.ControllingClient); | 1452 | destPart.GetProperties(avatar.ControllingClient); |
1454 | } | 1453 | } |
1455 | } | 1454 | } |
1456 | 1455 | ||
1457 | /// <summary> | 1456 | /// <summary> |
1458 | /// Called when an object is removed from the environment into inventory. | 1457 | /// Called when an object is removed from the environment into inventory. |
1459 | /// </summary> | 1458 | /// </summary> |
@@ -1566,7 +1565,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1566 | private bool InventoryDeQueueAndDelete() | 1565 | private bool InventoryDeQueueAndDelete() |
1567 | { | 1566 | { |
1568 | DeleteToInventoryHolder x = null; | 1567 | DeleteToInventoryHolder x = null; |
1569 | 1568 | ||
1570 | try | 1569 | try |
1571 | { | 1570 | { |
1572 | lock (m_inventoryDeletes) | 1571 | lock (m_inventoryDeletes) |
@@ -1580,13 +1579,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1580 | return true; | 1579 | return true; |
1581 | } | 1580 | } |
1582 | } | 1581 | } |
1583 | } | 1582 | } |
1584 | catch(Exception e) | 1583 | catch(Exception e) |
1585 | { | 1584 | { |
1586 | // We can't put the object group details in here since the root part may have disappeared (which is where these sit). | 1585 | // We can't put the object group details in here since the root part may have disappeared (which is where these sit). |
1587 | // FIXME: This needs to be fixed. | 1586 | // FIXME: This needs to be fixed. |
1588 | m_log.ErrorFormat( | 1587 | m_log.ErrorFormat( |
1589 | "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", | 1588 | "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", |
1590 | (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); | 1589 | (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); |
1591 | } | 1590 | } |
1592 | 1591 | ||
@@ -1745,7 +1744,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1745 | } | 1744 | } |
1746 | } | 1745 | } |
1747 | } | 1746 | } |
1748 | 1747 | ||
1749 | AssetBase asset = CreateAsset( | 1748 | AssetBase asset = CreateAsset( |
1750 | objectGroup.GetPartName(objectGroup.LocalId), | 1749 | objectGroup.GetPartName(objectGroup.LocalId), |
1751 | objectGroup.GetPartDescription(objectGroup.LocalId), | 1750 | objectGroup.GetPartDescription(objectGroup.LocalId), |
@@ -1792,7 +1791,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1792 | } | 1791 | } |
1793 | } | 1792 | } |
1794 | } | 1793 | } |
1795 | 1794 | ||
1796 | public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) | 1795 | public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) |
1797 | { | 1796 | { |
1798 | SceneObjectGroup objectGroup = grp; | 1797 | SceneObjectGroup objectGroup = grp; |
@@ -2057,7 +2056,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2057 | /// <param name="param"></param> | 2056 | /// <param name="param"></param> |
2058 | /// <returns></returns> | 2057 | /// <returns></returns> |
2059 | public virtual SceneObjectGroup RezObject( | 2058 | public virtual SceneObjectGroup RezObject( |
2060 | SceneObjectPart sourcePart, TaskInventoryItem item, | 2059 | SceneObjectPart sourcePart, TaskInventoryItem item, |
2061 | LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) | 2060 | LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) |
2062 | { | 2061 | { |
2063 | // Rez object | 2062 | // Rez object |
@@ -2142,10 +2141,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2142 | return rootPart.ParentGroup; | 2141 | return rootPart.ParentGroup; |
2143 | } | 2142 | } |
2144 | } | 2143 | } |
2145 | 2144 | ||
2146 | return null; | 2145 | return null; |
2147 | } | 2146 | } |
2148 | 2147 | ||
2149 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) | 2148 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) |
2150 | { | 2149 | { |
2151 | string message = ""; | 2150 | string message = ""; |
@@ -2218,7 +2217,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2218 | item.AssetType = asset.Type; | 2217 | item.AssetType = asset.Type; |
2219 | item.InvType = (int)InventoryType.Object; | 2218 | item.InvType = (int)InventoryType.Object; |
2220 | item.Folder = folderID; | 2219 | item.Folder = folderID; |
2221 | 2220 | ||
2222 | if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) | 2221 | if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) |
2223 | { | 2222 | { |
2224 | uint perms = returnobjects[i].GetEffectivePermissions(); | 2223 | uint perms = returnobjects[i].GetEffectivePermissions(); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e8a8a78..474f062 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -74,11 +74,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
74 | public InnerScene m_innerScene; | 74 | public InnerScene m_innerScene; |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
77 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is | 77 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is |
78 | /// dispenced. | 78 | /// dispenced. |
79 | /// </summary> | 79 | /// </summary> |
80 | private uint m_lastAllocatedLocalId = 720000; | 80 | private uint m_lastAllocatedLocalId = 720000; |
81 | 81 | ||
82 | private readonly Mutex _primAllocateMutex = new Mutex(false); | 82 | private readonly Mutex _primAllocateMutex = new Mutex(false); |
83 | 83 | ||
84 | private int m_timePhase = 24; | 84 | private int m_timePhase = 24; |
@@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
607 | public override void Close() | 607 | public override void Close() |
608 | { | 608 | { |
609 | m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); | 609 | m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); |
610 | 610 | ||
611 | // Kick all ROOT agents with the message, 'The simulator is going down' | 611 | // Kick all ROOT agents with the message, 'The simulator is going down' |
612 | ForEachScenePresence(delegate(ScenePresence avatar) | 612 | ForEachScenePresence(delegate(ScenePresence avatar) |
613 | { | 613 | { |
@@ -765,7 +765,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
765 | if (m_frame % m_update_backup == 0) | 765 | if (m_frame % m_update_backup == 0) |
766 | { | 766 | { |
767 | UpdateStorageBackup(); | 767 | UpdateStorageBackup(); |
768 | 768 | ||
769 | } | 769 | } |
770 | 770 | ||
771 | if (m_frame % m_update_terrain == 0) | 771 | if (m_frame % m_update_terrain == 0) |
@@ -1112,7 +1112,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1112 | //X | 1112 | //X |
1113 | // . | 1113 | // . |
1114 | // | 1114 | // |
1115 | // Shade the terrain for shadows | 1115 | // Shade the terrain for shadows |
1116 | if ((x - 1 > 0) && (y - 1 > 0)) | 1116 | if ((x - 1 > 0) && (y - 1 > 0)) |
1117 | { | 1117 | { |
1118 | hfvalue = (float)hm[x, y]; | 1118 | hfvalue = (float)hm[x, y]; |
@@ -1133,7 +1133,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1133 | else if (hfdiff < -0.3f) | 1133 | else if (hfdiff < -0.3f) |
1134 | { | 1134 | { |
1135 | // We have to desaturate and blacken the land at the same time | 1135 | // We have to desaturate and blacken the land at the same time |
1136 | // we use floats, colors use bytes, so shrink are space down to | 1136 | // we use floats, colors use bytes, so shrink are space down to |
1137 | // 0-255 | 1137 | // 0-255 |
1138 | 1138 | ||
1139 | 1139 | ||
@@ -1429,13 +1429,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1429 | public void LazySaveGeneratedMaptile(byte[] data, bool temporary) | 1429 | public void LazySaveGeneratedMaptile(byte[] data, bool temporary) |
1430 | { | 1430 | { |
1431 | // Overwrites the local Asset cache with new maptile data | 1431 | // Overwrites the local Asset cache with new maptile data |
1432 | // Assets are single write, this causes the asset server to ignore this update, | 1432 | // Assets are single write, this causes the asset server to ignore this update, |
1433 | // but the local asset cache does not | 1433 | // but the local asset cache does not |
1434 | 1434 | ||
1435 | // this is on purpose! The net result of this is the region always has the most up to date | 1435 | // this is on purpose! The net result of this is the region always has the most up to date |
1436 | // map tile while protecting the (grid) asset database from bloat caused by a new asset each | 1436 | // map tile while protecting the (grid) asset database from bloat caused by a new asset each |
1437 | // time a mapimage is generated! | 1437 | // time a mapimage is generated! |
1438 | 1438 | ||
1439 | LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; | 1439 | LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; |
1440 | 1440 | ||
1441 | int lastMapRefresh = 0; | 1441 | int lastMapRefresh = 0; |
@@ -1711,7 +1711,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1711 | /// </param> | 1711 | /// </param> |
1712 | /// <returns> | 1712 | /// <returns> |
1713 | /// true if the object was added, false if an object with the same uuid was already in the scene | 1713 | /// true if the object was added, false if an object with the same uuid was already in the scene |
1714 | /// </returns> | 1714 | /// </returns> |
1715 | public bool AddRestoredSceneObject( | 1715 | public bool AddRestoredSceneObject( |
1716 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 1716 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
1717 | { | 1717 | { |
@@ -1739,15 +1739,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1739 | lock (Entities) | 1739 | lock (Entities) |
1740 | { | 1740 | { |
1741 | ICollection<EntityBase> entities = new List<EntityBase>(Entities.Values); | 1741 | ICollection<EntityBase> entities = new List<EntityBase>(Entities.Values); |
1742 | 1742 | ||
1743 | foreach (EntityBase e in entities) | 1743 | foreach (EntityBase e in entities) |
1744 | { | 1744 | { |
1745 | if (e is SceneObjectGroup) | 1745 | if (e is SceneObjectGroup) |
1746 | DeleteSceneObject((SceneObjectGroup)e); | 1746 | DeleteSceneObject((SceneObjectGroup)e); |
1747 | } | 1747 | } |
1748 | } | 1748 | } |
1749 | } | 1749 | } |
1750 | 1750 | ||
1751 | /// <summary> | 1751 | /// <summary> |
1752 | /// Delete the given object from the scene. | 1752 | /// Delete the given object from the scene. |
1753 | /// </summary> | 1753 | /// </summary> |
@@ -1791,8 +1791,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1791 | 1791 | ||
1792 | public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) | 1792 | public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) |
1793 | { | 1793 | { |
1794 | m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); | 1794 | m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); |
1795 | 1795 | ||
1796 | m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); | 1796 | m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); |
1797 | } | 1797 | } |
1798 | 1798 | ||
@@ -1805,29 +1805,29 @@ namespace OpenSim.Region.Environment.Scenes | |||
1805 | 1805 | ||
1806 | public void LoadPrimsFromXml2(string fileName) | 1806 | public void LoadPrimsFromXml2(string fileName) |
1807 | { | 1807 | { |
1808 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); | 1808 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); |
1809 | 1809 | ||
1810 | m_serialiser.LoadPrimsFromXml2(this, fileName); | 1810 | m_serialiser.LoadPrimsFromXml2(this, fileName); |
1811 | } | 1811 | } |
1812 | 1812 | ||
1813 | public void LoadPrimsFromXml2(TextReader reader, bool startScripts) | 1813 | public void LoadPrimsFromXml2(TextReader reader, bool startScripts) |
1814 | { | 1814 | { |
1815 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); | 1815 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); |
1816 | 1816 | ||
1817 | m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); | 1817 | m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); |
1818 | } | 1818 | } |
1819 | 1819 | ||
1820 | public void SavePrimsToXml2(string fileName) | 1820 | public void SavePrimsToXml2(string fileName) |
1821 | { | 1821 | { |
1822 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); | 1822 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); |
1823 | 1823 | ||
1824 | m_serialiser.SavePrimsToXml2(this, fileName); | 1824 | m_serialiser.SavePrimsToXml2(this, fileName); |
1825 | } | 1825 | } |
1826 | 1826 | ||
1827 | public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) | 1827 | public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) |
1828 | { | 1828 | { |
1829 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); | 1829 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); |
1830 | 1830 | ||
1831 | m_serialiser.SavePrimsToXml2(this, stream, min, max); | 1831 | m_serialiser.SavePrimsToXml2(this, stream, min, max); |
1832 | } | 1832 | } |
1833 | 1833 | ||
@@ -1835,7 +1835,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1835 | { | 1835 | { |
1836 | m_log.InfoFormat( | 1836 | m_log.InfoFormat( |
1837 | "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName); | 1837 | "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName); |
1838 | 1838 | ||
1839 | List<EntityBase> entityList = GetEntities(); | 1839 | List<EntityBase> entityList = GetEntities(); |
1840 | List<EntityBase> primList = new List<EntityBase>(); | 1840 | List<EntityBase> primList = new List<EntityBase>(); |
1841 | 1841 | ||
@@ -1860,7 +1860,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1860 | public void LoadPrimsFromArchive(string filePath) | 1860 | public void LoadPrimsFromArchive(string filePath) |
1861 | { | 1861 | { |
1862 | m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath); | 1862 | m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath); |
1863 | 1863 | ||
1864 | m_archiver.DearchiveRegion(filePath); | 1864 | m_archiver.DearchiveRegion(filePath); |
1865 | } | 1865 | } |
1866 | 1866 | ||
@@ -1871,7 +1871,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1871 | public void SavePrimsToArchive(string filePath) | 1871 | public void SavePrimsToArchive(string filePath) |
1872 | { | 1872 | { |
1873 | m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath); | 1873 | m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath); |
1874 | 1874 | ||
1875 | m_archiver.ArchiveRegion(filePath); | 1875 | m_archiver.ArchiveRegion(filePath); |
1876 | } | 1876 | } |
1877 | 1877 | ||
@@ -1986,7 +1986,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1986 | m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); | 1986 | m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); |
1987 | if (XMLMethod == 0) | 1987 | if (XMLMethod == 0) |
1988 | { | 1988 | { |
1989 | SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); | 1989 | SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); |
1990 | AddRestoredSceneObject(sceneObject, true, false); | 1990 | AddRestoredSceneObject(sceneObject, true, false); |
1991 | 1991 | ||
1992 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); | 1992 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); |
@@ -1999,7 +1999,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1999 | { | 1999 | { |
2000 | DeleteSceneObject(grp); | 2000 | DeleteSceneObject(grp); |
2001 | } | 2001 | } |
2002 | 2002 | ||
2003 | m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); | 2003 | m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); |
2004 | 2004 | ||
2005 | return false; | 2005 | return false; |
@@ -2075,7 +2075,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2075 | else | 2075 | else |
2076 | { | 2076 | { |
2077 | m_log.DebugFormat( | 2077 | m_log.DebugFormat( |
2078 | "[SCENE]: Adding new {0} agent {1} {2} in {3}", | 2078 | "[SCENE]: Adding new {0} agent {1} {2} in {3}", |
2079 | (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); | 2079 | (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); |
2080 | 2080 | ||
2081 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | 2081 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); |
@@ -2156,7 +2156,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2156 | client.OnScriptReset += ProcessScriptReset; | 2156 | client.OnScriptReset += ProcessScriptReset; |
2157 | client.OnGetScriptRunning += GetScriptRunning; | 2157 | client.OnGetScriptRunning += GetScriptRunning; |
2158 | client.OnSetScriptRunning += SetScriptRunning; | 2158 | client.OnSetScriptRunning += SetScriptRunning; |
2159 | 2159 | ||
2160 | client.OnRegionHandleRequest += RegionHandleRequest; | 2160 | client.OnRegionHandleRequest += RegionHandleRequest; |
2161 | 2161 | ||
2162 | client.OnUnackedTerrain += TerrainUnAcked; | 2162 | client.OnUnackedTerrain += TerrainUnAcked; |
@@ -2310,7 +2310,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2310 | public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) | 2310 | public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) |
2311 | { | 2311 | { |
2312 | appearance = null; // VS needs this line, mono doesn't | 2312 | appearance = null; // VS needs this line, mono doesn't |
2313 | 2313 | ||
2314 | try | 2314 | try |
2315 | { | 2315 | { |
2316 | if (m_AvatarFactory == null || | 2316 | if (m_AvatarFactory == null || |
@@ -2323,10 +2323,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2323 | catch (Exception e) | 2323 | catch (Exception e) |
2324 | { | 2324 | { |
2325 | m_log.ErrorFormat( | 2325 | m_log.ErrorFormat( |
2326 | "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", | 2326 | "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", |
2327 | client.Name, client.AgentId, e); | 2327 | client.Name, client.AgentId, e); |
2328 | appearance = new AvatarAppearance(); | 2328 | appearance = new AvatarAppearance(); |
2329 | } | 2329 | } |
2330 | } | 2330 | } |
2331 | 2331 | ||
2332 | /// <summary> | 2332 | /// <summary> |
@@ -2341,13 +2341,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
2341 | { | 2341 | { |
2342 | childagentYN = avatar.IsChildAgent; | 2342 | childagentYN = avatar.IsChildAgent; |
2343 | } | 2343 | } |
2344 | 2344 | ||
2345 | try | 2345 | try |
2346 | { | 2346 | { |
2347 | m_log.DebugFormat( | 2347 | m_log.DebugFormat( |
2348 | "[SCENE]: Removing {0} agent {1} from region {2}", | 2348 | "[SCENE]: Removing {0} agent {1} from region {2}", |
2349 | (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); | 2349 | (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); |
2350 | 2350 | ||
2351 | if (avatar.IsChildAgent) | 2351 | if (avatar.IsChildAgent) |
2352 | { | 2352 | { |
2353 | m_innerScene.removeUserCount(false); | 2353 | m_innerScene.removeUserCount(false); |
@@ -2378,7 +2378,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2378 | // We don't know which count to remove it from | 2378 | // We don't know which count to remove it from |
2379 | // Avatar is already disposed :/ | 2379 | // Avatar is already disposed :/ |
2380 | } | 2380 | } |
2381 | 2381 | ||
2382 | m_eventManager.TriggerOnRemovePresence(agentID); | 2382 | m_eventManager.TriggerOnRemovePresence(agentID); |
2383 | Broadcast(delegate(IClientAPI client) | 2383 | Broadcast(delegate(IClientAPI client) |
2384 | { | 2384 | { |
@@ -2717,7 +2717,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2717 | { | 2717 | { |
2718 | m_innerScene.removeUserCount(true); | 2718 | m_innerScene.removeUserCount(true); |
2719 | } | 2719 | } |
2720 | 2720 | ||
2721 | // Tell a single agent to disconnect from the region. | 2721 | // Tell a single agent to disconnect from the region. |
2722 | presence.ControllingClient.SendShutdownConnectionNotice(); | 2722 | presence.ControllingClient.SendShutdownConnectionNotice(); |
2723 | 2723 | ||
@@ -3827,9 +3827,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
3827 | { | 3827 | { |
3828 | //should be doing this by parcel, but as its only for testing | 3828 | //should be doing this by parcel, but as its only for testing |
3829 | // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4 | 3829 | // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4 |
3830 | // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist | 3830 | // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist |
3831 | // in the context of `<>c__CompilerGenerated17' | 3831 | // in the context of `<>c__CompilerGenerated17' |
3832 | // MW said it was okay to comment the body of this method out for now since the code is experimental | 3832 | // MW said it was okay to comment the body of this method out for now since the code is experimental |
3833 | // and will be replaced anyway | 3833 | // and will be replaced anyway |
3834 | // ForEachClient(delegate(IClientAPI client) | 3834 | // ForEachClient(delegate(IClientAPI client) |
3835 | // { | 3835 | // { |
@@ -3840,7 +3840,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
3840 | // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); | 3840 | // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); |
3841 | // }); | 3841 | // }); |
3842 | } | 3842 | } |
3843 | 3843 | ||
3844 | public void RegionHandleRequest(IClientAPI client, LLUUID regionID) | 3844 | public void RegionHandleRequest(IClientAPI client, LLUUID regionID) |
3845 | { | 3845 | { |
3846 | RegionInfo info; | 3846 | RegionInfo info; |
@@ -3860,4 +3860,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
3860 | client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); | 3860 | client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); |
3861 | } | 3861 | } |
3862 | } | 3862 | } |
3863 | } | 3863 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 35a7434..adad7d3 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
60 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; | 60 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; |
61 | public event LogOffUser OnLogOffUser; | 61 | public event LogOffUser OnLogOffUser; |
62 | public event GetLandData OnGetLandData; | 62 | public event GetLandData OnGetLandData; |
63 | 63 | ||
64 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; | 64 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; |
65 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; | 65 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; |
66 | private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; | 66 | private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; |
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
70 | private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; | 70 | private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; |
71 | private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; | 71 | private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; |
72 | private LogOffUser handlerLogOffUser = null; | 72 | private LogOffUser handlerLogOffUser = null; |
73 | private GetLandData handlerGetLandData = null; // OnGetLandData | 73 | private GetLandData handlerGetLandData = null; // OnGetLandData |
74 | 74 | ||
75 | public KillObjectDelegate KillObject; | 75 | public KillObjectDelegate KillObject; |
76 | public string _debugRegionName = String.Empty; | 76 | public string _debugRegionName = String.Empty; |
@@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
240 | } | 240 | } |
241 | return null; | 241 | return null; |
242 | } | 242 | } |
243 | 243 | ||
244 | #endregion | 244 | #endregion |
245 | 245 | ||
246 | #region Inform Client of Neighbours | 246 | #region Inform Client of Neighbours |
@@ -582,7 +582,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
582 | LLVector3 lookAt, uint flags) | 582 | LLVector3 lookAt, uint flags) |
583 | { | 583 | { |
584 | bool destRegionUp = false; | 584 | bool destRegionUp = false; |
585 | 585 | ||
586 | if (regionHandle == m_regionInfo.RegionHandle) | 586 | if (regionHandle == m_regionInfo.RegionHandle) |
587 | { | 587 | { |
588 | // Teleport within the same region | 588 | // Teleport within the same region |
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index 0b2cc9e..a0e0a37 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -45,534 +45,553 @@ namespace OpenSim.Region.Environment.Scenes | |||
45 | 45 | ||
46 | #region Object Permission Checks | 46 | #region Object Permission Checks |
47 | 47 | ||
48 | public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); | 48 | public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); |
49 | private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>(); | 49 | private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>(); |
50 | 50 | ||
51 | public void addGenerateClientFlags(GenerateClientFlags delegateFunc) | 51 | public void addGenerateClientFlags(GenerateClientFlags delegateFunc) |
52 | { | 52 | { |
53 | if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) | 53 | if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) |
54 | GenerateClientFlagsCheckFunctions.Add(delegateFunc); | 54 | GenerateClientFlagsCheckFunctions.Add(delegateFunc); |
55 | } | 55 | } |
56 | public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) | ||
57 | { | ||
58 | if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) | ||
59 | GenerateClientFlagsCheckFunctions.Remove(delegateFunc); | ||
60 | } | ||
61 | 56 | ||
62 | public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) | 57 | public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) |
63 | { | 58 | { |
64 | SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); | 59 | if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) |
65 | 60 | GenerateClientFlagsCheckFunctions.Remove(delegateFunc); | |
66 | if (part == null) | 61 | } |
67 | return 0; | ||
68 | |||
69 | uint perms=part.GetEffectiveObjectFlags() | | ||
70 | (uint)LLObject.ObjectFlags.ObjectModify | | ||
71 | (uint)LLObject.ObjectFlags.ObjectCopy | | ||
72 | (uint)LLObject.ObjectFlags.ObjectMove | | ||
73 | (uint)LLObject.ObjectFlags.ObjectTransfer | | ||
74 | (uint)LLObject.ObjectFlags.ObjectYouOwner | | ||
75 | (uint)LLObject.ObjectFlags.ObjectAnyOwner | | ||
76 | (uint)LLObject.ObjectFlags.ObjectOwnerModify | | ||
77 | (uint)LLObject.ObjectFlags.ObjectYouOfficer; | ||
78 | |||
79 | foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) | ||
80 | { | ||
81 | perms &= check(userID, objectID); | ||
82 | } | ||
83 | return perms; | ||
84 | } | ||
85 | 62 | ||
86 | public delegate void SetBypassPermissions(bool value); | 63 | public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) |
87 | private List<SetBypassPermissions> SetBypassPermissionsCheckFunctions = new List<SetBypassPermissions>(); | 64 | { |
65 | SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); | ||
88 | 66 | ||
89 | public void addSetBypassPermissions(SetBypassPermissions delegateFunc) | 67 | if (part == null) |
90 | { | 68 | return 0; |
91 | if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
92 | SetBypassPermissionsCheckFunctions.Add(delegateFunc); | ||
93 | } | ||
94 | public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) | ||
95 | { | ||
96 | if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
97 | SetBypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
98 | } | ||
99 | 69 | ||
100 | public void ExternalChecksSetBypassPermissions(bool value) | 70 | uint perms=part.GetEffectiveObjectFlags() | |
71 | (uint)LLObject.ObjectFlags.ObjectModify | | ||
72 | (uint)LLObject.ObjectFlags.ObjectCopy | | ||
73 | (uint)LLObject.ObjectFlags.ObjectMove | | ||
74 | (uint)LLObject.ObjectFlags.ObjectTransfer | | ||
75 | (uint)LLObject.ObjectFlags.ObjectYouOwner | | ||
76 | (uint)LLObject.ObjectFlags.ObjectAnyOwner | | ||
77 | (uint)LLObject.ObjectFlags.ObjectOwnerModify | | ||
78 | (uint)LLObject.ObjectFlags.ObjectYouOfficer; | ||
79 | |||
80 | foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) | ||
101 | { | 81 | { |
102 | foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) | 82 | perms &= check(userID, objectID); |
103 | { | ||
104 | check(value); | ||
105 | } | ||
106 | } | 83 | } |
84 | return perms; | ||
85 | } | ||
107 | 86 | ||
108 | public delegate bool BypassPermissions(); | 87 | public delegate void SetBypassPermissions(bool value); |
109 | private List<BypassPermissions> BypassPermissionsCheckFunctions = new List<BypassPermissions>(); | 88 | private List<SetBypassPermissions> SetBypassPermissionsCheckFunctions = new List<SetBypassPermissions>(); |
110 | 89 | ||
111 | public void addBypassPermissions(BypassPermissions delegateFunc) | 90 | public void addSetBypassPermissions(SetBypassPermissions delegateFunc) |
112 | { | 91 | { |
113 | if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) | 92 | if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) |
114 | BypassPermissionsCheckFunctions.Add(delegateFunc); | 93 | SetBypassPermissionsCheckFunctions.Add(delegateFunc); |
115 | } | 94 | } |
116 | public void removeBypassPermissions(BypassPermissions delegateFunc) | 95 | |
96 | public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) | ||
97 | { | ||
98 | if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
99 | SetBypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
100 | } | ||
101 | |||
102 | public void ExternalChecksSetBypassPermissions(bool value) | ||
103 | { | ||
104 | foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) | ||
117 | { | 105 | { |
118 | if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) | 106 | check(value); |
119 | BypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
120 | } | 107 | } |
108 | } | ||
121 | 109 | ||
122 | public bool ExternalChecksBypassPermissions() | 110 | public delegate bool BypassPermissions(); |
111 | private List<BypassPermissions> BypassPermissionsCheckFunctions = new List<BypassPermissions>(); | ||
112 | |||
113 | public void addBypassPermissions(BypassPermissions delegateFunc) | ||
114 | { | ||
115 | if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
116 | BypassPermissionsCheckFunctions.Add(delegateFunc); | ||
117 | } | ||
118 | |||
119 | public void removeBypassPermissions(BypassPermissions delegateFunc) | ||
120 | { | ||
121 | if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
122 | BypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
123 | } | ||
124 | |||
125 | public bool ExternalChecksBypassPermissions() | ||
126 | { | ||
127 | foreach (BypassPermissions check in BypassPermissionsCheckFunctions) | ||
123 | { | 128 | { |
124 | foreach (BypassPermissions check in BypassPermissionsCheckFunctions) | 129 | if (check() == false) |
125 | { | 130 | { |
126 | if (check() == false) | 131 | return false; |
127 | { | ||
128 | return false; | ||
129 | } | ||
130 | } | 132 | } |
131 | return true; | ||
132 | } | 133 | } |
134 | return true; | ||
135 | } | ||
133 | 136 | ||
134 | public delegate bool PropagatePermissions(); | 137 | public delegate bool PropagatePermissions(); |
135 | private List<PropagatePermissions> PropagatePermissionsCheckFunctions = new List<PropagatePermissions>(); | 138 | private List<PropagatePermissions> PropagatePermissionsCheckFunctions = new List<PropagatePermissions>(); |
136 | 139 | ||
137 | public void addPropagatePermissions(PropagatePermissions delegateFunc) | 140 | public void addPropagatePermissions(PropagatePermissions delegateFunc) |
138 | { | 141 | { |
139 | if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | 142 | if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) |
140 | PropagatePermissionsCheckFunctions.Add(delegateFunc); | 143 | PropagatePermissionsCheckFunctions.Add(delegateFunc); |
141 | } | 144 | } |
142 | public void removePropagatePermissions(PropagatePermissions delegateFunc) | ||
143 | { | ||
144 | if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | ||
145 | PropagatePermissionsCheckFunctions.Remove(delegateFunc); | ||
146 | } | ||
147 | 145 | ||
148 | public bool ExternalChecksPropagatePermissions() | 146 | public void removePropagatePermissions(PropagatePermissions delegateFunc) |
147 | { | ||
148 | if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | ||
149 | PropagatePermissionsCheckFunctions.Remove(delegateFunc); | ||
150 | } | ||
151 | |||
152 | public bool ExternalChecksPropagatePermissions() | ||
153 | { | ||
154 | foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) | ||
149 | { | 155 | { |
150 | foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) | 156 | if (check() == false) |
151 | { | 157 | { |
152 | if (check() == false) | 158 | return false; |
153 | { | ||
154 | return false; | ||
155 | } | ||
156 | } | 159 | } |
157 | return true; | ||
158 | } | 160 | } |
161 | return true; | ||
162 | } | ||
159 | 163 | ||
160 | #region REZ OBJECT | 164 | #region REZ OBJECT |
161 | public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); | 165 | public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); |
162 | private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); | 166 | private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); |
163 | 167 | ||
164 | public void addCheckRezObject(CanRezObject delegateFunc) | 168 | public void addCheckRezObject(CanRezObject delegateFunc) |
165 | { | 169 | { |
166 | if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) | 170 | if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) |
167 | CanRezObjectCheckFunctions.Add(delegateFunc); | 171 | CanRezObjectCheckFunctions.Add(delegateFunc); |
168 | } | 172 | } |
169 | public void removeCheckRezObject(CanRezObject delegateFunc) | ||
170 | { | ||
171 | if (CanRezObjectCheckFunctions.Contains(delegateFunc)) | ||
172 | CanRezObjectCheckFunctions.Remove(delegateFunc); | ||
173 | } | ||
174 | 173 | ||
175 | public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) | 174 | public void removeCheckRezObject(CanRezObject delegateFunc) |
175 | { | ||
176 | if (CanRezObjectCheckFunctions.Contains(delegateFunc)) | ||
177 | CanRezObjectCheckFunctions.Remove(delegateFunc); | ||
178 | } | ||
179 | |||
180 | public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) | ||
181 | { | ||
182 | foreach (CanRezObject check in CanRezObjectCheckFunctions) | ||
176 | { | 183 | { |
177 | foreach (CanRezObject check in CanRezObjectCheckFunctions) | 184 | if (check(objectCount, owner,objectPosition, m_scene) == false) |
178 | { | 185 | { |
179 | if (check(objectCount, owner,objectPosition, m_scene) == false) | 186 | return false; |
180 | { | ||
181 | return false; | ||
182 | } | ||
183 | } | 187 | } |
184 | return true; | ||
185 | } | 188 | } |
189 | return true; | ||
190 | } | ||
186 | 191 | ||
187 | #endregion | 192 | #endregion |
188 | 193 | ||
189 | #region DELETE OBJECT | 194 | #region DELETE OBJECT |
190 | public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); | 195 | public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); |
191 | private List<CanDeleteObject> CanDeleteObjectCheckFunctions = new List<CanDeleteObject>(); | 196 | private List<CanDeleteObject> CanDeleteObjectCheckFunctions = new List<CanDeleteObject>(); |
192 | 197 | ||
193 | public void addCheckDeleteObject(CanDeleteObject delegateFunc) | 198 | public void addCheckDeleteObject(CanDeleteObject delegateFunc) |
194 | { | 199 | { |
195 | if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) | 200 | if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) |
196 | CanDeleteObjectCheckFunctions.Add(delegateFunc); | 201 | CanDeleteObjectCheckFunctions.Add(delegateFunc); |
197 | } | 202 | } |
198 | public void removeCheckDeleteObject(CanDeleteObject delegateFunc) | ||
199 | { | ||
200 | if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) | ||
201 | CanDeleteObjectCheckFunctions.Remove(delegateFunc); | ||
202 | } | ||
203 | 203 | ||
204 | public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) | 204 | public void removeCheckDeleteObject(CanDeleteObject delegateFunc) |
205 | { | ||
206 | if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) | ||
207 | CanDeleteObjectCheckFunctions.Remove(delegateFunc); | ||
208 | } | ||
209 | |||
210 | public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) | ||
211 | { | ||
212 | foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) | ||
205 | { | 213 | { |
206 | foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) | 214 | if (check(objectID,deleter,m_scene) == false) |
207 | { | 215 | { |
208 | if (check(objectID,deleter,m_scene) == false) | 216 | return false; |
209 | { | ||
210 | return false; | ||
211 | } | ||
212 | } | 217 | } |
213 | return true; | ||
214 | } | 218 | } |
219 | return true; | ||
220 | } | ||
215 | 221 | ||
216 | #endregion | 222 | #endregion |
217 | 223 | ||
218 | #region TAKE OBJECT | 224 | #region TAKE OBJECT |
219 | public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); | 225 | public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); |
220 | private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>(); | 226 | private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>(); |
221 | 227 | ||
222 | public void addCheckTakeObject(CanTakeObject delegateFunc) | 228 | public void addCheckTakeObject(CanTakeObject delegateFunc) |
223 | { | 229 | { |
224 | if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) | 230 | if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) |
225 | CanTakeObjectCheckFunctions.Add(delegateFunc); | 231 | CanTakeObjectCheckFunctions.Add(delegateFunc); |
226 | } | 232 | } |
227 | public void removeCheckTakeObject(CanTakeObject delegateFunc) | ||
228 | { | ||
229 | if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) | ||
230 | CanTakeObjectCheckFunctions.Remove(delegateFunc); | ||
231 | } | ||
232 | 233 | ||
233 | public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) | 234 | public void removeCheckTakeObject(CanTakeObject delegateFunc) |
235 | { | ||
236 | if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) | ||
237 | CanTakeObjectCheckFunctions.Remove(delegateFunc); | ||
238 | } | ||
239 | |||
240 | public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) | ||
241 | { | ||
242 | foreach (CanTakeObject check in CanTakeObjectCheckFunctions) | ||
234 | { | 243 | { |
235 | foreach (CanTakeObject check in CanTakeObjectCheckFunctions) | 244 | if (check(objectID, AvatarTakingUUID, m_scene) == false) |
236 | { | 245 | { |
237 | if (check(objectID, AvatarTakingUUID, m_scene) == false) | 246 | return false; |
238 | { | ||
239 | return false; | ||
240 | } | ||
241 | } | 247 | } |
242 | return true; | ||
243 | } | 248 | } |
249 | return true; | ||
250 | } | ||
244 | 251 | ||
245 | #endregion | 252 | #endregion |
246 | 253 | ||
247 | #region TAKE COPY OBJECT | 254 | #region TAKE COPY OBJECT |
248 | public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); | 255 | public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); |
249 | private List<CanTakeCopyObject> CanTakeCopyObjectCheckFunctions = new List<CanTakeCopyObject>(); | 256 | private List<CanTakeCopyObject> CanTakeCopyObjectCheckFunctions = new List<CanTakeCopyObject>(); |
250 | 257 | ||
251 | public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) | 258 | public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) |
252 | { | 259 | { |
253 | if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) | 260 | if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) |
254 | CanTakeCopyObjectCheckFunctions.Add(delegateFunc); | 261 | CanTakeCopyObjectCheckFunctions.Add(delegateFunc); |
255 | } | 262 | } |
256 | public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) | ||
257 | { | ||
258 | if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) | ||
259 | CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); | ||
260 | } | ||
261 | 263 | ||
262 | public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) | 264 | public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) |
265 | { | ||
266 | if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) | ||
267 | CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); | ||
268 | } | ||
269 | |||
270 | public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) | ||
271 | { | ||
272 | foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) | ||
263 | { | 273 | { |
264 | foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) | 274 | if (check(objectID,userID,m_scene) == false) |
265 | { | 275 | { |
266 | if (check(objectID,userID,m_scene) == false) | 276 | return false; |
267 | { | ||
268 | return false; | ||
269 | } | ||
270 | } | 277 | } |
271 | return true; | ||
272 | } | 278 | } |
279 | return true; | ||
280 | } | ||
273 | 281 | ||
274 | #endregion | 282 | #endregion |
275 | 283 | ||
276 | #region DUPLICATE OBJECT | 284 | #region DUPLICATE OBJECT |
277 | public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); | 285 | public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); |
278 | private List<CanDuplicateObject> CanDuplicateObjectCheckFunctions = new List<CanDuplicateObject>(); | 286 | private List<CanDuplicateObject> CanDuplicateObjectCheckFunctions = new List<CanDuplicateObject>(); |
279 | 287 | ||
280 | public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) | 288 | public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) |
281 | { | 289 | { |
282 | if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) | 290 | if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) |
283 | CanDuplicateObjectCheckFunctions.Add(delegateFunc); | 291 | CanDuplicateObjectCheckFunctions.Add(delegateFunc); |
284 | } | 292 | } |
285 | public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) | ||
286 | { | ||
287 | if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) | ||
288 | CanDuplicateObjectCheckFunctions.Remove(delegateFunc); | ||
289 | } | ||
290 | 293 | ||
291 | public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) | 294 | public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) |
295 | { | ||
296 | if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) | ||
297 | CanDuplicateObjectCheckFunctions.Remove(delegateFunc); | ||
298 | } | ||
299 | |||
300 | public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) | ||
301 | { | ||
302 | foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) | ||
292 | { | 303 | { |
293 | foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) | 304 | if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) |
294 | { | 305 | { |
295 | if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) | 306 | return false; |
296 | { | ||
297 | return false; | ||
298 | } | ||
299 | } | 307 | } |
300 | return true; | ||
301 | } | 308 | } |
309 | return true; | ||
310 | } | ||
302 | 311 | ||
303 | #endregion | 312 | #endregion |
304 | 313 | ||
305 | #region EDIT OBJECT | 314 | #region EDIT OBJECT |
306 | public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); | 315 | public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); |
307 | private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>(); | 316 | private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>(); |
308 | 317 | ||
309 | public void addCheckEditObject(CanEditObject delegateFunc) | 318 | public void addCheckEditObject(CanEditObject delegateFunc) |
310 | { | 319 | { |
311 | if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) | 320 | if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) |
312 | CanEditObjectCheckFunctions.Add(delegateFunc); | 321 | CanEditObjectCheckFunctions.Add(delegateFunc); |
313 | } | 322 | } |
314 | public void removeCheckEditObject(CanEditObject delegateFunc) | ||
315 | { | ||
316 | if (CanEditObjectCheckFunctions.Contains(delegateFunc)) | ||
317 | CanEditObjectCheckFunctions.Remove(delegateFunc); | ||
318 | } | ||
319 | 323 | ||
320 | public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) | 324 | public void removeCheckEditObject(CanEditObject delegateFunc) |
325 | { | ||
326 | if (CanEditObjectCheckFunctions.Contains(delegateFunc)) | ||
327 | CanEditObjectCheckFunctions.Remove(delegateFunc); | ||
328 | } | ||
329 | |||
330 | public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) | ||
331 | { | ||
332 | foreach (CanEditObject check in CanEditObjectCheckFunctions) | ||
321 | { | 333 | { |
322 | foreach (CanEditObject check in CanEditObjectCheckFunctions) | 334 | if (check(objectID, editorID, m_scene) == false) |
323 | { | 335 | { |
324 | if (check(objectID, editorID, m_scene) == false) | 336 | return false; |
325 | { | ||
326 | return false; | ||
327 | } | ||
328 | } | 337 | } |
329 | return true; | ||
330 | } | 338 | } |
339 | return true; | ||
340 | } | ||
331 | 341 | ||
332 | #endregion | 342 | #endregion |
333 | 343 | ||
334 | #region MOVE OBJECT | 344 | #region MOVE OBJECT |
335 | public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); | 345 | public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); |
336 | private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>(); | 346 | private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>(); |
337 | 347 | ||
338 | public void addCheckMoveObject(CanMoveObject delegateFunc) | 348 | public void addCheckMoveObject(CanMoveObject delegateFunc) |
339 | { | 349 | { |
340 | if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) | 350 | if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) |
341 | CanMoveObjectCheckFunctions.Add(delegateFunc); | 351 | CanMoveObjectCheckFunctions.Add(delegateFunc); |
342 | } | 352 | } |
343 | public void removeCheckMoveObject(CanMoveObject delegateFunc) | ||
344 | { | ||
345 | if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) | ||
346 | CanMoveObjectCheckFunctions.Remove(delegateFunc); | ||
347 | } | ||
348 | 353 | ||
349 | public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) | 354 | public void removeCheckMoveObject(CanMoveObject delegateFunc) |
355 | { | ||
356 | if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) | ||
357 | CanMoveObjectCheckFunctions.Remove(delegateFunc); | ||
358 | } | ||
359 | |||
360 | public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) | ||
361 | { | ||
362 | foreach (CanMoveObject check in CanMoveObjectCheckFunctions) | ||
350 | { | 363 | { |
351 | foreach (CanMoveObject check in CanMoveObjectCheckFunctions) | 364 | if (check(objectID,moverID,m_scene) == false) |
352 | { | 365 | { |
353 | if (check(objectID,moverID,m_scene) == false) | 366 | return false; |
354 | { | ||
355 | return false; | ||
356 | } | ||
357 | } | 367 | } |
358 | return true; | ||
359 | } | 368 | } |
369 | return true; | ||
370 | } | ||
360 | 371 | ||
361 | #endregion | 372 | #endregion |
362 | 373 | ||
363 | #region OBJECT ENTRY | 374 | #region OBJECT ENTRY |
364 | public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); | 375 | public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); |
365 | private List<CanObjectEntry> CanObjectEntryCheckFunctions = new List<CanObjectEntry>(); | 376 | private List<CanObjectEntry> CanObjectEntryCheckFunctions = new List<CanObjectEntry>(); |
366 | 377 | ||
367 | public void addCheckObjectEntry(CanObjectEntry delegateFunc) | 378 | public void addCheckObjectEntry(CanObjectEntry delegateFunc) |
368 | { | 379 | { |
369 | if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) | 380 | if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) |
370 | CanObjectEntryCheckFunctions.Add(delegateFunc); | 381 | CanObjectEntryCheckFunctions.Add(delegateFunc); |
371 | } | 382 | } |
372 | public void removeCheckObjectEntry(CanObjectEntry delegateFunc) | ||
373 | { | ||
374 | if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) | ||
375 | CanObjectEntryCheckFunctions.Remove(delegateFunc); | ||
376 | } | ||
377 | 383 | ||
378 | public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) | 384 | public void removeCheckObjectEntry(CanObjectEntry delegateFunc) |
385 | { | ||
386 | if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) | ||
387 | CanObjectEntryCheckFunctions.Remove(delegateFunc); | ||
388 | } | ||
389 | |||
390 | public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) | ||
391 | { | ||
392 | foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) | ||
379 | { | 393 | { |
380 | foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) | 394 | if (check(objectID, newPoint, m_scene) == false) |
381 | { | 395 | { |
382 | if (check(objectID, newPoint, m_scene) == false) | 396 | return false; |
383 | { | ||
384 | return false; | ||
385 | } | ||
386 | } | 397 | } |
387 | return true; | ||
388 | } | 398 | } |
399 | return true; | ||
400 | } | ||
389 | 401 | ||
390 | #endregion | 402 | #endregion |
391 | 403 | ||
392 | #region RETURN OBJECT | 404 | #region RETURN OBJECT |
393 | public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); | 405 | public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); |
394 | private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>(); | 406 | private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>(); |
395 | 407 | ||
396 | public void addCheckReturnObject(CanReturnObject delegateFunc) | 408 | public void addCheckReturnObject(CanReturnObject delegateFunc) |
397 | { | 409 | { |
398 | if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) | 410 | if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) |
399 | CanReturnObjectCheckFunctions.Add(delegateFunc); | 411 | CanReturnObjectCheckFunctions.Add(delegateFunc); |
400 | } | 412 | } |
401 | public void removeCheckReturnObject(CanReturnObject delegateFunc) | ||
402 | { | ||
403 | if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) | ||
404 | CanReturnObjectCheckFunctions.Remove(delegateFunc); | ||
405 | } | ||
406 | 413 | ||
407 | public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) | 414 | public void removeCheckReturnObject(CanReturnObject delegateFunc) |
415 | { | ||
416 | if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) | ||
417 | CanReturnObjectCheckFunctions.Remove(delegateFunc); | ||
418 | } | ||
419 | |||
420 | public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) | ||
421 | { | ||
422 | foreach (CanReturnObject check in CanReturnObjectCheckFunctions) | ||
408 | { | 423 | { |
409 | foreach (CanReturnObject check in CanReturnObjectCheckFunctions) | 424 | if (check(objectID,returnerID,m_scene) == false) |
410 | { | 425 | { |
411 | if (check(objectID,returnerID,m_scene) == false) | 426 | return false; |
412 | { | ||
413 | return false; | ||
414 | } | ||
415 | } | 427 | } |
416 | return true; | ||
417 | } | 428 | } |
429 | return true; | ||
430 | } | ||
418 | 431 | ||
419 | #endregion | 432 | #endregion |
420 | 433 | ||
421 | #region INSTANT MESSAGE | 434 | #region INSTANT MESSAGE |
422 | public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); | 435 | public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); |
423 | private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>(); | 436 | private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>(); |
424 | 437 | ||
425 | public void addCheckInstantMessage(CanInstantMessage delegateFunc) | 438 | public void addCheckInstantMessage(CanInstantMessage delegateFunc) |
426 | { | 439 | { |
427 | if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) | 440 | if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) |
428 | CanInstantMessageCheckFunctions.Add(delegateFunc); | 441 | CanInstantMessageCheckFunctions.Add(delegateFunc); |
429 | } | 442 | } |
430 | public void removeCheckInstantMessage(CanInstantMessage delegateFunc) | 443 | |
431 | { | 444 | public void removeCheckInstantMessage(CanInstantMessage delegateFunc) |
432 | if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) | 445 | { |
433 | CanInstantMessageCheckFunctions.Remove(delegateFunc); | 446 | if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) |
434 | } | 447 | CanInstantMessageCheckFunctions.Remove(delegateFunc); |
448 | } | ||
435 | 449 | ||
436 | public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) | 450 | public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) |
451 | { | ||
452 | foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) | ||
437 | { | 453 | { |
438 | foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) | 454 | if (check(user, target, m_scene) == false) |
439 | { | 455 | { |
440 | if (check(user, target, m_scene) == false) | 456 | return false; |
441 | { | ||
442 | return false; | ||
443 | } | ||
444 | } | 457 | } |
445 | return true; | ||
446 | } | 458 | } |
459 | return true; | ||
460 | } | ||
447 | 461 | ||
448 | #endregion | 462 | #endregion |
449 | 463 | ||
450 | #region INVENTORY TRANSFER | 464 | #region INVENTORY TRANSFER |
451 | public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); | 465 | public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); |
452 | private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>(); | 466 | private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>(); |
453 | 467 | ||
454 | public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) | 468 | public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) |
455 | { | 469 | { |
456 | if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) | 470 | if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) |
457 | CanInventoryTransferCheckFunctions.Add(delegateFunc); | 471 | CanInventoryTransferCheckFunctions.Add(delegateFunc); |
458 | } | 472 | } |
459 | public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) | 473 | |
474 | public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) | ||
460 | { | 475 | { |
461 | if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) | 476 | if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) |
462 | CanInventoryTransferCheckFunctions.Remove(delegateFunc); | 477 | CanInventoryTransferCheckFunctions.Remove(delegateFunc); |
463 | } | 478 | } |
464 | 479 | ||
465 | public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) | 480 | public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) |
481 | { | ||
482 | foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) | ||
466 | { | 483 | { |
467 | foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) | 484 | if (check(user, target, m_scene) == false) |
468 | { | 485 | { |
469 | if (check(user, target, m_scene) == false) | 486 | return false; |
470 | { | ||
471 | return false; | ||
472 | } | ||
473 | } | 487 | } |
474 | return true; | ||
475 | } | 488 | } |
489 | return true; | ||
490 | } | ||
476 | 491 | ||
477 | #endregion | 492 | #endregion |
478 | 493 | ||
479 | #region VIEW SCRIPT | 494 | #region VIEW SCRIPT |
480 | public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 495 | public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); |
481 | private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>(); | 496 | private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>(); |
482 | 497 | ||
483 | public void addCheckViewScript(CanViewScript delegateFunc) | 498 | public void addCheckViewScript(CanViewScript delegateFunc) |
484 | { | 499 | { |
485 | if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) | 500 | if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) |
486 | CanViewScriptCheckFunctions.Add(delegateFunc); | 501 | CanViewScriptCheckFunctions.Add(delegateFunc); |
487 | } | 502 | } |
488 | public void removeCheckViewScript(CanViewScript delegateFunc) | ||
489 | { | ||
490 | if (CanViewScriptCheckFunctions.Contains(delegateFunc)) | ||
491 | CanViewScriptCheckFunctions.Remove(delegateFunc); | ||
492 | } | ||
493 | 503 | ||
494 | public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) | 504 | public void removeCheckViewScript(CanViewScript delegateFunc) |
505 | { | ||
506 | if (CanViewScriptCheckFunctions.Contains(delegateFunc)) | ||
507 | CanViewScriptCheckFunctions.Remove(delegateFunc); | ||
508 | } | ||
509 | |||
510 | public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) | ||
511 | { | ||
512 | foreach (CanViewScript check in CanViewScriptCheckFunctions) | ||
495 | { | 513 | { |
496 | foreach (CanViewScript check in CanViewScriptCheckFunctions) | 514 | if (check(script, objectID, user, m_scene) == false) |
497 | { | 515 | { |
498 | if (check(script, objectID, user, m_scene) == false) | 516 | return false; |
499 | { | ||
500 | return false; | ||
501 | } | ||
502 | } | 517 | } |
503 | return true; | ||
504 | } | 518 | } |
519 | return true; | ||
520 | } | ||
505 | 521 | ||
506 | public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 522 | public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); |
507 | private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>(); | 523 | private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>(); |
508 | 524 | ||
509 | public void addCheckViewNotecard(CanViewNotecard delegateFunc) | 525 | public void addCheckViewNotecard(CanViewNotecard delegateFunc) |
510 | { | 526 | { |
511 | if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) | 527 | if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) |
512 | CanViewNotecardCheckFunctions.Add(delegateFunc); | 528 | CanViewNotecardCheckFunctions.Add(delegateFunc); |
513 | } | 529 | } |
514 | public void removeCheckViewNotecard(CanViewNotecard delegateFunc) | 530 | |
515 | { | 531 | public void removeCheckViewNotecard(CanViewNotecard delegateFunc) |
516 | if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) | 532 | { |
517 | CanViewNotecardCheckFunctions.Remove(delegateFunc); | 533 | if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) |
518 | } | 534 | CanViewNotecardCheckFunctions.Remove(delegateFunc); |
535 | } | ||
519 | 536 | ||
520 | public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) | 537 | public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) |
538 | { | ||
539 | foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) | ||
521 | { | 540 | { |
522 | foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) | 541 | if (check(script, objectID, user, m_scene) == false) |
523 | { | 542 | { |
524 | if (check(script, objectID, user, m_scene) == false) | 543 | return false; |
525 | { | ||
526 | return false; | ||
527 | } | ||
528 | } | 544 | } |
529 | return true; | ||
530 | } | 545 | } |
546 | return true; | ||
547 | } | ||
548 | |||
549 | #endregion | ||
531 | 550 | ||
532 | #endregion | 551 | #region EDIT SCRIPT |
552 | public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | ||
553 | private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>(); | ||
533 | 554 | ||
534 | #region EDIT SCRIPT | 555 | public void addCheckEditScript(CanEditScript delegateFunc) |
535 | public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 556 | { |
536 | private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>(); | 557 | if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) |
558 | CanEditScriptCheckFunctions.Add(delegateFunc); | ||
559 | } | ||
537 | 560 | ||
538 | public void addCheckEditScript(CanEditScript delegateFunc) | 561 | public void removeCheckEditScript(CanEditScript delegateFunc) |
539 | { | 562 | { |
540 | if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) | 563 | if (CanEditScriptCheckFunctions.Contains(delegateFunc)) |
541 | CanEditScriptCheckFunctions.Add(delegateFunc); | 564 | CanEditScriptCheckFunctions.Remove(delegateFunc); |
542 | } | 565 | } |
543 | public void removeCheckEditScript(CanEditScript delegateFunc) | ||
544 | { | ||
545 | if (CanEditScriptCheckFunctions.Contains(delegateFunc)) | ||
546 | CanEditScriptCheckFunctions.Remove(delegateFunc); | ||
547 | } | ||
548 | 566 | ||
549 | public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) | 567 | public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) |
568 | { | ||
569 | foreach (CanEditScript check in CanEditScriptCheckFunctions) | ||
550 | { | 570 | { |
551 | foreach (CanEditScript check in CanEditScriptCheckFunctions) | 571 | if (check(script, objectID, user, m_scene) == false) |
552 | { | 572 | { |
553 | if (check(script, objectID, user, m_scene) == false) | 573 | return false; |
554 | { | ||
555 | return false; | ||
556 | } | ||
557 | } | 574 | } |
558 | return true; | ||
559 | } | 575 | } |
576 | return true; | ||
577 | } | ||
560 | 578 | ||
561 | public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); | 579 | public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); |
562 | private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>(); | 580 | private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>(); |
563 | 581 | ||
564 | public void addCheckEditNotecard(CanEditNotecard delegateFunc) | 582 | public void addCheckEditNotecard(CanEditNotecard delegateFunc) |
565 | { | 583 | { |
566 | if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) | 584 | if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) |
567 | CanEditNotecardCheckFunctions.Add(delegateFunc); | 585 | CanEditNotecardCheckFunctions.Add(delegateFunc); |
568 | } | 586 | } |
569 | public void removeCheckEditNotecard(CanEditNotecard delegateFunc) | ||
570 | { | ||
571 | if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) | ||
572 | CanEditNotecardCheckFunctions.Remove(delegateFunc); | ||
573 | } | ||
574 | 587 | ||
575 | public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) | 588 | public void removeCheckEditNotecard(CanEditNotecard delegateFunc) |
589 | { | ||
590 | if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) | ||
591 | CanEditNotecardCheckFunctions.Remove(delegateFunc); | ||
592 | } | ||
593 | |||
594 | public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) | ||
576 | { | 595 | { |
577 | foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) | 596 | foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) |
578 | { | 597 | { |
@@ -584,388 +603,402 @@ namespace OpenSim.Region.Environment.Scenes | |||
584 | return true; | 603 | return true; |
585 | } | 604 | } |
586 | 605 | ||
587 | #endregion | 606 | #endregion |
588 | 607 | ||
589 | #region RUN SCRIPT (When Script Placed in Object) | 608 | #region RUN SCRIPT (When Script Placed in Object) |
590 | public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 609 | public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); |
591 | private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>(); | 610 | private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>(); |
592 | 611 | ||
593 | public void addCheckRunScript(CanRunScript delegateFunc) | 612 | public void addCheckRunScript(CanRunScript delegateFunc) |
594 | { | 613 | { |
595 | if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) | 614 | if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) |
596 | CanRunScriptCheckFunctions.Add(delegateFunc); | 615 | CanRunScriptCheckFunctions.Add(delegateFunc); |
597 | } | 616 | } |
598 | public void removeCheckRunScript(CanRunScript delegateFunc) | ||
599 | { | ||
600 | if (CanRunScriptCheckFunctions.Contains(delegateFunc)) | ||
601 | CanRunScriptCheckFunctions.Remove(delegateFunc); | ||
602 | } | ||
603 | 617 | ||
604 | public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) | 618 | public void removeCheckRunScript(CanRunScript delegateFunc) |
619 | { | ||
620 | if (CanRunScriptCheckFunctions.Contains(delegateFunc)) | ||
621 | CanRunScriptCheckFunctions.Remove(delegateFunc); | ||
622 | } | ||
623 | |||
624 | public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) | ||
625 | { | ||
626 | foreach (CanRunScript check in CanRunScriptCheckFunctions) | ||
605 | { | 627 | { |
606 | foreach (CanRunScript check in CanRunScriptCheckFunctions) | 628 | if (check(script, objectID, user, m_scene) == false) |
607 | { | 629 | { |
608 | if (check(script, objectID, user, m_scene) == false) | 630 | return false; |
609 | { | ||
610 | return false; | ||
611 | } | ||
612 | } | 631 | } |
613 | return true; | ||
614 | } | 632 | } |
633 | return true; | ||
634 | } | ||
615 | 635 | ||
616 | #endregion | 636 | #endregion |
617 | 637 | ||
618 | #region START SCRIPT (When Script run box is Checked after placed in object) | 638 | #region START SCRIPT (When Script run box is Checked after placed in object) |
619 | public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); | 639 | public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); |
620 | private List<CanStartScript> CanStartScriptCheckFunctions = new List<CanStartScript>(); | 640 | private List<CanStartScript> CanStartScriptCheckFunctions = new List<CanStartScript>(); |
621 | 641 | ||
622 | public void addCheckStartScript(CanStartScript delegateFunc) | 642 | public void addCheckStartScript(CanStartScript delegateFunc) |
623 | { | 643 | { |
624 | if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) | 644 | if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) |
625 | CanStartScriptCheckFunctions.Add(delegateFunc); | 645 | CanStartScriptCheckFunctions.Add(delegateFunc); |
626 | } | 646 | } |
627 | public void removeCheckStartScript(CanStartScript delegateFunc) | ||
628 | { | ||
629 | if (CanStartScriptCheckFunctions.Contains(delegateFunc)) | ||
630 | CanStartScriptCheckFunctions.Remove(delegateFunc); | ||
631 | } | ||
632 | 647 | ||
633 | public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) | 648 | public void removeCheckStartScript(CanStartScript delegateFunc) |
649 | { | ||
650 | if (CanStartScriptCheckFunctions.Contains(delegateFunc)) | ||
651 | CanStartScriptCheckFunctions.Remove(delegateFunc); | ||
652 | } | ||
653 | |||
654 | public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) | ||
655 | { | ||
656 | foreach (CanStartScript check in CanStartScriptCheckFunctions) | ||
634 | { | 657 | { |
635 | foreach (CanStartScript check in CanStartScriptCheckFunctions) | 658 | if (check(script, user, m_scene) == false) |
636 | { | 659 | { |
637 | if (check(script, user, m_scene) == false) | 660 | return false; |
638 | { | ||
639 | return false; | ||
640 | } | ||
641 | } | 661 | } |
642 | return true; | ||
643 | } | 662 | } |
663 | return true; | ||
664 | } | ||
644 | 665 | ||
645 | #endregion | 666 | #endregion |
646 | 667 | ||
647 | #region STOP SCRIPT (When Script run box is unchecked after placed in object) | 668 | #region STOP SCRIPT (When Script run box is unchecked after placed in object) |
648 | public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); | 669 | public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); |
649 | private List<CanStopScript> CanStopScriptCheckFunctions = new List<CanStopScript>(); | 670 | private List<CanStopScript> CanStopScriptCheckFunctions = new List<CanStopScript>(); |
650 | 671 | ||
651 | public void addCheckStopScript(CanStopScript delegateFunc) | 672 | public void addCheckStopScript(CanStopScript delegateFunc) |
652 | { | 673 | { |
653 | if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) | 674 | if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) |
654 | CanStopScriptCheckFunctions.Add(delegateFunc); | 675 | CanStopScriptCheckFunctions.Add(delegateFunc); |
655 | } | 676 | } |
656 | public void removeCheckStopScript(CanStopScript delegateFunc) | ||
657 | { | ||
658 | if (CanStopScriptCheckFunctions.Contains(delegateFunc)) | ||
659 | CanStopScriptCheckFunctions.Remove(delegateFunc); | ||
660 | } | ||
661 | 677 | ||
662 | public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) | 678 | public void removeCheckStopScript(CanStopScript delegateFunc) |
679 | { | ||
680 | if (CanStopScriptCheckFunctions.Contains(delegateFunc)) | ||
681 | CanStopScriptCheckFunctions.Remove(delegateFunc); | ||
682 | } | ||
683 | |||
684 | public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) | ||
685 | { | ||
686 | foreach (CanStopScript check in CanStopScriptCheckFunctions) | ||
663 | { | 687 | { |
664 | foreach (CanStopScript check in CanStopScriptCheckFunctions) | 688 | if (check(script, user, m_scene) == false) |
665 | { | 689 | { |
666 | if (check(script, user, m_scene) == false) | 690 | return false; |
667 | { | ||
668 | return false; | ||
669 | } | ||
670 | } | 691 | } |
671 | return true; | ||
672 | } | 692 | } |
693 | return true; | ||
694 | } | ||
673 | 695 | ||
674 | #endregion | 696 | #endregion |
675 | 697 | ||
676 | #region RESET SCRIPT | 698 | #region RESET SCRIPT |
677 | public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); | 699 | public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); |
678 | private List<CanResetScript> CanResetScriptCheckFunctions = new List<CanResetScript>(); | 700 | private List<CanResetScript> CanResetScriptCheckFunctions = new List<CanResetScript>(); |
679 | 701 | ||
680 | public void addCheckResetScript(CanResetScript delegateFunc) | 702 | public void addCheckResetScript(CanResetScript delegateFunc) |
681 | { | 703 | { |
682 | if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) | 704 | if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) |
683 | CanResetScriptCheckFunctions.Add(delegateFunc); | 705 | CanResetScriptCheckFunctions.Add(delegateFunc); |
684 | } | 706 | } |
685 | public void removeCheckResetScript(CanResetScript delegateFunc) | 707 | |
686 | { | 708 | public void removeCheckResetScript(CanResetScript delegateFunc) |
687 | if (CanResetScriptCheckFunctions.Contains(delegateFunc)) | 709 | { |
688 | CanResetScriptCheckFunctions.Remove(delegateFunc); | 710 | if (CanResetScriptCheckFunctions.Contains(delegateFunc)) |
689 | } | 711 | CanResetScriptCheckFunctions.Remove(delegateFunc); |
712 | } | ||
690 | 713 | ||
691 | public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) | 714 | public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) |
715 | { | ||
716 | foreach (CanResetScript check in CanResetScriptCheckFunctions) | ||
692 | { | 717 | { |
693 | foreach (CanResetScript check in CanResetScriptCheckFunctions) | 718 | if (check(script, user, m_scene) == false) |
694 | { | 719 | { |
695 | if (check(script, user, m_scene) == false) | 720 | return false; |
696 | { | ||
697 | return false; | ||
698 | } | ||
699 | } | 721 | } |
700 | return true; | ||
701 | } | 722 | } |
723 | return true; | ||
724 | } | ||
702 | 725 | ||
703 | #endregion | 726 | #endregion |
704 | 727 | ||
705 | #region TERRAFORM LAND | 728 | #region TERRAFORM LAND |
706 | public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); | 729 | public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); |
707 | private List<CanTerraformLand> CanTerraformLandCheckFunctions = new List<CanTerraformLand>(); | 730 | private List<CanTerraformLand> CanTerraformLandCheckFunctions = new List<CanTerraformLand>(); |
708 | 731 | ||
709 | public void addCheckTerraformLand(CanTerraformLand delegateFunc) | 732 | public void addCheckTerraformLand(CanTerraformLand delegateFunc) |
710 | { | 733 | { |
711 | if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) | 734 | if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) |
712 | CanTerraformLandCheckFunctions.Add(delegateFunc); | 735 | CanTerraformLandCheckFunctions.Add(delegateFunc); |
713 | } | 736 | } |
714 | public void removeCheckTerraformLand(CanTerraformLand delegateFunc) | ||
715 | { | ||
716 | if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) | ||
717 | CanTerraformLandCheckFunctions.Remove(delegateFunc); | ||
718 | } | ||
719 | 737 | ||
720 | public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) | 738 | public void removeCheckTerraformLand(CanTerraformLand delegateFunc) |
739 | { | ||
740 | if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) | ||
741 | CanTerraformLandCheckFunctions.Remove(delegateFunc); | ||
742 | } | ||
743 | |||
744 | public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) | ||
745 | { | ||
746 | foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) | ||
721 | { | 747 | { |
722 | foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) | 748 | if (check(user, pos, m_scene) == false) |
723 | { | 749 | { |
724 | if (check(user, pos, m_scene) == false) | 750 | return false; |
725 | { | ||
726 | return false; | ||
727 | } | ||
728 | } | 751 | } |
729 | return true; | ||
730 | } | 752 | } |
753 | return true; | ||
754 | } | ||
731 | 755 | ||
732 | #endregion | 756 | #endregion |
733 | 757 | ||
734 | #region RUN CONSOLE COMMAND | 758 | #region RUN CONSOLE COMMAND |
735 | public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); | 759 | public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); |
736 | private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>(); | 760 | private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>(); |
737 | 761 | ||
738 | public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) | 762 | public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) |
739 | { | 763 | { |
740 | if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) | 764 | if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) |
741 | CanRunConsoleCommandCheckFunctions.Add(delegateFunc); | 765 | CanRunConsoleCommandCheckFunctions.Add(delegateFunc); |
742 | } | 766 | } |
743 | public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) | ||
744 | { | ||
745 | if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) | ||
746 | CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); | ||
747 | } | ||
748 | 767 | ||
749 | public bool ExternalChecksCanRunConsoleCommand(LLUUID user) | 768 | public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) |
769 | { | ||
770 | if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) | ||
771 | CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); | ||
772 | } | ||
773 | |||
774 | public bool ExternalChecksCanRunConsoleCommand(LLUUID user) | ||
775 | { | ||
776 | foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) | ||
750 | { | 777 | { |
751 | foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) | 778 | if (check(user, m_scene) == false) |
752 | { | 779 | { |
753 | if (check(user, m_scene) == false) | 780 | return false; |
754 | { | ||
755 | return false; | ||
756 | } | ||
757 | } | 781 | } |
758 | return true; | ||
759 | } | 782 | } |
783 | return true; | ||
784 | } | ||
760 | 785 | ||
761 | #endregion | 786 | #endregion |
762 | 787 | ||
763 | #region CAN ISSUE ESTATE COMMAND | 788 | #region CAN ISSUE ESTATE COMMAND |
764 | public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); | 789 | public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); |
765 | private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>(); | 790 | private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>(); |
766 | 791 | ||
767 | public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) | 792 | public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) |
768 | { | 793 | { |
769 | if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) | 794 | if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) |
770 | CanIssueEstateCommandCheckFunctions.Add(delegateFunc); | 795 | CanIssueEstateCommandCheckFunctions.Add(delegateFunc); |
771 | } | 796 | } |
772 | public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) | ||
773 | { | ||
774 | if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) | ||
775 | CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); | ||
776 | } | ||
777 | 797 | ||
778 | public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) | 798 | public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) |
799 | { | ||
800 | if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) | ||
801 | CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); | ||
802 | } | ||
803 | |||
804 | public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) | ||
805 | { | ||
806 | foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) | ||
779 | { | 807 | { |
780 | foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) | 808 | if (check(user, m_scene, ownerCommand) == false) |
781 | { | 809 | { |
782 | if (check(user, m_scene, ownerCommand) == false) | 810 | return false; |
783 | { | ||
784 | return false; | ||
785 | } | ||
786 | } | 811 | } |
787 | return true; | ||
788 | } | 812 | } |
789 | #endregion | 813 | return true; |
814 | } | ||
815 | #endregion | ||
790 | 816 | ||
791 | #region CAN BE GODLIKE | 817 | #region CAN BE GODLIKE |
792 | public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); | 818 | public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); |
793 | private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>(); | 819 | private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>(); |
794 | 820 | ||
795 | public void addCheckBeGodLike(CanBeGodLike delegateFunc) | 821 | public void addCheckBeGodLike(CanBeGodLike delegateFunc) |
796 | { | 822 | { |
797 | if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) | 823 | if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) |
798 | CanBeGodLikeCheckFunctions.Add(delegateFunc); | 824 | CanBeGodLikeCheckFunctions.Add(delegateFunc); |
799 | } | 825 | } |
800 | public void removeCheckBeGodLike(CanBeGodLike delegateFunc) | 826 | |
801 | { | 827 | public void removeCheckBeGodLike(CanBeGodLike delegateFunc) |
802 | if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) | 828 | { |
803 | CanBeGodLikeCheckFunctions.Remove(delegateFunc); | 829 | if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) |
804 | } | 830 | CanBeGodLikeCheckFunctions.Remove(delegateFunc); |
831 | } | ||
805 | 832 | ||
806 | public bool ExternalChecksCanBeGodLike(LLUUID user) | 833 | public bool ExternalChecksCanBeGodLike(LLUUID user) |
834 | { | ||
835 | foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) | ||
807 | { | 836 | { |
808 | foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) | 837 | if (check(user, m_scene) == false) |
809 | { | 838 | { |
810 | if (check(user, m_scene) == false) | 839 | return false; |
811 | { | ||
812 | return false; | ||
813 | } | ||
814 | } | 840 | } |
815 | return true; | ||
816 | } | 841 | } |
817 | #endregion | 842 | return true; |
843 | } | ||
844 | #endregion | ||
818 | 845 | ||
819 | #region EDIT PARCEL | 846 | #region EDIT PARCEL |
820 | public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); | 847 | public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); |
821 | private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>(); | 848 | private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>(); |
822 | 849 | ||
823 | public void addCheckEditParcel(CanEditParcel delegateFunc) | 850 | public void addCheckEditParcel(CanEditParcel delegateFunc) |
824 | { | 851 | { |
825 | if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) | 852 | if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) |
826 | CanEditParcelCheckFunctions.Add(delegateFunc); | 853 | CanEditParcelCheckFunctions.Add(delegateFunc); |
827 | } | 854 | } |
828 | public void removeCheckEditParcel(CanEditParcel delegateFunc) | 855 | |
829 | { | 856 | public void removeCheckEditParcel(CanEditParcel delegateFunc) |
830 | if (CanEditParcelCheckFunctions.Contains(delegateFunc)) | 857 | { |
831 | CanEditParcelCheckFunctions.Remove(delegateFunc); | 858 | if (CanEditParcelCheckFunctions.Contains(delegateFunc)) |
832 | } | 859 | CanEditParcelCheckFunctions.Remove(delegateFunc); |
860 | } | ||
833 | 861 | ||
834 | public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) | 862 | public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) |
863 | { | ||
864 | foreach (CanEditParcel check in CanEditParcelCheckFunctions) | ||
835 | { | 865 | { |
836 | foreach (CanEditParcel check in CanEditParcelCheckFunctions) | 866 | if (check(user, parcel, m_scene) == false) |
837 | { | 867 | { |
838 | if (check(user, parcel, m_scene) == false) | 868 | return false; |
839 | { | ||
840 | return false; | ||
841 | } | ||
842 | } | 869 | } |
843 | return true; | ||
844 | } | 870 | } |
845 | #endregion | 871 | return true; |
872 | } | ||
873 | #endregion | ||
846 | 874 | ||
847 | #region SELL PARCEL | 875 | #region SELL PARCEL |
848 | public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); | 876 | public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); |
849 | private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>(); | 877 | private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>(); |
850 | 878 | ||
851 | public void addCheckSellParcel(CanSellParcel delegateFunc) | 879 | public void addCheckSellParcel(CanSellParcel delegateFunc) |
852 | { | 880 | { |
853 | if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) | 881 | if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) |
854 | CanSellParcelCheckFunctions.Add(delegateFunc); | 882 | CanSellParcelCheckFunctions.Add(delegateFunc); |
855 | } | 883 | } |
856 | public void removeCheckSellParcel(CanSellParcel delegateFunc) | 884 | |
857 | { | 885 | public void removeCheckSellParcel(CanSellParcel delegateFunc) |
858 | if (CanSellParcelCheckFunctions.Contains(delegateFunc)) | 886 | { |
859 | CanSellParcelCheckFunctions.Remove(delegateFunc); | 887 | if (CanSellParcelCheckFunctions.Contains(delegateFunc)) |
860 | } | 888 | CanSellParcelCheckFunctions.Remove(delegateFunc); |
889 | } | ||
861 | 890 | ||
862 | public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) | 891 | public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) |
892 | { | ||
893 | foreach (CanSellParcel check in CanSellParcelCheckFunctions) | ||
863 | { | 894 | { |
864 | foreach (CanSellParcel check in CanSellParcelCheckFunctions) | 895 | if (check(user, parcel, m_scene) == false) |
865 | { | 896 | { |
866 | if (check(user, parcel, m_scene) == false) | 897 | return false; |
867 | { | ||
868 | return false; | ||
869 | } | ||
870 | } | 898 | } |
871 | return true; | ||
872 | } | 899 | } |
873 | #endregion | 900 | return true; |
901 | } | ||
902 | #endregion | ||
874 | 903 | ||
875 | #region ABANDON PARCEL | 904 | #region ABANDON PARCEL |
876 | public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); | 905 | public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); |
877 | private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>(); | 906 | private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>(); |
878 | 907 | ||
879 | public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) | 908 | public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) |
880 | { | 909 | { |
881 | if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) | 910 | if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) |
882 | CanAbandonParcelCheckFunctions.Add(delegateFunc); | 911 | CanAbandonParcelCheckFunctions.Add(delegateFunc); |
883 | } | 912 | } |
884 | public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) | ||
885 | { | ||
886 | if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) | ||
887 | CanAbandonParcelCheckFunctions.Remove(delegateFunc); | ||
888 | } | ||
889 | 913 | ||
890 | public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) | 914 | public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) |
915 | { | ||
916 | if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) | ||
917 | CanAbandonParcelCheckFunctions.Remove(delegateFunc); | ||
918 | } | ||
919 | |||
920 | public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) | ||
921 | { | ||
922 | foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) | ||
891 | { | 923 | { |
892 | foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) | 924 | if (check(user, parcel, m_scene) == false) |
893 | { | 925 | { |
894 | if (check(user, parcel, m_scene) == false) | 926 | return false; |
895 | { | ||
896 | return false; | ||
897 | } | ||
898 | } | 927 | } |
899 | return true; | ||
900 | } | 928 | } |
901 | #endregion | 929 | return true; |
930 | } | ||
931 | #endregion | ||
902 | 932 | ||
903 | public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); | 933 | public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); |
904 | private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>(); | 934 | private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>(); |
905 | 935 | ||
906 | public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) | 936 | public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) |
907 | { | 937 | { |
908 | if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) | 938 | if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) |
909 | CanReclaimParcelCheckFunctions.Add(delegateFunc); | 939 | CanReclaimParcelCheckFunctions.Add(delegateFunc); |
910 | } | 940 | } |
911 | public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) | ||
912 | { | ||
913 | if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) | ||
914 | CanReclaimParcelCheckFunctions.Remove(delegateFunc); | ||
915 | } | ||
916 | 941 | ||
917 | public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) | 942 | public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) |
943 | { | ||
944 | if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) | ||
945 | CanReclaimParcelCheckFunctions.Remove(delegateFunc); | ||
946 | } | ||
947 | |||
948 | public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) | ||
949 | { | ||
950 | foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) | ||
918 | { | 951 | { |
919 | foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) | 952 | if (check(user, parcel, m_scene) == false) |
920 | { | 953 | { |
921 | if (check(user, parcel, m_scene) == false) | 954 | return false; |
922 | { | ||
923 | return false; | ||
924 | } | ||
925 | } | 955 | } |
926 | return true; | ||
927 | } | 956 | } |
928 | public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); | 957 | return true; |
929 | private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>(); | 958 | } |
959 | public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); | ||
960 | private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>(); | ||
930 | 961 | ||
931 | public void addCheckCanBuyLand(CanBuyLand delegateFunc) | 962 | public void addCheckCanBuyLand(CanBuyLand delegateFunc) |
932 | { | 963 | { |
933 | if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) | 964 | if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) |
934 | CanBuyLandCheckFunctions.Add(delegateFunc); | 965 | CanBuyLandCheckFunctions.Add(delegateFunc); |
935 | } | 966 | } |
936 | public void removeCheckCanBuyLand(CanBuyLand delegateFunc) | ||
937 | { | ||
938 | if (CanBuyLandCheckFunctions.Contains(delegateFunc)) | ||
939 | CanBuyLandCheckFunctions.Remove(delegateFunc); | ||
940 | } | ||
941 | 967 | ||
942 | public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) | 968 | public void removeCheckCanBuyLand(CanBuyLand delegateFunc) |
969 | { | ||
970 | if (CanBuyLandCheckFunctions.Contains(delegateFunc)) | ||
971 | CanBuyLandCheckFunctions.Remove(delegateFunc); | ||
972 | } | ||
973 | |||
974 | public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) | ||
975 | { | ||
976 | foreach (CanBuyLand check in CanBuyLandCheckFunctions) | ||
943 | { | 977 | { |
944 | foreach (CanBuyLand check in CanBuyLandCheckFunctions) | 978 | if (check(user, parcel, m_scene) == false) |
945 | { | 979 | { |
946 | if (check(user, parcel, m_scene) == false) | 980 | return false; |
947 | { | ||
948 | return false; | ||
949 | } | ||
950 | } | 981 | } |
951 | return true; | ||
952 | } | 982 | } |
983 | return true; | ||
984 | } | ||
953 | 985 | ||
954 | public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); | 986 | public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); |
955 | private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>(); | 987 | private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>(); |
956 | 988 | ||
957 | public void addCheckCanLinkObject(CanLinkObject delegateFunc) | 989 | public void addCheckCanLinkObject(CanLinkObject delegateFunc) |
958 | { | 990 | { |
959 | if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) | 991 | if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) |
960 | CanLinkObjectCheckFunctions.Add(delegateFunc); | 992 | CanLinkObjectCheckFunctions.Add(delegateFunc); |
961 | } | 993 | } |
962 | public void removeCheckCanLinkObject(CanLinkObject delegateFunc) | 994 | |
963 | { | 995 | public void removeCheckCanLinkObject(CanLinkObject delegateFunc) |
964 | if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) | 996 | { |
965 | CanLinkObjectCheckFunctions.Remove(delegateFunc); | 997 | if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) |
966 | } | 998 | CanLinkObjectCheckFunctions.Remove(delegateFunc); |
999 | } | ||
967 | 1000 | ||
968 | public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) | 1001 | public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) |
969 | { | 1002 | { |
970 | foreach (CanLinkObject check in CanLinkObjectCheckFunctions) | 1003 | foreach (CanLinkObject check in CanLinkObjectCheckFunctions) |
971 | { | 1004 | { |
@@ -977,137 +1010,141 @@ namespace OpenSim.Region.Environment.Scenes | |||
977 | return true; | 1010 | return true; |
978 | } | 1011 | } |
979 | 1012 | ||
980 | public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); | 1013 | public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); |
981 | private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>(); | 1014 | private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>(); |
982 | 1015 | ||
983 | public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) | 1016 | public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) |
984 | { | 1017 | { |
985 | if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) | 1018 | if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) |
986 | CanDelinkObjectCheckFunctions.Add(delegateFunc); | 1019 | CanDelinkObjectCheckFunctions.Add(delegateFunc); |
987 | } | 1020 | } |
988 | public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) | 1021 | |
989 | { | 1022 | public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) |
990 | if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) | 1023 | { |
991 | CanDelinkObjectCheckFunctions.Remove(delegateFunc); | 1024 | if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) |
992 | } | 1025 | CanDelinkObjectCheckFunctions.Remove(delegateFunc); |
1026 | } | ||
993 | 1027 | ||
994 | public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) | 1028 | public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) |
1029 | { | ||
1030 | foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) | ||
995 | { | 1031 | { |
996 | foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) | 1032 | if (check(user, objectID) == false) |
997 | { | 1033 | { |
998 | if (check(user, objectID) == false) | 1034 | return false; |
999 | { | ||
1000 | return false; | ||
1001 | } | ||
1002 | } | 1035 | } |
1003 | return true; | ||
1004 | } | 1036 | } |
1037 | return true; | ||
1038 | } | ||
1005 | 1039 | ||
1006 | #endregion | 1040 | #endregion |
1007 | 1041 | ||
1008 | public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); | 1042 | public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); |
1009 | private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>(); | 1043 | private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>(); |
1010 | 1044 | ||
1011 | public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) | 1045 | public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) |
1012 | { | 1046 | { |
1013 | if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) | 1047 | if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) |
1014 | CanCreateInventoryCheckFunctions.Add(delegateFunc); | 1048 | CanCreateInventoryCheckFunctions.Add(delegateFunc); |
1015 | } | 1049 | } |
1016 | public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) | ||
1017 | { | ||
1018 | if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) | ||
1019 | CanCreateInventoryCheckFunctions.Remove(delegateFunc); | ||
1020 | } | ||
1021 | 1050 | ||
1022 | public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) | 1051 | public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) |
1052 | { | ||
1053 | if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) | ||
1054 | CanCreateInventoryCheckFunctions.Remove(delegateFunc); | ||
1055 | } | ||
1056 | |||
1057 | public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) | ||
1058 | { | ||
1059 | foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) | ||
1023 | { | 1060 | { |
1024 | foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) | 1061 | if (check(invType, objectID, userID) == false) |
1025 | { | 1062 | { |
1026 | if (check(invType, objectID, userID) == false) | 1063 | return false; |
1027 | { | ||
1028 | return false; | ||
1029 | } | ||
1030 | } | 1064 | } |
1031 | return true; | ||
1032 | } | 1065 | } |
1066 | return true; | ||
1067 | } | ||
1033 | 1068 | ||
1034 | public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); | 1069 | public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); |
1035 | private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>(); | 1070 | private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>(); |
1036 | 1071 | ||
1037 | public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) | 1072 | public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) |
1038 | { | 1073 | { |
1039 | if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) | 1074 | if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) |
1040 | CanCopyInventoryCheckFunctions.Add(delegateFunc); | 1075 | CanCopyInventoryCheckFunctions.Add(delegateFunc); |
1041 | } | 1076 | } |
1042 | public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) | 1077 | |
1043 | { | 1078 | public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) |
1044 | if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) | 1079 | { |
1045 | CanCopyInventoryCheckFunctions.Remove(delegateFunc); | 1080 | if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) |
1046 | } | 1081 | CanCopyInventoryCheckFunctions.Remove(delegateFunc); |
1082 | } | ||
1047 | 1083 | ||
1048 | public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | 1084 | public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) |
1085 | { | ||
1086 | foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) | ||
1049 | { | 1087 | { |
1050 | foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) | 1088 | if (check(itemID, objectID, userID) == false) |
1051 | { | 1089 | { |
1052 | if (check(itemID, objectID, userID) == false) | 1090 | return false; |
1053 | { | ||
1054 | return false; | ||
1055 | } | ||
1056 | } | 1091 | } |
1057 | return true; | ||
1058 | } | 1092 | } |
1093 | return true; | ||
1094 | } | ||
1059 | 1095 | ||
1060 | public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); | 1096 | public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); |
1061 | private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>(); | 1097 | private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>(); |
1062 | 1098 | ||
1063 | public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) | 1099 | public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) |
1064 | { | 1100 | { |
1065 | if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) | 1101 | if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) |
1066 | CanDeleteInventoryCheckFunctions.Add(delegateFunc); | 1102 | CanDeleteInventoryCheckFunctions.Add(delegateFunc); |
1067 | } | 1103 | } |
1068 | public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) | ||
1069 | { | ||
1070 | if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) | ||
1071 | CanDeleteInventoryCheckFunctions.Remove(delegateFunc); | ||
1072 | } | ||
1073 | 1104 | ||
1074 | public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | 1105 | public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) |
1106 | { | ||
1107 | if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) | ||
1108 | CanDeleteInventoryCheckFunctions.Remove(delegateFunc); | ||
1109 | } | ||
1110 | |||
1111 | public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | ||
1112 | { | ||
1113 | foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) | ||
1075 | { | 1114 | { |
1076 | foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) | 1115 | if (check(itemID, objectID, userID) == false) |
1077 | { | 1116 | { |
1078 | if (check(itemID, objectID, userID) == false) | 1117 | return false; |
1079 | { | ||
1080 | return false; | ||
1081 | } | ||
1082 | } | 1118 | } |
1083 | return true; | ||
1084 | } | 1119 | } |
1120 | return true; | ||
1121 | } | ||
1085 | 1122 | ||
1086 | public delegate bool CanTeleport(LLUUID userID); | 1123 | public delegate bool CanTeleport(LLUUID userID); |
1087 | private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>(); | 1124 | private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>(); |
1088 | 1125 | ||
1089 | public void addCheckCanTeleport(CanTeleport delegateFunc) | 1126 | public void addCheckCanTeleport(CanTeleport delegateFunc) |
1090 | { | 1127 | { |
1091 | if (!CanTeleportCheckFunctions.Contains(delegateFunc)) | 1128 | if (!CanTeleportCheckFunctions.Contains(delegateFunc)) |
1092 | CanTeleportCheckFunctions.Add(delegateFunc); | 1129 | CanTeleportCheckFunctions.Add(delegateFunc); |
1093 | } | 1130 | } |
1094 | public void removeCheckCanTeleport(CanTeleport delegateFunc) | ||
1095 | { | ||
1096 | if (CanTeleportCheckFunctions.Contains(delegateFunc)) | ||
1097 | CanTeleportCheckFunctions.Remove(delegateFunc); | ||
1098 | } | ||
1099 | 1131 | ||
1100 | public bool ExternalChecksCanTeleport(LLUUID userID) | 1132 | public void removeCheckCanTeleport(CanTeleport delegateFunc) |
1133 | { | ||
1134 | if (CanTeleportCheckFunctions.Contains(delegateFunc)) | ||
1135 | CanTeleportCheckFunctions.Remove(delegateFunc); | ||
1136 | } | ||
1137 | |||
1138 | public bool ExternalChecksCanTeleport(LLUUID userID) | ||
1139 | { | ||
1140 | foreach (CanTeleport check in CanTeleportCheckFunctions) | ||
1101 | { | 1141 | { |
1102 | foreach (CanTeleport check in CanTeleportCheckFunctions) | 1142 | if (check(userID) == false) |
1103 | { | 1143 | { |
1104 | if (check(userID) == false) | 1144 | return false; |
1105 | { | ||
1106 | return false; | ||
1107 | } | ||
1108 | } | 1145 | } |
1109 | return true; | ||
1110 | } | 1146 | } |
1147 | return true; | ||
1148 | } | ||
1111 | } | 1149 | } |
1112 | } | 1150 | } |
1113 | |||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index cc4891f..032d673 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
41 | /// <summary> | 41 | /// <summary> |
42 | /// Force all task inventories of prims in the scene object to persist | 42 | /// Force all task inventories of prims in the scene object to persist |
43 | /// </summary> | 43 | /// </summary> |
44 | public void ForceInventoryPersistence() | 44 | public void ForceInventoryPersistence() |
45 | { | 45 | { |
@@ -49,9 +49,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
49 | { | 49 | { |
50 | part.ForceInventoryPersistence(); | 50 | part.ForceInventoryPersistence(); |
51 | } | 51 | } |
52 | } | 52 | } |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Start the scripts contained in all the prims in this group. | 56 | /// Start the scripts contained in all the prims in this group. |
57 | /// </summary> | 57 | /// </summary> |
@@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
161 | // taskItem.SalePrice = item.SalePrice; | 161 | // taskItem.SalePrice = item.SalePrice; |
162 | // taskItem.SaleType = item.SaleType; | 162 | // taskItem.SaleType = item.SaleType; |
163 | taskItem.CreationDate = (uint)item.CreationDate; | 163 | taskItem.CreationDate = (uint)item.CreationDate; |
164 | 164 | ||
165 | part.AddInventoryItem(taskItem); | 165 | part.AddInventoryItem(taskItem); |
166 | 166 | ||
167 | return true; | 167 | return true; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2a1b8c5..9c3d6a7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
94 | /// since the group's last persistent backup | 94 | /// since the group's last persistent backup |
95 | /// </summary> | 95 | /// </summary> |
96 | public bool HasGroupChanged = false; | 96 | public bool HasGroupChanged = false; |
97 | 97 | ||
98 | public float scriptScore = 0f; | 98 | public float scriptScore = 0f; |
99 | 99 | ||
100 | private LLVector3 lastPhysGroupPos; | 100 | private LLVector3 lastPhysGroupPos; |
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
115 | private bool m_scriptListens_notAtTarget = false; | 115 | private bool m_scriptListens_notAtTarget = false; |
116 | 116 | ||
117 | #region Properties | 117 | #region Properties |
118 | 118 | ||
119 | /// <summary> | 119 | /// <summary> |
120 | /// The name of an object grouping is always the same as its root part | 120 | /// The name of an object grouping is always the same as its root part |
121 | /// </summary> | 121 | /// </summary> |
@@ -123,7 +123,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
123 | { | 123 | { |
124 | get { return RootPart.Name; } | 124 | get { return RootPart.Name; } |
125 | set { RootPart.Name = value; } | 125 | set { RootPart.Name = value; } |
126 | } | 126 | } |
127 | 127 | ||
128 | /// <summary> | 128 | /// <summary> |
129 | /// Added because the Parcel code seems to use it | 129 | /// Added because the Parcel code seems to use it |
@@ -445,13 +445,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
445 | } | 445 | } |
446 | more = !reader.EOF; | 446 | more = !reader.EOF; |
447 | } | 447 | } |
448 | 448 | ||
449 | reader.Close(); | 449 | reader.Close(); |
450 | sr.Close(); | 450 | sr.Close(); |
451 | 451 | ||
452 | UpdateParentIDs(); | 452 | UpdateParentIDs(); |
453 | } | 453 | } |
454 | 454 | ||
455 | /// <summary> | 455 | /// <summary> |
456 | /// | 456 | /// |
457 | /// </summary> | 457 | /// </summary> |
@@ -468,14 +468,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
468 | newPart.LinkNum = 0; | 468 | newPart.LinkNum = 0; |
469 | m_parts.Add(newPart.UUID, newPart); | 469 | m_parts.Add(newPart.UUID, newPart); |
470 | SetPartAsRoot(newPart); | 470 | SetPartAsRoot(newPart); |
471 | 471 | ||
472 | // one of these is a proxy. | 472 | // one of these is a proxy. |
473 | if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) | 473 | if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) |
474 | AttachToBackup(); | 474 | AttachToBackup(); |
475 | 475 | ||
476 | //ApplyPhysics(scene.m_physicalPrim); | 476 | //ApplyPhysics(scene.m_physicalPrim); |
477 | } | 477 | } |
478 | 478 | ||
479 | /// <summary> | 479 | /// <summary> |
480 | /// | 480 | /// |
481 | /// </summary> | 481 | /// </summary> |
@@ -754,7 +754,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
754 | m_rootPart.ScheduleFullUpdate(); | 754 | m_rootPart.ScheduleFullUpdate(); |
755 | m_rootPart.ClearUndoState(); | 755 | m_rootPart.ClearUndoState(); |
756 | } | 756 | } |
757 | 757 | ||
758 | public void DetachToInventoryPrep() | 758 | public void DetachToInventoryPrep() |
759 | { | 759 | { |
760 | ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); | 760 | ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); |
@@ -873,11 +873,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
873 | return m_scene.MaxUndoCount; | 873 | return m_scene.MaxUndoCount; |
874 | return 5; | 874 | return 5; |
875 | } | 875 | } |
876 | 876 | ||
877 | // justincc: I don't believe this hack is needed any longer, especially since the physics | 877 | // justincc: I don't believe this hack is needed any longer, especially since the physics |
878 | // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false | 878 | // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false |
879 | // this method was preventing proper reload of scene objects. | 879 | // this method was preventing proper reload of scene objects. |
880 | // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects | 880 | // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects |
881 | // at region startup | 881 | // at region startup |
882 | public void ResetChildPrimPhysicsPositions() | 882 | public void ResetChildPrimPhysicsPositions() |
883 | { | 883 | { |
@@ -926,20 +926,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
926 | /// </summary> | 926 | /// </summary> |
927 | public void DeleteGroup() | 927 | public void DeleteGroup() |
928 | { | 928 | { |
929 | // We need to keep track of this state in case this group is still queued for backup. | 929 | // We need to keep track of this state in case this group is still queued for backup. |
930 | // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race | 930 | // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race |
931 | // conditions where a user deletes an entity while it is being stored. Really, the update | 931 | // conditions where a user deletes an entity while it is being stored. Really, the update |
932 | // code needs a redesign. | 932 | // code needs a redesign. |
933 | m_isDeleted = true; | 933 | m_isDeleted = true; |
934 | 934 | ||
935 | DetachFromBackup(this); | 935 | DetachFromBackup(this); |
936 | 936 | ||
937 | lock (m_parts) | 937 | lock (m_parts) |
938 | { | 938 | { |
939 | foreach (SceneObjectPart part in m_parts.Values) | 939 | foreach (SceneObjectPart part in m_parts.Values) |
940 | { | 940 | { |
941 | part.RemoveScriptInstances(); | 941 | part.RemoveScriptInstances(); |
942 | 942 | ||
943 | List<ScenePresence> avatars = Scene.GetScenePresences(); | 943 | List<ScenePresence> avatars = Scene.GetScenePresences(); |
944 | for (int i = 0; i < avatars.Count; i++) | 944 | for (int i = 0; i < avatars.Count; i++) |
945 | { | 945 | { |
@@ -951,12 +951,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
951 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | 951 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); |
952 | } | 952 | } |
953 | } | 953 | } |
954 | 954 | ||
955 | m_rootPart = null; | 955 | m_rootPart = null; |
956 | m_parts.Clear(); | 956 | m_parts.Clear(); |
957 | } | 957 | } |
958 | } | 958 | } |
959 | 959 | ||
960 | public void FakeDeleteGroup() | 960 | public void FakeDeleteGroup() |
961 | { | 961 | { |
962 | foreach (SceneObjectPart part in m_parts.Values) | 962 | foreach (SceneObjectPart part in m_parts.Values) |
@@ -1034,7 +1034,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1034 | lock (m_targets) | 1034 | lock (m_targets) |
1035 | m_targets.Clear(); | 1035 | m_targets.Clear(); |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | ScheduleGroupForFullUpdate(); | 1038 | ScheduleGroupForFullUpdate(); |
1039 | } | 1039 | } |
1040 | 1040 | ||
@@ -1067,7 +1067,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1067 | { | 1067 | { |
1068 | part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); | 1068 | part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | // Hack to get the physics scene geometries in the right spot | 1071 | // Hack to get the physics scene geometries in the right spot |
1072 | ResetChildPrimPhysicsPositions(); | 1072 | ResetChildPrimPhysicsPositions(); |
1073 | } | 1073 | } |
@@ -1102,14 +1102,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1102 | /// </summary> | 1102 | /// </summary> |
1103 | /// <param name="datastore"></param> | 1103 | /// <param name="datastore"></param> |
1104 | public void ProcessBackup(IRegionDataStore datastore) | 1104 | public void ProcessBackup(IRegionDataStore datastore) |
1105 | { | 1105 | { |
1106 | if (HasGroupChanged) | 1106 | if (HasGroupChanged) |
1107 | { | 1107 | { |
1108 | // don't backup while it's selected or you're asking for changes mid stream. | 1108 | // don't backup while it's selected or you're asking for changes mid stream. |
1109 | if ((!IsSelected) && (RootPart != null)) | 1109 | if ((!IsSelected) && (RootPart != null)) |
1110 | { | 1110 | { |
1111 | m_log.InfoFormat( | 1111 | m_log.InfoFormat( |
1112 | "[SCENE]: Storing object {0}, {1} in {2}", | 1112 | "[SCENE]: Storing object {0}, {1} in {2}", |
1113 | Name, UUID, m_scene.RegionInfo.RegionName); | 1113 | Name, UUID, m_scene.RegionInfo.RegionName); |
1114 | 1114 | ||
1115 | SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); | 1115 | SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); |
@@ -1236,7 +1236,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1236 | 1236 | ||
1237 | dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); | 1237 | dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); |
1238 | } | 1238 | } |
1239 | 1239 | ||
1240 | // Now we've made a copy that replaces this one, we need to | 1240 | // Now we've made a copy that replaces this one, we need to |
1241 | // switch the owner to the person who did the copying | 1241 | // switch the owner to the person who did the copying |
1242 | // Second Life copies an object and duplicates the first one in it's place | 1242 | // Second Life copies an object and duplicates the first one in it's place |
@@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1267 | dupe.UpdateParentIDs(); | 1267 | dupe.UpdateParentIDs(); |
1268 | dupe.HasGroupChanged = true; | 1268 | dupe.HasGroupChanged = true; |
1269 | dupe.AttachToBackup(); | 1269 | dupe.AttachToBackup(); |
1270 | 1270 | ||
1271 | ScheduleGroupForFullUpdate(); | 1271 | ScheduleGroupForFullUpdate(); |
1272 | } | 1272 | } |
1273 | 1273 | ||
@@ -1673,7 +1673,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1673 | { | 1673 | { |
1674 | return true; | 1674 | return true; |
1675 | } | 1675 | } |
1676 | 1676 | ||
1677 | return false; | 1677 | return false; |
1678 | } | 1678 | } |
1679 | 1679 | ||
@@ -1695,7 +1695,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1695 | } | 1695 | } |
1696 | } | 1696 | } |
1697 | } | 1697 | } |
1698 | 1698 | ||
1699 | return false; | 1699 | return false; |
1700 | } | 1700 | } |
1701 | 1701 | ||
@@ -2042,7 +2042,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2042 | public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) | 2042 | public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) |
2043 | { | 2043 | { |
2044 | SceneObjectPart selectionPart = GetChildPart(localID); | 2044 | SceneObjectPart selectionPart = GetChildPart(localID); |
2045 | 2045 | ||
2046 | if (selectionPart != null) | 2046 | if (selectionPart != null) |
2047 | { | 2047 | { |
2048 | lock (m_parts) | 2048 | lock (m_parts) |
@@ -2164,7 +2164,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2164 | m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); | 2164 | m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); |
2165 | } | 2165 | } |
2166 | //if (part.UUID != m_rootPart.UUID) | 2166 | //if (part.UUID != m_rootPart.UUID) |
2167 | 2167 | ||
2168 | HasGroupChanged = true; | 2168 | HasGroupChanged = true; |
2169 | ScheduleGroupForFullUpdate(); | 2169 | ScheduleGroupForFullUpdate(); |
2170 | 2170 | ||
@@ -2332,10 +2332,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2332 | } | 2332 | } |
2333 | 2333 | ||
2334 | AbsolutePosition = pos; | 2334 | AbsolutePosition = pos; |
2335 | 2335 | ||
2336 | HasGroupChanged = true; | 2336 | HasGroupChanged = true; |
2337 | } | 2337 | } |
2338 | 2338 | ||
2339 | //we need to do a terse update even if the move wasn't allowed | 2339 | //we need to do a terse update even if the move wasn't allowed |
2340 | // so that the position is reset in the client (the object snaps back) | 2340 | // so that the position is reset in the client (the object snaps back) |
2341 | ScheduleGroupForTerseUpdate(); | 2341 | ScheduleGroupForTerseUpdate(); |
@@ -2349,7 +2349,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2349 | public void UpdateSinglePosition(LLVector3 pos, uint localID) | 2349 | public void UpdateSinglePosition(LLVector3 pos, uint localID) |
2350 | { | 2350 | { |
2351 | SceneObjectPart part = GetChildPart(localID); | 2351 | SceneObjectPart part = GetChildPart(localID); |
2352 | 2352 | ||
2353 | if (part != null) | 2353 | if (part != null) |
2354 | { | 2354 | { |
2355 | if (part.UUID == m_rootPart.UUID) | 2355 | if (part.UUID == m_rootPart.UUID) |
@@ -2360,7 +2360,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2360 | { | 2360 | { |
2361 | part.UpdateOffSet(pos); | 2361 | part.UpdateOffSet(pos); |
2362 | } | 2362 | } |
2363 | 2363 | ||
2364 | HasGroupChanged = true; | 2364 | HasGroupChanged = true; |
2365 | } | 2365 | } |
2366 | } | 2366 | } |
@@ -2398,7 +2398,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2398 | } | 2398 | } |
2399 | 2399 | ||
2400 | AbsolutePosition = newPos; | 2400 | AbsolutePosition = newPos; |
2401 | 2401 | ||
2402 | HasGroupChanged = true; | 2402 | HasGroupChanged = true; |
2403 | ScheduleGroupForTerseUpdate(); | 2403 | ScheduleGroupForTerseUpdate(); |
2404 | } | 2404 | } |
@@ -2426,7 +2426,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2426 | m_rootPart.RotationOffset.Z); | 2426 | m_rootPart.RotationOffset.Z); |
2427 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 2427 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); |
2428 | } | 2428 | } |
2429 | 2429 | ||
2430 | HasGroupChanged = true; | 2430 | HasGroupChanged = true; |
2431 | ScheduleGroupForTerseUpdate(); | 2431 | ScheduleGroupForTerseUpdate(); |
2432 | } | 2432 | } |
@@ -2447,7 +2447,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2447 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 2447 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); |
2448 | } | 2448 | } |
2449 | AbsolutePosition = pos; | 2449 | AbsolutePosition = pos; |
2450 | 2450 | ||
2451 | HasGroupChanged = true; | 2451 | HasGroupChanged = true; |
2452 | ScheduleGroupForTerseUpdate(); | 2452 | ScheduleGroupForTerseUpdate(); |
2453 | } | 2453 | } |
@@ -2684,7 +2684,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2684 | } | 2684 | } |
2685 | } | 2685 | } |
2686 | } | 2686 | } |
2687 | 2687 | ||
2688 | /// <summary> | 2688 | /// <summary> |
2689 | /// Set the user group to which this scene object belongs. | 2689 | /// Set the user group to which this scene object belongs. |
2690 | /// </summary> | 2690 | /// </summary> |
@@ -2698,10 +2698,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2698 | { | 2698 | { |
2699 | part.SetGroup(GroupID, client); | 2699 | part.SetGroup(GroupID, client); |
2700 | } | 2700 | } |
2701 | 2701 | ||
2702 | HasGroupChanged = true; | 2702 | HasGroupChanged = true; |
2703 | } | 2703 | } |
2704 | 2704 | ||
2705 | ScheduleGroupForFullUpdate(); | 2705 | ScheduleGroupForFullUpdate(); |
2706 | } | 2706 | } |
2707 | 2707 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 480c030..0ac20e2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
43 | 43 | ||
44 | private string m_inventoryFileName = String.Empty; | 44 | private string m_inventoryFileName = String.Empty; |
45 | private int m_inventoryFileNameSerial = 0; | 45 | private int m_inventoryFileNameSerial = 0; |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Serial count for inventory file , used to tell if inventory has changed | 48 | /// Serial count for inventory file , used to tell if inventory has changed |
49 | /// no need for this to be part of Database backup | 49 | /// no need for this to be part of Database backup |
@@ -53,13 +53,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Holds in memory prim inventory | 54 | /// Holds in memory prim inventory |
55 | /// </summary> | 55 | /// </summary> |
56 | protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); | 56 | protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Tracks whether inventory has changed since the last persistent backup | 59 | /// Tracks whether inventory has changed since the last persistent backup |
60 | /// </summary> | 60 | /// </summary> |
61 | protected bool HasInventoryChanged; | 61 | protected bool HasInventoryChanged; |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Force the task inventory of this prim to persist at the next update sweep | 64 | /// Force the task inventory of this prim to persist at the next update sweep |
65 | /// </summary> | 65 | /// </summary> |
@@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
308 | { | 308 | { |
309 | if (i.InvType == (int)InventoryType.LSL) | 309 | if (i.InvType == (int)InventoryType.LSL) |
310 | RemoveScriptInstance(i.ItemID); | 310 | RemoveScriptInstance(i.ItemID); |
311 | 311 | ||
312 | RemoveInventoryItem(i.ItemID); | 312 | RemoveInventoryItem(i.ItemID); |
313 | break; | 313 | break; |
314 | } | 314 | } |
@@ -316,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
316 | 316 | ||
317 | AddInventoryItem(item.Name, item); | 317 | AddInventoryItem(item.Name, item); |
318 | } | 318 | } |
319 | 319 | ||
320 | /// <summary> | 320 | /// <summary> |
321 | /// Add an item to this prim's inventory. | 321 | /// Add an item to this prim's inventory. |
322 | /// </summary> | 322 | /// </summary> |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
329 | { | 329 | { |
330 | item.ParentID = UUID; | 330 | item.ParentID = UUID; |
331 | item.ParentPartID = UUID; | 331 | item.ParentPartID = UUID; |
332 | 332 | ||
333 | lock (m_taskInventory) | 333 | lock (m_taskInventory) |
334 | { | 334 | { |
335 | m_taskInventory.Add(item.ItemID, item); | 335 | m_taskInventory.Add(item.ItemID, item); |
@@ -339,7 +339,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
339 | m_inventorySerial++; | 339 | m_inventorySerial++; |
340 | //m_inventorySerial += 2; | 340 | //m_inventorySerial += 2; |
341 | HasInventoryChanged = true; | 341 | HasInventoryChanged = true; |
342 | ParentGroup.HasGroupChanged = true; | 342 | ParentGroup.HasGroupChanged = true; |
343 | } | 343 | } |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
@@ -369,10 +369,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
369 | /// <param name="itemID"></param> | 369 | /// <param name="itemID"></param> |
370 | /// <returns>null if the item does not exist</returns> | 370 | /// <returns>null if the item does not exist</returns> |
371 | public TaskInventoryItem GetInventoryItem(LLUUID itemId) | 371 | public TaskInventoryItem GetInventoryItem(LLUUID itemId) |
372 | { | 372 | { |
373 | TaskInventoryItem item; | 373 | TaskInventoryItem item; |
374 | m_taskInventory.TryGetValue(itemId, out item); | 374 | m_taskInventory.TryGetValue(itemId, out item); |
375 | 375 | ||
376 | return item; | 376 | return item; |
377 | } | 377 | } |
378 | 378 | ||
@@ -450,12 +450,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
450 | } | 450 | } |
451 | 451 | ||
452 | } | 452 | } |
453 | 453 | ||
454 | if (scriptcount <= 0) | 454 | if (scriptcount <= 0) |
455 | { | 455 | { |
456 | RemFlag(LLObject.ObjectFlags.Scripted); | 456 | RemFlag(LLObject.ObjectFlags.Scripted); |
457 | } | 457 | } |
458 | 458 | ||
459 | ScheduleFullUpdate(); | 459 | ScheduleFullUpdate(); |
460 | 460 | ||
461 | return type; | 461 | return type; |
@@ -603,7 +603,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
603 | public void ProcessInventoryBackup(IRegionDataStore datastore) | 603 | public void ProcessInventoryBackup(IRegionDataStore datastore) |
604 | { | 604 | { |
605 | if (HasInventoryChanged) | 605 | if (HasInventoryChanged) |
606 | { | 606 | { |
607 | lock (TaskInventory) | 607 | lock (TaskInventory) |
608 | { | 608 | { |
609 | datastore.StorePrimInventory(UUID, TaskInventory.Values); | 609 | datastore.StorePrimInventory(UUID, TaskInventory.Values); |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 1432912..517114f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
141 | public uint AttachmentPoint = (byte)0; | 141 | public uint AttachmentPoint = (byte)0; |
142 | [XmlIgnore] | 142 | [XmlIgnore] |
143 | public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); | 143 | public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); |
144 | 144 | ||
145 | [XmlIgnore] | 145 | [XmlIgnore] |
146 | public bool Undoing = false; | 146 | public bool Undoing = false; |
147 | 147 | ||
@@ -196,11 +196,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
196 | protected LLVector3 m_velocity; | 196 | protected LLVector3 m_velocity; |
197 | 197 | ||
198 | // TODO: Those have to be changed into persistent properties at some later point, | 198 | // TODO: Those have to be changed into persistent properties at some later point, |
199 | // or sit-camera on vehicles will break on sim-crossing. | 199 | // or sit-camera on vehicles will break on sim-crossing. |
200 | private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); | 200 | private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); |
201 | private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); | 201 | private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); |
202 | private bool m_forceMouselook = false; | 202 | private bool m_forceMouselook = false; |
203 | 203 | ||
204 | #endregion Fields | 204 | #endregion Fields |
205 | 205 | ||
206 | #region Constructors | 206 | #region Constructors |
@@ -352,13 +352,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
352 | private uint _everyoneMask = (uint)PermissionMask.None; | 352 | private uint _everyoneMask = (uint)PermissionMask.None; |
353 | private uint _nextOwnerMask = (uint)PermissionMask.All; | 353 | private uint _nextOwnerMask = (uint)PermissionMask.All; |
354 | private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; | 354 | private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; |
355 | 355 | ||
356 | public LLUUID CreatorID { | 356 | public LLUUID CreatorID { |
357 | get | 357 | get |
358 | { | 358 | { |
359 | return _creatorID; | 359 | return _creatorID; |
360 | } | 360 | } |
361 | set | 361 | set |
362 | { | 362 | { |
363 | _creatorID = value; | 363 | _creatorID = value; |
364 | } | 364 | } |
@@ -390,26 +390,26 @@ namespace OpenSim.Region.Environment.Scenes | |||
390 | { | 390 | { |
391 | get { return (uint)_flags; } | 391 | get { return (uint)_flags; } |
392 | set { _flags = (LLObject.ObjectFlags)value; } | 392 | set { _flags = (LLObject.ObjectFlags)value; } |
393 | } | 393 | } |
394 | 394 | ||
395 | public LLUUID UUID | 395 | public LLUUID UUID |
396 | { | 396 | { |
397 | get { return m_uuid; } | 397 | get { return m_uuid; } |
398 | set { m_uuid = value; } | 398 | set { m_uuid = value; } |
399 | } | 399 | } |
400 | 400 | ||
401 | public uint LocalId | 401 | public uint LocalId |
402 | { | 402 | { |
403 | get { return m_localId; } | 403 | get { return m_localId; } |
404 | set { m_localId = value; } | 404 | set { m_localId = value; } |
405 | } | 405 | } |
406 | 406 | ||
407 | public virtual string Name | 407 | public virtual string Name |
408 | { | 408 | { |
409 | get { return m_name; } | 409 | get { return m_name; } |
410 | set { m_name = value; } | 410 | set { m_name = value; } |
411 | } | 411 | } |
412 | 412 | ||
413 | public byte Material | 413 | public byte Material |
414 | { | 414 | { |
415 | get { return (byte) m_material; } | 415 | get { return (byte) m_material; } |
@@ -607,13 +607,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
607 | /// <summary></summary> | 607 | /// <summary></summary> |
608 | public LLVector3 AngularVelocity | 608 | public LLVector3 AngularVelocity |
609 | { | 609 | { |
610 | get | 610 | get |
611 | { | 611 | { |
612 | if ((PhysActor != null) && PhysActor.IsPhysical) | 612 | if ((PhysActor != null) && PhysActor.IsPhysical) |
613 | { | 613 | { |
614 | m_angularVelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(), 0); | 614 | m_angularVelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(), 0); |
615 | } | 615 | } |
616 | return m_angularVelocity; | 616 | return m_angularVelocity; |
617 | } | 617 | } |
618 | set { m_angularVelocity = value; } | 618 | set { m_angularVelocity = value; } |
619 | } | 619 | } |
@@ -631,7 +631,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
631 | get { return m_description; } | 631 | get { return m_description; } |
632 | set { m_description = value; } | 632 | set { m_description = value; } |
633 | } | 633 | } |
634 | 634 | ||
635 | public Color Color | 635 | public Color Color |
636 | { | 636 | { |
637 | get { return m_color; } | 637 | get { return m_color; } |
@@ -702,7 +702,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
702 | // set of attributes on shape change. For instance, | 702 | // set of attributes on shape change. For instance, |
703 | // changing the lighting on a shape shouldn't cause | 703 | // changing the lighting on a shape shouldn't cause |
704 | // this. | 704 | // this. |
705 | if (m_shape != null) | 705 | if (m_shape != null) |
706 | shape_changed = true; | 706 | shape_changed = true; |
707 | 707 | ||
708 | m_shape = value; | 708 | m_shape = value; |
@@ -740,7 +740,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
740 | } | 740 | } |
741 | 741 | ||
742 | #endregion | 742 | #endregion |
743 | 743 | ||
744 | //--------------- | 744 | //--------------- |
745 | 745 | ||
746 | 746 | ||
@@ -771,7 +771,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
771 | get { return m_parentGroup; } | 771 | get { return m_parentGroup; } |
772 | } | 772 | } |
773 | 773 | ||
774 | 774 | ||
775 | 775 | ||
776 | public scriptEvents ScriptEvents | 776 | public scriptEvents ScriptEvents |
777 | { | 777 | { |
@@ -802,8 +802,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
802 | 802 | ||
803 | public LLQuaternion SitTargetOrientationLL | 803 | public LLQuaternion SitTargetOrientationLL |
804 | { | 804 | { |
805 | get | 805 | get |
806 | { | 806 | { |
807 | return new LLQuaternion( | 807 | return new LLQuaternion( |
808 | m_sitTargetOrientation.x, | 808 | m_sitTargetOrientation.x, |
809 | m_sitTargetOrientation.y, | 809 | m_sitTargetOrientation.y, |
@@ -830,97 +830,97 @@ namespace OpenSim.Region.Environment.Scenes | |||
830 | } | 830 | } |
831 | } | 831 | } |
832 | 832 | ||
833 | public uint ParentID | 833 | public uint ParentID |
834 | { | 834 | { |
835 | get { return _parentID; } | 835 | get { return _parentID; } |
836 | set { _parentID = value; } | 836 | set { _parentID = value; } |
837 | } | 837 | } |
838 | 838 | ||
839 | public int CreationDate | 839 | public int CreationDate |
840 | { | 840 | { |
841 | get { return _creationDate; } | 841 | get { return _creationDate; } |
842 | set { _creationDate = value; } | 842 | set { _creationDate = value; } |
843 | } | 843 | } |
844 | 844 | ||
845 | public uint Category | 845 | public uint Category |
846 | { | 846 | { |
847 | get { return _category; } | 847 | get { return _category; } |
848 | set { _category = value; } | 848 | set { _category = value; } |
849 | } | 849 | } |
850 | 850 | ||
851 | public int SalePrice | 851 | public int SalePrice |
852 | { | 852 | { |
853 | get { return _salePrice; } | 853 | get { return _salePrice; } |
854 | set { _salePrice = value; } | 854 | set { _salePrice = value; } |
855 | } | 855 | } |
856 | 856 | ||
857 | public byte ObjectSaleType | 857 | public byte ObjectSaleType |
858 | { | 858 | { |
859 | get { return _objectSaleType; } | 859 | get { return _objectSaleType; } |
860 | set { _objectSaleType = value; } | 860 | set { _objectSaleType = value; } |
861 | } | 861 | } |
862 | 862 | ||
863 | public int OwnershipCost | 863 | public int OwnershipCost |
864 | { | 864 | { |
865 | get { return _ownershipCost; } | 865 | get { return _ownershipCost; } |
866 | set { _ownershipCost = value; } | 866 | set { _ownershipCost = value; } |
867 | } | 867 | } |
868 | 868 | ||
869 | public LLUUID GroupID | 869 | public LLUUID GroupID |
870 | { | 870 | { |
871 | get { return _groupID; } | 871 | get { return _groupID; } |
872 | set { _groupID = value; } | 872 | set { _groupID = value; } |
873 | } | 873 | } |
874 | 874 | ||
875 | public LLUUID OwnerID | 875 | public LLUUID OwnerID |
876 | { | 876 | { |
877 | get { return _ownerID; } | 877 | get { return _ownerID; } |
878 | set { _ownerID = value; } | 878 | set { _ownerID = value; } |
879 | } | 879 | } |
880 | 880 | ||
881 | public LLUUID LastOwnerID | 881 | public LLUUID LastOwnerID |
882 | { | 882 | { |
883 | get { return _lastOwnerID; } | 883 | get { return _lastOwnerID; } |
884 | set { _lastOwnerID = value; } | 884 | set { _lastOwnerID = value; } |
885 | } | 885 | } |
886 | 886 | ||
887 | public uint BaseMask | 887 | public uint BaseMask |
888 | { | 888 | { |
889 | get { return _baseMask; } | 889 | get { return _baseMask; } |
890 | set { _baseMask = value; } | 890 | set { _baseMask = value; } |
891 | } | 891 | } |
892 | 892 | ||
893 | public uint OwnerMask | 893 | public uint OwnerMask |
894 | { | 894 | { |
895 | get { return _ownerMask; } | 895 | get { return _ownerMask; } |
896 | set { _ownerMask = value; } | 896 | set { _ownerMask = value; } |
897 | } | 897 | } |
898 | 898 | ||
899 | public uint GroupMask | 899 | public uint GroupMask |
900 | { | 900 | { |
901 | get { return _groupMask; } | 901 | get { return _groupMask; } |
902 | set { _groupMask = value; } | 902 | set { _groupMask = value; } |
903 | } | 903 | } |
904 | 904 | ||
905 | public uint EveryoneMask | 905 | public uint EveryoneMask |
906 | { | 906 | { |
907 | get { return _everyoneMask; } | 907 | get { return _everyoneMask; } |
908 | set { _everyoneMask = value; } | 908 | set { _everyoneMask = value; } |
909 | } | 909 | } |
910 | 910 | ||
911 | public uint NextOwnerMask | 911 | public uint NextOwnerMask |
912 | { | 912 | { |
913 | get { return _nextOwnerMask; } | 913 | get { return _nextOwnerMask; } |
914 | set { _nextOwnerMask = value; } | 914 | set { _nextOwnerMask = value; } |
915 | } | 915 | } |
916 | 916 | ||
917 | public libsecondlife.LLObject.ObjectFlags Flags | 917 | public libsecondlife.LLObject.ObjectFlags Flags |
918 | { | 918 | { |
919 | get { return _flags; } | 919 | get { return _flags; } |
920 | set { _flags = value; } | 920 | set { _flags = value; } |
921 | } | 921 | } |
922 | 922 | ||
923 | public LLUUID SitTargetAvatar | 923 | public LLUUID SitTargetAvatar |
924 | { | 924 | { |
925 | get { return m_sitTargetAvatar; } | 925 | get { return m_sitTargetAvatar; } |
926 | set { m_sitTargetAvatar = value; } | 926 | set { m_sitTargetAvatar = value; } |
@@ -929,8 +929,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
929 | [XmlIgnore] | 929 | [XmlIgnore] |
930 | public virtual LLUUID RegionID | 930 | public virtual LLUUID RegionID |
931 | { | 931 | { |
932 | get | 932 | get |
933 | { | 933 | { |
934 | if (ParentGroup != null && ParentGroup.Scene != null) | 934 | if (ParentGroup != null && ParentGroup.Scene != null) |
935 | return ParentGroup.Scene.RegionInfo.RegionID; | 935 | return ParentGroup.Scene.RegionInfo.RegionID; |
936 | else | 936 | else |
@@ -943,9 +943,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
943 | [XmlIgnore] | 943 | [XmlIgnore] |
944 | public LLUUID ParentUUID | 944 | public LLUUID ParentUUID |
945 | { | 945 | { |
946 | get | 946 | get |
947 | { | 947 | { |
948 | if (ParentGroup != null) | 948 | if (ParentGroup != null) |
949 | { | 949 | { |
950 | _parentUUID = ParentGroup.UUID; | 950 | _parentUUID = ParentGroup.UUID; |
951 | } | 951 | } |
@@ -953,7 +953,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
953 | } | 953 | } |
954 | set { _parentUUID = value; } | 954 | set { _parentUUID = value; } |
955 | } | 955 | } |
956 | 956 | ||
957 | #endregion Public Properties with only Get | 957 | #endregion Public Properties with only Get |
958 | 958 | ||
959 | #region Private Methods | 959 | #region Private Methods |
@@ -2460,7 +2460,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2460 | return; | 2460 | return; |
2461 | } | 2461 | } |
2462 | } | 2462 | } |
2463 | 2463 | ||
2464 | 2464 | ||
2465 | 2465 | ||
2466 | if (m_parentGroup.GetSceneMaxUndo() > 0) | 2466 | if (m_parentGroup.GetSceneMaxUndo() > 0) |
@@ -2914,7 +2914,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2914 | ScaleOffset = Math.Abs(ScaleOffset); | 2914 | ScaleOffset = Math.Abs(ScaleOffset); |
2915 | Vector3 offset = returnresult.normal * ScaleOffset; | 2915 | Vector3 offset = returnresult.normal * ScaleOffset; |
2916 | returnresult.ipoint = AXpos + offset; | 2916 | returnresult.ipoint = AXpos + offset; |
2917 | 2917 | ||
2918 | ///pos = (intersectionpoint + offset); | 2918 | ///pos = (intersectionpoint + offset); |
2919 | } | 2919 | } |
2920 | else | 2920 | else |
@@ -3354,27 +3354,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
3354 | public void SetCameraAtOffset(LLVector3 v) { | 3354 | public void SetCameraAtOffset(LLVector3 v) { |
3355 | m_cameraAtOffset = v; | 3355 | m_cameraAtOffset = v; |
3356 | } | 3356 | } |
3357 | 3357 | ||
3358 | public void SetCameraEyeOffset(LLVector3 v) { | 3358 | public void SetCameraEyeOffset(LLVector3 v) { |
3359 | m_cameraEyeOffset = v; | 3359 | m_cameraEyeOffset = v; |
3360 | } | 3360 | } |
3361 | 3361 | ||
3362 | public void SetForceMouselook(bool force) { | 3362 | public void SetForceMouselook(bool force) { |
3363 | m_forceMouselook = force; | 3363 | m_forceMouselook = force; |
3364 | } | 3364 | } |
3365 | 3365 | ||
3366 | public LLVector3 GetCameraAtOffset() { | 3366 | public LLVector3 GetCameraAtOffset() { |
3367 | return m_cameraAtOffset; | 3367 | return m_cameraAtOffset; |
3368 | } | 3368 | } |
3369 | 3369 | ||
3370 | public LLVector3 GetCameraEyeOffset() { | 3370 | public LLVector3 GetCameraEyeOffset() { |
3371 | return m_cameraEyeOffset; | 3371 | return m_cameraEyeOffset; |
3372 | } | 3372 | } |
3373 | 3373 | ||
3374 | public bool GetForceMouselook() { | 3374 | public bool GetForceMouselook() { |
3375 | return m_forceMouselook; | 3375 | return m_forceMouselook; |
3376 | } | 3376 | } |
3377 | 3377 | ||
3378 | #endregion Public Methods | 3378 | #endregion Public Methods |
3379 | } | 3379 | } |
3380 | } | 3380 | } |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index cad2496..5669af6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1198,7 +1198,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1198 | RemoveFromPhysicalScene(); | 1198 | RemoveFromPhysicalScene(); |
1199 | } | 1199 | } |
1200 | } | 1200 | } |
1201 | 1201 | ||
1202 | cameraAtOffset = part.GetCameraAtOffset(); | 1202 | cameraAtOffset = part.GetCameraAtOffset(); |
1203 | cameraEyeOffset = part.GetCameraEyeOffset(); | 1203 | cameraEyeOffset = part.GetCameraEyeOffset(); |
1204 | forceMouselook = part.GetForceMouselook(); | 1204 | forceMouselook = part.GetForceMouselook(); |
@@ -1347,7 +1347,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1347 | 1347 | ||
1348 | RemoveAnimation(animID); | 1348 | RemoveAnimation(animID); |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | public LLUUID[] GetAnimationArray() | 1351 | public LLUUID[] GetAnimationArray() |
1352 | { | 1352 | { |
1353 | LLUUID[] animIDs; | 1353 | LLUUID[] animIDs; |
@@ -1696,7 +1696,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1696 | 1696 | ||
1697 | 1697 | ||
1698 | /// <summary> | 1698 | /// <summary> |
1699 | /// Do everything required once a client completes its movement into a region | 1699 | /// Do everything required once a client completes its movement into a region |
1700 | /// </summary> | 1700 | /// </summary> |
1701 | public void SendInitialData() | 1701 | public void SendInitialData() |
1702 | { | 1702 | { |
@@ -1898,7 +1898,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1898 | { | 1898 | { |
1899 | if (IsChildAgent) | 1899 | if (IsChildAgent) |
1900 | return; | 1900 | return; |
1901 | 1901 | ||
1902 | LLVector3 pos2 = AbsolutePosition; | 1902 | LLVector3 pos2 = AbsolutePosition; |
1903 | LLVector3 vel = Velocity; | 1903 | LLVector3 vel = Velocity; |
1904 | 1904 | ||
@@ -1968,9 +1968,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1968 | // This means we need to remove the current caps handler here and possibly compensate later, | 1968 | // This means we need to remove the current caps handler here and possibly compensate later, |
1969 | // in case both scenes are being hosted on the same region server. Messy | 1969 | // in case both scenes are being hosted on the same region server. Messy |
1970 | m_scene.RemoveCapsHandler(UUID); | 1970 | m_scene.RemoveCapsHandler(UUID); |
1971 | newpos = newpos + (vel); | 1971 | newpos = newpos + (vel); |
1972 | 1972 | ||
1973 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); | 1973 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); |
1974 | if (userInfo != null) | 1974 | if (userInfo != null) |
1975 | { | 1975 | { |
1976 | userInfo.DropInventory(); | 1976 | userInfo.DropInventory(); |
@@ -1978,11 +1978,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1978 | else | 1978 | else |
1979 | { | 1979 | { |
1980 | m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); | 1980 | m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); |
1981 | } | 1981 | } |
1982 | 1982 | ||
1983 | bool crossingSuccessful = | 1983 | bool crossingSuccessful = |
1984 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, | 1984 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, |
1985 | m_physicsActor.Flying); | 1985 | m_physicsActor.Flying); |
1986 | if (crossingSuccessful) | 1986 | if (crossingSuccessful) |
1987 | { | 1987 | { |
1988 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | 1988 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); |
@@ -1998,8 +1998,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1998 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, | 1998 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, |
1999 | capsPath); | 1999 | capsPath); |
2000 | MakeChildAgent(); | 2000 | MakeChildAgent(); |
2001 | CrossAttachmentsIntoNewRegion(neighbourHandle); | 2001 | CrossAttachmentsIntoNewRegion(neighbourHandle); |
2002 | 2002 | ||
2003 | m_scene.SendKillObject(m_localId); | 2003 | m_scene.SendKillObject(m_localId); |
2004 | m_scene.NotifyMyCoarseLocationChange(); | 2004 | m_scene.NotifyMyCoarseLocationChange(); |
2005 | // the user may change thier profile information in other region, | 2005 | // the user may change thier profile information in other region, |
@@ -2010,7 +2010,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2010 | else | 2010 | else |
2011 | { | 2011 | { |
2012 | // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing | 2012 | // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing |
2013 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); | 2013 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); |
2014 | m_scene.AddCapsHandler(UUID); | 2014 | m_scene.AddCapsHandler(UUID); |
2015 | } | 2015 | } |
2016 | } | 2016 | } |
@@ -2825,7 +2825,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2825 | } | 2825 | } |
2826 | } | 2826 | } |
2827 | } | 2827 | } |
2828 | 2828 | ||
2829 | LastCommands = allflags; | 2829 | LastCommands = allflags; |
2830 | } | 2830 | } |
2831 | 2831 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index f46aba4..0e551cb 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | |||
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
126 | m_report.Interval = statsUpdatesEveryMS; | 126 | m_report.Interval = statsUpdatesEveryMS; |
127 | m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); | 127 | m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); |
128 | m_report.Enabled = true; | 128 | m_report.Enabled = true; |
129 | 129 | ||
130 | if (StatsManager.SimExtraStats != null) | 130 | if (StatsManager.SimExtraStats != null) |
131 | OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; | 131 | OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; |
132 | } | 132 | } |
diff --git a/OpenSim/Region/Environment/Scenes/UndoState.cs b/OpenSim/Region/Environment/Scenes/UndoState.cs index 5d1f6a0..fdbfa8c 100644 --- a/OpenSim/Region/Environment/Scenes/UndoState.cs +++ b/OpenSim/Region/Environment/Scenes/UndoState.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
41 | Rotation = rot; | 41 | Rotation = rot; |
42 | Scale = scale; | 42 | Scale = scale; |
43 | } | 43 | } |
44 | 44 | ||
45 | public UndoState(SceneObjectPart part) | 45 | public UndoState(SceneObjectPart part) |
46 | { | 46 | { |
47 | if (part != null) | 47 | if (part != null) |
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
50 | { | 50 | { |
51 | Position = part.AbsolutePosition; | 51 | Position = part.AbsolutePosition; |
52 | Rotation = part.RotationOffset; | 52 | Rotation = part.RotationOffset; |
53 | 53 | ||
54 | } | 54 | } |
55 | else | 55 | else |
56 | { | 56 | { |
@@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
90 | if (part != null) | 90 | if (part != null) |
91 | { | 91 | { |
92 | part.Undoing = true; | 92 | part.Undoing = true; |
93 | 93 | ||
94 | if (part.ParentID == 0) | 94 | if (part.ParentID == 0) |
95 | { | 95 | { |
96 | part.ParentGroup.AbsolutePosition = Position; | 96 | part.ParentGroup.AbsolutePosition = Position; |
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
105 | part.ScheduleTerseUpdate(); | 105 | part.ScheduleTerseUpdate(); |
106 | } | 106 | } |
107 | part.Undoing = false; | 107 | part.Undoing = false; |
108 | 108 | ||
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index d83bba6..16636e0 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs | |||
@@ -49,7 +49,6 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
49 | 49 | ||
50 | public RotatingWheel() | 50 | public RotatingWheel() |
51 | { | 51 | { |
52 | |||
53 | } | 52 | } |
54 | 53 | ||
55 | public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, | 54 | public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, |
@@ -78,7 +77,6 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
78 | 77 | ||
79 | public ComplexObject() | 78 | public ComplexObject() |
80 | { | 79 | { |
81 | |||
82 | } | 80 | } |
83 | 81 | ||
84 | public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) | 82 | public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) |
diff --git a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs index 6a18091..e7d5db8 100644 --- a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
59 | { | 59 | { |
60 | float cpu = m_counter.NextValue()/40f; | 60 | float cpu = m_counter.NextValue()/40f; |
61 | LLVector3 size = new LLVector3(cpu, cpu, cpu); | 61 | LLVector3 size = new LLVector3(cpu, cpu, cpu); |
62 | 62 | ||
63 | RootPart.Resize(size); | 63 | RootPart.Resize(size); |
64 | 64 | ||
65 | base.UpdateMovement(); | 65 | base.UpdateMovement(); |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 213f1d4..3bf0956 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
70 | public BasicScene() | 70 | public BasicScene() |
71 | { | 71 | { |
72 | } | 72 | } |
73 | 73 | ||
74 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | 74 | public override void Initialise(IMesher meshmerizer, IConfigSource config) |
75 | { | 75 | { |
76 | // Does nothing right now | 76 | // Does nothing right now |
diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/Physics/Manager/IMesher.cs index 48e4ba6..0042c40 100644 --- a/OpenSim/Region/Physics/Manager/IMesher.cs +++ b/OpenSim/Region/Physics/Manager/IMesher.cs | |||
@@ -48,6 +48,5 @@ namespace OpenSim.Region.Physics.Manager | |||
48 | int[] getIndexListAsIntLocked(); | 48 | int[] getIndexListAsIntLocked(); |
49 | float[] getVertexListAsFloatLocked(); | 49 | float[] getVertexListAsFloatLocked(); |
50 | void releasePinned(); | 50 | void releasePinned(); |
51 | |||
52 | } | 51 | } |
53 | } | 52 | } |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index beca4da..d4af271 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -209,10 +209,8 @@ namespace OpenSim.Region.Physics.Manager | |||
209 | public override bool Stopped | 209 | public override bool Stopped |
210 | { | 210 | { |
211 | get{ return false; } | 211 | get{ return false; } |
212 | |||
213 | } | 212 | } |
214 | 213 | ||
215 | |||
216 | public override PhysicsVector Position | 214 | public override PhysicsVector Position |
217 | { | 215 | { |
218 | get { return PhysicsVector.Zero; } | 216 | get { return PhysicsVector.Zero; } |
diff --git a/OpenSim/Region/Physics/Meshing/Extruder.cs b/OpenSim/Region/Physics/Meshing/Extruder.cs index b14deeb..0c94669 100644 --- a/OpenSim/Region/Physics/Meshing/Extruder.cs +++ b/OpenSim/Region/Physics/Meshing/Extruder.cs | |||
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
286 | // It's not quite clear what pushY (Y top shear) does, but subtracting it from the start and end | 286 | // It's not quite clear what pushY (Y top shear) does, but subtracting it from the start and end |
287 | // angles appears to approximate it's effects on path cut. Likewise, adding it to the angle used | 287 | // angles appears to approximate it's effects on path cut. Likewise, adding it to the angle used |
288 | // to calculate the sine for generating the path radius appears to approximate it's effects there | 288 | // to calculate the sine for generating the path radius appears to approximate it's effects there |
289 | // too, but there are some subtle differences in the radius which are noticeable as the prim size | 289 | // too, but there are some subtle differences in the radius which are noticeable as the prim size |
290 | // increases and it may affect megaprims quite a bit. The effect of the Y top shear parameter on | 290 | // increases and it may affect megaprims quite a bit. The effect of the Y top shear parameter on |
291 | // the meshes generated with this technique appear nearly identical in shape to the same prims when | 291 | // the meshes generated with this technique appear nearly identical in shape to the same prims when |
292 | // displayed by the viewer. | 292 | // displayed by the viewer. |
@@ -369,28 +369,26 @@ namespace OpenSim.Region.Physics.Meshing | |||
369 | float yOffset; | 369 | float yOffset; |
370 | float zOffset; | 370 | float zOffset; |
371 | 371 | ||
372 | |||
373 | xOffset = 0.5f * (skewStart + totalSkew * (float)percentOfPath); | 372 | xOffset = 0.5f * (skewStart + totalSkew * (float)percentOfPath); |
374 | xOffset += (float) System.Math.Sin(angle) * pushX * 0.45f; | 373 | xOffset += (float) System.Math.Sin(angle) * pushX * 0.45f; |
375 | yOffset = (float)(System.Math.Cos(angle) * (0.5f - yPathScale)) * radiusScale; | 374 | yOffset = (float)(System.Math.Cos(angle) * (0.5f - yPathScale)) * radiusScale; |
376 | zOffset = (float)(System.Math.Sin(angle + pushY * 0.9f) * (0.5f - yPathScale)) * radiusScale; | 375 | zOffset = (float)(System.Math.Sin(angle + pushY * 0.9f) * (0.5f - yPathScale)) * radiusScale; |
377 | 376 | ||
378 | 377 | // next apply twist rotation to the profile layer | |
379 | // next apply twist rotation to the profile layer | 378 | if (twistTotal != 0.0f || twistBot != 0.0f) |
380 | if (twistTotal != 0.0f || twistBot != 0.0f) | 379 | { |
380 | Quaternion profileRot = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist); | ||
381 | foreach (Vertex v in newLayer.vertices) | ||
381 | { | 382 | { |
382 | Quaternion profileRot = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist); | 383 | if (v != null) |
383 | foreach (Vertex v in newLayer.vertices) | ||
384 | { | 384 | { |
385 | if (v != null) | 385 | vTemp = v * profileRot; |
386 | { | 386 | v.X = vTemp.X; |
387 | vTemp = v * profileRot; | 387 | v.Y = vTemp.Y; |
388 | v.X = vTemp.X; | 388 | v.Z = vTemp.Z; |
389 | v.Y = vTemp.Y; | ||
390 | v.Z = vTemp.Z; | ||
391 | } | ||
392 | } | 389 | } |
393 | } | 390 | } |
391 | } | ||
394 | 392 | ||
395 | // now orient the rotation of the profile layer relative to it's position on the path | 393 | // now orient the rotation of the profile layer relative to it's position on the path |
396 | // adding pushY to the angle used to generate the quat appears to approximate the viewer | 394 | // adding pushY to the angle used to generate the quat appears to approximate the viewer |
diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/Physics/Meshing/HelperTypes.cs index 816b6bb..2cb8d04 100644 --- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs +++ b/OpenSim/Region/Physics/Meshing/HelperTypes.cs | |||
@@ -118,7 +118,7 @@ public class Vertex : PhysicsVector, IComparable<Vertex> | |||
118 | { | 118 | { |
119 | return new Vertex(Y * v.Z - Z * v.Y, Z * v.X - X * v.Z, X * v.Y - Y * v.X); | 119 | return new Vertex(Y * v.Z - Z * v.Y, Z * v.X - X * v.Z, X * v.Y - Y * v.X); |
120 | } | 120 | } |
121 | 121 | ||
122 | // disable warning: mono compiler moans about overloading | 122 | // disable warning: mono compiler moans about overloading |
123 | // operators hiding base operator but should not according to C# | 123 | // operators hiding base operator but should not according to C# |
124 | // language spec | 124 | // language spec |
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index f041aec..a038dc2 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -941,7 +941,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
941 | extr.twistBot = (float)primShape.PathTwistBegin * (float)Math.PI * 0.01f; | 941 | extr.twistBot = (float)primShape.PathTwistBegin * (float)Math.PI * 0.01f; |
942 | extr.pathBegin = primShape.PathBegin; | 942 | extr.pathBegin = primShape.PathBegin; |
943 | extr.pathEnd = primShape.PathEnd; | 943 | extr.pathEnd = primShape.PathEnd; |
944 | 944 | ||
945 | //System.Console.WriteLine("[MESH]: twistTop = " + twistTop.ToString() + "|" + extr.twistTop.ToString() + ", twistMid = " + twistMid.ToString() + "|" + extr.twistMid.ToString() + ", twistbot = " + twistBot.ToString() + "|" + extr.twistBot.ToString()); | 945 | //System.Console.WriteLine("[MESH]: twistTop = " + twistTop.ToString() + "|" + extr.twistTop.ToString() + ", twistMid = " + twistMid.ToString() + "|" + extr.twistMid.ToString() + ", twistbot = " + twistBot.ToString() + "|" + extr.twistBot.ToString()); |
946 | //Mesh result = extr.Extrude(m); | 946 | //Mesh result = extr.Extrude(m); |
947 | Mesh result = extr.ExtrudeLinearPath(m); | 947 | Mesh result = extr.ExtrudeLinearPath(m); |
@@ -1340,7 +1340,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1340 | } | 1340 | } |
1341 | 1341 | ||
1342 | /// <summary> | 1342 | /// <summary> |
1343 | /// Creates a mesh for prim types torus, ring, tube, and sphere | 1343 | /// Creates a mesh for prim types torus, ring, tube, and sphere |
1344 | /// </summary> | 1344 | /// </summary> |
1345 | /// <param name="primName"></param> | 1345 | /// <param name="primName"></param> |
1346 | /// <param name="primShape"></param> | 1346 | /// <param name="primShape"></param> |
@@ -1655,7 +1655,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1655 | 1655 | ||
1656 | // Vertex vTemp = new Vertex(0.0f, 0.0f, 0.0f); | 1656 | // Vertex vTemp = new Vertex(0.0f, 0.0f, 0.0f); |
1657 | 1657 | ||
1658 | 1658 | ||
1659 | float skew = primShape.PathSkew * 0.01f; | 1659 | float skew = primShape.PathSkew * 0.01f; |
1660 | float pathScaleX = (float)(200 - primShape.PathScaleX) * 0.01f; | 1660 | float pathScaleX = (float)(200 - primShape.PathScaleX) * 0.01f; |
1661 | float pathScaleY = (float)(200 - primShape.PathScaleY) * 0.01f; | 1661 | float pathScaleY = (float)(200 - primShape.PathScaleY) * 0.01f; |
@@ -1700,7 +1700,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1700 | //System.Console.WriteLine("primShape.PathTaperX: " + primShape.PathTaperX.ToString()); | 1700 | //System.Console.WriteLine("primShape.PathTaperX: " + primShape.PathTaperX.ToString()); |
1701 | //System.Console.WriteLine("primShape.PathTaperY: " + primShape.PathTaperY.ToString()); | 1701 | //System.Console.WriteLine("primShape.PathTaperY: " + primShape.PathTaperY.ToString()); |
1702 | 1702 | ||
1703 | 1703 | ||
1704 | //System.Console.WriteLine("primShape.PathRadiusOffset: " + primShape.PathRadiusOffset.ToString()); | 1704 | //System.Console.WriteLine("primShape.PathRadiusOffset: " + primShape.PathRadiusOffset.ToString()); |
1705 | #endif | 1705 | #endif |
1706 | 1706 | ||
@@ -1875,7 +1875,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1875 | 1875 | ||
1876 | if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0) | 1876 | if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0) |
1877 | { | 1877 | { |
1878 | 1878 | ||
1879 | SculptMesh smesh = CreateSculptMesh(primName, primShape, size, lod); | 1879 | SculptMesh smesh = CreateSculptMesh(primName, primShape, size, lod); |
1880 | mesh = (Mesh)smesh; | 1880 | mesh = (Mesh)smesh; |
1881 | CalcNormals(mesh); | 1881 | CalcNormals(mesh); |
@@ -1967,7 +1967,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1967 | float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; | 1967 | float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; |
1968 | float pathBegin = (float)primShape.PathBegin * 2.0e-5f; | 1968 | float pathBegin = (float)primShape.PathBegin * 2.0e-5f; |
1969 | float pathEnd = 1.0f - (float)primShape.PathEnd * 2.0e-5f; | 1969 | float pathEnd = 1.0f - (float)primShape.PathEnd * 2.0e-5f; |
1970 | 1970 | ||
1971 | float profileBegin = (float)primShape.ProfileBegin * 2.0e-5f; | 1971 | float profileBegin = (float)primShape.ProfileBegin * 2.0e-5f; |
1972 | float profileEnd = 1.0f - (float)primShape.ProfileEnd * 2.0e-5f; | 1972 | float profileEnd = 1.0f - (float)primShape.ProfileEnd * 2.0e-5f; |
1973 | 1973 | ||
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index 95a244d..1c3153a 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
52 | { | 52 | { |
53 | if (_lod == 2f || _lod == 4f || _lod == 8f || _lod == 16f || _lod == 32f || _lod == 64f) | 53 | if (_lod == 2f || _lod == 4f || _lod == 8f || _lod == 16f || _lod == 32f || _lod == 64f) |
54 | lod = (int)_lod; | 54 | lod = (int)_lod; |
55 | 55 | ||
56 | try | 56 | try |
57 | { | 57 | { |
58 | idata = OpenJPEG.DecodeToImage(jpegData); | 58 | idata = OpenJPEG.DecodeToImage(jpegData); |
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | } | 85 | } |
86 | private Vertex ColorToVertex(Color input) | 86 | private Vertex ColorToVertex(Color input) |
87 | { | 87 | { |
@@ -225,7 +225,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
225 | // Create a vertex position from the RGB channels in the current pixel | 225 | // Create a vertex position from the RGB channels in the current pixel |
226 | // int ypos = y * bLOD.Width; | 226 | // int ypos = y * bLOD.Width; |
227 | 227 | ||
228 | 228 | ||
229 | if (y == 0) | 229 | if (y == 0) |
230 | { | 230 | { |
231 | v1 = northpole; | 231 | v1 = northpole; |
@@ -291,7 +291,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
291 | Add(tri2); | 291 | Add(tri2); |
292 | } | 292 | } |
293 | } | 293 | } |
294 | 294 | ||
295 | } | 295 | } |
296 | //Vertex vt31 = sVertices[(y * x_max + x)]; | 296 | //Vertex vt31 = sVertices[(y * x_max + x)]; |
297 | //Vertex vt32 = sVertices[(y * x_max + 0)]; | 297 | //Vertex vt32 = sVertices[(y * x_max + 0)]; |
@@ -311,7 +311,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
311 | //Add(tri3); | 311 | //Add(tri3); |
312 | // } | 312 | // } |
313 | //} | 313 | //} |
314 | 314 | ||
315 | //Vertex vt41 = sVertices[(y * x_max + x)]; | 315 | //Vertex vt41 = sVertices[(y * x_max + x)]; |
316 | //Vertex vt42 = sVertices[((y + 1) * x_max + 0)]; | 316 | //Vertex vt42 = sVertices[((y + 1) * x_max + 0)]; |
317 | //Vertex vt43 = sVertices[((y + 1) * x_max + x)]; | 317 | //Vertex vt43 = sVertices[((y + 1) * x_max + x)]; |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
329 | //Add(tri4); | 329 | //Add(tri4); |
330 | //} | 330 | //} |
331 | //} | 331 | //} |
332 | 332 | ||
333 | } | 333 | } |
334 | } | 334 | } |
335 | } | 335 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs index bc2ad69..074170a 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
40 | private OdePlugin cbt; | 40 | private OdePlugin cbt; |
41 | private PhysicsScene ps; | 41 | private PhysicsScene ps; |
42 | private IMeshingPlugin imp; | 42 | private IMeshingPlugin imp; |
43 | 43 | ||
44 | [SetUp] | 44 | [SetUp] |
45 | public void Initialize() | 45 | public void Initialize() |
46 | { | 46 | { |
@@ -96,11 +96,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
96 | 96 | ||
97 | Assert.That(!oprim.m_taintadd); | 97 | Assert.That(!oprim.m_taintadd); |
98 | Console.WriteLine("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString()); | 98 | Console.WriteLine("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString()); |
99 | 99 | ||
100 | // Make sure we're above the ground | 100 | // Make sure we're above the ground |
101 | //Assert.That(prim.Position.Z > 20f); | 101 | //Assert.That(prim.Position.Z > 20f); |
102 | //Console.WriteLine("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore); | 102 | //Console.WriteLine("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore); |
103 | 103 | ||
104 | // Make sure we've got a Body | 104 | // Make sure we've got a Body |
105 | Assert.That(oprim.Body != (IntPtr)0); | 105 | Assert.That(oprim.Body != (IntPtr)0); |
106 | //Console.WriteLine( | 106 | //Console.WriteLine( |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 3f8aa26..f285911 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -252,7 +252,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
252 | public int physics_logging_interval = 0; | 252 | public int physics_logging_interval = 0; |
253 | public bool physics_logging_append_existing_logfile = false; | 253 | public bool physics_logging_append_existing_logfile = false; |
254 | 254 | ||
255 | |||
256 | /// <summary> | 255 | /// <summary> |
257 | /// Initiailizes the scene | 256 | /// Initiailizes the scene |
258 | /// Sets many properties that ODE requires to be stable | 257 | /// Sets many properties that ODE requires to be stable |
@@ -352,14 +351,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
352 | 351 | ||
353 | geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", 10.000006836f); | 352 | geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", 10.000006836f); |
354 | bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", 20); | 353 | bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", 20); |
355 | 354 | ||
356 | bodyPIDD = physicsconfig.GetFloat("body_pid_derivative", 35f); | 355 | bodyPIDD = physicsconfig.GetFloat("body_pid_derivative", 35f); |
357 | bodyPIDG = physicsconfig.GetFloat("body_pid_gain", 25f); | 356 | bodyPIDG = physicsconfig.GetFloat("body_pid_gain", 25f); |
358 | 357 | ||
359 | meshSculptedPrim = physicsconfig.GetBoolean("mesh_sculpted_prim", true); | 358 | meshSculptedPrim = physicsconfig.GetBoolean("mesh_sculpted_prim", true); |
360 | meshSculptLOD = physicsconfig.GetFloat("mesh_lod", 32f); | 359 | meshSculptLOD = physicsconfig.GetFloat("mesh_lod", 32f); |
361 | MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", 16f); | 360 | MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", 16f); |
362 | |||
363 | 361 | ||
364 | if (Environment.OSVersion.Platform == PlatformID.Unix) | 362 | if (Environment.OSVersion.Platform == PlatformID.Unix) |
365 | { | 363 | { |
@@ -367,7 +365,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
367 | avPIDP = physicsconfig.GetFloat("av_pid_proportional_linux", 1400.0f); | 365 | avPIDP = physicsconfig.GetFloat("av_pid_proportional_linux", 1400.0f); |
368 | avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_linux", 2000000f); | 366 | avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_linux", 2000000f); |
369 | bodyMotorJointMaxforceTensor = physicsconfig.GetFloat("body_motor_joint_maxforce_tensor_linux", 2f); | 367 | bodyMotorJointMaxforceTensor = physicsconfig.GetFloat("body_motor_joint_maxforce_tensor_linux", 2f); |
370 | |||
371 | } | 368 | } |
372 | else | 369 | else |
373 | { | 370 | { |
@@ -547,7 +544,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
547 | } | 544 | } |
548 | catch (AccessViolationException) | 545 | catch (AccessViolationException) |
549 | { | 546 | { |
550 | |||
551 | m_log.Warn("[PHYSICS]: Unable to collide test an object"); | 547 | m_log.Warn("[PHYSICS]: Unable to collide test an object"); |
552 | return; | 548 | return; |
553 | } | 549 | } |
@@ -603,7 +599,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
603 | p2.CollidingGround = true; | 599 | p2.CollidingGround = true; |
604 | break; | 600 | break; |
605 | } | 601 | } |
606 | |||
607 | 602 | ||
608 | // we don't want prim or avatar to explode | 603 | // we don't want prim or avatar to explode |
609 | 604 | ||
@@ -850,87 +845,87 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
850 | case ActorTypes.Agent: | 845 | case ActorTypes.Agent: |
851 | cc2 = (OdeCharacter)p2; | 846 | cc2 = (OdeCharacter)p2; |
852 | 847 | ||
853 | // obj1LocalID = cc2.m_localID; | 848 | // obj1LocalID = cc2.m_localID; |
854 | switch ((ActorTypes)p1.PhysicsActorType) | 849 | switch ((ActorTypes)p1.PhysicsActorType) |
855 | { | 850 | { |
856 | case ActorTypes.Agent: | 851 | case ActorTypes.Agent: |
857 | cc1 = (OdeCharacter)p1; | 852 | cc1 = (OdeCharacter)p1; |
858 | obj2LocalID = cc1.m_localID; | 853 | obj2LocalID = cc1.m_localID; |
859 | cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); | 854 | cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); |
860 | //ctype = (int)CollisionCategories.Character; | 855 | //ctype = (int)CollisionCategories.Character; |
861 | 856 | ||
862 | //if (cc1.CollidingObj) | 857 | //if (cc1.CollidingObj) |
863 | //cStartStop = (int)StatusIndicators.Generic; | 858 | //cStartStop = (int)StatusIndicators.Generic; |
864 | //else | 859 | //else |
865 | //cStartStop = (int)StatusIndicators.Start; | 860 | //cStartStop = (int)StatusIndicators.Start; |
866 | 861 | ||
867 | //returncollisions = true; | 862 | //returncollisions = true; |
868 | break; | 863 | break; |
869 | case ActorTypes.Prim: | 864 | case ActorTypes.Prim: |
870 | cp1 = (OdePrim)p1; | 865 | cp1 = (OdePrim)p1; |
871 | obj2LocalID = cp1.m_localID; | 866 | obj2LocalID = cp1.m_localID; |
872 | cp1.AddCollisionEvent(cc2.m_localID, collisiondepth); | 867 | cp1.AddCollisionEvent(cc2.m_localID, collisiondepth); |
873 | //ctype = (int)CollisionCategories.Geom; | 868 | //ctype = (int)CollisionCategories.Geom; |
874 | 869 | ||
875 | //if (cp1.CollidingObj) | 870 | //if (cp1.CollidingObj) |
876 | //cStartStop = (int)StatusIndicators.Generic; | 871 | //cStartStop = (int)StatusIndicators.Generic; |
877 | //else | 872 | //else |
878 | //cStartStop = (int)StatusIndicators.Start; | 873 | //cStartStop = (int)StatusIndicators.Start; |
879 | 874 | ||
880 | //returncollisions = true; | 875 | //returncollisions = true; |
881 | break; | 876 | break; |
882 | 877 | ||
883 | case ActorTypes.Ground: | 878 | case ActorTypes.Ground: |
884 | case ActorTypes.Unknown: | 879 | case ActorTypes.Unknown: |
885 | obj2LocalID = 0; | 880 | obj2LocalID = 0; |
886 | //ctype = (int)CollisionCategories.Land; | 881 | //ctype = (int)CollisionCategories.Land; |
887 | //returncollisions = true; | 882 | //returncollisions = true; |
888 | break; | 883 | break; |
889 | } | 884 | } |
890 | 885 | ||
891 | cc2.AddCollisionEvent(obj2LocalID, collisiondepth); | 886 | cc2.AddCollisionEvent(obj2LocalID, collisiondepth); |
892 | break; | 887 | break; |
893 | case ActorTypes.Prim: | 888 | case ActorTypes.Prim: |
894 | cp2 = (OdePrim)p2; | 889 | cp2 = (OdePrim)p2; |
895 | 890 | ||
896 | // obj1LocalID = cp2.m_localID; | 891 | // obj1LocalID = cp2.m_localID; |
897 | switch ((ActorTypes)p1.PhysicsActorType) | 892 | switch ((ActorTypes)p1.PhysicsActorType) |
898 | { | 893 | { |
899 | case ActorTypes.Agent: | 894 | case ActorTypes.Agent: |
900 | cc1 = (OdeCharacter)p1; | 895 | cc1 = (OdeCharacter)p1; |
901 | obj2LocalID = cc1.m_localID; | 896 | obj2LocalID = cc1.m_localID; |
902 | cc1.AddCollisionEvent(cp2.m_localID, collisiondepth); | 897 | cc1.AddCollisionEvent(cp2.m_localID, collisiondepth); |
903 | //ctype = (int)CollisionCategories.Character; | 898 | //ctype = (int)CollisionCategories.Character; |
904 | 899 | ||
905 | //if (cc1.CollidingObj) | 900 | //if (cc1.CollidingObj) |
906 | //cStartStop = (int)StatusIndicators.Generic; | 901 | //cStartStop = (int)StatusIndicators.Generic; |
907 | //else | 902 | //else |
908 | //cStartStop = (int)StatusIndicators.Start; | 903 | //cStartStop = (int)StatusIndicators.Start; |
909 | //returncollisions = true; | 904 | //returncollisions = true; |
910 | 905 | ||
911 | break; | 906 | break; |
912 | case ActorTypes.Prim: | 907 | case ActorTypes.Prim: |
913 | cp1 = (OdePrim)p1; | 908 | cp1 = (OdePrim)p1; |
914 | obj2LocalID = cp1.m_localID; | 909 | obj2LocalID = cp1.m_localID; |
915 | cp1.AddCollisionEvent(cp2.m_localID, collisiondepth); | 910 | cp1.AddCollisionEvent(cp2.m_localID, collisiondepth); |
916 | //ctype = (int)CollisionCategories.Geom; | 911 | //ctype = (int)CollisionCategories.Geom; |
917 | 912 | ||
918 | //if (cp1.CollidingObj) | 913 | //if (cp1.CollidingObj) |
919 | //cStartStop = (int)StatusIndicators.Generic; | 914 | //cStartStop = (int)StatusIndicators.Generic; |
920 | //else | 915 | //else |
921 | //cStartStop = (int)StatusIndicators.Start; | 916 | //cStartStop = (int)StatusIndicators.Start; |
922 | 917 | ||
923 | //returncollisions = true; | 918 | //returncollisions = true; |
924 | break; | 919 | break; |
925 | 920 | ||
926 | case ActorTypes.Ground: | 921 | case ActorTypes.Ground: |
927 | case ActorTypes.Unknown: | 922 | case ActorTypes.Unknown: |
928 | obj2LocalID = 0; | 923 | obj2LocalID = 0; |
929 | //ctype = (int)CollisionCategories.Land; | 924 | //ctype = (int)CollisionCategories.Land; |
930 | 925 | ||
931 | //returncollisions = true; | 926 | //returncollisions = true; |
932 | break; | 927 | break; |
933 | } | 928 | } |
934 | 929 | ||
935 | cp2.AddCollisionEvent(obj2LocalID, collisiondepth); | 930 | cp2.AddCollisionEvent(obj2LocalID, collisiondepth); |
936 | break; | 931 | break; |
@@ -1015,7 +1010,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1015 | /// <param name="timeStep"></param> | 1010 | /// <param name="timeStep"></param> |
1016 | private void collision_optimized(float timeStep) | 1011 | private void collision_optimized(float timeStep) |
1017 | { | 1012 | { |
1018 | |||
1019 | foreach (OdeCharacter chr in _characters) | 1013 | foreach (OdeCharacter chr in _characters) |
1020 | { | 1014 | { |
1021 | // Reset the collision values to false | 1015 | // Reset the collision values to false |
@@ -1579,7 +1573,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1579 | // if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) | 1573 | // if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) |
1580 | // return true; | 1574 | // return true; |
1581 | 1575 | ||
1582 | 1576 | ||
1583 | 1577 | ||
1584 | // return false; | 1578 | // return false; |
1585 | 1579 | ||
@@ -1625,7 +1619,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1625 | //m_log.Info(timeStep.ToString()); | 1619 | //m_log.Info(timeStep.ToString()); |
1626 | step_time += timeStep; | 1620 | step_time += timeStep; |
1627 | 1621 | ||
1628 | |||
1629 | // If We're loaded down by something else, | 1622 | // If We're loaded down by something else, |
1630 | // or debugging with the Visual Studio project on pause | 1623 | // or debugging with the Visual Studio project on pause |
1631 | // skip a few frames to catch up gracefully. | 1624 | // skip a few frames to catch up gracefully. |
@@ -1739,7 +1732,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1739 | } | 1732 | } |
1740 | 1733 | ||
1741 | d.WorldQuickStep(world, ODE_STEPSIZE); | 1734 | d.WorldQuickStep(world, ODE_STEPSIZE); |
1742 | |||
1743 | d.JointGroupEmpty(contactgroup); | 1735 | d.JointGroupEmpty(contactgroup); |
1744 | //ode.dunlock(world); | 1736 | //ode.dunlock(world); |
1745 | } | 1737 | } |
@@ -2075,7 +2067,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2075 | if (resultarr2[y, x] <= 0) | 2067 | if (resultarr2[y, x] <= 0) |
2076 | { | 2068 | { |
2077 | returnarr[i] = 0.0000001f; | 2069 | returnarr[i] = 0.0000001f; |
2078 | 2070 | ||
2079 | } | 2071 | } |
2080 | else | 2072 | else |
2081 | returnarr[i] = resultarr2[y, x]; | 2073 | returnarr[i] = resultarr2[y, x]; |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 25c0d9a..9195063 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -361,23 +361,23 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
361 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting | 361 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting |
362 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. | 362 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. |
363 | */ | 363 | */ |
364 | 364 | ||
365 | /* How we arrived at this llEuler2Rot | 365 | /* How we arrived at this llEuler2Rot |
366 | * | 366 | * |
367 | * Experiment in SL to determine conventions: | 367 | * Experiment in SL to determine conventions: |
368 | * llEuler2Rot(<PI,0,0>)=<1,0,0,0> | 368 | * llEuler2Rot(<PI,0,0>)=<1,0,0,0> |
369 | * llEuler2Rot(<0,PI,0>)=<0,1,0,0> | 369 | * llEuler2Rot(<0,PI,0>)=<0,1,0,0> |
370 | * llEuler2Rot(<0,0,PI>)=<0,0,1,0> | 370 | * llEuler2Rot(<0,0,PI>)=<0,0,1,0> |
371 | * | 371 | * |
372 | * Important facts about Quaternions | 372 | * Important facts about Quaternions |
373 | * - multiplication is non-commutative (a*b != b*a) | 373 | * - multiplication is non-commutative (a*b != b*a) |
374 | * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication | 374 | * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication |
375 | * | 375 | * |
376 | * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): | 376 | * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): |
377 | * Qx = c1+i*s1 | 377 | * Qx = c1+i*s1 |
378 | * Qy = c2+j*s2; | 378 | * Qy = c2+j*s2; |
379 | * Qz = c3+k*s3; | 379 | * Qz = c3+k*s3; |
380 | * | 380 | * |
381 | * Rotations applied in order (from above) Z, Y, X | 381 | * Rotations applied in order (from above) Z, Y, X |
382 | * Q = (Qz * Qy) * Qx | 382 | * Q = (Qz * Qy) * Qx |
383 | * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) | 383 | * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) |
@@ -389,23 +389,23 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
389 | * y=j*(c1*s2*c3-s1*c2*s3) | 389 | * y=j*(c1*s2*c3-s1*c2*s3) |
390 | * z=k*(s1*s2*c3+c1*c2*s3) | 390 | * z=k*(s1*s2*c3+c1*c2*s3) |
391 | * s= c1*c2*c3-s1*s2*s3 | 391 | * s= c1*c2*c3-s1*s2*s3 |
392 | * | 392 | * |
393 | * This implementation agrees with the functions found here: | 393 | * This implementation agrees with the functions found here: |
394 | * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions | 394 | * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions |
395 | * And with the results in SL. | 395 | * And with the results in SL. |
396 | * | 396 | * |
397 | * It's also possible to calculate llEuler2Rot by direct multiplication of | 397 | * It's also possible to calculate llEuler2Rot by direct multiplication of |
398 | * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function | 398 | * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function |
399 | * from the wiki). | 399 | * from the wiki). |
400 | * Apparently in some cases this is better from a numerical precision perspective? | 400 | * Apparently in some cases this is better from a numerical precision perspective? |
401 | */ | 401 | */ |
402 | 402 | ||
403 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) | 403 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) |
404 | { | 404 | { |
405 | m_host.AddScriptLPS(1); | 405 | m_host.AddScriptLPS(1); |
406 | 406 | ||
407 | double x,y,z,s; | 407 | double x,y,z,s; |
408 | 408 | ||
409 | double c1 = Math.Cos(v.x/2.0); | 409 | double c1 = Math.Cos(v.x/2.0); |
410 | double c2 = Math.Cos(v.y/2.0); | 410 | double c2 = Math.Cos(v.y/2.0); |
411 | double c3 = Math.Cos(v.z/2.0); | 411 | double c3 = Math.Cos(v.z/2.0); |
@@ -417,7 +417,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
417 | y = c1*s2*c3-s1*c2*s3; | 417 | y = c1*s2*c3-s1*c2*s3; |
418 | z = s1*s2*c3+c1*c2*s3; | 418 | z = s1*s2*c3+c1*c2*s3; |
419 | s = c1*c2*c3-s1*s2*s3; | 419 | s = c1*c2*c3-s1*s2*s3; |
420 | 420 | ||
421 | return new LSL_Types.Quaternion(x, y, z, s); | 421 | return new LSL_Types.Quaternion(x, y, z, s); |
422 | } | 422 | } |
423 | 423 | ||
@@ -427,7 +427,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
427 | double x,y,z,s; | 427 | double x,y,z,s; |
428 | int f=0; | 428 | int f=0; |
429 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> | 429 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> |
430 | // Computing quaternion x,y,z,s values | 430 | // Computing quaternion x,y,z,s values |
431 | x = ((fwd.x - left.y - up.z + 1) / 4); | 431 | x = ((fwd.x - left.y - up.z + 1) / 4); |
432 | x *= x; | 432 | x *= x; |
433 | x = Math.Sqrt(Math.Sqrt(x)); | 433 | x = Math.Sqrt(Math.Sqrt(x)); |
@@ -441,7 +441,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
441 | s *= s; | 441 | s *= s; |
442 | s = Math.Sqrt(Math.Sqrt(s)); | 442 | s = Math.Sqrt(Math.Sqrt(s)); |
443 | 443 | ||
444 | // Set f for signs detection | 444 | // Set f for signs detection |
445 | if (fwd.y+left.x >= 0){f+=1;} | 445 | if (fwd.y+left.x >= 0){f+=1;} |
446 | if (fwd.z+up.x >= 0){f+=2;} | 446 | if (fwd.z+up.x >= 0){f+=2;} |
447 | if (left.z-up.y >= 0){f+=4;} | 447 | if (left.z-up.y >= 0){f+=4;} |
@@ -510,7 +510,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
510 | x = 2 * (r.x * r.y - r.z * r.s); | 510 | x = 2 * (r.x * r.y - r.z * r.s); |
511 | y = -r.x * r.x + r.y * r.y - r.z * r.z + r.s * r.s; | 511 | y = -r.x * r.x + r.y * r.y - r.z * r.z + r.s * r.s; |
512 | z = 2 * (r.x * r.s + r.y * r.z); | 512 | z = 2 * (r.x * r.s + r.y * r.z); |
513 | return (new LSL_Types.Vector3(x, y, z)); | 513 | return (new LSL_Types.Vector3(x, y, z)); |
514 | } | 514 | } |
515 | 515 | ||
516 | public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) | 516 | public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) |
@@ -536,7 +536,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
536 | z = -r.x * r.x - r.y * r.y + r.z * r.z + r.s * r.s; | 536 | z = -r.x * r.x - r.y * r.y + r.z * r.z + r.s * r.s; |
537 | return (new LSL_Types.Vector3(x, y, z)); | 537 | return (new LSL_Types.Vector3(x, y, z)); |
538 | } | 538 | } |
539 | 539 | ||
540 | public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) | 540 | public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) |
541 | { | 541 | { |
542 | //A and B should both be normalized | 542 | //A and B should both be normalized |
@@ -1215,7 +1215,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1215 | 1215 | ||
1216 | /// <summary> | 1216 | /// <summary> |
1217 | /// Set flexi parameters of a part. | 1217 | /// Set flexi parameters of a part. |
1218 | /// | 1218 | /// |
1219 | /// FIXME: Much of this code should probably be within the part itself. | 1219 | /// FIXME: Much of this code should probably be within the part itself. |
1220 | /// </summary> | 1220 | /// </summary> |
1221 | /// <param name="part"></param> | 1221 | /// <param name="part"></param> |
@@ -1226,7 +1226,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1226 | /// <param name="wind"></param> | 1226 | /// <param name="wind"></param> |
1227 | /// <param name="tension"></param> | 1227 | /// <param name="tension"></param> |
1228 | /// <param name="Force"></param> | 1228 | /// <param name="Force"></param> |
1229 | private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, | 1229 | private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, |
1230 | float wind, float tension, LSL_Types.Vector3 Force) | 1230 | float wind, float tension, LSL_Types.Vector3 Force) |
1231 | { | 1231 | { |
1232 | if (part == null) | 1232 | if (part == null) |
@@ -1239,7 +1239,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1239 | { | 1239 | { |
1240 | needs_fakedelete = true; | 1240 | needs_fakedelete = true; |
1241 | } | 1241 | } |
1242 | part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do | 1242 | part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do |
1243 | // work once the prim is already flexi | 1243 | // work once the prim is already flexi |
1244 | part.Shape.FlexiSoftness = softness; | 1244 | part.Shape.FlexiSoftness = softness; |
1245 | part.Shape.FlexiGravity = gravity; | 1245 | part.Shape.FlexiGravity = gravity; |
@@ -1265,7 +1265,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1265 | if (needs_fakedelete) | 1265 | if (needs_fakedelete) |
1266 | { | 1266 | { |
1267 | if (part.ParentGroup != null) | 1267 | if (part.ParentGroup != null) |
1268 | { | 1268 | { |
1269 | part.ParentGroup.FakeDeleteGroup(); | 1269 | part.ParentGroup.FakeDeleteGroup(); |
1270 | } | 1270 | } |
1271 | } | 1271 | } |
@@ -1276,7 +1276,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1276 | 1276 | ||
1277 | /// <summary> | 1277 | /// <summary> |
1278 | /// Set a light point on a part | 1278 | /// Set a light point on a part |
1279 | /// | 1279 | /// |
1280 | /// FIXME: Much of this code should probably be in SceneObjectGroup | 1280 | /// FIXME: Much of this code should probably be in SceneObjectGroup |
1281 | /// </summary> | 1281 | /// </summary> |
1282 | /// <param name="part"></param> | 1282 | /// <param name="part"></param> |
@@ -1781,7 +1781,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1781 | m_host.SoundGain = volume; | 1781 | m_host.SoundGain = volume; |
1782 | m_host.SoundFlags = 1; // looping | 1782 | m_host.SoundFlags = 1; // looping |
1783 | m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? | 1783 | m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? |
1784 | 1784 | ||
1785 | m_host.ScheduleFullUpdate(); | 1785 | m_host.ScheduleFullUpdate(); |
1786 | m_host.SendFullUpdateToAllClients(); | 1786 | m_host.SendFullUpdateToAllClients(); |
1787 | } | 1787 | } |
@@ -2908,13 +2908,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2908 | bool found = false; | 2908 | bool found = false; |
2909 | LLUUID destId = LLUUID.Zero; | 2909 | LLUUID destId = LLUUID.Zero; |
2910 | LLUUID objId = LLUUID.Zero; | 2910 | LLUUID objId = LLUUID.Zero; |
2911 | 2911 | ||
2912 | if (!LLUUID.TryParse(destination, out destId)) | 2912 | if (!LLUUID.TryParse(destination, out destId)) |
2913 | { | 2913 | { |
2914 | llSay(0, "Could not parse key " + destination); | 2914 | llSay(0, "Could not parse key " + destination); |
2915 | return; | 2915 | return; |
2916 | } | 2916 | } |
2917 | 2917 | ||
2918 | // move the first object found with this inventory name | 2918 | // move the first object found with this inventory name |
2919 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | 2919 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) |
2920 | { | 2920 | { |
@@ -2931,7 +2931,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2931 | llSay(0, String.Format("Could not find object '{0}'", inventory)); | 2931 | llSay(0, String.Format("Could not find object '{0}'", inventory)); |
2932 | throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); | 2932 | throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); |
2933 | } | 2933 | } |
2934 | 2934 | ||
2935 | // check if destination is an avatar | 2935 | // check if destination is an avatar |
2936 | if (World.GetScenePresence(destId) != null) | 2936 | if (World.GetScenePresence(destId) != null) |
2937 | { | 2937 | { |
@@ -2993,7 +2993,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2993 | { | 2993 | { |
2994 | LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( | 2994 | LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( |
2995 | m_localID, m_itemID, item.AssetID.ToString()); | 2995 | m_localID, m_itemID, item.AssetID.ToString()); |
2996 | 2996 | ||
2997 | LLVector3 region = new LLVector3( | 2997 | LLVector3 region = new LLVector3( |
2998 | World.RegionInfo.RegionLocX * Constants.RegionSize, | 2998 | World.RegionInfo.RegionLocX * Constants.RegionSize, |
2999 | World.RegionInfo.RegionLocY * Constants.RegionSize, | 2999 | World.RegionInfo.RegionLocY * Constants.RegionSize, |
@@ -4155,13 +4155,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4155 | if (LLUUID.TryParse(id,out key)) | 4155 | if (LLUUID.TryParse(id,out key)) |
4156 | { | 4156 | { |
4157 | ScenePresence presence = World.GetScenePresence(key); | 4157 | ScenePresence presence = World.GetScenePresence(key); |
4158 | 4158 | ||
4159 | if (presence != null) | 4159 | if (presence != null) |
4160 | { | 4160 | { |
4161 | return presence.ControllingClient.Name; | 4161 | return presence.ControllingClient.Name; |
4162 | //return presence.Name; | 4162 | //return presence.Name; |
4163 | } | 4163 | } |
4164 | 4164 | ||
4165 | if (World.GetSceneObjectPart(key) != null) | 4165 | if (World.GetSceneObjectPart(key) != null) |
4166 | { | 4166 | { |
4167 | return World.GetSceneObjectPart(key).Name; | 4167 | return World.GetSceneObjectPart(key).Name; |
@@ -4516,7 +4516,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4516 | private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() | 4516 | private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() |
4517 | { | 4517 | { |
4518 | Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); | 4518 | Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); |
4519 | 4519 | ||
4520 | // TODO find out about the other defaults and add them here | 4520 | // TODO find out about the other defaults and add them here |
4521 | ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); | 4521 | ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); |
4522 | ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); | 4522 | ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); |
@@ -4530,7 +4530,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4530 | ps.PartMaxAge = 10.0f; | 4530 | ps.PartMaxAge = 10.0f; |
4531 | return ps; | 4531 | return ps; |
4532 | } | 4532 | } |
4533 | 4533 | ||
4534 | public void llParticleSystem(LSL_Types.list rules) | 4534 | public void llParticleSystem(LSL_Types.list rules) |
4535 | { | 4535 | { |
4536 | m_host.AddScriptLPS(1); | 4536 | m_host.AddScriptLPS(1); |
@@ -4725,7 +4725,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4725 | itemList.Add(itemID); | 4725 | itemList.Add(itemID); |
4726 | } | 4726 | } |
4727 | } | 4727 | } |
4728 | 4728 | ||
4729 | if (itemList.Count == 0) | 4729 | if (itemList.Count == 0) |
4730 | return; | 4730 | return; |
4731 | 4731 | ||
@@ -4973,7 +4973,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4973 | public void llSetRemoteScriptAccessPin(int pin) | 4973 | public void llSetRemoteScriptAccessPin(int pin) |
4974 | { | 4974 | { |
4975 | m_host.AddScriptLPS(1); | 4975 | m_host.AddScriptLPS(1); |
4976 | 4976 | ||
4977 | m_host.ScriptAccessPin = pin; | 4977 | m_host.ScriptAccessPin = pin; |
4978 | } | 4978 | } |
4979 | 4979 | ||
@@ -4983,19 +4983,19 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4983 | bool found = false; | 4983 | bool found = false; |
4984 | LLUUID destId = LLUUID.Zero; | 4984 | LLUUID destId = LLUUID.Zero; |
4985 | LLUUID srcId = LLUUID.Zero; | 4985 | LLUUID srcId = LLUUID.Zero; |
4986 | 4986 | ||
4987 | if (!LLUUID.TryParse(target, out destId)) | 4987 | if (!LLUUID.TryParse(target, out destId)) |
4988 | { | 4988 | { |
4989 | llSay(0, "Could not parse key " + target); | 4989 | llSay(0, "Could not parse key " + target); |
4990 | return; | 4990 | return; |
4991 | } | 4991 | } |
4992 | 4992 | ||
4993 | // target must be a different prim than the one containing the script | 4993 | // target must be a different prim than the one containing the script |
4994 | if (m_host.UUID == destId) | 4994 | if (m_host.UUID == destId) |
4995 | { | 4995 | { |
4996 | return; | 4996 | return; |
4997 | } | 4997 | } |
4998 | 4998 | ||
4999 | // copy the first script found with this inventory name | 4999 | // copy the first script found with this inventory name |
5000 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | 5000 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) |
5001 | { | 5001 | { |
@@ -5010,13 +5010,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5010 | } | 5010 | } |
5011 | } | 5011 | } |
5012 | } | 5012 | } |
5013 | 5013 | ||
5014 | if (!found) | 5014 | if (!found) |
5015 | { | 5015 | { |
5016 | llSay(0, "Could not find script " + name); | 5016 | llSay(0, "Could not find script " + name); |
5017 | return; | 5017 | return; |
5018 | } | 5018 | } |
5019 | 5019 | ||
5020 | // the rest of the permission checks are done in RezScript, so check the pin there as well | 5020 | // the rest of the permission checks are done in RezScript, so check the pin there as well |
5021 | World.RezScript(srcId, m_host, destId, pin, running, start_param); | 5021 | World.RezScript(srcId, m_host, destId, pin, running, start_param); |
5022 | // this will cause the delay even if the script pin or permissions were wrong - seems ok | 5022 | // this will cause the delay even if the script pin or permissions were wrong - seems ok |
@@ -5066,11 +5066,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5066 | m_host.AddScriptLPS(1); | 5066 | m_host.AddScriptLPS(1); |
5067 | return Util.Md5Hash(src + ":" + nonce.ToString()); | 5067 | return Util.Md5Hash(src + ":" + nonce.ToString()); |
5068 | } | 5068 | } |
5069 | 5069 | ||
5070 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) | 5070 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) |
5071 | { | 5071 | { |
5072 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | 5072 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); |
5073 | 5073 | ||
5074 | if (holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_DEFAULT && | 5074 | if (holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_DEFAULT && |
5075 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_CIRCLE && | 5075 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_CIRCLE && |
5076 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_SQUARE && | 5076 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_SQUARE && |
@@ -5128,23 +5128,23 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5128 | } | 5128 | } |
5129 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); | 5129 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); |
5130 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); | 5130 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); |
5131 | 5131 | ||
5132 | shapeBlock.ObjectLocalID = m_host.LocalId; | 5132 | shapeBlock.ObjectLocalID = m_host.LocalId; |
5133 | 5133 | ||
5134 | // retain pathcurve | 5134 | // retain pathcurve |
5135 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | 5135 | shapeBlock.PathCurve = m_host.Shape.PathCurve; |
5136 | 5136 | ||
5137 | return shapeBlock; | 5137 | return shapeBlock; |
5138 | } | 5138 | } |
5139 | 5139 | ||
5140 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) | 5140 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) |
5141 | { | 5141 | { |
5142 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5142 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5143 | 5143 | ||
5144 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5144 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5145 | 5145 | ||
5146 | shapeBlock.ProfileCurve += fudge; | 5146 | shapeBlock.ProfileCurve += fudge; |
5147 | 5147 | ||
5148 | if (taper_b.x < 0f) | 5148 | if (taper_b.x < 0f) |
5149 | { | 5149 | { |
5150 | taper_b.x = 0f; | 5150 | taper_b.x = 0f; |
@@ -5181,25 +5181,25 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5181 | } | 5181 | } |
5182 | shapeBlock.PathShearX = (byte)(100 * topshear.x); | 5182 | shapeBlock.PathShearX = (byte)(100 * topshear.x); |
5183 | shapeBlock.PathShearY = (byte)(100 * topshear.y); | 5183 | shapeBlock.PathShearY = (byte)(100 * topshear.y); |
5184 | 5184 | ||
5185 | m_host.UpdateShape(shapeBlock); | 5185 | m_host.UpdateShape(shapeBlock); |
5186 | } | 5186 | } |
5187 | 5187 | ||
5188 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) | 5188 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) |
5189 | { | 5189 | { |
5190 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5190 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5191 | 5191 | ||
5192 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5192 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5193 | 5193 | ||
5194 | // profile/path swapped for a sphere | 5194 | // profile/path swapped for a sphere |
5195 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | 5195 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; |
5196 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | 5196 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; |
5197 | 5197 | ||
5198 | shapeBlock.ProfileCurve += fudge; | 5198 | shapeBlock.ProfileCurve += fudge; |
5199 | 5199 | ||
5200 | shapeBlock.PathScaleX = 100; | 5200 | shapeBlock.PathScaleX = 100; |
5201 | shapeBlock.PathScaleY = 100; | 5201 | shapeBlock.PathScaleY = 100; |
5202 | 5202 | ||
5203 | if (dimple.x < 0f) | 5203 | if (dimple.x < 0f) |
5204 | { | 5204 | { |
5205 | dimple.x = 0f; | 5205 | dimple.x = 0f; |
@@ -5222,22 +5222,22 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5222 | } | 5222 | } |
5223 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); | 5223 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); |
5224 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); | 5224 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); |
5225 | 5225 | ||
5226 | m_host.UpdateShape(shapeBlock); | 5226 | m_host.UpdateShape(shapeBlock); |
5227 | } | 5227 | } |
5228 | 5228 | ||
5229 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) | 5229 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) |
5230 | { | 5230 | { |
5231 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5231 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5232 | 5232 | ||
5233 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5233 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5234 | 5234 | ||
5235 | shapeBlock.ProfileCurve += fudge; | 5235 | shapeBlock.ProfileCurve += fudge; |
5236 | 5236 | ||
5237 | // profile/path swapped for a torrus, tube, ring | 5237 | // profile/path swapped for a torrus, tube, ring |
5238 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | 5238 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; |
5239 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | 5239 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; |
5240 | 5240 | ||
5241 | if (holesize.x < 0.05f) | 5241 | if (holesize.x < 0.05f) |
5242 | { | 5242 | { |
5243 | holesize.x = 0.05f; | 5243 | holesize.x = 0.05f; |
@@ -5342,15 +5342,15 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5342 | skew = 0.95f; | 5342 | skew = 0.95f; |
5343 | } | 5343 | } |
5344 | shapeBlock.PathSkew = (sbyte)(100 * skew); | 5344 | shapeBlock.PathSkew = (sbyte)(100 * skew); |
5345 | 5345 | ||
5346 | m_host.UpdateShape(shapeBlock); | 5346 | m_host.UpdateShape(shapeBlock); |
5347 | } | 5347 | } |
5348 | 5348 | ||
5349 | private void SetPrimitiveShapeParams(string map, int type) | 5349 | private void SetPrimitiveShapeParams(string map, int type) |
5350 | { | 5350 | { |
5351 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | 5351 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); |
5352 | LLUUID sculptId; | 5352 | LLUUID sculptId; |
5353 | 5353 | ||
5354 | if (!LLUUID.TryParse(map, out sculptId)) | 5354 | if (!LLUUID.TryParse(map, out sculptId)) |
5355 | { | 5355 | { |
5356 | llSay(0, "Could not parse key " + map); | 5356 | llSay(0, "Could not parse key " + map); |
@@ -5360,7 +5360,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5360 | shapeBlock.ObjectLocalID = m_host.LocalId; | 5360 | shapeBlock.ObjectLocalID = m_host.LocalId; |
5361 | shapeBlock.PathScaleX = 100; | 5361 | shapeBlock.PathScaleX = 100; |
5362 | shapeBlock.PathScaleY = 150; | 5362 | shapeBlock.PathScaleY = 150; |
5363 | 5363 | ||
5364 | if (type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_CYLINDER && | 5364 | if (type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_CYLINDER && |
5365 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_PLANE && | 5365 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_PLANE && |
5366 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE && | 5366 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE && |
@@ -5369,7 +5369,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5369 | // default | 5369 | // default |
5370 | type = (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE; | 5370 | type = (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE; |
5371 | } | 5371 | } |
5372 | 5372 | ||
5373 | // retain pathcurve | 5373 | // retain pathcurve |
5374 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | 5374 | shapeBlock.PathCurve = m_host.Shape.PathCurve; |
5375 | 5375 | ||
@@ -5422,7 +5422,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5422 | 5422 | ||
5423 | v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5423 | v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
5424 | SetScale(part, v); | 5424 | SetScale(part, v); |
5425 | 5425 | ||
5426 | break; | 5426 | break; |
5427 | case (int)BuiltIn_Commands_BaseClass.PRIM_ROTATION: | 5427 | case (int)BuiltIn_Commands_BaseClass.PRIM_ROTATION: |
5428 | if (remain < 1) | 5428 | if (remain < 1) |
@@ -5432,13 +5432,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5432 | SetRot(part, q); | 5432 | SetRot(part, q); |
5433 | 5433 | ||
5434 | break; | 5434 | break; |
5435 | 5435 | ||
5436 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE: | 5436 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE: |
5437 | if (remain < 3) | 5437 | if (remain < 3) |
5438 | return; | 5438 | return; |
5439 | 5439 | ||
5440 | code = Convert.ToInt32(rules.Data[idx++]); | 5440 | code = Convert.ToInt32(rules.Data[idx++]); |
5441 | 5441 | ||
5442 | remain = rules.Length - idx; | 5442 | remain = rules.Length - idx; |
5443 | float hollow; | 5443 | float hollow; |
5444 | LSL_Types.Vector3 twist; | 5444 | LSL_Types.Vector3 twist; |
@@ -5449,9 +5449,9 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5449 | float skew; | 5449 | float skew; |
5450 | LSL_Types.Vector3 holesize; | 5450 | LSL_Types.Vector3 holesize; |
5451 | LSL_Types.Vector3 profilecut; | 5451 | LSL_Types.Vector3 profilecut; |
5452 | 5452 | ||
5453 | switch (code) | 5453 | switch (code) |
5454 | { | 5454 | { |
5455 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_BOX: | 5455 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_BOX: |
5456 | if (remain < 6) | 5456 | if (remain < 6) |
5457 | return; | 5457 | return; |
@@ -5465,7 +5465,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5465 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | 5465 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; |
5466 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); | 5466 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); |
5467 | break; | 5467 | break; |
5468 | 5468 | ||
5469 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER: | 5469 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER: |
5470 | if (remain < 6) | 5470 | if (remain < 6) |
5471 | return; | 5471 | return; |
@@ -5480,12 +5480,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5480 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | 5480 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; |
5481 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); | 5481 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); |
5482 | break; | 5482 | break; |
5483 | 5483 | ||
5484 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_PRISM: | 5484 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_PRISM: |
5485 | if (remain < 6) | 5485 | if (remain < 6) |
5486 | return; | 5486 | return; |
5487 | 5487 | ||
5488 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5488 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5489 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5489 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5490 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5490 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5491 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5491 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5507,12 +5507,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5507 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5507 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5508 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); | 5508 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); |
5509 | break; | 5509 | break; |
5510 | 5510 | ||
5511 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TORUS: | 5511 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TORUS: |
5512 | if (remain < 11) | 5512 | if (remain < 11) |
5513 | return; | 5513 | return; |
5514 | 5514 | ||
5515 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5515 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5516 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5516 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5517 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5517 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5518 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5518 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5526,12 +5526,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5526 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5526 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5527 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); | 5527 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); |
5528 | break; | 5528 | break; |
5529 | 5529 | ||
5530 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TUBE: | 5530 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TUBE: |
5531 | if (remain < 11) | 5531 | if (remain < 11) |
5532 | return; | 5532 | return; |
5533 | 5533 | ||
5534 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5534 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5535 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5535 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5536 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5536 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5537 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5537 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5545,12 +5545,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5545 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5545 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5546 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); | 5546 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); |
5547 | break; | 5547 | break; |
5548 | 5548 | ||
5549 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_RING: | 5549 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_RING: |
5550 | if (remain < 11) | 5550 | if (remain < 11) |
5551 | return; | 5551 | return; |
5552 | 5552 | ||
5553 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5553 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5554 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5554 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5555 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5555 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5556 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5556 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5564,7 +5564,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5564 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5564 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5565 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); | 5565 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); |
5566 | break; | 5566 | break; |
5567 | 5567 | ||
5568 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_SCULPT: | 5568 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_SCULPT: |
5569 | if (remain < 2) | 5569 | if (remain < 2) |
5570 | return; | 5570 | return; |
@@ -5575,7 +5575,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5575 | SetPrimitiveShapeParams(map, face); | 5575 | SetPrimitiveShapeParams(map, face); |
5576 | break; | 5576 | break; |
5577 | } | 5577 | } |
5578 | 5578 | ||
5579 | break; | 5579 | break; |
5580 | 5580 | ||
5581 | case (int)BuiltIn_Commands_BaseClass.PRIM_TEXTURE: | 5581 | case (int)BuiltIn_Commands_BaseClass.PRIM_TEXTURE: |
@@ -5630,7 +5630,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5630 | float intensity = (float)Convert.ToDouble(rules.Data[idx++]); | 5630 | float intensity = (float)Convert.ToDouble(rules.Data[idx++]); |
5631 | float radius = (float)Convert.ToDouble(rules.Data[idx++]); | 5631 | float radius = (float)Convert.ToDouble(rules.Data[idx++]); |
5632 | float falloff = (float)Convert.ToDouble(rules.Data[idx++]); | 5632 | float falloff = (float)Convert.ToDouble(rules.Data[idx++]); |
5633 | 5633 | ||
5634 | SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); | 5634 | SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); |
5635 | 5635 | ||
5636 | break; | 5636 | break; |
@@ -5701,7 +5701,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5701 | public LSL_Types.list llGetAnimationList( string id ) | 5701 | public LSL_Types.list llGetAnimationList( string id ) |
5702 | { | 5702 | { |
5703 | m_host.AddScriptLPS(1); | 5703 | m_host.AddScriptLPS(1); |
5704 | 5704 | ||
5705 | LSL_Types.list l = new LSL_Types.list(); | 5705 | LSL_Types.list l = new LSL_Types.list(); |
5706 | ScenePresence av = World.GetScenePresence(id); | 5706 | ScenePresence av = World.GetScenePresence(id); |
5707 | if (av == null) | 5707 | if (av == null) |
@@ -6560,7 +6560,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6560 | IConfigSource config = new IniConfigSource(Application.iniFilePath); | 6560 | IConfigSource config = new IniConfigSource(Application.iniFilePath); |
6561 | if (config.Configs["LL-Functions"] == null) | 6561 | if (config.Configs["LL-Functions"] == null) |
6562 | config.AddConfig("LL-Functions"); | 6562 | config.AddConfig("LL-Functions"); |
6563 | 6563 | ||
6564 | if (config.Configs["LL-Functions"].GetBoolean("AllowGodFunctions", false)) | 6564 | if (config.Configs["LL-Functions"].GetBoolean("AllowGodFunctions", false)) |
6565 | { | 6565 | { |
6566 | if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) | 6566 | if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) |
@@ -6829,7 +6829,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6829 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) | 6829 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) |
6830 | m_host.AddScriptLPS(1); | 6830 | m_host.AddScriptLPS(1); |
6831 | for (int i = 0; i < commandList.Data.Length; i++) | 6831 | for (int i = 0; i < commandList.Data.Length; i++) |
6832 | { | 6832 | { |
6833 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) | 6833 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) |
6834 | { | 6834 | { |
6835 | case ParcelMediaCommandEnum.Play: | 6835 | case ParcelMediaCommandEnum.Play: |
@@ -6839,7 +6839,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6839 | if (!agent.IsChildAgent) | 6839 | if (!agent.IsChildAgent) |
6840 | { | 6840 | { |
6841 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); | 6841 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); |
6842 | } | 6842 | } |
6843 | } | 6843 | } |
6844 | break; | 6844 | break; |
6845 | case ParcelMediaCommandEnum.Stop: | 6845 | case ParcelMediaCommandEnum.Stop: |
@@ -6870,7 +6870,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6870 | { | 6870 | { |
6871 | //Set the new media URL only if the user is the owner of the land | 6871 | //Set the new media URL only if the user is the owner of the land |
6872 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); | 6872 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); |
6873 | 6873 | ||
6874 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); | 6874 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); |
6875 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 6875 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
6876 | //Send an update of the mediaURL to all the clients that are in the parcel | 6876 | //Send an update of the mediaURL to all the clients that are in the parcel |
@@ -6881,8 +6881,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6881 | //Send parcel media update to the client | 6881 | //Send parcel media update to the client |
6882 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); | 6882 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); |
6883 | } | 6883 | } |
6884 | } | 6884 | } |
6885 | 6885 | ||
6886 | } | 6886 | } |
6887 | i++; | 6887 | i++; |
6888 | } | 6888 | } |
@@ -6892,7 +6892,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6892 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); | 6892 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); |
6893 | break; | 6893 | break; |
6894 | }//end switch | 6894 | }//end switch |
6895 | 6895 | ||
6896 | } | 6896 | } |
6897 | 6897 | ||
6898 | 6898 | ||
@@ -6935,7 +6935,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6935 | } | 6935 | } |
6936 | } | 6936 | } |
6937 | return list; | 6937 | return list; |
6938 | 6938 | ||
6939 | } | 6939 | } |
6940 | 6940 | ||
6941 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) | 6941 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) |
@@ -6979,7 +6979,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6979 | { | 6979 | { |
6980 | m_host.AddScriptLPS(1); | 6980 | m_host.AddScriptLPS(1); |
6981 | LLUUID invItemID=InventorySelf(); | 6981 | LLUUID invItemID=InventorySelf(); |
6982 | if (invItemID == LLUUID.Zero) | 6982 | if (invItemID == LLUUID.Zero) |
6983 | return new LSL_Types.Vector3(); | 6983 | return new LSL_Types.Vector3(); |
6984 | if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) | 6984 | if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) |
6985 | return new LSL_Types.Vector3(); | 6985 | return new LSL_Types.Vector3(); |
@@ -6989,7 +6989,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6989 | return new LSL_Types.Vector3(); | 6989 | return new LSL_Types.Vector3(); |
6990 | } | 6990 | } |
6991 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | 6991 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); |
6992 | if (presence != null) | 6992 | if (presence != null) |
6993 | { | 6993 | { |
6994 | LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); | 6994 | LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); |
6995 | return pos; | 6995 | return pos; |
@@ -7111,8 +7111,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
7111 | public void llSetCameraParams(LSL_Types.list rules) | 7111 | public void llSetCameraParams(LSL_Types.list rules) |
7112 | { | 7112 | { |
7113 | m_host.AddScriptLPS(1); | 7113 | m_host.AddScriptLPS(1); |
7114 | 7114 | ||
7115 | // our key in the object we are in | 7115 | // our key in the object we are in |
7116 | LLUUID invItemID=InventorySelf(); | 7116 | LLUUID invItemID=InventorySelf(); |
7117 | if (invItemID == LLUUID.Zero) return; | 7117 | if (invItemID == LLUUID.Zero) return; |
7118 | 7118 | ||
@@ -7126,10 +7126,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
7126 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 7126 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; |
7127 | 7127 | ||
7128 | ScenePresence presence = World.GetScenePresence(agentID); | 7128 | ScenePresence presence = World.GetScenePresence(agentID); |
7129 | 7129 | ||
7130 | // we are not interested in child-agents | 7130 | // we are not interested in child-agents |
7131 | if (presence.IsChildAgent) return; | 7131 | if (presence.IsChildAgent) return; |
7132 | 7132 | ||
7133 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); | 7133 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); |
7134 | object[] data = rules.Data; | 7134 | object[] data = rules.Data; |
7135 | for (int i = 0; i < data.Length; ++i) { | 7135 | for (int i = 0; i < data.Length; ++i) { |
@@ -7142,8 +7142,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
7142 | case BuiltIn_Commands_BaseClass.CAMERA_FOCUS_OFFSET: | 7142 | case BuiltIn_Commands_BaseClass.CAMERA_FOCUS_OFFSET: |
7143 | case BuiltIn_Commands_BaseClass.CAMERA_POSITION: | 7143 | case BuiltIn_Commands_BaseClass.CAMERA_POSITION: |
7144 | LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; | 7144 | LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; |
7145 | parameters.Add(type + 1, (float)v.x); | 7145 | parameters.Add(type + 1, (float)v.x); |
7146 | parameters.Add(type + 2, (float)v.y); | 7146 | parameters.Add(type + 2, (float)v.y); |
7147 | parameters.Add(type + 3, (float)v.z); | 7147 | parameters.Add(type + 3, (float)v.z); |
7148 | break; | 7148 | break; |
7149 | default: | 7149 | default: |
@@ -7163,7 +7163,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
7163 | { | 7163 | { |
7164 | m_host.AddScriptLPS(1); | 7164 | m_host.AddScriptLPS(1); |
7165 | 7165 | ||
7166 | // our key in the object we are in | 7166 | // our key in the object we are in |
7167 | LLUUID invItemID=InventorySelf(); | 7167 | LLUUID invItemID=InventorySelf(); |
7168 | if (invItemID == LLUUID.Zero) return; | 7168 | if (invItemID == LLUUID.Zero) return; |
7169 | 7169 | ||
@@ -7177,10 +7177,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
7177 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 7177 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; |
7178 | 7178 | ||
7179 | ScenePresence presence = World.GetScenePresence(agentID); | 7179 | ScenePresence presence = World.GetScenePresence(agentID); |
7180 | 7180 | ||
7181 | // we are not interested in child-agents | 7181 | // we are not interested in child-agents |
7182 | if (presence.IsChildAgent) return; | 7182 | if (presence.IsChildAgent) return; |
7183 | 7183 | ||
7184 | presence.ControllingClient.SendClearFollowCamProperties(objectID); | 7184 | presence.ControllingClient.SendClearFollowCamProperties(objectID); |
7185 | } | 7185 | } |
7186 | 7186 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index e98dec6..3b317ac 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | |||
@@ -703,7 +703,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
703 | // Otherwise, if we have strings, compare them alphabetically. | 703 | // Otherwise, if we have strings, compare them alphabetically. |
704 | string str1 = new string(space1); | 704 | string str1 = new string(space1); |
705 | string str2 = new string(space2); | 705 | string str2 = new string(space2); |
706 | 706 | ||
707 | int result; | 707 | int result; |
708 | 708 | ||
709 | if (char.IsDigit(space1[0]) && char.IsDigit(space2[0])) | 709 | if (char.IsDigit(space1[0]) && char.IsDigit(space2[0])) |
@@ -1427,22 +1427,22 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1427 | bool ret = i1.value != i2.value; | 1427 | bool ret = i1.value != i2.value; |
1428 | return ret; | 1428 | return ret; |
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | static public LSLInteger operator +(LSLInteger i1, int i2) | 1431 | static public LSLInteger operator +(LSLInteger i1, int i2) |
1432 | { | 1432 | { |
1433 | return new LSLInteger(i1.value + i2); | 1433 | return new LSLInteger(i1.value + i2); |
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | static public LSLInteger operator -(LSLInteger i1, int i2) | 1436 | static public LSLInteger operator -(LSLInteger i1, int i2) |
1437 | { | 1437 | { |
1438 | return new LSLInteger(i1.value - i2); | 1438 | return new LSLInteger(i1.value - i2); |
1439 | } | 1439 | } |
1440 | 1440 | ||
1441 | static public LSLInteger operator *(LSLInteger i1, int i2) | 1441 | static public LSLInteger operator *(LSLInteger i1, int i2) |
1442 | { | 1442 | { |
1443 | return new LSLInteger(i1.value * i2); | 1443 | return new LSLInteger(i1.value * i2); |
1444 | } | 1444 | } |
1445 | 1445 | ||
1446 | static public LSLInteger operator /(LSLInteger i1, int i2) | 1446 | static public LSLInteger operator /(LSLInteger i1, int i2) |
1447 | { | 1447 | { |
1448 | return new LSLInteger(i1.value / i2); | 1448 | return new LSLInteger(i1.value / i2); |
@@ -1452,22 +1452,22 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1452 | { | 1452 | { |
1453 | return new LSLFloat((double)i1.value + f); | 1453 | return new LSLFloat((double)i1.value + f); |
1454 | } | 1454 | } |
1455 | 1455 | ||
1456 | static public LSLFloat operator -(LSLInteger i1, double f) | 1456 | static public LSLFloat operator -(LSLInteger i1, double f) |
1457 | { | 1457 | { |
1458 | return new LSLFloat((double)i1.value - f); | 1458 | return new LSLFloat((double)i1.value - f); |
1459 | } | 1459 | } |
1460 | 1460 | ||
1461 | static public LSLFloat operator *(LSLInteger i1, double f) | 1461 | static public LSLFloat operator *(LSLInteger i1, double f) |
1462 | { | 1462 | { |
1463 | return new LSLFloat((double)i1.value * f); | 1463 | return new LSLFloat((double)i1.value * f); |
1464 | } | 1464 | } |
1465 | 1465 | ||
1466 | static public LSLFloat operator /(LSLInteger i1, double f) | 1466 | static public LSLFloat operator /(LSLInteger i1, double f) |
1467 | { | 1467 | { |
1468 | return new LSLFloat((double)i1.value / f); | 1468 | return new LSLFloat((double)i1.value / f); |
1469 | } | 1469 | } |
1470 | 1470 | ||
1471 | static public LSLInteger operator -(LSLInteger i) | 1471 | static public LSLInteger operator -(LSLInteger i) |
1472 | { | 1472 | { |
1473 | return new LSLInteger(-i.value); | 1473 | return new LSLInteger(-i.value); |
@@ -1623,17 +1623,17 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1623 | f.value--; | 1623 | f.value--; |
1624 | return f; | 1624 | return f; |
1625 | } | 1625 | } |
1626 | 1626 | ||
1627 | static public LSLFloat operator +(LSLFloat f, int i) | 1627 | static public LSLFloat operator +(LSLFloat f, int i) |
1628 | { | 1628 | { |
1629 | return new LSLFloat(f.value + (double)i); | 1629 | return new LSLFloat(f.value + (double)i); |
1630 | } | 1630 | } |
1631 | 1631 | ||
1632 | static public LSLFloat operator -(LSLFloat f, int i) | 1632 | static public LSLFloat operator -(LSLFloat f, int i) |
1633 | { | 1633 | { |
1634 | return new LSLFloat(f.value - (double)i); | 1634 | return new LSLFloat(f.value - (double)i); |
1635 | } | 1635 | } |
1636 | 1636 | ||
1637 | static public LSLFloat operator *(LSLFloat f, int i) | 1637 | static public LSLFloat operator *(LSLFloat f, int i) |
1638 | { | 1638 | { |
1639 | return new LSLFloat(f.value * (double)i); | 1639 | return new LSLFloat(f.value * (double)i); |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs index 5f86c9c..77cc7ea 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs | |||
@@ -88,7 +88,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin | |||
88 | { | 88 | { |
89 | if (!DataserverRequests.ContainsKey(identifier)) | 89 | if (!DataserverRequests.ContainsKey(identifier)) |
90 | return; | 90 | return; |
91 | 91 | ||
92 | ds=DataserverRequests[identifier]; | 92 | ds=DataserverRequests[identifier]; |
93 | DataserverRequests.Remove(identifier); | 93 | DataserverRequests.Remove(identifier); |
94 | } | 94 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index 79c1dde..5c57874 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | |||
@@ -126,7 +126,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
126 | /// Queue containing events waiting to be executed | 126 | /// Queue containing events waiting to be executed |
127 | /// </summary> | 127 | /// </summary> |
128 | public Queue<QueueItemStruct> eventQueue = new Queue<QueueItemStruct>(); | 128 | public Queue<QueueItemStruct> eventQueue = new Queue<QueueItemStruct>(); |
129 | 129 | ||
130 | #region " Queue structures " | 130 | #region " Queue structures " |
131 | /// <summary> | 131 | /// <summary> |
132 | /// Queue item structure | 132 | /// Queue item structure |
@@ -193,7 +193,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
193 | } | 193 | } |
194 | 194 | ||
195 | #endregion | 195 | #endregion |
196 | 196 | ||
197 | #region " Shutdown all threads " | 197 | #region " Shutdown all threads " |
198 | ~EventQueueManager() | 198 | ~EventQueueManager() |
199 | { | 199 | { |
@@ -408,10 +408,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
408 | 408 | ||
409 | // Set flag if script should be removed or not | 409 | // Set flag if script should be removed or not |
410 | EventQueueThread.KillCurrentScript = KillScriptOnMaxFunctionExecutionTime; | 410 | EventQueueThread.KillCurrentScript = KillScriptOnMaxFunctionExecutionTime; |
411 | 411 | ||
412 | // Abort this thread | 412 | // Abort this thread |
413 | AbortThreadClass(EventQueueThread); | 413 | AbortThreadClass(EventQueueThread); |
414 | 414 | ||
415 | // We do not need to start another, MaintenenceThread will do that for us | 415 | // We do not need to start another, MaintenenceThread will do that for us |
416 | //StartNewThreadClass(); | 416 | //StartNewThreadClass(); |
417 | } | 417 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index 255ab99..4376e00 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
44 | public class EventQueueThreadClass : iScriptEngineFunctionModule | 44 | public class EventQueueThreadClass : iScriptEngineFunctionModule |
45 | { | 45 | { |
46 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// How many ms to sleep if queue is empty | 49 | /// How many ms to sleep if queue is empty |
50 | /// </summary> | 50 | /// </summary> |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs index f04ac01..9a465f6 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
73 | void remote_data(uint localID, LLUUID itemID); | 73 | void remote_data(uint localID, LLUUID itemID); |
74 | void http_response(uint localID, LLUUID itemID); | 74 | void http_response(uint localID, LLUUID itemID); |
75 | } | 75 | } |
76 | 76 | ||
77 | public interface ServerRemotingObject | 77 | public interface ServerRemotingObject |
78 | { | 78 | { |
79 | RemoteEvents Events(); | 79 | RemoteEvents Events(); |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index 06c7387..fa3e35b 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | |||
@@ -355,8 +355,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
355 | 355 | ||
356 | private static string CreateYPCompilerScript(string compileScript) | 356 | private static string CreateYPCompilerScript(string compileScript) |
357 | { | 357 | { |
358 | |||
359 | |||
360 | compileScript = String.Empty + | 358 | compileScript = String.Empty + |
361 | "using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog; " + | 359 | "using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog; " + |
362 | "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" + | 360 | "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" + |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs index 3f7b95e..8618d6c 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
61 | myCode = myCode.Substring(0, cs_pointer); | 61 | myCode = myCode.Substring(0, cs_pointer); |
62 | } | 62 | } |
63 | myCode.Replace("//yp", "%YPCode"); | 63 | myCode.Replace("//yp", "%YPCode"); |
64 | 64 | ||
65 | StringWriter myCS_SW = new StringWriter(); | 65 | StringWriter myCS_SW = new StringWriter(); |
66 | StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); | 66 | StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); |
67 | 67 | ||
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs index 999208d..415c646 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
54 | { | 54 | { |
55 | _arity = arity; | 55 | _arity = arity; |
56 | } | 56 | } |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Append the answer to the list and update the indexes, if any. | 59 | /// Append the answer to the list and update the indexes, if any. |
60 | /// Elements of answer must be ground, since arguments with unbound variables make this | 60 | /// Elements of answer must be ground, since arguments with unbound variables make this |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs index 9a1f00d..56ed719 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
54 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. | 54 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. |
55 | /// </summary> | 55 | /// </summary> |
56 | /// <param name="ErrorTerm">the error term of the error</param> | 56 | /// <param name="ErrorTerm">the error term of the error</param> |
57 | /// <param name="Messsage">the message term of the error. If this is a string, it is converted to an | 57 | /// <param name="Messsage">the message term of the error. If this is a string, it is converted to an |
58 | /// Atom so it can be used by Prolog code. | 58 | /// Atom so it can be used by Prolog code. |
59 | /// Message, converted to a string, is use as the printable exception message. | 59 | /// Message, converted to a string, is use as the printable exception message. |
60 | /// </param> | 60 | /// </param> |
@@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
66 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); | 66 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); |
67 | } | 67 | } |
68 | 68 | ||
69 | public class TypeErrorInfo | 69 | public class TypeErrorInfo |
70 | { | 70 | { |
71 | public readonly Atom _Type; | 71 | public readonly Atom _Type; |
72 | public readonly object _Culprit; | 72 | public readonly object _Culprit; |
@@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
116 | /// <returns></returns> | 116 | /// <returns></returns> |
117 | public object getProcedureName() | 117 | public object getProcedureName() |
118 | { | 118 | { |
119 | if (!(_Type._name == "procedure" && | 119 | if (!(_Type._name == "procedure" && |
120 | _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) | 120 | _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) |
121 | return null; | 121 | return null; |
122 | return ((Functor2)_Culprit)._arg1; | 122 | return ((Functor2)_Culprit)._arg1; |
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. | 126 | /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. |
127 | /// Otherwise return -1. | 127 | /// Otherwise return -1. |
128 | /// </summary> | 128 | /// </summary> |
129 | /// <returns></returns> | 129 | /// <returns></returns> |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs index b69f9c4..694e733 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
147 | /// <summary> | 147 | /// <summary> |
148 | /// Convert term to an int. | 148 | /// Convert term to an int. |
149 | /// If term is a single-element List, use its first element | 149 | /// If term is a single-element List, use its first element |
150 | /// (to handle the char types like "a"). | 150 | /// (to handle the char types like "a"). |
151 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only | 151 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only |
152 | /// called from arithmetic functions). | 152 | /// called from arithmetic functions). |
153 | /// </summary> | 153 | /// </summary> |
@@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
172 | { | 172 | { |
173 | throw new PrologException | 173 | throw new PrologException |
174 | (new Functor2 | 174 | (new Functor2 |
175 | ("type_error", Atom.a("evaluable"), | 175 | ("type_error", Atom.a("evaluable"), |
176 | new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), | 176 | new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), |
177 | "Term must be an integer"); | 177 | "Term must be an integer"); |
178 | } | 178 | } |
179 | } | 179 | } |
@@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
181 | /// <summary> | 181 | /// <summary> |
182 | /// Convert term to a double. This may convert an int to a double, etc. | 182 | /// Convert term to a double. This may convert an int to a double, etc. |
183 | /// If term is a single-element List, use its first element | 183 | /// If term is a single-element List, use its first element |
184 | /// (to handle the char types like "a"). | 184 | /// (to handle the char types like "a"). |
185 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only | 185 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only |
186 | /// called from arithmetic functions). | 186 | /// called from arithmetic functions). |
187 | /// </summary> | 187 | /// </summary> |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
195 | // Assume it is a char type like "a". | 195 | // Assume it is a char type like "a". |
196 | term = YP.getValue(((Functor2)term)._arg1); | 196 | term = YP.getValue(((Functor2)term)._arg1); |
197 | if (term is Variable) | 197 | if (term is Variable) |
198 | throw new PrologException(Atom.a("instantiation_error"), | 198 | throw new PrologException(Atom.a("instantiation_error"), |
199 | "Expected a number but the argument is an unbound variable"); | 199 | "Expected a number but the argument is an unbound variable"); |
200 | 200 | ||
201 | try | 201 | try |
@@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
776 | if (term1TypeCode == -2) | 776 | if (term1TypeCode == -2) |
777 | { | 777 | { |
778 | // Variable. | 778 | // Variable. |
779 | // We always check for equality first because we want to be sure | 779 | // We always check for equality first because we want to be sure |
780 | // that less than returns false if the terms are equal, in | 780 | // that less than returns false if the terms are equal, in |
781 | // case that the less than check really behaves like less than or equal. | 781 | // case that the less than check really behaves like less than or equal. |
782 | if ((Variable)Term1 != (Variable)Term2) | 782 | if ((Variable)Term1 != (Variable)Term2) |
783 | // The hash code should be unique to a Variable object. | 783 | // The hash code should be unique to a Variable object. |
@@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
820 | } | 820 | } |
821 | 821 | ||
822 | /// <summary> | 822 | /// <summary> |
823 | /// Type code is -2 if term is a Variable, 0 if it is an Atom, | 823 | /// Type code is -2 if term is a Variable, 0 if it is an Atom, |
824 | /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, | 824 | /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, |
825 | /// 4 if it is Functor. | 825 | /// 4 if it is Functor. |
826 | /// Otherwise, type code is -1. | 826 | /// Otherwise, type code is -1. |
827 | /// This does not call YP.getValue(term). | 827 | /// This does not call YP.getValue(term). |
@@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1167 | "Arg 2 List has an element which is an unbound variable"); | 1167 | "Arg 2 List has an element which is an unbound variable"); |
1168 | if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) | 1168 | if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) |
1169 | throw new PrologException | 1169 | throw new PrologException |
1170 | (new Functor2("type_error", Atom.a("character"), listAtom), | 1170 | (new Functor2("type_error", Atom.a("character"), listAtom), |
1171 | "Arg 2 List has an element which is not a one character atom"); | 1171 | "Arg 2 List has an element which is not a one character atom"); |
1172 | charArray[i] = ((Atom)listAtom)._name[0]; | 1172 | charArray[i] = ((Atom)listAtom)._name[0]; |
1173 | } | 1173 | } |
@@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1209 | int codeInt; | 1209 | int codeInt; |
1210 | if (!getInt(codeArray[i], out codeInt) || codeInt < 0) | 1210 | if (!getInt(codeArray[i], out codeInt) || codeInt < 0) |
1211 | throw new PrologException | 1211 | throw new PrologException |
1212 | (new Functor1("representation_error", Atom.a("character_code")), | 1212 | (new Functor1("representation_error", Atom.a("character_code")), |
1213 | "Element of Arg 2 List is not a character code"); | 1213 | "Element of Arg 2 List is not a character code"); |
1214 | charArray[i] = (char)codeInt; | 1214 | charArray[i] = (char)codeInt; |
1215 | } | 1215 | } |
@@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1323 | { | 1323 | { |
1324 | if (!YP.number(Number)) | 1324 | if (!YP.number(Number)) |
1325 | throw new PrologException | 1325 | throw new PrologException |
1326 | (new Functor2("type_error", Atom.a("number"), Number), | 1326 | (new Functor2("type_error", Atom.a("number"), Number), |
1327 | "Arg 1 Number is not var or number"); | 1327 | "Arg 1 Number is not var or number"); |
1328 | // We just checked, so convertDouble shouldn't throw an exception. | 1328 | // We just checked, so convertDouble shouldn't throw an exception. |
1329 | numberString = YP.doubleToString(YP.convertDouble(Number)); | 1329 | numberString = YP.doubleToString(YP.convertDouble(Number)); |
@@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1413 | { | 1413 | { |
1414 | if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) | 1414 | if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) |
1415 | throw new PrologException | 1415 | throw new PrologException |
1416 | (new Functor2("type_error", Atom.a("character"), Char), | 1416 | (new Functor2("type_error", Atom.a("character"), Char), |
1417 | "Arg 1 Char is not var or one-character atom"); | 1417 | "Arg 1 Char is not var or one-character atom"); |
1418 | 1418 | ||
1419 | if (Code is Variable) | 1419 | if (Code is Variable) |
@@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1795 | IndexedAnswers indexedAnswers; | 1795 | IndexedAnswers indexedAnswers; |
1796 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) | 1796 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) |
1797 | { | 1797 | { |
1798 | // Create an IndexedAnswers as the only clause of the predicate. | 1798 | // Create an IndexedAnswers as the only clause of the predicate. |
1799 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); | 1799 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); |
1800 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); | 1800 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); |
1801 | } | 1801 | } |
@@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1826 | IndexedAnswers indexedAnswers; | 1826 | IndexedAnswers indexedAnswers; |
1827 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) | 1827 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) |
1828 | { | 1828 | { |
1829 | // Create an IndexedAnswers as the only clause of the predicate. | 1829 | // Create an IndexedAnswers as the only clause of the predicate. |
1830 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); | 1830 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); |
1831 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); | 1831 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); |
1832 | } | 1832 | } |
@@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1855 | { | 1855 | { |
1856 | List<IClause> clauses; | 1856 | List<IClause> clauses; |
1857 | if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) | 1857 | if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) |
1858 | return unknownPredicate(name, arguments.Length, | 1858 | return unknownPredicate(name, arguments.Length, |
1859 | "Undefined dynamic predicate: " + name + "/" + arguments.Length); | 1859 | "Undefined dynamic predicate: " + name + "/" + arguments.Length); |
1860 | 1860 | ||
1861 | if (clauses.Count == 1) | 1861 | if (clauses.Count == 1) |
@@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1889 | } | 1889 | } |
1890 | 1890 | ||
1891 | /// <summary> | 1891 | /// <summary> |
1892 | /// If _prologFlags["unknown"] is fail then return fail(), else if | 1892 | /// If _prologFlags["unknown"] is fail then return fail(), else if |
1893 | /// _prologFlags["unknown"] is warning then write the message to YP.write and | 1893 | /// _prologFlags["unknown"] is warning then write the message to YP.write and |
1894 | /// return fail(), else throw a PrologException for existence_error. . | 1894 | /// return fail(), else throw a PrologException for existence_error. . |
1895 | /// </summary> | 1895 | /// </summary> |
@@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1917 | } | 1917 | } |
1918 | 1918 | ||
1919 | /// <summary> | 1919 | /// <summary> |
1920 | /// This is deprecated and just calls matchDynamic. This matches all clauses, | 1920 | /// This is deprecated and just calls matchDynamic. This matches all clauses, |
1921 | /// not just the ones defined with assertFact. | 1921 | /// not just the ones defined with assertFact. |
1922 | /// </summary> | 1922 | /// </summary> |
1923 | /// <param name="name"></param> | 1923 | /// <param name="name"></param> |
@@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2066 | /// dynamic predicate. | 2066 | /// dynamic predicate. |
2067 | /// </summary> | 2067 | /// </summary> |
2068 | /// <param name="NameSlashArity"></param> | 2068 | /// <param name="NameSlashArity"></param> |
2069 | /// <param name="declaringClass">if not null, used to resolve references to the default | 2069 | /// <param name="declaringClass">if not null, used to resolve references to the default |
2070 | /// module Atom.a("")</param> | 2070 | /// module Atom.a("")</param> |
2071 | /// <returns></returns> | 2071 | /// <returns></returns> |
2072 | public static IEnumerable<bool> current_predicate(object NameSlashArity, Type declaringClass) | 2072 | public static IEnumerable<bool> current_predicate(object NameSlashArity, Type declaringClass) |
@@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2078 | Functor2 NameArityFunctor = NameSlashArity as Functor2; | 2078 | Functor2 NameArityFunctor = NameSlashArity as Functor2; |
2079 | if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) | 2079 | if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) |
2080 | throw new PrologException | 2080 | throw new PrologException |
2081 | (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), | 2081 | (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), |
2082 | "Must be a name/arity predicate indicator"); | 2082 | "Must be a name/arity predicate indicator"); |
2083 | object name = YP.getValue(NameArityFunctor._arg1); | 2083 | object name = YP.getValue(NameArityFunctor._arg1); |
2084 | object arity = YP.getValue(NameArityFunctor._arg2); | 2084 | object arity = YP.getValue(NameArityFunctor._arg2); |
@@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2163 | } | 2163 | } |
2164 | 2164 | ||
2165 | /// <summary> | 2165 | /// <summary> |
2166 | /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from | 2166 | /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from |
2167 | /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. | 2167 | /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. |
2168 | /// Otherwise, compile the goal as a single clause predicate and invoke it. | 2168 | /// Otherwise, compile the goal as a single clause predicate and invoke it. |
2169 | /// </summary> | 2169 | /// </summary> |
2170 | /// <param name="Goal"></param> | 2170 | /// <param name="Goal"></param> |
2171 | /// <param name="declaringClass">if not null, used to resolve references to the default | 2171 | /// <param name="declaringClass">if not null, used to resolve references to the default |
2172 | /// module Atom.a("")</param> | 2172 | /// module Atom.a("")</param> |
2173 | /// <returns></returns> | 2173 | /// <returns></returns> |
2174 | public static IEnumerable<bool> getIterator(object Goal, Type declaringClass) | 2174 | public static IEnumerable<bool> getIterator(object Goal, Type declaringClass) |
@@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2259 | (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); | 2259 | (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); |
2260 | if (!_prologFlags.ContainsKey(((Atom)Key)._name)) | 2260 | if (!_prologFlags.ContainsKey(((Atom)Key)._name)) |
2261 | throw new PrologException | 2261 | throw new PrologException |
2262 | (new Functor2("domain_error", Atom.a("prolog_flag"), Key), | 2262 | (new Functor2("domain_error", Atom.a("prolog_flag"), Key), |
2263 | "Arg 1 Key is not a recognized flag"); | 2263 | "Arg 1 Key is not a recognized flag"); |
2264 | 2264 | ||
2265 | foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) | 2265 | foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) |
@@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2343 | string results = ""; | 2343 | string results = ""; |
2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) | 2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) |
2345 | { | 2345 | { |
2346 | //Console.WriteLine( m ); | 2346 | //Console.WriteLine( m ); |
2347 | results += presep+ m + postsep; | 2347 | results += presep+ m + postsep; |
2348 | } | 2348 | } |
2349 | return results; | 2349 | return results; |
@@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2662 | #pragma warning restore 0168 | 2662 | #pragma warning restore 0168 |
2663 | } | 2663 | } |
2664 | } | 2664 | } |
2665 | 2665 | ||
2666 | /// <summary> | 2666 | /// <summary> |
2667 | /// CodeListReader extends TextReader and overrides Read to read the next code from | 2667 | /// CodeListReader extends TextReader and overrides Read to read the next code from |
2668 | /// the CodeList which is a Prolog list of integer character codes. | 2668 | /// the CodeList which is a Prolog list of integer character codes. |
@@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2683 | /// <returns></returns> | 2683 | /// <returns></returns> |
2684 | public override int Read() | 2684 | public override int Read() |
2685 | { | 2685 | { |
2686 | Functor2 CodeListPair = _CodeList as Functor2; | 2686 | Functor2 CodeListPair = _CodeList as Functor2; |
2687 | int code; | 2687 | int code; |
2688 | if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && | 2688 | if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && |
2689 | getInt(CodeListPair._arg1, out code))) | 2689 | getInt(CodeListPair._arg1, out code))) |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 42d9bf8..c94b56a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -39,13 +39,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
39 | public class ScriptManager : Common.ScriptEngineBase.ScriptManager | 39 | public class ScriptManager : Common.ScriptEngineBase.ScriptManager |
40 | { | 40 | { |
41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
42 | 42 | ||
43 | public ScriptManager(Common.ScriptEngineBase.ScriptEngine scriptEngine) | 43 | public ScriptManager(Common.ScriptEngineBase.ScriptEngine scriptEngine) |
44 | : base(scriptEngine) | 44 | : base(scriptEngine) |
45 | { | 45 | { |
46 | base.m_scriptEngine = scriptEngine; | 46 | base.m_scriptEngine = scriptEngine; |
47 | } | 47 | } |
48 | private Compiler.LSL.Compiler LSLCompiler; | 48 | private Compiler.LSL.Compiler LSLCompiler; |
49 | 49 | ||
50 | public override void Initialize() | 50 | public override void Initialize() |
51 | { | 51 | { |
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
63 | public override void _StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez) | 63 | public override void _StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez) |
64 | { | 64 | { |
65 | m_log.DebugFormat( | 65 | m_log.DebugFormat( |
66 | "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", | 66 | "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", |
67 | m_scriptEngine.ScriptEngineName, localID, itemID); | 67 | m_scriptEngine.ScriptEngineName, localID, itemID); |
68 | 68 | ||
69 | //IScriptHost root = host.GetRoot(); | 69 | //IScriptHost root = host.GetRoot(); |
@@ -73,13 +73,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
73 | string CompiledScriptFile = String.Empty; | 73 | string CompiledScriptFile = String.Empty; |
74 | 74 | ||
75 | SceneObjectPart m_host = World.GetSceneObjectPart(localID); | 75 | SceneObjectPart m_host = World.GetSceneObjectPart(localID); |
76 | 76 | ||
77 | if (null == m_host) | 77 | if (null == m_host) |
78 | { | 78 | { |
79 | m_log.ErrorFormat( | 79 | m_log.ErrorFormat( |
80 | "[{0}]: Could not find scene object part corresponding to localID {1} to start script", | 80 | "[{0}]: Could not find scene object part corresponding to localID {1} to start script", |
81 | m_scriptEngine.ScriptEngineName, localID); | 81 | m_scriptEngine.ScriptEngineName, localID); |
82 | 82 | ||
83 | return; | 83 | return; |
84 | } | 84 | } |
85 | 85 | ||
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index 6924dd2..21888fa 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs | |||
@@ -53,12 +53,12 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
53 | public EventManager(ScriptEngine _ScriptEngine) | 53 | public EventManager(ScriptEngine _ScriptEngine) |
54 | { | 54 | { |
55 | myScriptEngine = _ScriptEngine; | 55 | myScriptEngine = _ScriptEngine; |
56 | 56 | ||
57 | m_TCPClient = new TCPClient(); | 57 | m_TCPClient = new TCPClient(); |
58 | RPC = new TRPC_Remote(m_TCPClient); | 58 | RPC = new TRPC_Remote(m_TCPClient); |
59 | RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); | 59 | RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); |
60 | myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort); | 60 | myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort); |
61 | 61 | ||
62 | myScriptEngine.Log.Info("[RemoteEngine]: Hooking up to server events"); | 62 | myScriptEngine.Log.Info("[RemoteEngine]: Hooking up to server events"); |
63 | //myScriptEngine.World.EventManager.OnObjectGrab += touch_start; | 63 | //myScriptEngine.World.EventManager.OnObjectGrab += touch_start; |
64 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; | 64 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9604828..4de207a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -348,23 +348,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
348 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting | 348 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting |
349 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. | 349 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. |
350 | */ | 350 | */ |
351 | 351 | ||
352 | /* How we arrived at this llEuler2Rot | 352 | /* How we arrived at this llEuler2Rot |
353 | * | 353 | * |
354 | * Experiment in SL to determine conventions: | 354 | * Experiment in SL to determine conventions: |
355 | * llEuler2Rot(<PI,0,0>)=<1,0,0,0> | 355 | * llEuler2Rot(<PI,0,0>)=<1,0,0,0> |
356 | * llEuler2Rot(<0,PI,0>)=<0,1,0,0> | 356 | * llEuler2Rot(<0,PI,0>)=<0,1,0,0> |
357 | * llEuler2Rot(<0,0,PI>)=<0,0,1,0> | 357 | * llEuler2Rot(<0,0,PI>)=<0,0,1,0> |
358 | * | 358 | * |
359 | * Important facts about Quaternions | 359 | * Important facts about Quaternions |
360 | * - multiplication is non-commutative (a*b != b*a) | 360 | * - multiplication is non-commutative (a*b != b*a) |
361 | * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication | 361 | * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication |
362 | * | 362 | * |
363 | * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): | 363 | * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): |
364 | * Qx = c1+i*s1 | 364 | * Qx = c1+i*s1 |
365 | * Qy = c2+j*s2; | 365 | * Qy = c2+j*s2; |
366 | * Qz = c3+k*s3; | 366 | * Qz = c3+k*s3; |
367 | * | 367 | * |
368 | * Rotations applied in order (from above) Z, Y, X | 368 | * Rotations applied in order (from above) Z, Y, X |
369 | * Q = (Qz * Qy) * Qx | 369 | * Q = (Qz * Qy) * Qx |
370 | * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) | 370 | * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) |
@@ -376,23 +376,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
376 | * y=j*(c1*s2*c3-s1*c2*s3) | 376 | * y=j*(c1*s2*c3-s1*c2*s3) |
377 | * z=k*(s1*s2*c3+c1*c2*s3) | 377 | * z=k*(s1*s2*c3+c1*c2*s3) |
378 | * s= c1*c2*c3-s1*s2*s3 | 378 | * s= c1*c2*c3-s1*s2*s3 |
379 | * | 379 | * |
380 | * This implementation agrees with the functions found here: | 380 | * This implementation agrees with the functions found here: |
381 | * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions | 381 | * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions |
382 | * And with the results in SL. | 382 | * And with the results in SL. |
383 | * | 383 | * |
384 | * It's also possible to calculate llEuler2Rot by direct multiplication of | 384 | * It's also possible to calculate llEuler2Rot by direct multiplication of |
385 | * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function | 385 | * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function |
386 | * from the wiki). | 386 | * from the wiki). |
387 | * Apparently in some cases this is better from a numerical precision perspective? | 387 | * Apparently in some cases this is better from a numerical precision perspective? |
388 | */ | 388 | */ |
389 | 389 | ||
390 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) | 390 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) |
391 | { | 391 | { |
392 | m_host.AddScriptLPS(1); | 392 | m_host.AddScriptLPS(1); |
393 | 393 | ||
394 | double x,y,z,s; | 394 | double x,y,z,s; |
395 | 395 | ||
396 | double c1 = Math.Cos(v.x/2.0); | 396 | double c1 = Math.Cos(v.x/2.0); |
397 | double c2 = Math.Cos(v.y/2.0); | 397 | double c2 = Math.Cos(v.y/2.0); |
398 | double c3 = Math.Cos(v.z/2.0); | 398 | double c3 = Math.Cos(v.z/2.0); |
@@ -404,7 +404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
404 | y = c1*s2*c3-s1*c2*s3; | 404 | y = c1*s2*c3-s1*c2*s3; |
405 | z = s1*s2*c3+c1*c2*s3; | 405 | z = s1*s2*c3+c1*c2*s3; |
406 | s = c1*c2*c3-s1*s2*s3; | 406 | s = c1*c2*c3-s1*s2*s3; |
407 | 407 | ||
408 | return new LSL_Types.Quaternion(x, y, z, s); | 408 | return new LSL_Types.Quaternion(x, y, z, s); |
409 | } | 409 | } |
410 | 410 | ||
@@ -414,7 +414,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
414 | double x, y, z, s; | 414 | double x, y, z, s; |
415 | int f = 0; | 415 | int f = 0; |
416 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> | 416 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> |
417 | // Computing quaternion x,y,z,s values | 417 | // Computing quaternion x,y,z,s values |
418 | x = ((fwd.x - left.y - up.z + 1) / 4); | 418 | x = ((fwd.x - left.y - up.z + 1) / 4); |
419 | x *= x; | 419 | x *= x; |
420 | x = Math.Sqrt(Math.Sqrt(x)); | 420 | x = Math.Sqrt(Math.Sqrt(x)); |
@@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
428 | s *= s; | 428 | s *= s; |
429 | s = Math.Sqrt(Math.Sqrt(s)); | 429 | s = Math.Sqrt(Math.Sqrt(s)); |
430 | 430 | ||
431 | // Set f for signs detection | 431 | // Set f for signs detection |
432 | if (fwd.y + left.x >= 0) { f += 1; } | 432 | if (fwd.y + left.x >= 0) { f += 1; } |
433 | if (fwd.z + up.x >= 0) { f += 2; } | 433 | if (fwd.z + up.x >= 0) { f += 2; } |
434 | if (left.z - up.y >= 0) { f += 4; } | 434 | if (left.z - up.y >= 0) { f += 4; } |
@@ -1013,9 +1013,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1013 | return; | 1013 | return; |
1014 | } | 1014 | } |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | public void SetGlow(SceneObjectPart part, int face, float glow) | 1017 | public void SetGlow(SceneObjectPart part, int face, float glow) |
1018 | { | 1018 | { |
1019 | LLObject.TextureEntry tex = part.Shape.Textures; | 1019 | LLObject.TextureEntry tex = part.Shape.Textures; |
1020 | if (face > -1) | 1020 | if (face > -1) |
1021 | { | 1021 | { |
@@ -1023,7 +1023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1023 | tex.FaceTextures[face].Glow = glow; | 1023 | tex.FaceTextures[face].Glow = glow; |
1024 | part.UpdateTexture(tex); | 1024 | part.UpdateTexture(tex); |
1025 | return; | 1025 | return; |
1026 | } | 1026 | } |
1027 | else if (face == -1) | 1027 | else if (face == -1) |
1028 | { | 1028 | { |
1029 | for (uint i = 0; i < 32; i++) | 1029 | for (uint i = 0; i < 32; i++) |
@@ -1038,15 +1038,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1038 | return; | 1038 | return; |
1039 | } | 1039 | } |
1040 | } | 1040 | } |
1041 | 1041 | ||
1042 | public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) | 1042 | public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) |
1043 | { | 1043 | { |
1044 | 1044 | ||
1045 | Shininess sval = new Shininess(); | 1045 | Shininess sval = new Shininess(); |
1046 | 1046 | ||
1047 | switch (shiny) | 1047 | switch (shiny) |
1048 | { | 1048 | { |
1049 | case 0: | 1049 | case 0: |
1050 | sval = Shininess.None; | 1050 | sval = Shininess.None; |
1051 | break; | 1051 | break; |
1052 | case 1: | 1052 | case 1: |
@@ -1062,7 +1062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1062 | sval = Shininess.None; | 1062 | sval = Shininess.None; |
1063 | break; | 1063 | break; |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | LLObject.TextureEntry tex = part.Shape.Textures; | 1066 | LLObject.TextureEntry tex = part.Shape.Textures; |
1067 | if (face > -1) | 1067 | if (face > -1) |
1068 | { | 1068 | { |
@@ -1070,8 +1070,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1070 | tex.FaceTextures[face].Shiny = sval; | 1070 | tex.FaceTextures[face].Shiny = sval; |
1071 | tex.FaceTextures[face].Bump = bump; | 1071 | tex.FaceTextures[face].Bump = bump; |
1072 | part.UpdateTexture(tex); | 1072 | part.UpdateTexture(tex); |
1073 | return; | 1073 | return; |
1074 | } | 1074 | } |
1075 | else if (face == -1) | 1075 | else if (face == -1) |
1076 | { | 1076 | { |
1077 | for (uint i = 0; i < 32; i++) | 1077 | for (uint i = 0; i < 32; i++) |
@@ -1088,8 +1088,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1088 | return; | 1088 | return; |
1089 | } | 1089 | } |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | public void SetFullBright(SceneObjectPart part, int face, bool bright) | 1092 | public void SetFullBright(SceneObjectPart part, int face, bool bright) |
1093 | { | 1093 | { |
1094 | LLObject.TextureEntry tex = part.Shape.Textures; | 1094 | LLObject.TextureEntry tex = part.Shape.Textures; |
1095 | if (face > -1) | 1095 | if (face > -1) |
@@ -1106,14 +1106,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1106 | if (tex.FaceTextures[i] != null) | 1106 | if (tex.FaceTextures[i] != null) |
1107 | { | 1107 | { |
1108 | tex.FaceTextures[i].Fullbright = bright; | 1108 | tex.FaceTextures[i].Fullbright = bright; |
1109 | } | 1109 | } |
1110 | } | 1110 | } |
1111 | tex.DefaultTexture.Fullbright = bright; | 1111 | tex.DefaultTexture.Fullbright = bright; |
1112 | part.UpdateTexture(tex); | 1112 | part.UpdateTexture(tex); |
1113 | return; | 1113 | return; |
1114 | } | 1114 | } |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | public double llGetAlpha(int face) | 1117 | public double llGetAlpha(int face) |
1118 | { | 1118 | { |
1119 | m_host.AddScriptLPS(1); | 1119 | m_host.AddScriptLPS(1); |
@@ -1169,7 +1169,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1169 | 1169 | ||
1170 | /// <summary> | 1170 | /// <summary> |
1171 | /// Set flexi parameters of a part. | 1171 | /// Set flexi parameters of a part. |
1172 | /// | 1172 | /// |
1173 | /// FIXME: Much of this code should probably be within the part itself. | 1173 | /// FIXME: Much of this code should probably be within the part itself. |
1174 | /// </summary> | 1174 | /// </summary> |
1175 | /// <param name="part"></param> | 1175 | /// <param name="part"></param> |
@@ -1179,7 +1179,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1179 | /// <param name="friction"></param> | 1179 | /// <param name="friction"></param> |
1180 | /// <param name="wind"></param> | 1180 | /// <param name="wind"></param> |
1181 | /// <param name="tension"></param> | 1181 | /// <param name="tension"></param> |
1182 | /// <param name="Force"></param> | 1182 | /// <param name="Force"></param> |
1183 | private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, | 1183 | private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, |
1184 | float wind, float tension, LSL_Types.Vector3 Force) | 1184 | float wind, float tension, LSL_Types.Vector3 Force) |
1185 | { | 1185 | { |
@@ -1230,7 +1230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1230 | 1230 | ||
1231 | /// <summary> | 1231 | /// <summary> |
1232 | /// Set a light point on a part | 1232 | /// Set a light point on a part |
1233 | /// | 1233 | /// |
1234 | /// FIXME: Much of this code should probably be in SceneObjectGroup | 1234 | /// FIXME: Much of this code should probably be in SceneObjectGroup |
1235 | /// </summary> | 1235 | /// </summary> |
1236 | /// <param name="part"></param> | 1236 | /// <param name="part"></param> |
@@ -1238,7 +1238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1238 | /// <param name="color"></param> | 1238 | /// <param name="color"></param> |
1239 | /// <param name="intensity"></param> | 1239 | /// <param name="intensity"></param> |
1240 | /// <param name="radius"></param> | 1240 | /// <param name="radius"></param> |
1241 | /// <param name="falloff"></param> | 1241 | /// <param name="falloff"></param> |
1242 | private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) | 1242 | private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) |
1243 | { | 1243 | { |
1244 | if (part == null) | 1244 | if (part == null) |
@@ -2880,13 +2880,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2880 | bool found = false; | 2880 | bool found = false; |
2881 | LLUUID destId = LLUUID.Zero; | 2881 | LLUUID destId = LLUUID.Zero; |
2882 | LLUUID objId = LLUUID.Zero; | 2882 | LLUUID objId = LLUUID.Zero; |
2883 | 2883 | ||
2884 | if (!LLUUID.TryParse(destination, out destId)) | 2884 | if (!LLUUID.TryParse(destination, out destId)) |
2885 | { | 2885 | { |
2886 | llSay(0, "Could not parse key " + destination); | 2886 | llSay(0, "Could not parse key " + destination); |
2887 | return; | 2887 | return; |
2888 | } | 2888 | } |
2889 | 2889 | ||
2890 | // move the first object found with this inventory name | 2890 | // move the first object found with this inventory name |
2891 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | 2891 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) |
2892 | { | 2892 | { |
@@ -4451,7 +4451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4451 | private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() | 4451 | private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() |
4452 | { | 4452 | { |
4453 | Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); | 4453 | Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); |
4454 | 4454 | ||
4455 | // TODO find out about the other defaults and add them here | 4455 | // TODO find out about the other defaults and add them here |
4456 | ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); | 4456 | ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); |
4457 | ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); | 4457 | ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); |
@@ -4465,7 +4465,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4465 | ps.PartMaxAge = 10.0f; | 4465 | ps.PartMaxAge = 10.0f; |
4466 | return ps; | 4466 | return ps; |
4467 | } | 4467 | } |
4468 | 4468 | ||
4469 | public void llParticleSystem(LSL_Types.list rules) | 4469 | public void llParticleSystem(LSL_Types.list rules) |
4470 | { | 4470 | { |
4471 | m_host.AddScriptLPS(1); | 4471 | m_host.AddScriptLPS(1); |
@@ -4660,7 +4660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4660 | itemList.Add(itemID); | 4660 | itemList.Add(itemID); |
4661 | } | 4661 | } |
4662 | } | 4662 | } |
4663 | 4663 | ||
4664 | if (itemList.Count == 0) | 4664 | if (itemList.Count == 0) |
4665 | return; | 4665 | return; |
4666 | 4666 | ||
@@ -4936,11 +4936,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4936 | m_host.AddScriptLPS(1); | 4936 | m_host.AddScriptLPS(1); |
4937 | return Util.Md5Hash(src + ":" + nonce.ToString()); | 4937 | return Util.Md5Hash(src + ":" + nonce.ToString()); |
4938 | } | 4938 | } |
4939 | 4939 | ||
4940 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) | 4940 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) |
4941 | { | 4941 | { |
4942 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | 4942 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); |
4943 | 4943 | ||
4944 | if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && | 4944 | if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && |
4945 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE && | 4945 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE && |
4946 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE && | 4946 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE && |
@@ -4998,23 +4998,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4998 | } | 4998 | } |
4999 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); | 4999 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); |
5000 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); | 5000 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); |
5001 | 5001 | ||
5002 | shapeBlock.ObjectLocalID = m_host.LocalId; | 5002 | shapeBlock.ObjectLocalID = m_host.LocalId; |
5003 | 5003 | ||
5004 | // retain pathcurve | 5004 | // retain pathcurve |
5005 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | 5005 | shapeBlock.PathCurve = m_host.Shape.PathCurve; |
5006 | 5006 | ||
5007 | return shapeBlock; | 5007 | return shapeBlock; |
5008 | } | 5008 | } |
5009 | 5009 | ||
5010 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) | 5010 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) |
5011 | { | 5011 | { |
5012 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5012 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5013 | 5013 | ||
5014 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5014 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5015 | 5015 | ||
5016 | shapeBlock.ProfileCurve += fudge; | 5016 | shapeBlock.ProfileCurve += fudge; |
5017 | 5017 | ||
5018 | if (taper_b.x < 0f) | 5018 | if (taper_b.x < 0f) |
5019 | { | 5019 | { |
5020 | taper_b.x = 0f; | 5020 | taper_b.x = 0f; |
@@ -5051,25 +5051,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5051 | } | 5051 | } |
5052 | shapeBlock.PathShearX = (byte)(100 * topshear.x); | 5052 | shapeBlock.PathShearX = (byte)(100 * topshear.x); |
5053 | shapeBlock.PathShearY = (byte)(100 * topshear.y); | 5053 | shapeBlock.PathShearY = (byte)(100 * topshear.y); |
5054 | 5054 | ||
5055 | m_host.UpdateShape(shapeBlock); | 5055 | m_host.UpdateShape(shapeBlock); |
5056 | } | 5056 | } |
5057 | 5057 | ||
5058 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) | 5058 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) |
5059 | { | 5059 | { |
5060 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5060 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5061 | 5061 | ||
5062 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5062 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5063 | 5063 | ||
5064 | // profile/path swapped for a sphere | 5064 | // profile/path swapped for a sphere |
5065 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | 5065 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; |
5066 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | 5066 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; |
5067 | 5067 | ||
5068 | shapeBlock.ProfileCurve += fudge; | 5068 | shapeBlock.ProfileCurve += fudge; |
5069 | 5069 | ||
5070 | shapeBlock.PathScaleX = 100; | 5070 | shapeBlock.PathScaleX = 100; |
5071 | shapeBlock.PathScaleY = 100; | 5071 | shapeBlock.PathScaleY = 100; |
5072 | 5072 | ||
5073 | if (dimple.x < 0f) | 5073 | if (dimple.x < 0f) |
5074 | { | 5074 | { |
5075 | dimple.x = 0f; | 5075 | dimple.x = 0f; |
@@ -5092,22 +5092,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5092 | } | 5092 | } |
5093 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); | 5093 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); |
5094 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); | 5094 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); |
5095 | 5095 | ||
5096 | m_host.UpdateShape(shapeBlock); | 5096 | m_host.UpdateShape(shapeBlock); |
5097 | } | 5097 | } |
5098 | 5098 | ||
5099 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) | 5099 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) |
5100 | { | 5100 | { |
5101 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5101 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5102 | 5102 | ||
5103 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5103 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5104 | 5104 | ||
5105 | shapeBlock.ProfileCurve += fudge; | 5105 | shapeBlock.ProfileCurve += fudge; |
5106 | 5106 | ||
5107 | // profile/path swapped for a torrus, tube, ring | 5107 | // profile/path swapped for a torrus, tube, ring |
5108 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | 5108 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; |
5109 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | 5109 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; |
5110 | 5110 | ||
5111 | if (holesize.x < 0.05f) | 5111 | if (holesize.x < 0.05f) |
5112 | { | 5112 | { |
5113 | holesize.x = 0.05f; | 5113 | holesize.x = 0.05f; |
@@ -5212,15 +5212,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5212 | skew = 0.95f; | 5212 | skew = 0.95f; |
5213 | } | 5213 | } |
5214 | shapeBlock.PathSkew = (sbyte)(100 * skew); | 5214 | shapeBlock.PathSkew = (sbyte)(100 * skew); |
5215 | 5215 | ||
5216 | m_host.UpdateShape(shapeBlock); | 5216 | m_host.UpdateShape(shapeBlock); |
5217 | } | 5217 | } |
5218 | 5218 | ||
5219 | private void SetPrimitiveShapeParams(string map, int type) | 5219 | private void SetPrimitiveShapeParams(string map, int type) |
5220 | { | 5220 | { |
5221 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | 5221 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); |
5222 | LLUUID sculptId; | 5222 | LLUUID sculptId; |
5223 | 5223 | ||
5224 | if (!LLUUID.TryParse(map, out sculptId)) | 5224 | if (!LLUUID.TryParse(map, out sculptId)) |
5225 | { | 5225 | { |
5226 | llSay(0, "Could not parse key " + map); | 5226 | llSay(0, "Could not parse key " + map); |
@@ -5230,7 +5230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5230 | shapeBlock.ObjectLocalID = m_host.LocalId; | 5230 | shapeBlock.ObjectLocalID = m_host.LocalId; |
5231 | shapeBlock.PathScaleX = 100; | 5231 | shapeBlock.PathScaleX = 100; |
5232 | shapeBlock.PathScaleY = 150; | 5232 | shapeBlock.PathScaleY = 150; |
5233 | 5233 | ||
5234 | if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && | 5234 | if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && |
5235 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && | 5235 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && |
5236 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && | 5236 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && |
@@ -5239,7 +5239,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5239 | // default | 5239 | // default |
5240 | type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; | 5240 | type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; |
5241 | } | 5241 | } |
5242 | 5242 | ||
5243 | // retain pathcurve | 5243 | // retain pathcurve |
5244 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | 5244 | shapeBlock.PathCurve = m_host.Shape.PathCurve; |
5245 | 5245 | ||
@@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5256 | public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules) | 5256 | public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules) |
5257 | { | 5257 | { |
5258 | m_host.AddScriptLPS(1); | 5258 | m_host.AddScriptLPS(1); |
5259 | 5259 | ||
5260 | if (m_host.ParentGroup == null) | 5260 | if (m_host.ParentGroup == null) |
5261 | return; | 5261 | return; |
5262 | 5262 | ||
@@ -5302,13 +5302,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5302 | SetRot(part, q); | 5302 | SetRot(part, q); |
5303 | 5303 | ||
5304 | break; | 5304 | break; |
5305 | 5305 | ||
5306 | case (int)ScriptBaseClass.PRIM_TYPE: | 5306 | case (int)ScriptBaseClass.PRIM_TYPE: |
5307 | if (remain < 3) | 5307 | if (remain < 3) |
5308 | return; | 5308 | return; |
5309 | 5309 | ||
5310 | code = Convert.ToInt32(rules.Data[idx++]); | 5310 | code = Convert.ToInt32(rules.Data[idx++]); |
5311 | 5311 | ||
5312 | remain = rules.Length - idx; | 5312 | remain = rules.Length - idx; |
5313 | float hollow; | 5313 | float hollow; |
5314 | LSL_Types.Vector3 twist; | 5314 | LSL_Types.Vector3 twist; |
@@ -5319,9 +5319,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5319 | float skew; | 5319 | float skew; |
5320 | LSL_Types.Vector3 holesize; | 5320 | LSL_Types.Vector3 holesize; |
5321 | LSL_Types.Vector3 profilecut; | 5321 | LSL_Types.Vector3 profilecut; |
5322 | 5322 | ||
5323 | switch (code) | 5323 | switch (code) |
5324 | { | 5324 | { |
5325 | case (int)ScriptBaseClass.PRIM_TYPE_BOX: | 5325 | case (int)ScriptBaseClass.PRIM_TYPE_BOX: |
5326 | if (remain < 6) | 5326 | if (remain < 6) |
5327 | return; | 5327 | return; |
@@ -5335,7 +5335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5335 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | 5335 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; |
5336 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); | 5336 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); |
5337 | break; | 5337 | break; |
5338 | 5338 | ||
5339 | case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: | 5339 | case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: |
5340 | if (remain < 6) | 5340 | if (remain < 6) |
5341 | return; | 5341 | return; |
@@ -5350,12 +5350,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5350 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | 5350 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; |
5351 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); | 5351 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); |
5352 | break; | 5352 | break; |
5353 | 5353 | ||
5354 | case (int)ScriptBaseClass.PRIM_TYPE_PRISM: | 5354 | case (int)ScriptBaseClass.PRIM_TYPE_PRISM: |
5355 | if (remain < 6) | 5355 | if (remain < 6) |
5356 | return; | 5356 | return; |
5357 | 5357 | ||
5358 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5358 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5359 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5359 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5360 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5360 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5361 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5361 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5377,12 +5377,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5377 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5377 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5378 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); | 5378 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); |
5379 | break; | 5379 | break; |
5380 | 5380 | ||
5381 | case (int)ScriptBaseClass.PRIM_TYPE_TORUS: | 5381 | case (int)ScriptBaseClass.PRIM_TYPE_TORUS: |
5382 | if (remain < 11) | 5382 | if (remain < 11) |
5383 | return; | 5383 | return; |
5384 | 5384 | ||
5385 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5385 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5386 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5386 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5387 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5387 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5388 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5388 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5396,12 +5396,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5396 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5396 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5397 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); | 5397 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); |
5398 | break; | 5398 | break; |
5399 | 5399 | ||
5400 | case (int)ScriptBaseClass.PRIM_TYPE_TUBE: | 5400 | case (int)ScriptBaseClass.PRIM_TYPE_TUBE: |
5401 | if (remain < 11) | 5401 | if (remain < 11) |
5402 | return; | 5402 | return; |
5403 | 5403 | ||
5404 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5404 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5405 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5405 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5406 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5406 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5407 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5407 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5415,12 +5415,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5415 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5415 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5416 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); | 5416 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); |
5417 | break; | 5417 | break; |
5418 | 5418 | ||
5419 | case (int)ScriptBaseClass.PRIM_TYPE_RING: | 5419 | case (int)ScriptBaseClass.PRIM_TYPE_RING: |
5420 | if (remain < 11) | 5420 | if (remain < 11) |
5421 | return; | 5421 | return; |
5422 | 5422 | ||
5423 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5423 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5424 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5424 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5425 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5425 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5426 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5426 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5434,7 +5434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5434 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5434 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5435 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); | 5435 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); |
5436 | break; | 5436 | break; |
5437 | 5437 | ||
5438 | case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: | 5438 | case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: |
5439 | if (remain < 2) | 5439 | if (remain < 2) |
5440 | return; | 5440 | return; |
@@ -5445,7 +5445,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5445 | SetPrimitiveShapeParams(map, face); | 5445 | SetPrimitiveShapeParams(map, face); |
5446 | break; | 5446 | break; |
5447 | } | 5447 | } |
5448 | 5448 | ||
5449 | break; | 5449 | break; |
5450 | 5450 | ||
5451 | case (int)ScriptBaseClass.PRIM_TEXTURE: | 5451 | case (int)ScriptBaseClass.PRIM_TEXTURE: |
@@ -5509,31 +5509,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5509 | return; | 5509 | return; |
5510 | face = Convert.ToInt32(rules.Data[idx++]); | 5510 | face = Convert.ToInt32(rules.Data[idx++]); |
5511 | float glow = (float)Convert.ToDouble(rules.Data[idx++]); | 5511 | float glow = (float)Convert.ToDouble(rules.Data[idx++]); |
5512 | 5512 | ||
5513 | SetGlow(part, face, glow); | 5513 | SetGlow(part, face, glow); |
5514 | 5514 | ||
5515 | break; | 5515 | break; |
5516 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | 5516 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
5517 | if (remain < 3) | 5517 | if (remain < 3) |
5518 | return; | 5518 | return; |
5519 | face = Convert.ToInt32(rules.Data[idx++]); | 5519 | face = Convert.ToInt32(rules.Data[idx++]); |
5520 | int shiny = Convert.ToInt32(rules.Data[idx++]); | 5520 | int shiny = Convert.ToInt32(rules.Data[idx++]); |
5521 | Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); | 5521 | Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); |
5522 | 5522 | ||
5523 | SetShiny(part, face, shiny, bump); | 5523 | SetShiny(part, face, shiny, bump); |
5524 | 5524 | ||
5525 | break; | 5525 | break; |
5526 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: | 5526 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: |
5527 | if (remain < 2) | 5527 | if (remain < 2) |
5528 | return; | 5528 | return; |
5529 | face = Convert.ToInt32(rules.Data[idx++]); | 5529 | face = Convert.ToInt32(rules.Data[idx++]); |
5530 | string bv = rules.Data[idx++].ToString(); | 5530 | string bv = rules.Data[idx++].ToString(); |
5531 | bool st; | 5531 | bool st; |
5532 | if (bv.Equals("1")) | 5532 | if (bv.Equals("1")) |
5533 | st = true; | 5533 | st = true; |
5534 | else | 5534 | else |
5535 | st = false; | 5535 | st = false; |
5536 | 5536 | ||
5537 | SetFullBright(part, face , st); | 5537 | SetFullBright(part, face , st); |
5538 | break; | 5538 | break; |
5539 | case (int)ScriptBaseClass.PRIM_MATERIAL: | 5539 | case (int)ScriptBaseClass.PRIM_MATERIAL: |
@@ -5552,29 +5552,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5552 | case (int)ScriptBaseClass.PRIM_PHANTOM: | 5552 | case (int)ScriptBaseClass.PRIM_PHANTOM: |
5553 | if (remain < 1) | 5553 | if (remain < 1) |
5554 | return; | 5554 | return; |
5555 | 5555 | ||
5556 | string ph = rules.Data[idx++].ToString(); | 5556 | string ph = rules.Data[idx++].ToString(); |
5557 | bool phantom; | 5557 | bool phantom; |
5558 | 5558 | ||
5559 | if (ph.Equals("1")) | 5559 | if (ph.Equals("1")) |
5560 | phantom = true; | 5560 | phantom = true; |
5561 | else | 5561 | else |
5562 | phantom = false; | 5562 | phantom = false; |
5563 | 5563 | ||
5564 | part.ScriptSetPhantomStatus(phantom); | 5564 | part.ScriptSetPhantomStatus(phantom); |
5565 | part.ScheduleFullUpdate(); | 5565 | part.ScheduleFullUpdate(); |
5566 | break; | 5566 | break; |
5567 | case (int)ScriptBaseClass.PRIM_PHYSICS: | 5567 | case (int)ScriptBaseClass.PRIM_PHYSICS: |
5568 | if (remain < 1) | 5568 | if (remain < 1) |
5569 | return; | 5569 | return; |
5570 | string phy = rules.Data[idx++].ToString(); | 5570 | string phy = rules.Data[idx++].ToString(); |
5571 | bool physics; | 5571 | bool physics; |
5572 | 5572 | ||
5573 | if (phy.Equals("1")) | 5573 | if (phy.Equals("1")) |
5574 | physics = true; | 5574 | physics = true; |
5575 | else | 5575 | else |
5576 | physics = false; | 5576 | physics = false; |
5577 | 5577 | ||
5578 | m_host.ScriptSetPhysicsStatus(physics); | 5578 | m_host.ScriptSetPhysicsStatus(physics); |
5579 | part.ScheduleFullUpdate(); | 5579 | part.ScheduleFullUpdate(); |
5580 | break; | 5580 | break; |
@@ -5645,7 +5645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5645 | public LSL_Types.list llGetAnimationList( string id ) | 5645 | public LSL_Types.list llGetAnimationList( string id ) |
5646 | { | 5646 | { |
5647 | m_host.AddScriptLPS(1); | 5647 | m_host.AddScriptLPS(1); |
5648 | 5648 | ||
5649 | LSL_Types.list l = new LSL_Types.list(); | 5649 | LSL_Types.list l = new LSL_Types.list(); |
5650 | ScenePresence av = World.GetScenePresence(id); | 5650 | ScenePresence av = World.GetScenePresence(id); |
5651 | if (av == null) | 5651 | if (av == null) |
@@ -6758,7 +6758,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6758 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) | 6758 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) |
6759 | m_host.AddScriptLPS(1); | 6759 | m_host.AddScriptLPS(1); |
6760 | for (int i = 0; i < commandList.Data.Length; i++) | 6760 | for (int i = 0; i < commandList.Data.Length; i++) |
6761 | { | 6761 | { |
6762 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) | 6762 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) |
6763 | { | 6763 | { |
6764 | case ParcelMediaCommandEnum.Play: | 6764 | case ParcelMediaCommandEnum.Play: |
@@ -6768,7 +6768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6768 | if (!agent.IsChildAgent) | 6768 | if (!agent.IsChildAgent) |
6769 | { | 6769 | { |
6770 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); | 6770 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); |
6771 | } | 6771 | } |
6772 | } | 6772 | } |
6773 | break; | 6773 | break; |
6774 | case ParcelMediaCommandEnum.Stop: | 6774 | case ParcelMediaCommandEnum.Stop: |
@@ -6799,7 +6799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6799 | { | 6799 | { |
6800 | //Set the new media URL only if the user is the owner of the land | 6800 | //Set the new media URL only if the user is the owner of the land |
6801 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); | 6801 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); |
6802 | 6802 | ||
6803 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); | 6803 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); |
6804 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 6804 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
6805 | //Send an update of the mediaURL to all the clients that are in the parcel | 6805 | //Send an update of the mediaURL to all the clients that are in the parcel |
@@ -6810,8 +6810,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6810 | //Send parcel media update to the client | 6810 | //Send parcel media update to the client |
6811 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); | 6811 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); |
6812 | } | 6812 | } |
6813 | } | 6813 | } |
6814 | 6814 | ||
6815 | } | 6815 | } |
6816 | i++; | 6816 | i++; |
6817 | } | 6817 | } |
@@ -6821,7 +6821,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6821 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); | 6821 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); |
6822 | break; | 6822 | break; |
6823 | }//end switch | 6823 | }//end switch |
6824 | 6824 | ||
6825 | } | 6825 | } |
6826 | 6826 | ||
6827 | 6827 | ||
@@ -6864,7 +6864,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6864 | } | 6864 | } |
6865 | } | 6865 | } |
6866 | return list; | 6866 | return list; |
6867 | 6867 | ||
6868 | } | 6868 | } |
6869 | 6869 | ||
6870 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) | 6870 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) |
@@ -6908,7 +6908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6908 | { | 6908 | { |
6909 | m_host.AddScriptLPS(1); | 6909 | m_host.AddScriptLPS(1); |
6910 | LLUUID invItemID=InventorySelf(); | 6910 | LLUUID invItemID=InventorySelf(); |
6911 | if (invItemID == LLUUID.Zero) | 6911 | if (invItemID == LLUUID.Zero) |
6912 | return new LSL_Types.Vector3(); | 6912 | return new LSL_Types.Vector3(); |
6913 | if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) | 6913 | if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) |
6914 | return new LSL_Types.Vector3(); | 6914 | return new LSL_Types.Vector3(); |
@@ -7036,8 +7036,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7036 | public void llSetCameraParams(LSL_Types.list rules) | 7036 | public void llSetCameraParams(LSL_Types.list rules) |
7037 | { | 7037 | { |
7038 | m_host.AddScriptLPS(1); | 7038 | m_host.AddScriptLPS(1); |
7039 | 7039 | ||
7040 | // our key in the object we are in | 7040 | // our key in the object we are in |
7041 | LLUUID invItemID=InventorySelf(); | 7041 | LLUUID invItemID=InventorySelf(); |
7042 | if (invItemID == LLUUID.Zero) return; | 7042 | if (invItemID == LLUUID.Zero) return; |
7043 | 7043 | ||
@@ -7051,10 +7051,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7051 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 7051 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; |
7052 | 7052 | ||
7053 | ScenePresence presence = World.GetScenePresence(agentID); | 7053 | ScenePresence presence = World.GetScenePresence(agentID); |
7054 | 7054 | ||
7055 | // we are not interested in child-agents | 7055 | // we are not interested in child-agents |
7056 | if (presence.IsChildAgent) return; | 7056 | if (presence.IsChildAgent) return; |
7057 | 7057 | ||
7058 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); | 7058 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); |
7059 | object[] data = rules.Data; | 7059 | object[] data = rules.Data; |
7060 | for (int i = 0; i < data.Length; ++i) { | 7060 | for (int i = 0; i < data.Length; ++i) { |
@@ -7067,8 +7067,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7067 | case ScriptBaseClass.CAMERA_FOCUS_OFFSET: | 7067 | case ScriptBaseClass.CAMERA_FOCUS_OFFSET: |
7068 | case ScriptBaseClass.CAMERA_POSITION: | 7068 | case ScriptBaseClass.CAMERA_POSITION: |
7069 | LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; | 7069 | LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; |
7070 | parameters.Add(type + 1, (float)v.x); | 7070 | parameters.Add(type + 1, (float)v.x); |
7071 | parameters.Add(type + 2, (float)v.y); | 7071 | parameters.Add(type + 2, (float)v.y); |
7072 | parameters.Add(type + 3, (float)v.z); | 7072 | parameters.Add(type + 3, (float)v.z); |
7073 | break; | 7073 | break; |
7074 | default: | 7074 | default: |
@@ -7088,7 +7088,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7088 | { | 7088 | { |
7089 | m_host.AddScriptLPS(1); | 7089 | m_host.AddScriptLPS(1); |
7090 | 7090 | ||
7091 | // our key in the object we are in | 7091 | // our key in the object we are in |
7092 | LLUUID invItemID=InventorySelf(); | 7092 | LLUUID invItemID=InventorySelf(); |
7093 | if (invItemID == LLUUID.Zero) return; | 7093 | if (invItemID == LLUUID.Zero) return; |
7094 | 7094 | ||
@@ -7102,10 +7102,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7102 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 7102 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; |
7103 | 7103 | ||
7104 | ScenePresence presence = World.GetScenePresence(agentID); | 7104 | ScenePresence presence = World.GetScenePresence(agentID); |
7105 | 7105 | ||
7106 | // we are not interested in child-agents | 7106 | // we are not interested in child-agents |
7107 | if (presence.IsChildAgent) return; | 7107 | if (presence.IsChildAgent) return; |
7108 | 7108 | ||
7109 | presence.ControllingClient.SendClearFollowCamProperties(objectID); | 7109 | presence.ControllingClient.SendClearFollowCamProperties(objectID); |
7110 | } | 7110 | } |
7111 | 7111 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs index 6c88ae86..52d277e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs | |||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
89 | { | 89 | { |
90 | if (!DataserverRequests.ContainsKey(identifier)) | 90 | if (!DataserverRequests.ContainsKey(identifier)) |
91 | return; | 91 | return; |
92 | 92 | ||
93 | ds=DataserverRequests[identifier]; | 93 | ds=DataserverRequests[identifier]; |
94 | DataserverRequests.Remove(identifier); | 94 | DataserverRequests.Remove(identifier); |
95 | } | 95 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs index 89bf51c..3f3cf39 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
70 | new LSL_Types.LSLInteger(rInfo.GetIntValue()), | 70 | new LSL_Types.LSLInteger(rInfo.GetIntValue()), |
71 | new LSL_Types.LSLString(rInfo.GetStrVal()) | 71 | new LSL_Types.LSLString(rInfo.GetStrVal()) |
72 | }; | 72 | }; |
73 | 73 | ||
74 | foreach (AsyncCommandManager m in m_CmdManager.Managers) | 74 | foreach (AsyncCommandManager m in m_CmdManager.Managers) |
75 | { | 75 | { |
76 | if (m.m_ScriptEngine.PostScriptEvent( | 76 | if (m.m_ScriptEngine.PostScriptEvent( |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index 5b32cde..c28aa9a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | |||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
81 | return; | 81 | return; |
82 | 82 | ||
83 | MethodInfo mi = inits[api]; | 83 | MethodInfo mi = inits[api]; |
84 | 84 | ||
85 | Object[] args = new Object[1]; | 85 | Object[] args = new Object[1]; |
86 | args[0] = data; | 86 | args[0] = data; |
87 | 87 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs index 681b2f2..d6a339b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
54 | { | 54 | { |
55 | _arity = arity; | 55 | _arity = arity; |
56 | } | 56 | } |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Append the answer to the list and update the indexes, if any. | 59 | /// Append the answer to the list and update the indexes, if any. |
60 | /// Elements of answer must be ground, since arguments with unbound variables make this | 60 | /// Elements of answer must be ground, since arguments with unbound variables make this |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs index a2fe7ec..9f5ae3d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
54 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. | 54 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. |
55 | /// </summary> | 55 | /// </summary> |
56 | /// <param name="ErrorTerm">the error term of the error</param> | 56 | /// <param name="ErrorTerm">the error term of the error</param> |
57 | /// <param name="Messsage">the message term of the error. If this is a string, it is converted to an | 57 | /// <param name="Messsage">the message term of the error. If this is a string, it is converted to an |
58 | /// Atom so it can be used by Prolog code. | 58 | /// Atom so it can be used by Prolog code. |
59 | /// Message, converted to a string, is use as the printable exception message. | 59 | /// Message, converted to a string, is use as the printable exception message. |
60 | /// </param> | 60 | /// </param> |
@@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
66 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); | 66 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); |
67 | } | 67 | } |
68 | 68 | ||
69 | public class TypeErrorInfo | 69 | public class TypeErrorInfo |
70 | { | 70 | { |
71 | public readonly Atom _Type; | 71 | public readonly Atom _Type; |
72 | public readonly object _Culprit; | 72 | public readonly object _Culprit; |
@@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
116 | /// <returns></returns> | 116 | /// <returns></returns> |
117 | public object getProcedureName() | 117 | public object getProcedureName() |
118 | { | 118 | { |
119 | if (!(_Type._name == "procedure" && | 119 | if (!(_Type._name == "procedure" && |
120 | _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) | 120 | _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) |
121 | return null; | 121 | return null; |
122 | return ((Functor2)_Culprit)._arg1; | 122 | return ((Functor2)_Culprit)._arg1; |
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. | 126 | /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. |
127 | /// Otherwise return -1. | 127 | /// Otherwise return -1. |
128 | /// </summary> | 128 | /// </summary> |
129 | /// <returns></returns> | 129 | /// <returns></returns> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 97c9087..2e90d74 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
147 | /// <summary> | 147 | /// <summary> |
148 | /// Convert term to an int. | 148 | /// Convert term to an int. |
149 | /// If term is a single-element List, use its first element | 149 | /// If term is a single-element List, use its first element |
150 | /// (to handle the char types like "a"). | 150 | /// (to handle the char types like "a"). |
151 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only | 151 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only |
152 | /// called from arithmetic functions). | 152 | /// called from arithmetic functions). |
153 | /// </summary> | 153 | /// </summary> |
@@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
172 | { | 172 | { |
173 | throw new PrologException | 173 | throw new PrologException |
174 | (new Functor2 | 174 | (new Functor2 |
175 | ("type_error", Atom.a("evaluable"), | 175 | ("type_error", Atom.a("evaluable"), |
176 | new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), | 176 | new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), |
177 | "Term must be an integer"); | 177 | "Term must be an integer"); |
178 | } | 178 | } |
179 | } | 179 | } |
@@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
181 | /// <summary> | 181 | /// <summary> |
182 | /// Convert term to a double. This may convert an int to a double, etc. | 182 | /// Convert term to a double. This may convert an int to a double, etc. |
183 | /// If term is a single-element List, use its first element | 183 | /// If term is a single-element List, use its first element |
184 | /// (to handle the char types like "a"). | 184 | /// (to handle the char types like "a"). |
185 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only | 185 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only |
186 | /// called from arithmetic functions). | 186 | /// called from arithmetic functions). |
187 | /// </summary> | 187 | /// </summary> |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
195 | // Assume it is a char type like "a". | 195 | // Assume it is a char type like "a". |
196 | term = YP.getValue(((Functor2)term)._arg1); | 196 | term = YP.getValue(((Functor2)term)._arg1); |
197 | if (term is Variable) | 197 | if (term is Variable) |
198 | throw new PrologException(Atom.a("instantiation_error"), | 198 | throw new PrologException(Atom.a("instantiation_error"), |
199 | "Expected a number but the argument is an unbound variable"); | 199 | "Expected a number but the argument is an unbound variable"); |
200 | 200 | ||
201 | try | 201 | try |
@@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
776 | if (term1TypeCode == -2) | 776 | if (term1TypeCode == -2) |
777 | { | 777 | { |
778 | // Variable. | 778 | // Variable. |
779 | // We always check for equality first because we want to be sure | 779 | // We always check for equality first because we want to be sure |
780 | // that less than returns false if the terms are equal, in | 780 | // that less than returns false if the terms are equal, in |
781 | // case that the less than check really behaves like less than or equal. | 781 | // case that the less than check really behaves like less than or equal. |
782 | if ((Variable)Term1 != (Variable)Term2) | 782 | if ((Variable)Term1 != (Variable)Term2) |
783 | // The hash code should be unique to a Variable object. | 783 | // The hash code should be unique to a Variable object. |
@@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
820 | } | 820 | } |
821 | 821 | ||
822 | /// <summary> | 822 | /// <summary> |
823 | /// Type code is -2 if term is a Variable, 0 if it is an Atom, | 823 | /// Type code is -2 if term is a Variable, 0 if it is an Atom, |
824 | /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, | 824 | /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, |
825 | /// 4 if it is Functor. | 825 | /// 4 if it is Functor. |
826 | /// Otherwise, type code is -1. | 826 | /// Otherwise, type code is -1. |
827 | /// This does not call YP.getValue(term). | 827 | /// This does not call YP.getValue(term). |
@@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1167 | "Arg 2 List has an element which is an unbound variable"); | 1167 | "Arg 2 List has an element which is an unbound variable"); |
1168 | if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) | 1168 | if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) |
1169 | throw new PrologException | 1169 | throw new PrologException |
1170 | (new Functor2("type_error", Atom.a("character"), listAtom), | 1170 | (new Functor2("type_error", Atom.a("character"), listAtom), |
1171 | "Arg 2 List has an element which is not a one character atom"); | 1171 | "Arg 2 List has an element which is not a one character atom"); |
1172 | charArray[i] = ((Atom)listAtom)._name[0]; | 1172 | charArray[i] = ((Atom)listAtom)._name[0]; |
1173 | } | 1173 | } |
@@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1209 | int codeInt; | 1209 | int codeInt; |
1210 | if (!getInt(codeArray[i], out codeInt) || codeInt < 0) | 1210 | if (!getInt(codeArray[i], out codeInt) || codeInt < 0) |
1211 | throw new PrologException | 1211 | throw new PrologException |
1212 | (new Functor1("representation_error", Atom.a("character_code")), | 1212 | (new Functor1("representation_error", Atom.a("character_code")), |
1213 | "Element of Arg 2 List is not a character code"); | 1213 | "Element of Arg 2 List is not a character code"); |
1214 | charArray[i] = (char)codeInt; | 1214 | charArray[i] = (char)codeInt; |
1215 | } | 1215 | } |
@@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1323 | { | 1323 | { |
1324 | if (!YP.number(Number)) | 1324 | if (!YP.number(Number)) |
1325 | throw new PrologException | 1325 | throw new PrologException |
1326 | (new Functor2("type_error", Atom.a("number"), Number), | 1326 | (new Functor2("type_error", Atom.a("number"), Number), |
1327 | "Arg 1 Number is not var or number"); | 1327 | "Arg 1 Number is not var or number"); |
1328 | // We just checked, so convertDouble shouldn't throw an exception. | 1328 | // We just checked, so convertDouble shouldn't throw an exception. |
1329 | numberString = YP.doubleToString(YP.convertDouble(Number)); | 1329 | numberString = YP.doubleToString(YP.convertDouble(Number)); |
@@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1413 | { | 1413 | { |
1414 | if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) | 1414 | if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) |
1415 | throw new PrologException | 1415 | throw new PrologException |
1416 | (new Functor2("type_error", Atom.a("character"), Char), | 1416 | (new Functor2("type_error", Atom.a("character"), Char), |
1417 | "Arg 1 Char is not var or one-character atom"); | 1417 | "Arg 1 Char is not var or one-character atom"); |
1418 | 1418 | ||
1419 | if (Code is Variable) | 1419 | if (Code is Variable) |
@@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1795 | IndexedAnswers indexedAnswers; | 1795 | IndexedAnswers indexedAnswers; |
1796 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) | 1796 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) |
1797 | { | 1797 | { |
1798 | // Create an IndexedAnswers as the only clause of the predicate. | 1798 | // Create an IndexedAnswers as the only clause of the predicate. |
1799 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); | 1799 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); |
1800 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); | 1800 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); |
1801 | } | 1801 | } |
@@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1826 | IndexedAnswers indexedAnswers; | 1826 | IndexedAnswers indexedAnswers; |
1827 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) | 1827 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) |
1828 | { | 1828 | { |
1829 | // Create an IndexedAnswers as the only clause of the predicate. | 1829 | // Create an IndexedAnswers as the only clause of the predicate. |
1830 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); | 1830 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); |
1831 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); | 1831 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); |
1832 | } | 1832 | } |
@@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1855 | { | 1855 | { |
1856 | List<IClause> clauses; | 1856 | List<IClause> clauses; |
1857 | if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) | 1857 | if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) |
1858 | return unknownPredicate(name, arguments.Length, | 1858 | return unknownPredicate(name, arguments.Length, |
1859 | "Undefined dynamic predicate: " + name + "/" + arguments.Length); | 1859 | "Undefined dynamic predicate: " + name + "/" + arguments.Length); |
1860 | 1860 | ||
1861 | if (clauses.Count == 1) | 1861 | if (clauses.Count == 1) |
@@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1889 | } | 1889 | } |
1890 | 1890 | ||
1891 | /// <summary> | 1891 | /// <summary> |
1892 | /// If _prologFlags["unknown"] is fail then return fail(), else if | 1892 | /// If _prologFlags["unknown"] is fail then return fail(), else if |
1893 | /// _prologFlags["unknown"] is warning then write the message to YP.write and | 1893 | /// _prologFlags["unknown"] is warning then write the message to YP.write and |
1894 | /// return fail(), else throw a PrologException for existence_error. . | 1894 | /// return fail(), else throw a PrologException for existence_error. . |
1895 | /// </summary> | 1895 | /// </summary> |
@@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1917 | } | 1917 | } |
1918 | 1918 | ||
1919 | /// <summary> | 1919 | /// <summary> |
1920 | /// This is deprecated and just calls matchDynamic. This matches all clauses, | 1920 | /// This is deprecated and just calls matchDynamic. This matches all clauses, |
1921 | /// not just the ones defined with assertFact. | 1921 | /// not just the ones defined with assertFact. |
1922 | /// </summary> | 1922 | /// </summary> |
1923 | /// <param name="name"></param> | 1923 | /// <param name="name"></param> |
@@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2066 | /// dynamic predicate. | 2066 | /// dynamic predicate. |
2067 | /// </summary> | 2067 | /// </summary> |
2068 | /// <param name="NameSlashArity"></param> | 2068 | /// <param name="NameSlashArity"></param> |
2069 | /// <param name="declaringClass">if not null, used to resolve references to the default | 2069 | /// <param name="declaringClass">if not null, used to resolve references to the default |
2070 | /// module Atom.a("")</param> | 2070 | /// module Atom.a("")</param> |
2071 | /// <returns></returns> | 2071 | /// <returns></returns> |
2072 | public static IEnumerable<bool> current_predicate(object NameSlashArity, Type declaringClass) | 2072 | public static IEnumerable<bool> current_predicate(object NameSlashArity, Type declaringClass) |
@@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2078 | Functor2 NameArityFunctor = NameSlashArity as Functor2; | 2078 | Functor2 NameArityFunctor = NameSlashArity as Functor2; |
2079 | if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) | 2079 | if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) |
2080 | throw new PrologException | 2080 | throw new PrologException |
2081 | (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), | 2081 | (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), |
2082 | "Must be a name/arity predicate indicator"); | 2082 | "Must be a name/arity predicate indicator"); |
2083 | object name = YP.getValue(NameArityFunctor._arg1); | 2083 | object name = YP.getValue(NameArityFunctor._arg1); |
2084 | object arity = YP.getValue(NameArityFunctor._arg2); | 2084 | object arity = YP.getValue(NameArityFunctor._arg2); |
@@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2163 | } | 2163 | } |
2164 | 2164 | ||
2165 | /// <summary> | 2165 | /// <summary> |
2166 | /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from | 2166 | /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from |
2167 | /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. | 2167 | /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. |
2168 | /// Otherwise, compile the goal as a single clause predicate and invoke it. | 2168 | /// Otherwise, compile the goal as a single clause predicate and invoke it. |
2169 | /// </summary> | 2169 | /// </summary> |
2170 | /// <param name="Goal"></param> | 2170 | /// <param name="Goal"></param> |
2171 | /// <param name="declaringClass">if not null, used to resolve references to the default | 2171 | /// <param name="declaringClass">if not null, used to resolve references to the default |
2172 | /// module Atom.a("")</param> | 2172 | /// module Atom.a("")</param> |
2173 | /// <returns></returns> | 2173 | /// <returns></returns> |
2174 | public static IEnumerable<bool> getIterator(object Goal, Type declaringClass) | 2174 | public static IEnumerable<bool> getIterator(object Goal, Type declaringClass) |
@@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2259 | (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); | 2259 | (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); |
2260 | if (!_prologFlags.ContainsKey(((Atom)Key)._name)) | 2260 | if (!_prologFlags.ContainsKey(((Atom)Key)._name)) |
2261 | throw new PrologException | 2261 | throw new PrologException |
2262 | (new Functor2("domain_error", Atom.a("prolog_flag"), Key), | 2262 | (new Functor2("domain_error", Atom.a("prolog_flag"), Key), |
2263 | "Arg 1 Key is not a recognized flag"); | 2263 | "Arg 1 Key is not a recognized flag"); |
2264 | 2264 | ||
2265 | foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) | 2265 | foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) |
@@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2343 | string results = ""; | 2343 | string results = ""; |
2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) | 2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) |
2345 | { | 2345 | { |
2346 | //Console.WriteLine( m ); | 2346 | //Console.WriteLine( m ); |
2347 | results += presep+ m + postsep; | 2347 | results += presep+ m + postsep; |
2348 | } | 2348 | } |
2349 | return results; | 2349 | return results; |
@@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2662 | #pragma warning restore 0168 | 2662 | #pragma warning restore 0168 |
2663 | } | 2663 | } |
2664 | } | 2664 | } |
2665 | 2665 | ||
2666 | /// <summary> | 2666 | /// <summary> |
2667 | /// CodeListReader extends TextReader and overrides Read to read the next code from | 2667 | /// CodeListReader extends TextReader and overrides Read to read the next code from |
2668 | /// the CodeList which is a Prolog list of integer character codes. | 2668 | /// the CodeList which is a Prolog list of integer character codes. |
@@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2683 | /// <returns></returns> | 2683 | /// <returns></returns> |
2684 | public override int Read() | 2684 | public override int Read() |
2685 | { | 2685 | { |
2686 | Functor2 CodeListPair = _CodeList as Functor2; | 2686 | Functor2 CodeListPair = _CodeList as Functor2; |
2687 | int code; | 2687 | int code; |
2688 | if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && | 2688 | if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && |
2689 | getInt(CodeListPair._arg1, out code))) | 2689 | getInt(CodeListPair._arg1, out code))) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs index f9b160d..0f79019 100644 --- a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs | |||
@@ -54,11 +54,11 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
54 | { | 54 | { |
55 | string path = Path.Combine(Directory.GetCurrentDirectory(), | 55 | string path = Path.Combine(Directory.GetCurrentDirectory(), |
56 | Path.Combine(s, assemblyName))+".dll"; | 56 | Path.Combine(s, assemblyName))+".dll"; |
57 | 57 | ||
58 | if (File.Exists(path)) | 58 | if (File.Exists(path)) |
59 | return Assembly.LoadFrom(path); | 59 | return Assembly.LoadFrom(path); |
60 | } | 60 | } |
61 | 61 | ||
62 | return null; | 62 | return null; |
63 | } | 63 | } |
64 | } | 64 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 4962023..db90f3e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -412,8 +412,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
412 | 412 | ||
413 | private static string CreateYPCompilerScript(string compileScript) | 413 | private static string CreateYPCompilerScript(string compileScript) |
414 | { | 414 | { |
415 | |||
416 | |||
417 | compileScript = String.Empty + | 415 | compileScript = String.Empty + |
418 | "using OpenSim.Region.ScriptEngine.Shared.YieldProlog; " + | 416 | "using OpenSim.Region.ScriptEngine.Shared.YieldProlog; " + |
419 | "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + | 417 | "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs index 57e8776..45f92e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs | |||
@@ -87,9 +87,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
87 | string quote = String.Empty; | 87 | string quote = String.Empty; |
88 | bool last_was_escape = false; | 88 | bool last_was_escape = false; |
89 | int quote_replaced_count = 0; | 89 | int quote_replaced_count = 0; |
90 | 90 | ||
91 | string removefwnoncomments = nonCommentFwsl.Replace(Script, "\"\";"); | 91 | string removefwnoncomments = nonCommentFwsl.Replace(Script, "\"\";"); |
92 | 92 | ||
93 | string removecomments = conelinecomments.Replace(removefwnoncomments, ""); | 93 | string removecomments = conelinecomments.Replace(removefwnoncomments, ""); |
94 | removecomments = cstylecomments.Replace(removecomments, ""); | 94 | removecomments = cstylecomments.Replace(removecomments, ""); |
95 | string[] localscript = removecomments.Split('"'); | 95 | string[] localscript = removecomments.Split('"'); |
@@ -120,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
120 | // checks for alpha.alpha way of referring to objects in C# | 120 | // checks for alpha.alpha way of referring to objects in C# |
121 | // ignores alpha.x alpha.y, alpha.z for refering to vector components | 121 | // ignores alpha.x alpha.y, alpha.z for refering to vector components |
122 | Match SecurityM; | 122 | Match SecurityM; |
123 | 123 | ||
124 | // BROKEN: this check is very wrong. It block's any url in strings. | 124 | // BROKEN: this check is very wrong. It block's any url in strings. |
125 | SecurityM = Regex.Match(checkscript, @"(?:[a-zA-Z])\.(?:[a-rt-wA-Z]|[a-zA-Z][a-zA-Z])", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 125 | SecurityM = Regex.Match(checkscript, @"(?:[a-zA-Z])\.(?:[a-rt-wA-Z]|[a-zA-Z][a-zA-Z])", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
126 | 126 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs index 831b918..22b3742 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
61 | myCode = myCode.Substring(0, cs_pointer); | 61 | myCode = myCode.Substring(0, cs_pointer); |
62 | } | 62 | } |
63 | myCode.Replace("//yp", "%YPCode"); | 63 | myCode.Replace("//yp", "%YPCode"); |
64 | 64 | ||
65 | StringWriter myCS_SW = new StringWriter(); | 65 | StringWriter myCS_SW = new StringWriter(); |
66 | StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); | 66 | StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); |
67 | 67 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 8326e16..5497e2c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -1335,22 +1335,22 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1335 | bool ret = i1.value != i2.value; | 1335 | bool ret = i1.value != i2.value; |
1336 | return ret; | 1336 | return ret; |
1337 | } | 1337 | } |
1338 | 1338 | ||
1339 | static public LSLInteger operator +(LSLInteger i1, int i2) | 1339 | static public LSLInteger operator +(LSLInteger i1, int i2) |
1340 | { | 1340 | { |
1341 | return new LSLInteger(i1.value + i2); | 1341 | return new LSLInteger(i1.value + i2); |
1342 | } | 1342 | } |
1343 | 1343 | ||
1344 | static public LSLInteger operator -(LSLInteger i1, int i2) | 1344 | static public LSLInteger operator -(LSLInteger i1, int i2) |
1345 | { | 1345 | { |
1346 | return new LSLInteger(i1.value - i2); | 1346 | return new LSLInteger(i1.value - i2); |
1347 | } | 1347 | } |
1348 | 1348 | ||
1349 | static public LSLInteger operator *(LSLInteger i1, int i2) | 1349 | static public LSLInteger operator *(LSLInteger i1, int i2) |
1350 | { | 1350 | { |
1351 | return new LSLInteger(i1.value * i2); | 1351 | return new LSLInteger(i1.value * i2); |
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | static public LSLInteger operator /(LSLInteger i1, int i2) | 1354 | static public LSLInteger operator /(LSLInteger i1, int i2) |
1355 | { | 1355 | { |
1356 | return new LSLInteger(i1.value / i2); | 1356 | return new LSLInteger(i1.value / i2); |
@@ -1360,22 +1360,22 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1360 | { | 1360 | { |
1361 | return new LSLFloat((double)i1.value + f); | 1361 | return new LSLFloat((double)i1.value + f); |
1362 | } | 1362 | } |
1363 | 1363 | ||
1364 | static public LSLFloat operator -(LSLInteger i1, double f) | 1364 | static public LSLFloat operator -(LSLInteger i1, double f) |
1365 | { | 1365 | { |
1366 | return new LSLFloat((double)i1.value - f); | 1366 | return new LSLFloat((double)i1.value - f); |
1367 | } | 1367 | } |
1368 | 1368 | ||
1369 | static public LSLFloat operator *(LSLInteger i1, double f) | 1369 | static public LSLFloat operator *(LSLInteger i1, double f) |
1370 | { | 1370 | { |
1371 | return new LSLFloat((double)i1.value * f); | 1371 | return new LSLFloat((double)i1.value * f); |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | static public LSLFloat operator /(LSLInteger i1, double f) | 1374 | static public LSLFloat operator /(LSLInteger i1, double f) |
1375 | { | 1375 | { |
1376 | return new LSLFloat((double)i1.value / f); | 1376 | return new LSLFloat((double)i1.value / f); |
1377 | } | 1377 | } |
1378 | 1378 | ||
1379 | static public LSLInteger operator -(LSLInteger i) | 1379 | static public LSLInteger operator -(LSLInteger i) |
1380 | { | 1380 | { |
1381 | return new LSLInteger(-i.value); | 1381 | return new LSLInteger(-i.value); |
@@ -1536,17 +1536,17 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1536 | f.value--; | 1536 | f.value--; |
1537 | return f; | 1537 | return f; |
1538 | } | 1538 | } |
1539 | 1539 | ||
1540 | static public LSLFloat operator +(LSLFloat f, int i) | 1540 | static public LSLFloat operator +(LSLFloat f, int i) |
1541 | { | 1541 | { |
1542 | return new LSLFloat(f.value + (double)i); | 1542 | return new LSLFloat(f.value + (double)i); |
1543 | } | 1543 | } |
1544 | 1544 | ||
1545 | static public LSLFloat operator -(LSLFloat f, int i) | 1545 | static public LSLFloat operator -(LSLFloat f, int i) |
1546 | { | 1546 | { |
1547 | return new LSLFloat(f.value - (double)i); | 1547 | return new LSLFloat(f.value - (double)i); |
1548 | } | 1548 | } |
1549 | 1549 | ||
1550 | static public LSLFloat operator *(LSLFloat f, int i) | 1550 | static public LSLFloat operator *(LSLFloat f, int i) |
1551 | { | 1551 | { |
1552 | return new LSLFloat(f.value * (double)i); | 1552 | return new LSLFloat(f.value * (double)i); |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index cdba1ac..c528c02 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -363,7 +363,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
363 | new WorkItemCallback( | 363 | new WorkItemCallback( |
364 | this.DoOnRezScriptQueue), new Object[0]); | 364 | this.DoOnRezScriptQueue), new Object[0]); |
365 | } | 365 | } |
366 | else | 366 | else |
367 | { | 367 | { |
368 | m_CurrentCompile = null; | 368 | m_CurrentCompile = null; |
369 | } | 369 | } |
@@ -394,7 +394,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
394 | new WorkItemCallback( | 394 | new WorkItemCallback( |
395 | this.DoOnRezScriptQueue), new Object[0]); | 395 | this.DoOnRezScriptQueue), new Object[0]); |
396 | } | 396 | } |
397 | else | 397 | else |
398 | { | 398 | { |
399 | m_CurrentCompile = null; | 399 | m_CurrentCompile = null; |
400 | } | 400 | } |
@@ -1113,7 +1113,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1113 | { | 1113 | { |
1114 | string savedState = Path.Combine(Path.GetDirectoryName(m_Assembly), | 1114 | string savedState = Path.Combine(Path.GetDirectoryName(m_Assembly), |
1115 | m_ItemID.ToString() + ".state"); | 1115 | m_ItemID.ToString() + ".state"); |
1116 | 1116 | ||
1117 | try | 1117 | try |
1118 | { | 1118 | { |
1119 | File.Delete(savedState); | 1119 | File.Delete(savedState); |
diff --git a/OpenSim/TestSuite/BotManager.cs b/OpenSim/TestSuite/BotManager.cs index a431a43..29864ab 100644 --- a/OpenSim/TestSuite/BotManager.cs +++ b/OpenSim/TestSuite/BotManager.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.TestSuite | |||
51 | protected Random somthing = new Random(Environment.TickCount); | 51 | protected Random somthing = new Random(Environment.TickCount); |
52 | protected int numbots = 0; | 52 | protected int numbots = 0; |
53 | protected IConfig Previous_config; | 53 | protected IConfig Previous_config; |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Constructor Creates MainConsole.Instance to take commands and provide the place to write data | 56 | /// Constructor Creates MainConsole.Instance to take commands and provide the place to write data |
57 | /// </summary> | 57 | /// </summary> |
@@ -97,7 +97,7 @@ namespace OpenSim.TestSuite | |||
97 | startupBot(i, Previous_config); | 97 | startupBot(i, Previous_config); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | /// <summary> | 101 | /// <summary> |
102 | /// This starts up the bot and stores the thread for the bot in the thread array | 102 | /// This starts up the bot and stores the thread for the bot in the thread array |
103 | /// </summary> | 103 | /// </summary> |
@@ -128,7 +128,7 @@ namespace OpenSim.TestSuite | |||
128 | { | 128 | { |
129 | string returnstring = ""; | 129 | string returnstring = ""; |
130 | string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; | 130 | string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; |
131 | 131 | ||
132 | for (int i = 0; i < 7; i++) | 132 | for (int i = 0; i < 7; i++) |
133 | { | 133 | { |
134 | returnstring += chars.Substring(somthing.Next(chars.Length),1); | 134 | returnstring += chars.Substring(somthing.Next(chars.Length),1); |
@@ -178,7 +178,7 @@ namespace OpenSim.TestSuite | |||
178 | { | 178 | { |
179 | return new ConsoleBase("Region", this); | 179 | return new ConsoleBase("Region", this); |
180 | } | 180 | } |
181 | 181 | ||
182 | /// <summary> | 182 | /// <summary> |
183 | /// Command runnint tool.. Currently use it to add bots, shutdown and (dangerous)Forcequit | 183 | /// Command runnint tool.. Currently use it to add bots, shutdown and (dangerous)Forcequit |
184 | /// </summary> | 184 | /// </summary> |
@@ -199,7 +199,7 @@ namespace OpenSim.TestSuite | |||
199 | case "addbots": | 199 | case "addbots": |
200 | int newbots; | 200 | int newbots; |
201 | Helpers.TryParse(cmdparams[0], out newbots); | 201 | Helpers.TryParse(cmdparams[0], out newbots); |
202 | 202 | ||
203 | if (newbots > 0) | 203 | if (newbots > 0) |
204 | addbots(newbots); | 204 | addbots(newbots); |
205 | break; | 205 | break; |
diff --git a/OpenSim/TestSuite/Main.cs b/OpenSim/TestSuite/Main.cs index b944304..8b2de81 100644 --- a/OpenSim/TestSuite/Main.cs +++ b/OpenSim/TestSuite/Main.cs | |||
@@ -58,9 +58,9 @@ namespace OpenSim.TestSuite | |||
58 | else | 58 | else |
59 | { | 59 | { |
60 | // TODO: unused: int botcount = config.GetInt("botcount", 1); | 60 | // TODO: unused: int botcount = config.GetInt("botcount", 1); |
61 | 61 | ||
62 | // BotManager bm = new BotManager(); | 62 | // BotManager bm = new BotManager(); |
63 | 63 | ||
64 | Utils.TestPass("Completed Startup"); | 64 | Utils.TestPass("Completed Startup"); |
65 | } | 65 | } |
66 | } | 66 | } |
@@ -69,18 +69,18 @@ namespace OpenSim.TestSuite | |||
69 | { | 69 | { |
70 | //Set up our nifty config.. thanks to nini | 70 | //Set up our nifty config.. thanks to nini |
71 | ArgvConfigSource cs = new ArgvConfigSource(args); | 71 | ArgvConfigSource cs = new ArgvConfigSource(args); |
72 | 72 | ||
73 | // TODO: unused: cs.AddSwitch("Startup", "botcount","n"); | 73 | // TODO: unused: cs.AddSwitch("Startup", "botcount","n"); |
74 | cs.AddSwitch("Startup", "loginuri","l"); | 74 | cs.AddSwitch("Startup", "loginuri","l"); |
75 | cs.AddSwitch("Startup", "firstname"); | 75 | cs.AddSwitch("Startup", "firstname"); |
76 | cs.AddSwitch("Startup", "lastname"); | 76 | cs.AddSwitch("Startup", "lastname"); |
77 | cs.AddSwitch("Startup", "password"); | 77 | cs.AddSwitch("Startup", "password"); |
78 | cs.AddSwitch("Startup", "help","h"); | 78 | cs.AddSwitch("Startup", "help","h"); |
79 | 79 | ||
80 | IConfig ol = cs.Configs["Startup"]; | 80 | IConfig ol = cs.Configs["Startup"]; |
81 | return ol; | 81 | return ol; |
82 | } | 82 | } |
83 | 83 | ||
84 | private static void Help() | 84 | private static void Help() |
85 | { | 85 | { |
86 | Console.WriteLine( | 86 | Console.WriteLine( |
diff --git a/OpenSim/Tests/Inventory/TestInventory.cs b/OpenSim/Tests/Inventory/TestInventory.cs index 7863904..3c90e1f 100644 --- a/OpenSim/Tests/Inventory/TestInventory.cs +++ b/OpenSim/Tests/Inventory/TestInventory.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Test.Inventory | |||
94 | if (a.parentFolderID != b.parentFolderID) return false; | 94 | if (a.parentFolderID != b.parentFolderID) return false; |
95 | return true; | 95 | return true; |
96 | } | 96 | } |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// Test that we can insert a root folder | 99 | /// Test that we can insert a root folder |
100 | /// </summary> | 100 | /// </summary> |
diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs index dbc58ff..25044db 100644 --- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs +++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs | |||
@@ -123,7 +123,7 @@ namespace LaunchSLClient | |||
123 | string sandboxHostName = ""; | 123 | string sandboxHostName = ""; |
124 | string sandboxPort = ""; | 124 | string sandboxPort = ""; |
125 | string text; | 125 | string text; |
126 | 126 | ||
127 | Regex myRegex = new Regex(".*internal_ip_port=\\\"(?<port>.*?)\\\".*external_host_name=\\\"(?<name>.*?)\\\".*"); | 127 | Regex myRegex = new Regex(".*internal_ip_port=\\\"(?<port>.*?)\\\".*external_host_name=\\\"(?<name>.*?)\\\".*"); |
128 | 128 | ||
129 | FileInfo defaultFile = new FileInfo("Regions/default.xml"); | 129 | FileInfo defaultFile = new FileInfo("Regions/default.xml"); |
diff --git a/OpenSim/Tools/OpenSim.GUI/InputTextBoxControl.cs b/OpenSim/Tools/OpenSim.GUI/InputTextBoxControl.cs index a43795a..d6a3d04 100644 --- a/OpenSim/Tools/OpenSim.GUI/InputTextBoxControl.cs +++ b/OpenSim/Tools/OpenSim.GUI/InputTextBoxControl.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.GUI | |||
38 | { | 38 | { |
39 | this.KeyDown += new System.Windows.Forms.KeyEventHandler(TextInputControl_KeyDown); | 39 | this.KeyDown += new System.Windows.Forms.KeyEventHandler(TextInputControl_KeyDown); |
40 | } | 40 | } |
41 | 41 | ||
42 | private List<string> CommandHistory = new List<string>(); | 42 | private List<string> CommandHistory = new List<string>(); |
43 | private bool InHistory = false; | 43 | private bool InHistory = false; |
44 | private int HistoryPosition = -1; | 44 | private int HistoryPosition = -1; |
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 302dc08..4bdc494 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs | |||
@@ -51,7 +51,7 @@ namespace pCampBot | |||
51 | protected Random somthing = new Random(Environment.TickCount); | 51 | protected Random somthing = new Random(Environment.TickCount); |
52 | protected int numbots = 0; | 52 | protected int numbots = 0; |
53 | protected IConfig Previous_config; | 53 | protected IConfig Previous_config; |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Constructor Creates MainConsole.Instance to take commands and provide the place to write data | 56 | /// Constructor Creates MainConsole.Instance to take commands and provide the place to write data |
57 | /// </summary> | 57 | /// </summary> |
@@ -96,7 +96,7 @@ namespace pCampBot | |||
96 | startupBot(i, Previous_config); | 96 | startupBot(i, Previous_config); |
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | /// <summary> | 100 | /// <summary> |
101 | /// This starts up the bot and stores the thread for the bot in the thread array | 101 | /// This starts up the bot and stores the thread for the bot in the thread array |
102 | /// </summary> | 102 | /// </summary> |
@@ -127,7 +127,7 @@ namespace pCampBot | |||
127 | { | 127 | { |
128 | string returnstring = ""; | 128 | string returnstring = ""; |
129 | string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; | 129 | string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; |
130 | 130 | ||
131 | for (int i = 0; i < 7; i++) | 131 | for (int i = 0; i < 7; i++) |
132 | { | 132 | { |
133 | returnstring += chars.Substring(somthing.Next(chars.Length),1); | 133 | returnstring += chars.Substring(somthing.Next(chars.Length),1); |
@@ -177,7 +177,7 @@ namespace pCampBot | |||
177 | { | 177 | { |
178 | return new ConsoleBase("Region", this); | 178 | return new ConsoleBase("Region", this); |
179 | } | 179 | } |
180 | 180 | ||
181 | /// <summary> | 181 | /// <summary> |
182 | /// Command runnint tool.. Currently use it to add bots, shutdown and (dangerous)Forcequit | 182 | /// Command runnint tool.. Currently use it to add bots, shutdown and (dangerous)Forcequit |
183 | /// </summary> | 183 | /// </summary> |
@@ -198,7 +198,7 @@ namespace pCampBot | |||
198 | case "addbots": | 198 | case "addbots": |
199 | int newbots; | 199 | int newbots; |
200 | Helpers.TryParse(cmdparams[0], out newbots); | 200 | Helpers.TryParse(cmdparams[0], out newbots); |
201 | 201 | ||
202 | if (newbots > 0) | 202 | if (newbots > 0) |
203 | addbots(newbots); | 203 | addbots(newbots); |
204 | break; | 204 | break; |
diff --git a/OpenSim/Tools/pCampBot/pCampBot.cs b/OpenSim/Tools/pCampBot/pCampBot.cs index 81ec2b2..9cde451 100644 --- a/OpenSim/Tools/pCampBot/pCampBot.cs +++ b/OpenSim/Tools/pCampBot/pCampBot.cs | |||
@@ -54,9 +54,9 @@ namespace pCampBot | |||
54 | else | 54 | else |
55 | { | 55 | { |
56 | int botcount = config.GetInt("botcount", 1); | 56 | int botcount = config.GetInt("botcount", 1); |
57 | 57 | ||
58 | BotManager bm = new BotManager(); | 58 | BotManager bm = new BotManager(); |
59 | 59 | ||
60 | //startup specified number of bots. 1 is the default | 60 | //startup specified number of bots. 1 is the default |
61 | bm.dobotStartup(botcount, config); | 61 | bm.dobotStartup(botcount, config); |
62 | while (true) | 62 | while (true) |
@@ -70,18 +70,18 @@ namespace pCampBot | |||
70 | { | 70 | { |
71 | //Set up our nifty config.. thanks to nini | 71 | //Set up our nifty config.. thanks to nini |
72 | ArgvConfigSource cs = new ArgvConfigSource(args); | 72 | ArgvConfigSource cs = new ArgvConfigSource(args); |
73 | 73 | ||
74 | cs.AddSwitch("Startup", "botcount","n"); | 74 | cs.AddSwitch("Startup", "botcount","n"); |
75 | cs.AddSwitch("Startup", "loginuri","l"); | 75 | cs.AddSwitch("Startup", "loginuri","l"); |
76 | cs.AddSwitch("Startup", "firstname"); | 76 | cs.AddSwitch("Startup", "firstname"); |
77 | cs.AddSwitch("Startup", "lastname"); | 77 | cs.AddSwitch("Startup", "lastname"); |
78 | cs.AddSwitch("Startup", "password"); | 78 | cs.AddSwitch("Startup", "password"); |
79 | cs.AddSwitch("Startup", "help","h"); | 79 | cs.AddSwitch("Startup", "help","h"); |
80 | 80 | ||
81 | IConfig ol = cs.Configs["Startup"]; | 81 | IConfig ol = cs.Configs["Startup"]; |
82 | return ol; | 82 | return ol; |
83 | } | 83 | } |
84 | 84 | ||
85 | private static void Help() | 85 | private static void Help() |
86 | { | 86 | { |
87 | Console.WriteLine( | 87 | Console.WriteLine( |