aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
diff options
context:
space:
mode:
authorJeff Ames2008-02-05 19:44:27 +0000
committerJeff Ames2008-02-05 19:44:27 +0000
commit6ed5283bc06a62f38eb517e67b975832b603bf61 (patch)
treee5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
parentCut down on the number of packets sent during terraforming. Terraforming shou... (diff)
downloadopensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.zip
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.gz
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.bz2
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.xz
Converted logging to use log4net.
Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs22
1 files changed, 7 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
index 047ff2e..971982c 100644
--- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
@@ -26,6 +26,7 @@
26* 26*
27*/ 27*/
28/* Original code: Tedd Hansen */ 28/* Original code: Tedd Hansen */
29
29using System; 30using System;
30using libsecondlife; 31using libsecondlife;
31using OpenSim.Framework; 32using OpenSim.Framework;
@@ -40,7 +41,6 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
40 [Serializable] 41 [Serializable]
41 internal class EventManager 42 internal class EventManager
42 { 43 {
43
44 System.Collections.Generic.Dictionary<uint, ScriptServerInterfaces.ServerRemotingObject> remoteScript = new System.Collections.Generic.Dictionary<uint, ScriptServerInterfaces.ServerRemotingObject>(); 44 System.Collections.Generic.Dictionary<uint, ScriptServerInterfaces.ServerRemotingObject> remoteScript = new System.Collections.Generic.Dictionary<uint, ScriptServerInterfaces.ServerRemotingObject>();
45 TCPClient m_TCPClient; 45 TCPClient m_TCPClient;
46 TRPC_Remote RPC; 46 TRPC_Remote RPC;
@@ -59,32 +59,28 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
59 RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); 59 RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand);
60 myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort); 60 myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort);
61 61
62 myScriptEngine.Log.Verbose("RemoteEngine", "Hooking up to server events"); 62 myScriptEngine.Log.Info("[RemoteEngine]: Hooking up to server events");
63 //myScriptEngine.World.EventManager.OnObjectGrab += touch_start; 63 //myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
64 myScriptEngine.World.EventManager.OnRezScript += OnRezScript; 64 myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
65 //myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; 65 //myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
66
67
68 } 66 }
69 67
70 void RPC_ReceiveCommand(int ID, string Command, params object[] p) 68 void RPC_ReceiveCommand(int ID, string Command, params object[] p)
71 { 69 {
72 myScriptEngine.Log.Notice("REMOTESERVER", "Received command: '" + Command + "'"); 70 myScriptEngine.Log.Info("[REMOTESERVER]: Received command: '" + Command + "'");
73 if (p != null) 71 if (p != null)
74 { 72 {
75 for (int i = 0; i < p.Length; i++) 73 for (int i = 0; i < p.Length; i++)
76 { 74 {
77 myScriptEngine.Log.Notice("REMOTESERVER", "Param " + i + ": " + p[i].ToString()); 75 myScriptEngine.Log.Info("[REMOTESERVER]: Param " + i + ": " + p[i].ToString());
78 } 76 }
79 } 77 }
80
81 } 78 }
82 79
83
84 public void OnRezScript(uint localID, LLUUID itemID, string script) 80 public void OnRezScript(uint localID, LLUUID itemID, string script)
85 { 81 {
86 // WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID 82 // WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID
87 myScriptEngine.Log.Verbose("RemoteEngine", "Creating new script (with connection)"); 83 myScriptEngine.Log.Info("[RemoteEngine]: Creating new script (with connection)");
88 84
89 // Temp for now: We have one connection only - this is hardcoded in myScriptServerID 85 // Temp for now: We have one connection only - this is hardcoded in myScriptServerID
90 RPC.SendCommand(myScriptServerID, "OnRezScript", localID, itemID.ToString(), script); 86 RPC.SendCommand(myScriptServerID, "OnRezScript", localID, itemID.ToString(), script);
@@ -92,18 +88,15 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
92 //ScriptServerInterfaces.ServerRemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234); 88 //ScriptServerInterfaces.ServerRemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234);
93 //remoteScript.Add(localID, obj); 89 //remoteScript.Add(localID, obj);
94 //remoteScript[localID].Events().OnRezScript(localID, itemID, script); 90 //remoteScript[localID].Events().OnRezScript(localID, itemID, script);
95
96
97 } 91 }
98 92
99 public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) 93 public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
100 { 94 {
101 //remoteScript[localID].Events.touch_start(localID, offsetPos, remoteClient); 95 //remoteScript[localID].Events.touch_start(localID, offsetPos, remoteClient);
102 RPC.SendCommand(myScriptServerID, "touch_start", offsetPos, "How to transfer IClientAPI?"); 96 RPC.SendCommand(myScriptServerID, "touch_start", offsetPos, "How to transfer IClientAPI?");
103 } 97 }
104 98
105 99
106
107 // PLACEHOLDERS -- CODE WILL CHANGE! 100 // PLACEHOLDERS -- CODE WILL CHANGE!
108 101
109 102
@@ -266,6 +259,5 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
266 //{ 259 //{
267 // remoteScript[localID].Events.http_response(localID, itemID); 260 // remoteScript[localID].Events.http_response(localID, itemID);
268 //} 261 //}
269
270 } 262 }
271} \ No newline at end of file 263}