diff options
author | alondria | 2008-02-05 15:06:37 +0000 |
---|---|---|
committer | alondria | 2008-02-05 15:06:37 +0000 |
commit | 36f7a087e6f101f1d74659621afc460c974a8dc9 (patch) | |
tree | 6697a2b48cca5b3c1127a9e3347641c49bff58dd | |
parent | Small refactoring on Terrain Update sending, so that other code can force ter... (diff) | |
download | opensim-SC_OLD-36f7a087e6f101f1d74659621afc460c974a8dc9.zip opensim-SC_OLD-36f7a087e6f101f1d74659621afc460c974a8dc9.tar.gz opensim-SC_OLD-36f7a087e6f101f1d74659621afc460c974a8dc9.tar.bz2 opensim-SC_OLD-36f7a087e6f101f1d74659621afc460c974a8dc9.tar.xz |
Added explicit Quaternion->string and list->string conversions.
Some preliminary work on llSetStatus and llGetStatus.
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 96 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 21 |
3 files changed, 116 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs index c985d6f..8511b56 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs | |||
@@ -1877,6 +1877,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1877 | public const int STATUS_BLOCK_GRAB = 64; | 1877 | public const int STATUS_BLOCK_GRAB = 64; |
1878 | public const int STATUS_DIE_AT_EDGE = 128; | 1878 | public const int STATUS_DIE_AT_EDGE = 128; |
1879 | public const int STATUS_RETURN_AT_EDGE = 256; | 1879 | public const int STATUS_RETURN_AT_EDGE = 256; |
1880 | public const int STATUS_CAST_SHADOWS = 512; | ||
1880 | public const int AGENT = 1; | 1881 | public const int AGENT = 1; |
1881 | public const int ACTIVE = 2; | 1882 | public const int ACTIVE = 2; |
1882 | public const int PASSIVE = 4; | 1883 | public const int PASSIVE = 4; |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 80df86e..242bd27 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -425,13 +425,105 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
425 | 425 | ||
426 | public void llSetStatus(int status, int value) | 426 | public void llSetStatus(int status, int value) |
427 | { | 427 | { |
428 | NotImplemented("llSetStatus"); | 428 | if ((status & LSL_BaseClass.STATUS_PHYSICS) == LSL_BaseClass.STATUS_PHYSICS) |
429 | { | ||
430 | m_host.AddFlag(LLObject.ObjectFlags.Physics); | ||
431 | } | ||
432 | if ((status & LSL_BaseClass.STATUS_PHANTOM) == LSL_BaseClass.STATUS_PHANTOM) | ||
433 | { | ||
434 | m_host.AddFlag(LLObject.ObjectFlags.Phantom); | ||
435 | } | ||
436 | if ((status & LSL_BaseClass.STATUS_CAST_SHADOWS) == LSL_BaseClass.STATUS_CAST_SHADOWS) | ||
437 | { | ||
438 | m_host.AddFlag(LLObject.ObjectFlags.CastShadows); | ||
439 | } | ||
440 | if ((status & LSL_BaseClass.STATUS_ROTATE_X) == LSL_BaseClass.STATUS_ROTATE_X) | ||
441 | { | ||
442 | NotImplemented("llSetStatus - STATUS_ROTATE_X"); | ||
443 | } | ||
444 | if ((status & LSL_BaseClass.STATUS_ROTATE_Y) == LSL_BaseClass.STATUS_ROTATE_Y) | ||
445 | { | ||
446 | NotImplemented("llSetStatus - STATUS_ROTATE_Y"); | ||
447 | } | ||
448 | if ((status & LSL_BaseClass.STATUS_ROTATE_Z) == LSL_BaseClass.STATUS_ROTATE_Z) | ||
449 | { | ||
450 | NotImplemented("llSetStatus - STATUS_ROTATE_Z"); | ||
451 | } | ||
452 | if ((status & LSL_BaseClass.STATUS_BLOCK_GRAB) == LSL_BaseClass.STATUS_BLOCK_GRAB) | ||
453 | { | ||
454 | NotImplemented("llSetStatus - STATUS_BLOCK_GRAB"); | ||
455 | } | ||
456 | if ((status & LSL_BaseClass.STATUS_DIE_AT_EDGE) == LSL_BaseClass.STATUS_DIE_AT_EDGE) | ||
457 | { | ||
458 | NotImplemented("llSetStatus - STATUS_DIE_AT_EDGE"); | ||
459 | } | ||
460 | if ((status & LSL_BaseClass.STATUS_RETURN_AT_EDGE) == LSL_BaseClass.STATUS_RETURN_AT_EDGE) | ||
461 | { | ||
462 | NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE"); | ||
463 | } | ||
464 | if ((status & LSL_BaseClass.STATUS_SANDBOX) == LSL_BaseClass.STATUS_SANDBOX) | ||
465 | { | ||
466 | NotImplemented("llSetStatus - STATUS_SANDBOX"); | ||
467 | } | ||
429 | return; | 468 | return; |
430 | } | 469 | } |
431 | 470 | ||
432 | public int llGetStatus(int status) | 471 | public int llGetStatus(int status) |
433 | { | 472 | { |
434 | NotImplemented("llGetStatus"); | 473 | Console.WriteLine(m_host.UUID.ToString() + " status is " + m_host.ObjectFlags.ToString()); |
474 | switch (status) | ||
475 | { | ||
476 | case LSL_BaseClass.STATUS_PHYSICS: | ||
477 | if ((m_host.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) == (uint)LLObject.ObjectFlags.Physics) | ||
478 | { | ||
479 | return 1; | ||
480 | } | ||
481 | return 0; | ||
482 | break; | ||
483 | case LSL_BaseClass.STATUS_PHANTOM: | ||
484 | if ((m_host.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom) | ||
485 | { | ||
486 | return 1; | ||
487 | } | ||
488 | return 0; | ||
489 | break; | ||
490 | case LSL_BaseClass.STATUS_CAST_SHADOWS: | ||
491 | if ((m_host.ObjectFlags & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows) | ||
492 | { | ||
493 | return 1; | ||
494 | } | ||
495 | return 0; | ||
496 | break; | ||
497 | case LSL_BaseClass.STATUS_BLOCK_GRAB: | ||
498 | NotImplemented("llGetStatus - STATUS_BLOCK_GRAB"); | ||
499 | return 0; | ||
500 | break; | ||
501 | case LSL_BaseClass.STATUS_DIE_AT_EDGE: | ||
502 | NotImplemented("llGetStatus - STATUS_DIE_AT_EDGE"); | ||
503 | return 0; | ||
504 | break; | ||
505 | case LSL_BaseClass.STATUS_RETURN_AT_EDGE: | ||
506 | NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE"); | ||
507 | return 0; | ||
508 | break; | ||
509 | case LSL_BaseClass.STATUS_ROTATE_X: | ||
510 | NotImplemented("llGetStatus - STATUS_ROTATE_X"); | ||
511 | return 0; | ||
512 | break; | ||
513 | case LSL_BaseClass.STATUS_ROTATE_Y: | ||
514 | NotImplemented("llGetStatus - STATUS_ROTATE_Y"); | ||
515 | return 0; | ||
516 | break; | ||
517 | case LSL_BaseClass.STATUS_ROTATE_Z: | ||
518 | NotImplemented("llGetStatus - STATUS_ROTATE_Z"); | ||
519 | return 0; | ||
520 | break; | ||
521 | case LSL_BaseClass.STATUS_SANDBOX: | ||
522 | NotImplemented("llGetStatus - STATUS_SANDBOX"); | ||
523 | return 0; | ||
524 | break; | ||
525 | } | ||
526 | NotImplemented("llGetStatus - Unknown Status parameter"); | ||
435 | return 0; | 527 | return 0; |
436 | } | 528 | } |
437 | 529 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index fc0e282..1611b74 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | |||
@@ -305,6 +305,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
305 | return "<" + x.ToString() + ", " + y.ToString() + ", " + z.ToString() + ", " + s.ToString() + ">"; | 305 | return "<" + x.ToString() + ", " + y.ToString() + ", " + z.ToString() + ", " + s.ToString() + ">"; |
306 | } | 306 | } |
307 | 307 | ||
308 | public static explicit operator string(Quaternion r) | ||
309 | { | ||
310 | return "<" + r.x.ToString() + ", " + r.y.ToString() + ", " + r.z.ToString() + ", " + r.s.ToString() + ">"; | ||
311 | } | ||
312 | |||
308 | public static bool operator ==(Quaternion lhs, Quaternion rhs) | 313 | public static bool operator ==(Quaternion lhs, Quaternion rhs) |
309 | { | 314 | { |
310 | // Return true if the fields match: | 315 | // Return true if the fields match: |
@@ -454,6 +459,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
454 | return output; | 459 | return output; |
455 | } | 460 | } |
456 | 461 | ||
462 | |||
463 | |||
457 | public override string ToString() | 464 | public override string ToString() |
458 | { | 465 | { |
459 | string output; | 466 | string output; |
@@ -470,6 +477,20 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
470 | 477 | ||
471 | } | 478 | } |
472 | 479 | ||
480 | public static explicit operator string(list l) | ||
481 | { | ||
482 | string output; | ||
483 | output = String.Empty; | ||
484 | if (l.m_data.Length == 0) | ||
485 | { | ||
486 | return String.Empty; | ||
487 | } | ||
488 | foreach (object o in l.m_data) | ||
489 | { | ||
490 | output = output + o.ToString(); | ||
491 | } | ||
492 | return output; | ||
493 | } | ||
473 | } | 494 | } |
474 | 495 | ||
475 | // | 496 | // |