Fix casting in llParcelMediaCommandList so that it actually, you know, works
parent
ddd072b3fb
commit
4be13b1a42
|
@ -8925,17 +8925,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
int width = 0;
|
int width = 0;
|
||||||
int height = 0;
|
int height = 0;
|
||||||
|
|
||||||
ParcelMediaCommandEnum? commandToSend = null;
|
uint commandToSend = 0;
|
||||||
float time = 0.0f; // default is from start
|
float time = 0.0f; // default is from start
|
||||||
|
|
||||||
ScenePresence presence = null;
|
ScenePresence presence = null;
|
||||||
|
|
||||||
for (int i = 0; i < commandList.Data.Length; i++)
|
for (int i = 0; i < commandList.Data.Length; i++)
|
||||||
{
|
{
|
||||||
ParcelMediaCommandEnum command = (ParcelMediaCommandEnum)commandList.Data[i];
|
uint command = (uint)(commandList.GetLSLIntegerItem(i));
|
||||||
switch (command)
|
switch (command)
|
||||||
{
|
{
|
||||||
case ParcelMediaCommandEnum.Agent:
|
case (uint)ParcelMediaCommandEnum.Agent:
|
||||||
// we send only to one agent
|
// we send only to one agent
|
||||||
if ((i + 1) < commandList.Length)
|
if ((i + 1) < commandList.Length)
|
||||||
{
|
{
|
||||||
|
@ -8952,25 +8952,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ParcelMediaCommandEnum.Loop:
|
case (uint)ParcelMediaCommandEnum.Loop:
|
||||||
loop = 1;
|
loop = 1;
|
||||||
commandToSend = command;
|
commandToSend = command;
|
||||||
update = true; //need to send the media update packet to set looping
|
update = true; //need to send the media update packet to set looping
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ParcelMediaCommandEnum.Play:
|
case (uint)ParcelMediaCommandEnum.Play:
|
||||||
loop = 0;
|
loop = 0;
|
||||||
commandToSend = command;
|
commandToSend = command;
|
||||||
update = true; //need to send the media update packet to make sure it doesn't loop
|
update = true; //need to send the media update packet to make sure it doesn't loop
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ParcelMediaCommandEnum.Pause:
|
case (uint)ParcelMediaCommandEnum.Pause:
|
||||||
case ParcelMediaCommandEnum.Stop:
|
case (uint)ParcelMediaCommandEnum.Stop:
|
||||||
case ParcelMediaCommandEnum.Unload:
|
case (uint)ParcelMediaCommandEnum.Unload:
|
||||||
commandToSend = command;
|
commandToSend = command;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ParcelMediaCommandEnum.Url:
|
case (uint)ParcelMediaCommandEnum.Url:
|
||||||
if ((i + 1) < commandList.Length)
|
if ((i + 1) < commandList.Length)
|
||||||
{
|
{
|
||||||
if (commandList.Data[i + 1] is LSL_String)
|
if (commandList.Data[i + 1] is LSL_String)
|
||||||
|
@ -8983,7 +8983,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ParcelMediaCommandEnum.Texture:
|
case (uint)ParcelMediaCommandEnum.Texture:
|
||||||
if ((i + 1) < commandList.Length)
|
if ((i + 1) < commandList.Length)
|
||||||
{
|
{
|
||||||
if (commandList.Data[i + 1] is LSL_String)
|
if (commandList.Data[i + 1] is LSL_String)
|
||||||
|
@ -8996,7 +8996,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ParcelMediaCommandEnum.Time:
|
case (uint)ParcelMediaCommandEnum.Time:
|
||||||
if ((i + 1) < commandList.Length)
|
if ((i + 1) < commandList.Length)
|
||||||
{
|
{
|
||||||
if (commandList.Data[i + 1] is LSL_Float)
|
if (commandList.Data[i + 1] is LSL_Float)
|
||||||
|
@ -9008,7 +9008,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ParcelMediaCommandEnum.AutoAlign:
|
case (uint)ParcelMediaCommandEnum.AutoAlign:
|
||||||
if ((i + 1) < commandList.Length)
|
if ((i + 1) < commandList.Length)
|
||||||
{
|
{
|
||||||
if (commandList.Data[i + 1] is LSL_Integer)
|
if (commandList.Data[i + 1] is LSL_Integer)
|
||||||
|
@ -9022,7 +9022,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ParcelMediaCommandEnum.Type:
|
case (uint)ParcelMediaCommandEnum.Type:
|
||||||
if ((i + 1) < commandList.Length)
|
if ((i + 1) < commandList.Length)
|
||||||
{
|
{
|
||||||
if (commandList.Data[i + 1] is LSL_String)
|
if (commandList.Data[i + 1] is LSL_String)
|
||||||
|
@ -9035,7 +9035,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ParcelMediaCommandEnum.Desc:
|
case (uint)ParcelMediaCommandEnum.Desc:
|
||||||
if ((i + 1) < commandList.Length)
|
if ((i + 1) < commandList.Length)
|
||||||
{
|
{
|
||||||
if (commandList.Data[i + 1] is LSL_String)
|
if (commandList.Data[i + 1] is LSL_String)
|
||||||
|
@ -9048,7 +9048,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ParcelMediaCommandEnum.Size:
|
case (uint)ParcelMediaCommandEnum.Size:
|
||||||
if ((i + 2) < commandList.Length)
|
if ((i + 2) < commandList.Length)
|
||||||
{
|
{
|
||||||
if (commandList.Data[i + 1] is LSL_Integer)
|
if (commandList.Data[i + 1] is LSL_Integer)
|
||||||
|
@ -9116,7 +9116,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commandToSend != null)
|
if (commandToSend != 0)
|
||||||
{
|
{
|
||||||
// the commandList contained a start/stop/... command, too
|
// the commandList contained a start/stop/... command, too
|
||||||
if (presence == null)
|
if (presence == null)
|
||||||
|
|
Loading…
Reference in New Issue