mirror of
https://github.com/opensim/opensim.git
synced 2026-05-15 19:35:41 +08:00
ScriptServer communication protocol (v1), primitive RPC-like TCP client/server
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user