diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Grid/ScriptEngine/Common | |
parent | * Deleted .user file (diff) | |
download | opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Grid/ScriptEngine/Common')
5 files changed, 82 insertions, 84 deletions
diff --git a/OpenSim/Grid/ScriptEngine/Common/Executor.cs b/OpenSim/Grid/ScriptEngine/Common/Executor.cs index 0732cbc..495c267 100644 --- a/OpenSim/Grid/ScriptEngine/Common/Executor.cs +++ b/OpenSim/Grid/ScriptEngine/Common/Executor.cs | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | ||
32 | using System.Reflection; | 31 | using System.Reflection; |
33 | using System.Runtime.Remoting.Lifetime; | 32 | using System.Runtime.Remoting.Lifetime; |
34 | 33 | ||
@@ -53,7 +52,7 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
53 | { | 52 | { |
54 | //Console.WriteLine("Executor: InitializeLifetimeService()"); | 53 | //Console.WriteLine("Executor: InitializeLifetimeService()"); |
55 | // return null; | 54 | // return null; |
56 | ILease lease = (ILease)base.InitializeLifetimeService(); | 55 | ILease lease = (ILease) base.InitializeLifetimeService(); |
57 | 56 | ||
58 | if (lease.CurrentState == LeaseState.Initial) | 57 | if (lease.CurrentState == LeaseState.Initial) |
59 | { | 58 | { |
@@ -75,56 +74,56 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
75 | // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead! | 74 | // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead! |
76 | //try | 75 | //try |
77 | //{ | 76 | //{ |
78 | if (m_Running == false) | 77 | if (m_Running == false) |
79 | { | 78 | { |
80 | // Script is inactive, do not execute! | 79 | // Script is inactive, do not execute! |
81 | return; | 80 | return; |
82 | } | 81 | } |
83 | 82 | ||
84 | string EventName = m_Script.State() + "_event_" + FunctionName; | 83 | string EventName = m_Script.State() + "_event_" + FunctionName; |
85 | 84 | ||
86 | //type.InvokeMember(EventName, BindingFlags.InvokeMethod, null, m_Script, args); | 85 | //type.InvokeMember(EventName, BindingFlags.InvokeMethod, null, m_Script, args); |
87 | 86 | ||
88 | //Console.WriteLine("ScriptEngine Executor.ExecuteEvent: \"" + EventName + "\""); | 87 | //Console.WriteLine("ScriptEngine Executor.ExecuteEvent: \"" + EventName + "\""); |
89 | 88 | ||
90 | if (Events.ContainsKey(EventName) == false) | 89 | if (Events.ContainsKey(EventName) == false) |
90 | { | ||
91 | // Not found, create | ||
92 | Type type = m_Script.GetType(); | ||
93 | try | ||
91 | { | 94 | { |
92 | // Not found, create | 95 | MethodInfo mi = type.GetMethod(EventName); |
93 | Type type = m_Script.GetType(); | 96 | Events.Add(EventName, mi); |
94 | try | ||
95 | { | ||
96 | MethodInfo mi = type.GetMethod(EventName); | ||
97 | Events.Add(EventName, mi); | ||
98 | } | ||
99 | catch | ||
100 | { | ||
101 | // Event name not found, cache it as not found | ||
102 | Events.Add(EventName, null); | ||
103 | } | ||
104 | } | 97 | } |
105 | 98 | catch | |
106 | // Get event | ||
107 | MethodInfo ev = null; | ||
108 | Events.TryGetValue(EventName, out ev); | ||
109 | |||
110 | if (ev == null) // No event by that name! | ||
111 | { | 99 | { |
112 | //Console.WriteLine("ScriptEngine Can not find any event named: \"" + EventName + "\""); | 100 | // Event name not found, cache it as not found |
113 | return; | 101 | Events.Add(EventName, null); |
114 | } | 102 | } |
103 | } | ||
104 | |||
105 | // Get event | ||
106 | MethodInfo ev = null; | ||
107 | Events.TryGetValue(EventName, out ev); | ||
108 | |||
109 | if (ev == null) // No event by that name! | ||
110 | { | ||
111 | //Console.WriteLine("ScriptEngine Can not find any event named: \"" + EventName + "\""); | ||
112 | return; | ||
113 | } | ||
115 | 114 | ||
116 | // Found | 115 | // Found |
117 | //try | 116 | //try |
118 | //{ | 117 | //{ |
119 | // Invoke it | 118 | // Invoke it |
120 | ev.Invoke(m_Script, args); | 119 | ev.Invoke(m_Script, args); |
121 | 120 | ||
122 | //} | 121 | //} |
123 | //catch (Exception e) | 122 | //catch (Exception e) |
124 | //{ | 123 | //{ |
125 | // // TODO: Send to correct place | 124 | // // TODO: Send to correct place |
126 | // Console.WriteLine("ScriptEngine Exception attempting to executing script function: " + e.ToString()); | 125 | // Console.WriteLine("ScriptEngine Exception attempting to executing script function: " + e.ToString()); |
127 | //} | 126 | //} |
128 | 127 | ||
129 | 128 | ||
130 | //} | 129 | //} |
@@ -136,8 +135,5 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
136 | { | 135 | { |
137 | m_Running = false; | 136 | m_Running = false; |
138 | } | 137 | } |
139 | |||
140 | |||
141 | } | 138 | } |
142 | 139 | } \ No newline at end of file | |
143 | } | ||
diff --git a/OpenSim/Grid/ScriptEngine/Common/IScript.cs b/OpenSim/Grid/ScriptEngine/Common/IScript.cs index 7d51c50..eb8205b 100644 --- a/OpenSim/Grid/ScriptEngine/Common/IScript.cs +++ b/OpenSim/Grid/ScriptEngine/Common/IScript.cs | |||
@@ -26,10 +26,6 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | |||
33 | namespace OpenSim.Grid.ScriptEngine.Common | 29 | namespace OpenSim.Grid.ScriptEngine.Common |
34 | { | 30 | { |
35 | public interface IScript | 31 | public interface IScript |
@@ -37,4 +33,4 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
37 | string State(); | 33 | string State(); |
38 | Executor Exec { get; } | 34 | Executor Exec { get; } |
39 | } | 35 | } |
40 | } | 36 | } \ No newline at end of file |
diff --git a/OpenSim/Grid/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Grid/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs index 7bd6f43..9630d6e 100644 --- a/OpenSim/Grid/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs +++ b/OpenSim/Grid/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs | |||
@@ -26,15 +26,12 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | ||
30 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
31 | using System.Text; | ||
32 | 30 | ||
33 | namespace OpenSim.Grid.ScriptEngine.Common | 31 | namespace OpenSim.Grid.ScriptEngine.Common |
34 | { | 32 | { |
35 | public interface LSL_BuiltIn_Commands_Interface | 33 | public interface LSL_BuiltIn_Commands_Interface |
36 | { | 34 | { |
37 | |||
38 | string State(); | 35 | string State(); |
39 | 36 | ||
40 | double llSin(double f); | 37 | double llSin(double f); |
@@ -404,7 +401,9 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
404 | //wiki: llSetTextureAnim(integer mode, integer face, integer sizex, integer sizey, double start, double length, double rate) | 401 | //wiki: llSetTextureAnim(integer mode, integer face, integer sizex, integer sizey, double start, double length, double rate) |
405 | void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate); | 402 | void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate); |
406 | //wiki: llTriggerSoundLimited(string sound, double volume, vector top_north_east, vector bottom_south_west) | 403 | //wiki: llTriggerSoundLimited(string sound, double volume, vector top_north_east, vector bottom_south_west) |
407 | void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, LSL_Types.Vector3 bottom_south_west); | 404 | void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, |
405 | LSL_Types.Vector3 bottom_south_west); | ||
406 | |||
408 | //wiki: llEjectFromLand(key pest) | 407 | //wiki: llEjectFromLand(key pest) |
409 | void llEjectFromLand(string pest); | 408 | void llEjectFromLand(string pest); |
410 | void llParseString2List(); | 409 | void llParseString2List(); |
@@ -437,7 +436,7 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
437 | //wiki: double llGetRegionFPS() | 436 | //wiki: double llGetRegionFPS() |
438 | double llGetRegionFPS(); | 437 | double llGetRegionFPS(); |
439 | //wiki: llParticleSystem(List<Object> rules | 438 | //wiki: llParticleSystem(List<Object> rules |
440 | void llParticleSystem(List<Object> rules); | 439 | void llParticleSystem(List<object> rules); |
441 | //wiki: llGroundRepel(double height, integer water, double tau) | 440 | //wiki: llGroundRepel(double height, integer water, double tau) |
442 | void llGroundRepel(double height, int water, double tau); | 441 | void llGroundRepel(double height, int water, double tau); |
443 | void llGiveInventoryList(); | 442 | void llGiveInventoryList(); |
@@ -548,7 +547,9 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
548 | //wiki: list llParseStringKeepNulls( string src, list separators, list spacers ) | 547 | //wiki: list llParseStringKeepNulls( string src, list separators, list spacers ) |
549 | List<string> llParseStringKeepNulls(string src, List<string> seperators, List<string> spacers); | 548 | List<string> llParseStringKeepNulls(string src, List<string> seperators, List<string> spacers); |
550 | //wiki: llRezAtRoot(string inventory, vector position, vector velocity, rotation rot, integer param) | 549 | //wiki: llRezAtRoot(string inventory, vector position, vector velocity, rotation rot, integer param) |
551 | void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, LSL_Types.Quaternion rot, int param); | 550 | void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, |
551 | LSL_Types.Quaternion rot, int param); | ||
552 | |||
552 | //wiki: integer llGetObjectPermMask(integer mask) | 553 | //wiki: integer llGetObjectPermMask(integer mask) |
553 | int llGetObjectPermMask(int mask); | 554 | int llGetObjectPermMask(int mask); |
554 | //wiki: llSetObjectPermMask(integer mask, integer value) | 555 | //wiki: llSetObjectPermMask(integer mask, integer value) |
@@ -632,4 +633,4 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
632 | //OpenSim functions | 633 | //OpenSim functions |
633 | string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); | 634 | string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); |
634 | } | 635 | } |
635 | } | 636 | } \ No newline at end of file |
diff --git a/OpenSim/Grid/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Grid/ScriptEngine/Common/LSL_Types.cs index 02f9e9a..d10a5ef 100644 --- a/OpenSim/Grid/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Grid/ScriptEngine/Common/LSL_Types.cs | |||
@@ -41,11 +41,12 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
41 | public double Z; | 41 | public double Z; |
42 | 42 | ||
43 | public Vector3(Vector3 vector) | 43 | public Vector3(Vector3 vector) |
44 | { | 44 | { |
45 | X = (float)vector.X; | 45 | X = (float) vector.X; |
46 | Y = (float)vector.Y; | 46 | Y = (float) vector.Y; |
47 | Z = (float)vector.Z; | 47 | Z = (float) vector.Z; |
48 | } | 48 | } |
49 | |||
49 | public Vector3(double x, double y, double z) | 50 | public Vector3(double x, double y, double z) |
50 | { | 51 | { |
51 | X = x; | 52 | X = x; |
@@ -53,6 +54,7 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
53 | Z = z; | 54 | Z = z; |
54 | } | 55 | } |
55 | } | 56 | } |
57 | |||
56 | [Serializable] | 58 | [Serializable] |
57 | public struct Quaternion | 59 | public struct Quaternion |
58 | { | 60 | { |
@@ -62,12 +64,13 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
62 | public double R; | 64 | public double R; |
63 | 65 | ||
64 | public Quaternion(Quaternion Quat) | 66 | public Quaternion(Quaternion Quat) |
65 | { | 67 | { |
66 | X = (float)Quat.X; | 68 | X = (float) Quat.X; |
67 | Y = (float)Quat.Y; | 69 | Y = (float) Quat.Y; |
68 | Z = (float)Quat.Z; | 70 | Z = (float) Quat.Z; |
69 | R = (float)Quat.R; | 71 | R = (float) Quat.R; |
70 | } | 72 | } |
73 | |||
71 | public Quaternion(double x, double y, double z, double r) | 74 | public Quaternion(double x, double y, double z, double r) |
72 | { | 75 | { |
73 | X = x; | 76 | X = x; |
@@ -75,7 +78,6 @@ namespace OpenSim.Grid.ScriptEngine.Common | |||
75 | Z = z; | 78 | Z = z; |
76 | R = r; | 79 | R = r; |
77 | } | 80 | } |
78 | |||
79 | } | 81 | } |
80 | } | 82 | } |
81 | } | 83 | } \ No newline at end of file |
diff --git a/OpenSim/Grid/ScriptEngine/Common/Properties/AssemblyInfo.cs b/OpenSim/Grid/ScriptEngine/Common/Properties/AssemblyInfo.cs index 44a4f29..1d5911b 100644 --- a/OpenSim/Grid/ScriptEngine/Common/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/ScriptEngine/Common/Properties/AssemblyInfo.cs | |||
@@ -1,26 +1,28 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | 2 | using System.Runtime.InteropServices; |
4 | 3 | ||
5 | // General Information about an assembly is controlled through the following | 4 | // General Information about an assembly is controlled through the following |
6 | // set of attributes. Change these attribute values to modify the information | 5 | // set of attributes. Change these attribute values to modify the information |
7 | // associated with an assembly. | 6 | // associated with an assembly. |
8 | [assembly: AssemblyTitle("OpenSim.Grid.ScriptEngine.Common")] | 7 | |
9 | [assembly: AssemblyDescription("")] | 8 | [assembly : AssemblyTitle("OpenSim.Grid.ScriptEngine.Common")] |
10 | [assembly: AssemblyConfiguration("")] | 9 | [assembly : AssemblyDescription("")] |
11 | [assembly: AssemblyCompany("")] | 10 | [assembly : AssemblyConfiguration("")] |
12 | [assembly: AssemblyProduct("OpenSim.Grid.ScriptEngine.Common")] | 11 | [assembly : AssemblyCompany("")] |
13 | [assembly: AssemblyCopyright("Copyright © 2007")] | 12 | [assembly : AssemblyProduct("OpenSim.Grid.ScriptEngine.Common")] |
14 | [assembly: AssemblyTrademark("")] | 13 | [assembly : AssemblyCopyright("Copyright © 2007")] |
15 | [assembly: AssemblyCulture("")] | 14 | [assembly : AssemblyTrademark("")] |
15 | [assembly : AssemblyCulture("")] | ||
16 | 16 | ||
17 | // Setting ComVisible to false makes the types in this assembly not visible | 17 | // Setting ComVisible to false makes the types in this assembly not visible |
18 | // to COM components. If you need to access a type in this assembly from | 18 | // to COM components. If you need to access a type in this assembly from |
19 | // COM, set the ComVisible attribute to true on that type. | 19 | // COM, set the ComVisible attribute to true on that type. |
20 | [assembly: ComVisible(false)] | 20 | |
21 | [assembly : ComVisible(false)] | ||
21 | 22 | ||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
23 | [assembly: Guid("0bf07c53-ae51-487f-a907-e9b30c251602")] | 24 | |
25 | [assembly : Guid("0bf07c53-ae51-487f-a907-e9b30c251602")] | ||
24 | 26 | ||
25 | // Version information for an assembly consists of the following four values: | 27 | // Version information for an assembly consists of the following four values: |
26 | // | 28 | // |
@@ -29,5 +31,6 @@ using System.Runtime.InteropServices; | |||
29 | // Build Number | 31 | // Build Number |
30 | // Revision | 32 | // Revision |
31 | // | 33 | // |
32 | [assembly: AssemblyVersion("1.0.0.0")] | 34 | |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 35 | [assembly : AssemblyVersion("1.0.0.0")] |
36 | [assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file | ||