ScriptServer communication protocol (v1), primitive RPC-like TCP client/server

This commit is contained in:
Tedd Hansen
2008-01-12 00:48:58 +00:00
parent ef674acc24
commit 1e9a66cbaa
9 changed files with 491 additions and 12 deletions

View File

@@ -48,6 +48,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
{
myScriptEngine = _ScriptEngine;
myScriptEngine.Log.Verbose("RemoteEngine", "Hooking up to server events");
//myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
@@ -61,10 +62,11 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
{
// WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID
myScriptEngine.Log.Verbose("RemoteEngine", "Creating new script (with connection)");
ScriptServerInterfaces.ServerRemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234);
remoteScript.Add(localID, obj);
//remoteScript[localID].Events.OnRezScript(localID, itemID, script);
remoteScript[localID].Events().OnRezScript(localID, itemID, script);
}

View File

@@ -13,19 +13,17 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
// Handles connections to servers
// Create and returns server object
public RemoteServer()
{
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan, true);
}
public ScriptServerInterfaces.ServerRemotingObject Connect(string hostname, int port)
{
// Create a channel for communicating w/ the remote object
// Notice no port is specified on the client
TcpChannel chan = new TcpChannel();
try
{
ChannelServices.RegisterChannel(chan, true);
}
catch (System.Runtime.Remoting.RemotingException)
{
System.Console.WriteLine("Error: tcp already registered, RemoteServer.cs in OpenSim.Region.ScriptEngine.RemoteServer line 24");
}
try
{