diff options
author | Tedd Hansen | 2008-01-12 01:14:31 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-01-12 01:14:31 +0000 |
commit | e7dbaad04f1599965cf8ad709828a17fbd6f8a3a (patch) | |
tree | 7187520c6a30055bc005d11d2b1666e311735504 /OpenSim/Grid | |
parent | ScriptServer communication protocol (v1), primitive RPC-like TCP client/server (diff) | |
download | opensim-SC-e7dbaad04f1599965cf8ad709828a17fbd6f8a3a.zip opensim-SC-e7dbaad04f1599965cf8ad709828a17fbd6f8a3a.tar.gz opensim-SC-e7dbaad04f1599965cf8ad709828a17fbd6f8a3a.tar.bz2 opensim-SC-e7dbaad04f1599965cf8ad709828a17fbd6f8a3a.tar.xz |
New ScriptServer protocol successfully implemented.
Still needs hooking up for all commands in both ends, separation of local and remote LSL-commands, etc.
Diffstat (limited to 'OpenSim/Grid')
-rw-r--r-- | OpenSim/Grid/ScriptServer/ScriptServerMain.cs | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index bdd6f18..f86aaba 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs | |||
@@ -31,6 +31,7 @@ using OpenSim.Framework; | |||
31 | using OpenSim.Framework.Console; | 31 | using OpenSim.Framework.Console; |
32 | using OpenSim.Grid.ScriptServer.ScriptServer; | 32 | using OpenSim.Grid.ScriptServer.ScriptServer; |
33 | using OpenSim.Region.ScriptEngine.Common; | 33 | using OpenSim.Region.ScriptEngine.Common; |
34 | using OpenSim.Region.ScriptEngine.Common.TRPC; | ||
34 | 35 | ||
35 | namespace OpenSim.Grid.ScriptServer | 36 | namespace OpenSim.Grid.ScriptServer |
36 | { | 37 | { |
@@ -39,7 +40,7 @@ namespace OpenSim.Grid.ScriptServer | |||
39 | // | 40 | // |
40 | // Root object. Creates objects used. | 41 | // Root object. Creates objects used. |
41 | // | 42 | // |
42 | private int listenPort = 1234; | 43 | private int listenPort = 8010; |
43 | private readonly string m_logFilename = ("scriptserver.log"); | 44 | private readonly string m_logFilename = ("scriptserver.log"); |
44 | private LogBase m_log; | 45 | private LogBase m_log; |
45 | 46 | ||
@@ -49,12 +50,15 @@ namespace OpenSim.Grid.ScriptServer | |||
49 | // Objects we use | 50 | // Objects we use |
50 | internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region | 51 | internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region |
51 | internal ScriptEngineManager ScriptEngines; // Loads scriptengines | 52 | internal ScriptEngineManager ScriptEngines; // Loads scriptengines |
52 | internal RemotingServer m_RemotingServer; | 53 | //internal RemotingServer m_RemotingServer; |
54 | internal TCPServer m_TCPServer; | ||
55 | internal TRPC_Remote RPC; | ||
53 | 56 | ||
54 | public ScriptServerMain() | 57 | public ScriptServerMain() |
55 | { | 58 | { |
56 | m_log = CreateLog(); | 59 | m_log = CreateLog(); |
57 | 60 | ||
61 | |||
58 | // Set up script engine mananger | 62 | // Set up script engine mananger |
59 | ScriptEngines = new ScriptEngineManager(this, m_log); | 63 | ScriptEngines = new ScriptEngineManager(this, m_log); |
60 | 64 | ||
@@ -62,10 +66,27 @@ namespace OpenSim.Grid.ScriptServer | |||
62 | Engine = ScriptEngines.LoadEngine("DotNetEngine"); | 66 | Engine = ScriptEngines.LoadEngine("DotNetEngine"); |
63 | 67 | ||
64 | // Set up server | 68 | // Set up server |
65 | m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine"); | 69 | //m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine"); |
70 | m_TCPServer = new TCPServer(listenPort); | ||
71 | RPC = new TRPC_Remote(m_TCPServer); | ||
72 | RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); | ||
73 | m_TCPServer.StartListen(); | ||
74 | |||
66 | System.Console.ReadLine(); | 75 | System.Console.ReadLine(); |
67 | } | 76 | } |
68 | 77 | ||
78 | private void RPC_ReceiveCommand(int ID, string Command, object[] p) | ||
79 | { | ||
80 | m_log.Notice("SERVER", "Received command: '" + Command + "'"); | ||
81 | if (p != null) | ||
82 | { | ||
83 | for (int i = 0; i < p.Length; i++) | ||
84 | { | ||
85 | m_log.Notice("SERVER", "Param " + i + ": " + p[i].ToString()); | ||
86 | } | ||
87 | } | ||
88 | } | ||
89 | |||
69 | ~ScriptServerMain() | 90 | ~ScriptServerMain() |
70 | { | 91 | { |
71 | } | 92 | } |