[Simian]
* Partial implementation of RezScript * Ported LSL to C# conversion code from OpenSim. Big thank you to all of the OpenSim contributors * Moved Simian scripting code to a new folder git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2518 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -79,13 +79,13 @@ namespace Simian
|
||||
SimulationObject simObj = new SimulationObject(prim, scene);
|
||||
if (MasterAgent != null)
|
||||
simObj.Prim.OwnerID = MasterAgent.ID;
|
||||
scene.ObjectAddOrUpdate(this, simObj, MasterAgent.ID, 0, PrimFlags.None, UpdateFlags.FullUpdate);
|
||||
scene.ObjectAddOrUpdate(this, simObj, MasterAgent.ID, PrimFlags.None, UpdateFlags.FullUpdate);
|
||||
}
|
||||
|
||||
void Objects_OnNewAttachment(Simulator simulator, Primitive prim, ulong regionHandle, ushort timeDilation)
|
||||
{
|
||||
SimulationObject simObj = new SimulationObject(prim, scene);
|
||||
scene.ObjectAddOrUpdate(this, simObj, MasterAgent.ID, 0, PrimFlags.None, UpdateFlags.FullUpdate);
|
||||
scene.ObjectAddOrUpdate(this, simObj, MasterAgent.ID, PrimFlags.None, UpdateFlags.FullUpdate);
|
||||
}
|
||||
|
||||
void Objects_OnNewAvatar(Simulator simulator, Avatar avatar, ulong regionHandle, ushort timeDilation)
|
||||
@@ -95,7 +95,7 @@ namespace Simian
|
||||
Agent agent = new Agent(obj, AgentInfoFromAvatar(avatar));
|
||||
|
||||
scene.AgentAdd(this, agent, avatar.Flags);
|
||||
scene.ObjectAddOrUpdate(this, obj, obj.Prim.OwnerID, 0, PrimFlags.None, UpdateFlags.FullUpdate);
|
||||
scene.ObjectAddOrUpdate(this, obj, obj.Prim.OwnerID, PrimFlags.None, UpdateFlags.FullUpdate);
|
||||
}
|
||||
|
||||
void Objects_OnObjectUpdated(Simulator simulator, ObjectUpdate update, ulong regionHandle, ushort timeDilation)
|
||||
@@ -117,7 +117,7 @@ namespace Simian
|
||||
if (update.Avatar) obj.Prim.CollisionPlane = update.CollisionPlane;
|
||||
if (update.Textures != null) obj.Prim.Textures = update.Textures;
|
||||
|
||||
scene.ObjectAddOrUpdate(this, obj, obj.Prim.OwnerID, 0, PrimFlags.None, flags);
|
||||
scene.ObjectAddOrUpdate(this, obj, obj.Prim.OwnerID, PrimFlags.None, flags);
|
||||
}
|
||||
|
||||
if (update.LocalID == client.Self.LocalID)
|
||||
@@ -130,7 +130,7 @@ namespace Simian
|
||||
if (update.Avatar) MasterAgent.Avatar.Prim.CollisionPlane = update.CollisionPlane;
|
||||
if (update.Textures != null) MasterAgent.Avatar.Prim.Textures = update.Textures;
|
||||
|
||||
scene.ObjectAddOrUpdate(this, MasterAgent.Avatar, MasterAgent.ID, 0, PrimFlags.None, flags);
|
||||
scene.ObjectAddOrUpdate(this, MasterAgent.Avatar, MasterAgent.ID, PrimFlags.None, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ namespace Simian
|
||||
if (scene.TryGetObject(update.AgentData.AgentID, out obj))
|
||||
{
|
||||
obj.Prim.Rotation = update.AgentData.BodyRotation;
|
||||
scene.ObjectAddOrUpdate(this, obj, obj.Prim.OwnerID, 0, PrimFlags.None, UpdateFlags.Rotation);
|
||||
scene.ObjectAddOrUpdate(this, obj, obj.Prim.OwnerID, PrimFlags.None, UpdateFlags.Rotation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@ namespace Simian
|
||||
}
|
||||
}
|
||||
|
||||
void Scene_OnObjectAddOrUpdate(object sender, SimulationObject obj, UUID ownerID, int scriptStartParam, PrimFlags creatorFlags, UpdateFlags update)
|
||||
void Scene_OnObjectAddOrUpdate(object sender, SimulationObject obj, UUID ownerID, PrimFlags creatorFlags, UpdateFlags update)
|
||||
{
|
||||
// Recompute meshes for
|
||||
bool forceMeshing = false;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ExtensionLoader;
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -24,6 +25,32 @@ namespace Simian
|
||||
{
|
||||
}
|
||||
|
||||
public bool RezScript(UUID scriptID, UUID scriptSourceAssetID, SimulationObject hostObject, int scriptStartParam)
|
||||
{
|
||||
Asset sourceAsset;
|
||||
Asset binaryAsset;
|
||||
|
||||
// Try to fetch the script source code asset
|
||||
if (scene.Server.Assets.TryGetAsset(scriptSourceAssetID, out sourceAsset) && sourceAsset is AssetScriptText)
|
||||
{
|
||||
// The script binary assetID is the MD5 hash of the source to avoid lots of duplicate compiles
|
||||
UUID scriptBinaryAssetID = new UUID(Utils.MD5(sourceAsset.AssetData), 0);
|
||||
|
||||
// Check if a compiled assembly already exists for this script
|
||||
if (scene.Server.Assets.TryGetAsset(scriptBinaryAssetID, out binaryAsset))
|
||||
{
|
||||
Logger.Log("Using existing compile for scriptID " + scriptID, Helpers.LogLevel.Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScriptCompiler compiler = new ScriptCompiler();
|
||||
string csText = compiler.Convert(Encoding.UTF8.GetString(sourceAsset.AssetData));
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool PostScriptEvent(UUID scriptID, EventParams parms)
|
||||
{
|
||||
return false;
|
||||
@@ -44,12 +71,12 @@ namespace Simian
|
||||
return parms;
|
||||
}
|
||||
|
||||
public bool GetScriptState(UUID scriptID)
|
||||
public bool IsScriptEnabled(UUID scriptID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void SetScriptState(UUID scriptID, bool state)
|
||||
public void SetScriptEnabled(UUID scriptID, bool enabled)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user