diff options
Diffstat (limited to '')
-rw-r--r-- | Script_manager.cs | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/Script_manager.cs b/Script_manager.cs index 87f2eca..354247b 100644 --- a/Script_manager.cs +++ b/Script_manager.cs | |||
@@ -33,18 +33,18 @@ using System.Collections; | |||
33 | //using LuaInterface; | 33 | //using LuaInterface; |
34 | using libsecondlife; | 34 | using libsecondlife; |
35 | 35 | ||
36 | namespace Second_server | 36 | namespace OpenSim |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// Description of Script_manager. | 39 | /// Description of Script_manager. |
40 | /// </summary> | 40 | /// </summary> |
41 | public class Script_manager | 41 | public class ScriptManager |
42 | { | 42 | { |
43 | //public LuaInterface.Lua Lu; | 43 | //public LuaInterface.Lua Lu; |
44 | //private ArrayList scripts; | 44 | //private ArrayList scripts; |
45 | //private prim_info current_prim; | 45 | //private prim_info current_prim; |
46 | 46 | ||
47 | public Script_manager() | 47 | public ScriptManager() |
48 | { | 48 | { |
49 | } | 49 | } |
50 | 50 | ||
@@ -54,36 +54,52 @@ namespace Second_server | |||
54 | //register any lua routines , like check finish script one | 54 | //register any lua routines , like check finish script one |
55 | Lu.OpenMathLib(); | 55 | Lu.OpenMathLib(); |
56 | }*/ | 56 | }*/ |
57 | public void script_register( script_object_interface script) | 57 | |
58 | private void RegisterFunctions() | ||
58 | { | 59 | { |
59 | //called by scripts to register themselves | 60 | //lu.RegisterFunction( "RegisterScript",this,this.GetType().GetMethod("ScriptRegister")); |
61 | //lu.RegisterFunction( "MoveObject",this,this.GetType().GetMethod("MoveObject")); | ||
62 | //lu.RegisterFunction( "Say",this,this.GetType().GetMethod("Say")); | ||
63 | |||
60 | } | 64 | } |
61 | 65 | ||
62 | public void Call_tick(prim_info prim) | 66 | public void Call_tick(PrimInfo prim) |
63 | { | 67 | { |
64 | //set current prim and then call tick function in linked script | 68 | //set current prim and then call tick function in linked script |
65 | } | 69 | } |
66 | public void Call_click(prim_info prim) | 70 | public void Call_touch(PrimInfo prim) |
67 | { | 71 | { |
68 | //set current prim and then call clicked function in linked script | 72 | //set current prim and then call clicked function in linked script |
69 | 73 | ||
70 | } | 74 | } |
71 | private void Register_functions() | 75 | public void Call_on_rex(PrimInfo prim) |
72 | { | 76 | { |
73 | //lu.RegisterFunction( "register_script",this,this.GetType().GetMethod("script_register")); | 77 | //set current prim and then call clicked function in linked script |
74 | //lu.RegisterFunction( "Move_object",this,this.GetType().GetMethod("Move_object")); | 78 | |
75 | |||
76 | } | 79 | } |
77 | //Lua registered functions | 80 | |
78 | public void Move_object(float x ,float y, float z) | 81 | #region Lua Functions |
82 | |||
83 | public void ScriptRegister( script_object_interface script) | ||
84 | { | ||
85 | //called by scripts to register themselves | ||
86 | } | ||
87 | public void MoveObject(float x ,float y, float z) | ||
79 | { | 88 | { |
80 | 89 | ||
81 | } | 90 | } |
91 | public void Say(string message) | ||
92 | { | ||
93 | |||
94 | } | ||
95 | #endregion | ||
96 | |||
82 | } | 97 | } |
83 | 98 | ||
84 | public interface script_object_interface | 99 | public interface script_object_interface |
85 | { | 100 | { |
86 | void Frame_tick(); | 101 | void frame_tick(); |
87 | void clicked(); | 102 | void touch(int num); |
103 | void on_rex(int num); | ||
88 | } | 104 | } |
89 | } | 105 | } |