diff options
author | Melanie Thielker | 2008-08-13 12:20:49 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-08-13 12:20:49 +0000 |
commit | 4b6097756f1295e65b4c732606f14f4b43d12fb6 (patch) | |
tree | a85cdade5d9df681c220b9114218dc7ac847ecf0 /OpenSim/Region/ScriptEngine | |
parent | From: Omar Vera Ustariz <ustariz@de.ibm.com> (diff) | |
download | opensim-SC_OLD-4b6097756f1295e65b4c732606f14f4b43d12fb6.zip opensim-SC_OLD-4b6097756f1295e65b4c732606f14f4b43d12fb6.tar.gz opensim-SC_OLD-4b6097756f1295e65b4c732606f14f4b43d12fb6.tar.bz2 opensim-SC_OLD-4b6097756f1295e65b4c732606f14f4b43d12fb6.tar.xz |
Port the llParcelMediaQuery forward to the new Shared/ directory
Add a Dictionary for faster lookup of cached items.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 123 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a6de186..d7633d8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -6541,14 +6541,130 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6541 | 6541 | ||
6542 | public void llParcelMediaCommandList(LSL_Types.list commandList) | 6542 | public void llParcelMediaCommandList(LSL_Types.list commandList) |
6543 | { | 6543 | { |
6544 | m_host.AddScriptLPS(1); | 6544 | //TO DO: Implement the missing commands |
6545 | NotImplemented("llParcelMediaCommandList"); | 6545 | //PARCEL_MEDIA_COMMAND_STOP Stop the media stream and go back to the first frame. |
6546 | //PARCEL_MEDIA_COMMAND_PAUSE Pause the media stream (stop playing but stay on current frame). | ||
6547 | //PARCEL_MEDIA_COMMAND_PLAY Start the media stream playing from the current frame and stop when the end is reached. | ||
6548 | //PARCEL_MEDIA_COMMAND_LOOP Start the media stream playing from the current frame. When the end is reached, loop to the beginning and continue. | ||
6549 | //PARCEL_MEDIA_COMMAND_TEXTURE key uuid Use this to get or set the parcel's media texture. | ||
6550 | //PARCEL_MEDIA_COMMAND_URL string url Used to get or set the parcel's media url. | ||
6551 | //PARCEL_MEDIA_COMMAND_TIME float time Move a media stream to a specific time. | ||
6552 | //PARCEL_MEDIA_COMMAND_AGENT key uuid Applies the media command to the specified agent only. | ||
6553 | //PARCEL_MEDIA_COMMAND_UNLOAD Completely unloads the movie and restores the original texture. | ||
6554 | //PARCEL_MEDIA_COMMAND_AUTO_ALIGN integer boolean Sets the parcel option 'Auto scale content'. | ||
6555 | //PARCEL_MEDIA_COMMAND_TYPE string mime_type Use this to get or set the parcel media MIME type (e.g. "text/html"). (1.19.1 RC0 or later) | ||
6556 | //PARCEL_MEDIA_COMMAND_SIZE integer x, integer y Use this to get or set the parcel media pixel resolution. (1.19.1 RC0 or later) | ||
6557 | //PARCEL_MEDIA_COMMAND_DESC string desc Use this to get or set the parcel media description. (1.19.1 RC0 or later) | ||
6558 | //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) | ||
6559 | m_host.AddScriptLPS(1); | ||
6560 | for (int i = 0; i < commandList.Data.Length; i++) | ||
6561 | { | ||
6562 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) | ||
6563 | { | ||
6564 | case ParcelMediaCommandEnum.Play: | ||
6565 | List<ScenePresence> scenePresencePlayList = World.GetScenePresences(); | ||
6566 | foreach (ScenePresence agent in scenePresencePlayList) | ||
6567 | { | ||
6568 | if (!agent.IsChildAgent) | ||
6569 | { | ||
6570 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); | ||
6571 | } | ||
6572 | } | ||
6573 | break; | ||
6574 | case ParcelMediaCommandEnum.Stop: | ||
6575 | List<ScenePresence> scenePresenceStopList = World.GetScenePresences(); | ||
6576 | foreach (ScenePresence agent in scenePresenceStopList) | ||
6577 | { | ||
6578 | if (!agent.IsChildAgent) | ||
6579 | { | ||
6580 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Stop, 0); | ||
6581 | } | ||
6582 | } | ||
6583 | break; | ||
6584 | case ParcelMediaCommandEnum.Pause: | ||
6585 | List<ScenePresence> scenePresencePauseList = World.GetScenePresences(); | ||
6586 | foreach (ScenePresence agent in scenePresencePauseList) | ||
6587 | { | ||
6588 | if (!agent.IsChildAgent) | ||
6589 | { | ||
6590 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Pause, 0); | ||
6591 | } | ||
6592 | } | ||
6593 | break; | ||
6594 | |||
6595 | case ParcelMediaCommandEnum.Url: | ||
6596 | if ((i + 1) < commandList.Length) | ||
6597 | { | ||
6598 | if (commandList.Data[i + 1] is string) | ||
6599 | { | ||
6600 | //Set the new media URL only if the user is the owner of the land | ||
6601 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); | ||
6602 | |||
6603 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); | ||
6604 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | ||
6605 | //Send an update of the mediaURL to all the clients that are in the parcel | ||
6606 | foreach (ScenePresence agent in scenePresenceList) | ||
6607 | { | ||
6608 | if (!agent.IsChildAgent) | ||
6609 | { | ||
6610 | //Send parcel media update to the client | ||
6611 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); | ||
6612 | } | ||
6613 | } | ||
6614 | |||
6615 | } | ||
6616 | i++; | ||
6617 | } | ||
6618 | break; | ||
6619 | default: | ||
6620 | ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; | ||
6621 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); | ||
6622 | break; | ||
6623 | }//end switch | ||
6624 | |||
6625 | } | ||
6626 | |||
6627 | |||
6628 | //NotImplemented("llParcelMediaCommandList"); | ||
6546 | } | 6629 | } |
6547 | 6630 | ||
6548 | public void llParcelMediaQuery() | 6631 | public LSL_Types.list llParcelMediaQuery(LSL_Types.list aList) |
6549 | { | 6632 | { |
6550 | m_host.AddScriptLPS(1); | 6633 | m_host.AddScriptLPS(1); |
6551 | NotImplemented("llParcelMediaQuery"); | 6634 | LSL_Types.list list = new LSL_Types.list(); |
6635 | //TO DO: make the implementation for the missing commands | ||
6636 | //PARCEL_MEDIA_COMMAND_TEXTURE key uuid Use this to get or set the parcel's media texture. | ||
6637 | //PARCEL_MEDIA_COMMAND_URL string url Used to get or set the parcel's media url. | ||
6638 | //PARCEL_MEDIA_COMMAND_TYPE string mime_type Use this to get or set the parcel media MIME type (e.g. "text/html"). (1.19.1 RC0 or later) | ||
6639 | //PARCEL_MEDIA_COMMAND_SIZE integer x, integer y Use this to get or set the parcel media pixel resolution. (1.19.1 RC0 or later) | ||
6640 | //PARCEL_MEDIA_COMMAND_DESC string desc Use this to get or set the parcel media description. (1.19.1 RC0 or later) | ||
6641 | //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) | ||
6642 | for (int i = 0; i < aList.Data.Length; i++) | ||
6643 | { | ||
6644 | |||
6645 | if (aList.Data[i] != null) | ||
6646 | { | ||
6647 | switch((ParcelMediaCommandEnum)aList.Data[i]) | ||
6648 | { | ||
6649 | case ParcelMediaCommandEnum.Url: | ||
6650 | list.Add(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaURL); | ||
6651 | break; | ||
6652 | case ParcelMediaCommandEnum.Desc: | ||
6653 | list.Add(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).Description); | ||
6654 | break; | ||
6655 | case ParcelMediaCommandEnum.Texture: | ||
6656 | list.Add(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaID); | ||
6657 | break; | ||
6658 | default: | ||
6659 | ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; | ||
6660 | NotImplemented("llParcelMediaQuery parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType() , aList.Data[i].ToString()).ToString()); | ||
6661 | break; | ||
6662 | } | ||
6663 | |||
6664 | } | ||
6665 | } | ||
6666 | return list; | ||
6667 | |||
6552 | } | 6668 | } |
6553 | 6669 | ||
6554 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) | 6670 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 8eea756..61556a9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -583,7 +583,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
583 | void llLoadURL(string avatar_id, string message, string url); | 583 | void llLoadURL(string avatar_id, string message, string url); |
584 | //wiki: llParcelMediaCommandList(list commandList) | 584 | //wiki: llParcelMediaCommandList(list commandList) |
585 | void llParcelMediaCommandList(LSL_Types.list commandList); | 585 | void llParcelMediaCommandList(LSL_Types.list commandList); |
586 | void llParcelMediaQuery(); | 586 | LSL_Types.list llParcelMediaQuery(LSL_Types.list aList); |
587 | //wiki integer llModPow(integer a, integer b, integer c) | 587 | //wiki integer llModPow(integer a, integer b, integer c) |
588 | LSL_Types.LSLInteger llModPow(int a, int b, int c); | 588 | LSL_Types.LSLInteger llModPow(int a, int b, int c); |
589 | //wiki: integer llGetInventoryType(string name) | 589 | //wiki: integer llGetInventoryType(string name) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index e6966fc..5f0a1bc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -1564,9 +1564,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1564 | m_LSL_Functions.llParcelMediaCommandList(commandList); | 1564 | m_LSL_Functions.llParcelMediaCommandList(commandList); |
1565 | } | 1565 | } |
1566 | 1566 | ||
1567 | public void llParcelMediaQuery() | 1567 | public LSL_Types.list llParcelMediaQuery(LSL_Types.list aList) |
1568 | { | 1568 | { |
1569 | m_LSL_Functions.llParcelMediaQuery(); | 1569 | return m_LSL_Functions.llParcelMediaQuery(aList); |
1570 | } | 1570 | } |
1571 | 1571 | ||
1572 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) | 1572 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) |