aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs124
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs2
3 files changed, 123 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
index 53533ec..d59da96 100644
--- a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
@@ -1714,9 +1714,9 @@ namespace OpenSim.Region.ScriptEngine.Common
1714 m_LSL_Functions.llParcelMediaCommandList(commandList); 1714 m_LSL_Functions.llParcelMediaCommandList(commandList);
1715 } 1715 }
1716 1716
1717 public void llParcelMediaQuery() 1717 public LSL_Types.list llParcelMediaQuery(LSL_Types.list aList)
1718 { 1718 {
1719 m_LSL_Functions.llParcelMediaQuery(); 1719 return m_LSL_Functions.llParcelMediaQuery(aList);
1720 } 1720 }
1721 1721
1722 public LSL_Types.LSLInteger llModPow(int a, int b, int c) 1722 public LSL_Types.LSLInteger llModPow(int a, int b, int c)
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 440540e..d2a15aa 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -6758,14 +6758,130 @@ namespace OpenSim.Region.ScriptEngine.Common
6758 6758
6759 public void llParcelMediaCommandList(LSL_Types.list commandList) 6759 public void llParcelMediaCommandList(LSL_Types.list commandList)
6760 { 6760 {
6761 m_host.AddScriptLPS(1); 6761 //TO DO: Implement the missing commands
6762 NotImplemented("llParcelMediaCommandList"); 6762 //PARCEL_MEDIA_COMMAND_STOP Stop the media stream and go back to the first frame.
6763 //PARCEL_MEDIA_COMMAND_PAUSE Pause the media stream (stop playing but stay on current frame).
6764 //PARCEL_MEDIA_COMMAND_PLAY Start the media stream playing from the current frame and stop when the end is reached.
6765 //PARCEL_MEDIA_COMMAND_LOOP Start the media stream playing from the current frame. When the end is reached, loop to the beginning and continue.
6766 //PARCEL_MEDIA_COMMAND_TEXTURE key uuid Use this to get or set the parcel's media texture.
6767 //PARCEL_MEDIA_COMMAND_URL string url Used to get or set the parcel's media url.
6768 //PARCEL_MEDIA_COMMAND_TIME float time Move a media stream to a specific time.
6769 //PARCEL_MEDIA_COMMAND_AGENT key uuid Applies the media command to the specified agent only.
6770 //PARCEL_MEDIA_COMMAND_UNLOAD Completely unloads the movie and restores the original texture.
6771 //PARCEL_MEDIA_COMMAND_AUTO_ALIGN integer boolean Sets the parcel option 'Auto scale content'.
6772 //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)
6773 //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)
6774 //PARCEL_MEDIA_COMMAND_DESC string desc Use this to get or set the parcel media description. (1.19.1 RC0 or later)
6775 //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)
6776 m_host.AddScriptLPS(1);
6777 for (int i = 0; i < commandList.Data.Length; i++)
6778 {
6779 switch ((ParcelMediaCommandEnum)commandList.Data[i])
6780 {
6781 case ParcelMediaCommandEnum.Play:
6782 List<ScenePresence> scenePresencePlayList = World.GetScenePresences();
6783 foreach (ScenePresence agent in scenePresencePlayList)
6784 {
6785 if (!agent.IsChildAgent)
6786 {
6787 agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0);
6788 }
6789 }
6790 break;
6791 case ParcelMediaCommandEnum.Stop:
6792 List<ScenePresence> scenePresenceStopList = World.GetScenePresences();
6793 foreach (ScenePresence agent in scenePresenceStopList)
6794 {
6795 if (!agent.IsChildAgent)
6796 {
6797 agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Stop, 0);
6798 }
6799 }
6800 break;
6801 case ParcelMediaCommandEnum.Pause:
6802 List<ScenePresence> scenePresencePauseList = World.GetScenePresences();
6803 foreach (ScenePresence agent in scenePresencePauseList)
6804 {
6805 if (!agent.IsChildAgent)
6806 {
6807 agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Pause, 0);
6808 }
6809 }
6810 break;
6811
6812 case ParcelMediaCommandEnum.Url:
6813 if ((i + 1) < commandList.Length)
6814 {
6815 if (commandList.Data[i + 1] is string)
6816 {
6817 //Set the new media URL only if the user is the owner of the land
6818 osSetParcelMediaURL(commandList.Data[i + 1].ToString());
6819
6820 List<ScenePresence> scenePresenceList = World.GetScenePresences();
6821 LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
6822 //Send an update of the mediaURL to all the clients that are in the parcel
6823 foreach (ScenePresence agent in scenePresenceList)
6824 {
6825 if (!agent.IsChildAgent)
6826 {
6827 //Send parcel media update to the client
6828 agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1);
6829 }
6830 }
6831
6832 }
6833 i++;
6834 }
6835 break;
6836 default:
6837 ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url;
6838 NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString());
6839 break;
6840 }//end switch
6841
6842 }
6843
6844
6845 //NotImplemented("llParcelMediaCommandList");
6763 } 6846 }
6764 6847
6765 public void llParcelMediaQuery() 6848 public LSL_Types.list llParcelMediaQuery(LSL_Types.list aList)
6766 { 6849 {
6767 m_host.AddScriptLPS(1); 6850 m_host.AddScriptLPS(1);
6768 NotImplemented("llParcelMediaQuery"); 6851 LSL_Types.list list = new LSL_Types.list();
6852 //TO DO: make the implementation for the missing commands
6853 //PARCEL_MEDIA_COMMAND_TEXTURE key uuid Use this to get or set the parcel's media texture.
6854 //PARCEL_MEDIA_COMMAND_URL string url Used to get or set the parcel's media url.
6855 //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)
6856 //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)
6857 //PARCEL_MEDIA_COMMAND_DESC string desc Use this to get or set the parcel media description. (1.19.1 RC0 or later)
6858 //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)
6859 for (int i = 0; i < aList.Data.Length; i++)
6860 {
6861
6862 if (aList.Data[i] != null)
6863 {
6864 switch((ParcelMediaCommandEnum)aList.Data[i])
6865 {
6866 case ParcelMediaCommandEnum.Url:
6867 list.Add(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaURL);
6868 break;
6869 case ParcelMediaCommandEnum.Desc:
6870 list.Add(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).Description);
6871 break;
6872 case ParcelMediaCommandEnum.Texture:
6873 list.Add(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaID);
6874 break;
6875 default:
6876 ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url;
6877 NotImplemented("llParcelMediaQuery parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType() , aList.Data[i].ToString()).ToString());
6878 break;
6879 }
6880
6881 }
6882 }
6883 return list;
6884
6769 } 6885 }
6770 6886
6771 public LSL_Types.LSLInteger llModPow(int a, int b, int c) 6887 public LSL_Types.LSLInteger llModPow(int a, int b, int c)
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
index 3acbf97..9e3742c 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
@@ -586,7 +586,7 @@ namespace OpenSim.Region.ScriptEngine.Common
586 void llLoadURL(string avatar_id, string message, string url); 586 void llLoadURL(string avatar_id, string message, string url);
587 //wiki: llParcelMediaCommandList(list commandList) 587 //wiki: llParcelMediaCommandList(list commandList)
588 void llParcelMediaCommandList(LSL_Types.list commandList); 588 void llParcelMediaCommandList(LSL_Types.list commandList);
589 void llParcelMediaQuery(); 589 LSL_Types.list llParcelMediaQuery(LSL_Types.list aList);
590 //wiki integer llModPow(integer a, integer b, integer c) 590 //wiki integer llModPow(integer a, integer b, integer c)
591 LSL_Types.LSLInteger llModPow(int a, int b, int c); 591 LSL_Types.LSLInteger llModPow(int a, int b, int c);
592 //wiki: integer llGetInventoryType(string name) 592 //wiki: integer llGetInventoryType(string name)