mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Formatting cleanup.
This commit is contained in:
@@ -168,7 +168,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
Common.SendToDebug("IL_CREATE_CONSTRUCTOR()");
|
||||
//ConstructorBuilder constructor = typeBuilder.DefineConstructor(
|
||||
// MethodAttributes.Public,
|
||||
// CallingConventions.Standard,
|
||||
// CallingConventions.Standard,
|
||||
// new Type[0]);
|
||||
ConstructorBuilder constructor = typeBuilder.DefineConstructor(
|
||||
MethodAttributes.Public |
|
||||
@@ -192,8 +192,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
//// Create state object
|
||||
//FieldName = "State";
|
||||
//FieldBuilder State_fb = typeBuilder.DefineField(
|
||||
// FieldName,
|
||||
// typeof(UInt32),
|
||||
// FieldName,
|
||||
// typeof(UInt32),
|
||||
// FieldAttributes.Public);
|
||||
//il.Emit(OpCodes.Ldarg_0);
|
||||
//il.Emit(OpCodes.Ldc_I4, 0);
|
||||
@@ -206,8 +206,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
|
||||
//FieldName = "LSL_BuiltIns";
|
||||
//FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField(
|
||||
// FieldName,
|
||||
// objType1,
|
||||
// FieldName,
|
||||
// objType1,
|
||||
// FieldAttributes.Public);
|
||||
|
||||
////LSL_BuiltIn_Commands_TestImplementation _ti = new LSL_BuiltIn_Commands_TestImplementation();
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
// *
|
||||
// * These are internal "assembly" commands,
|
||||
// * basic operators like "ADD", "PUSH" and "POP"
|
||||
// *
|
||||
// *
|
||||
// * It also contains managed stack and keeps track of internal variables, etc.
|
||||
// *
|
||||
// *
|
||||
// */
|
||||
|
||||
|
||||
|
||||
@@ -69,14 +69,12 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
fs.Close();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Parse LSO file.
|
||||
/// </summary>
|
||||
public void Parse()
|
||||
{
|
||||
// The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack.
|
||||
|
||||
// The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack.
|
||||
|
||||
// HEADER BLOCK
|
||||
Common.SendToDebug("Reading HEADER BLOCK at: 0");
|
||||
@@ -156,7 +154,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
}
|
||||
Common.SendToDebug("Number of Static Blocks read: " + StaticBlockCount);
|
||||
|
||||
|
||||
// FUNCTION BLOCK
|
||||
// Always right after STATIC BLOCK
|
||||
LSO_Struct.FunctionBlock myFunctionBlock = new LSO_Struct.FunctionBlock();
|
||||
@@ -186,7 +183,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// STATE FRAME BLOCK
|
||||
// Always right after FUNCTION BLOCK
|
||||
Common.SendToDebug("Reading STATE BLOCK at: " + myHeader.SR);
|
||||
@@ -213,7 +209,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// STATE BLOCK
|
||||
// For each StateFrameBlock there is one StateBlock with multiple event handlers
|
||||
|
||||
@@ -239,7 +234,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
|
||||
// We need to count number of bits flagged in EventMask?
|
||||
|
||||
|
||||
// for each bit in myStateFrameBlock.StatePointer[i].EventMask
|
||||
|
||||
// ADDING TO ALL RIGHT NOW, SHOULD LIMIT TO ONLY THE ONES IN USE
|
||||
@@ -273,7 +267,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// READ FUNCTION CODE CHUNKS
|
||||
//// Functions + Function start pos (GFR)
|
||||
//// TODO: Somehow be able to identify and reference this
|
||||
@@ -293,7 +286,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
{
|
||||
for (int i = 0; i < myStateFrameBlock.StateCount; i++)
|
||||
{
|
||||
// TODO: Somehow organize events and functions so they can be found again,
|
||||
// TODO: Somehow organize events and functions so they can be found again,
|
||||
// two level search ain't no good
|
||||
for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++)
|
||||
{
|
||||
@@ -320,7 +313,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Common.IL_CreateFunctionList)
|
||||
IL_INSERT_FUNCTIONLIST();
|
||||
}
|
||||
@@ -371,7 +363,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
|
||||
//private byte[] br_read_smallendian(int len)
|
||||
//{
|
||||
// byte[] bytes = new byte[len];
|
||||
// byte[] bytes = new byte[len];
|
||||
// br.Read(bytes,0, len);
|
||||
// return bytes;
|
||||
//}
|
||||
@@ -459,7 +451,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
Common.SendToDebug("Return type #" + myCodeChunk.ReturnType.ObjectType + ": " +
|
||||
((LSO_Enums.Variable_Type_Codes) myCodeChunk.ReturnType.ObjectType).ToString());
|
||||
|
||||
|
||||
// TODO: How to determine number of codechunks -- does this method work?
|
||||
myCodeChunk.CodeChunkArguments = new List<LSO_Struct.CodeChunkArgument>();
|
||||
byte reader = br_read(1)[0];
|
||||
@@ -492,7 +483,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
// End marker is 0x000
|
||||
myCodeChunk.EndMarker = reader;
|
||||
|
||||
|
||||
//
|
||||
// Emit: START OF METHOD (FUNCTION)
|
||||
//
|
||||
@@ -515,11 +505,9 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
Common.SendToDebug("CLR:" + eventname + ":ILGenerator il = methodBuilder.GetILGenerator();");
|
||||
ILGenerator il = methodBuilder.GetILGenerator();
|
||||
|
||||
|
||||
if (Common.IL_UseTryCatch)
|
||||
IL_INSERT_TRY(il, eventname);
|
||||
|
||||
|
||||
// Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!");
|
||||
//Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call...");
|
||||
//il.Emit(OpCodes.Call, typeof(Console).GetMethod
|
||||
@@ -534,7 +522,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
il.Emit(OpCodes.Ldarg, _ic);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CALLING OPCODE PROCESSOR, one command at the time TO GENERATE IL
|
||||
//
|
||||
@@ -544,7 +531,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
FoundRet = LSL_PROCESS_OPCODE(il);
|
||||
}
|
||||
|
||||
|
||||
if (Common.IL_UseTryCatch)
|
||||
IL_INSERT_END_TRY(il, eventname);
|
||||
|
||||
@@ -558,17 +544,14 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
{
|
||||
Common.SendToDebug("Creating function list");
|
||||
|
||||
|
||||
string eventname = "GetFunctions";
|
||||
|
||||
Common.SendToDebug("Creating IL " + eventname);
|
||||
// Define a private String field.
|
||||
//FieldBuilder myField = myTypeBuilder.DefineField("EventList", typeof(String[]), FieldAttributes.Public);
|
||||
|
||||
|
||||
//FieldBuilder mem = typeBuilder.DefineField("mem", typeof(Array), FieldAttributes.Private);
|
||||
|
||||
|
||||
MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname,
|
||||
MethodAttributes.Public,
|
||||
typeof (string[]),
|
||||
@@ -579,7 +562,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
|
||||
ILGenerator il = methodBuilder.GetILGenerator();
|
||||
|
||||
|
||||
// IL_INSERT_TRY(il, eventname);
|
||||
|
||||
// // Push string to stack
|
||||
@@ -615,17 +597,14 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
//il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddFunction", new Type[] { typeof(string) }));
|
||||
}
|
||||
|
||||
|
||||
// IL_INSERT_END_TRY(il, eventname);
|
||||
|
||||
|
||||
il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack
|
||||
// il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("SetFunctionList", new Type[] { typeof(Array) }));
|
||||
|
||||
il.Emit(OpCodes.Ret); // Return
|
||||
}
|
||||
|
||||
|
||||
private void IL_INSERT_TRY(ILGenerator il, string eventname)
|
||||
{
|
||||
/*
|
||||
@@ -687,7 +666,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||
{
|
||||
Common.SendToDebug("Found cached STATIC BLOCK");
|
||||
|
||||
|
||||
return StaticBlocks[pos];
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
|
||||
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
|
||||
[assembly : AssemblyTrademark("")]
|
||||
[assembly : AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
|
||||
[assembly : ComVisible(false)]
|
||||
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("1.0.0.0")]
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine
|
||||
|
||||
// Fire the first start-event
|
||||
int eventFlags = m_scriptEngine.m_ScriptManager.GetStateEventFlags(localID, itemID);
|
||||
m_host.SetScriptEvents(itemID, eventFlags);
|
||||
m_host.SetScriptEvents(itemID, eventFlags);
|
||||
m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { });
|
||||
}
|
||||
catch (Exception e) // LEGIT - User Script Compilation
|
||||
|
||||
Reference in New Issue
Block a user