Gird mode in sugilite should now work in so far as you should be able to login and move between regions in the same instance. Moving to regions in a different instance of opensim still needs implementing (working on it now).

Also trying to look at the map in grid mode will crash the server.
Sugilite
MW 2007-07-10 17:56:31 +00:00
parent 9f5f65c847
commit 7f03246653
19 changed files with 162 additions and 109 deletions

View File

@ -31,6 +31,7 @@ using libsecondlife.Packets;
using OpenSim.Framework.Data;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
using OpenSim.Framework.Servers;
namespace OpenSim.Framework.Communications
{
@ -42,7 +43,7 @@ namespace OpenSim.Framework.Communications
public IInterRegionCommunications InterRegion;
public NetworkServersInfo ServersInfo;
public CommunicationsManager(NetworkServersInfo serversInfo)
public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer)
{
ServersInfo = serversInfo;
}

View File

@ -80,6 +80,10 @@ namespace OpenSim.Framework.Data
public uint serverPort;
public string serverURI = "";
public uint httpPort;
public uint remotingPort;
public string httpServerURI = "";
/// <summary>
/// Set of optional overrides. Can be used to create non-eulicidean spaces.
/// </summary>
@ -143,7 +147,10 @@ namespace OpenSim.Framework.Data
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256));
simData.serverIP = (string)responseData["sim_ip"];
simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]);
simData.httpPort = Convert.ToUInt32((string)responseData["http_port"]);
simData.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]);
simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/";
simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/";
simData.UUID = new LLUUID((string)responseData["region_UUID"]);
simData.regionName = (string)responseData["region_name"];
@ -172,6 +179,9 @@ namespace OpenSim.Framework.Data
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256));
simData.serverIP = (string)responseData["sim_ip"];
simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]);
simData.httpPort = Convert.ToUInt32((string)responseData["http_port"]);
simData.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]);
simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/";
simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/";
simData.UUID = new LLUUID((string)responseData["region_UUID"]);
simData.regionName = (string)responseData["region_name"];

View File

@ -261,12 +261,16 @@ namespace OpenSim.Grid.GridServer
TheSim.serverIP = (string)requestData["sim_ip"];
TheSim.serverPort = Convert.ToUInt32((string)requestData["sim_port"]);
TheSim.httpPort = Convert.ToUInt32((string)requestData["http_port"]);
TheSim.remotingPort = Convert.ToUInt32((string)requestData["remoting_port"]);
TheSim.regionLocX = Convert.ToUInt32((string)requestData["region_locx"]);
TheSim.regionLocY = Convert.ToUInt32((string)requestData["region_locy"]);
TheSim.regionLocZ = 0;
TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256));
System.Console.WriteLine("adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " + TheSim.regionHandle);
TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/";
TheSim.httpServerURI = "http://" + TheSim.serverIP + ":" + TheSim.httpPort + "/";
Console.WriteLine("NEW SIM: " + TheSim.serverURI);
TheSim.regionName = (string)requestData["sim_name"];
@ -400,6 +404,8 @@ namespace OpenSim.Grid.GridServer
{
responseData["sim_ip"] = simData.serverIP;
responseData["sim_port"] = simData.serverPort.ToString();
responseData["http_port"] = simData.httpPort.ToString();
responseData["remoting_port"] = simData.remotingPort.ToString();
responseData["region_locx"] = simData.regionLocX.ToString() ;
responseData["region_locy"] = simData.regionLocY.ToString();
responseData["region_UUID"] = simData.UUID.UUID.ToString();
@ -438,7 +444,7 @@ namespace OpenSim.Grid.GridServer
response.Value = responseData;
IList simProfileList = new ArrayList();
bool fastMode = true; // MySQL Only
bool fastMode = false; // MySQL Only
if (fastMode)
{
@ -449,6 +455,7 @@ namespace OpenSim.Grid.GridServer
Hashtable simProfileBlock = new Hashtable();
simProfileBlock["x"] = aSim.Value.regionLocX.ToString();
simProfileBlock["y"] = aSim.Value.regionLocY.ToString();
System.Console.WriteLine("send neighbour info for " + aSim.Value.regionLocX.ToString() + " , " + aSim.Value.regionLocY.ToString());
simProfileBlock["name"] = aSim.Value.regionName;
simProfileBlock["access"] = 21;
simProfileBlock["region-flags"] = 512;
@ -470,11 +477,12 @@ namespace OpenSim.Grid.GridServer
else
{
SimProfileData simProfile;
for (int x = xmin; x < xmax; x++)
for (int x = xmin; x < xmax+1; x++)
{
for (int y = ymin; y < ymax; y++)
for (int y = ymin; y < ymax+1; y++)
{
simProfile = getRegion(Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256)));
ulong regHandle = Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256));
simProfile = getRegion(regHandle);
if (simProfile != null)
{
Hashtable simProfileBlock = new Hashtable();

View File

@ -85,9 +85,10 @@ namespace OpenSim.Grid.UserServer
theUser.currentAgent.currentRegion = SimInfo.UUID;
theUser.currentAgent.currentHandle = SimInfo.regionHandle;
System.Console.WriteLine("sending reply");
// Send
XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
XmlRpcResponse GridResp = GridReq.Send(SimInfo.serverURI, 3000);
XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 3000);
}
}
}

View File

@ -93,17 +93,17 @@ namespace OpenSim
ClientView.TerrainManager = new TerrainManager(new SecondLife());
this.SetupHttpListener();
if (m_sandbox)
{
this.SetupLocalGridServers();
// this.checkServer = new CheckSumServer(12036);
// this.checkServer.ServerListener();
this.commsManager = new CommunicationsLocal(this.serversData);
}
else
{
this.SetupRemoteGridServers();
this.commsManager = new CommunicationsOGS1(this.serversData);
}
startuptime = DateTime.Now;
@ -111,14 +111,10 @@ namespace OpenSim
this.physManager = new PhysicsManager();
this.physManager.LoadPlugins();
this.SetupHttpListener();
this.SetupWorld();
m_log.Verbose("Main.cs:Startup() - Initialising HTTP server");
if (m_sandbox)
{
httpServer.AddXmlRPCHandler("login_to_simulator", ((CommunicationsLocal)this.commsManager).UserServices.XmlRpcLoginMethod);
@ -143,6 +139,7 @@ namespace OpenSim
{
AssetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", this.serversData.AssetURL, this.serversData.AssetSendKey);
InventoryCache = new InventoryCache();
this.commsManager = new CommunicationsLocal(this.serversData, httpServer);
}
catch (Exception e)
{
@ -156,8 +153,9 @@ namespace OpenSim
{
try
{
AssetCache = new AssetCache("OpenSim.Region.GridInterfaces.Remote.dll", this.serversData.AssetURL, this.serversData.AssetSendKey);
AssetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", this.serversData.AssetURL, this.serversData.AssetSendKey);
InventoryCache = new InventoryCache();
this.commsManager = new CommunicationsOGS1(this.serversData, httpServer);
}
catch (Exception e)
{

View File

@ -41,7 +41,6 @@ namespace OpenSim.Region.ClientStack
protected override void ProcessInPacket(Packet Pack)
{
ack_pack(Pack);
debug = true;
if (debug)
{
if (Pack.Type != PacketType.AgentUpdate)

View File

@ -71,7 +71,8 @@ namespace OpenSim.Region.ClientStack
// Keep track of when this packet was sent out
Pack.TickCount = Environment.TickCount;
Console.WriteLine("OUT: " + Pack.Type.ToString());
// Console.WriteLine("OUT: " + Pack.Type.ToString());
if (!Pack.Header.Resent)
{

View File

@ -27,6 +27,7 @@
*/
using OpenSim.Framework.Communications;
using OpenSim.Framework.Types;
using OpenSim.Framework.Servers;
namespace OpenSim.Region.Communications.Local
{
@ -35,8 +36,8 @@ namespace OpenSim.Region.Communications.Local
public LocalBackEndServices SandBoxServices = new LocalBackEndServices();
public LocalUserServices UserServices;
public CommunicationsLocal(NetworkServersInfo serversInfo)
: base(serversInfo)
public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer )
: base(serversInfo, httpServer)
{
UserServices = new LocalUserServices(this, serversInfo);
UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll");

View File

@ -1,14 +1,15 @@
using OpenSim.Framework.Communications;
using OpenSim.Framework.Types;
using OpenSim.Framework.Servers;
namespace OpenSim.Region.Communications.OGS1
{
public class CommunicationsOGS1 : CommunicationsManager
{
public CommunicationsOGS1(NetworkServersInfo serversInfo) :base(serversInfo)
public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer ) :base(serversInfo, httpServer)
{
OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo);
OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer);
GridServer = gridInterComms;
InterRegion = gridInterComms;
UserServer = new OGS1UserServices(this);

View File

@ -18,40 +18,50 @@ namespace OpenSim.Region.Communications.OGS1
public class OGS1GridServices : IGridServices, IInterRegionCommunications
{
public Dictionary<ulong, RegionCommsListener> listeners = new Dictionary<ulong, RegionCommsListener>();
protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>();
public BaseHttpServer httpListener;
public NetworkServersInfo serversInfo;
public BaseHttpServer httpServer;
public OGS1GridServices(NetworkServersInfo servers_info)
public OGS1GridServices(NetworkServersInfo servers_info, BaseHttpServer httpServe)
{
serversInfo = servers_info;
httpServer = httpServe;
httpServer.AddXmlRPCHandler("expect_user", this.ExpectUser);
}
public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
{
if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
{
this.regions.Add(regionInfo.RegionHandle, regionInfo);
}
Hashtable GridParams = new Hashtable();
// Login / Authentication
GridParams["authkey"] = serversInfo.GridSendKey;
GridParams["authkey"] = serversInfo.GridSendKey;
GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated();
GridParams["sim_ip"] = regionInfo.ExternalHostName;
GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString();
GridParams["region_locx"] = regionInfo.RegionLocX.ToString();
GridParams["region_locy"] = regionInfo.RegionLocY.ToString();
GridParams["sim_name"] = regionInfo.RegionName;
GridParams["http_port"] = serversInfo.HttpListenerPort.ToString();
GridParams["remoting_port"] = serversInfo.RemotingListenerPort.ToString();
// Package into an XMLRPC Request
ArrayList SendParams = new ArrayList();
ArrayList SendParams = new ArrayList();
SendParams.Add(GridParams);
// Send Request
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
Hashtable GridRespData = (Hashtable)GridResp.Value;
Hashtable griddatahash = GridRespData;
// Process Response
@ -60,25 +70,34 @@ namespace OpenSim.Region.Communications.OGS1
string errorstring = (string)GridRespData["error"];
MainLog.Instance.Error("Unable to connect to grid: " + errorstring);
return null;
}
if (!this.listeners.ContainsKey(regionInfo.RegionHandle))
{
MainLog.Instance.Verbose("OGS1 - Registering new HTTP listener on port " + regionInfo.InternalEndPoint.Port.ToString());
// initialised = true;
httpListener = new BaseHttpServer( regionInfo.InternalEndPoint.Port );
httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser);
httpListener.Start();
}
// Initialise the background listeners
listeners[regionInfo.RegionHandle] = new RegionCommsListener();
/* if (!this.listeners.ContainsKey(regionInfo.RegionHandle))
{
MainLog.Instance.Verbose("OGS1 - Registering new HTTP listener on port " + regionInfo.InternalEndPoint.Port.ToString());
// initialised = true;
httpListener = new BaseHttpServer( regionInfo.InternalEndPoint.Port );
httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser);
httpListener.Start();
}*/
return listeners[regionInfo.RegionHandle];
// Initialise the background listeners
RegionCommsListener regListener = new RegionCommsListener();
if (this.listeners.ContainsKey(regionInfo.RegionHandle))
{
this.listeners.Add(regionInfo.RegionHandle, regListener);
}
else
{
listeners[regionInfo.RegionHandle] = regListener;
}
return regListener;
}
public List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
{
Hashtable respData = MapBlockQuery((int)regionInfo.RegionLocX - 1, (int)regionInfo.RegionLocY - 1, (int)regionInfo.RegionLocX + 1, (int)regionInfo.RegionLocY + 1);
List<RegionInfo> neighbours = new List<RegionInfo>();
@ -87,24 +106,28 @@ namespace OpenSim.Region.Communications.OGS1
{
foreach (Hashtable n in a)
{
string internalIpStr = (string)n["sim_ip"];
int port = (int)n["sim_port"];
string externalUri = (string)n["sim_uri"];
uint regX = Convert.ToUInt32(n["x"]);
uint regY = Convert.ToUInt32(n["y"]);
if ((regionInfo.RegionLocX != regX) || (regionInfo.RegionLocY != regY))
{
string internalIpStr = (string)n["sim_ip"];
uint port = Convert.ToUInt32(n["sim_port"]);
string externalUri = (string)n["sim_uri"];
IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), port);
string neighbourExternalUri = externalUri;
IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int)port);
string neighbourExternalUri = externalUri;
RegionInfo neighbour = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr);
RegionInfo neighbour = new RegionInfo((uint)n["x"], (uint)n["y"], neighbourInternalEndPoint, neighbourExternalUri);
//OGS1
//neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally
//OGS1
//neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally
neighbour.RegionName = (string)n["name"];
neighbour.RegionName = (string)n["name"];
//OGS1+
neighbour.SimUUID = (string)n["uuid"];
//OGS1+
neighbour.SimUUID = (string)n["uuid"];
neighbours.Add(neighbour);
neighbours.Add(neighbour);
}
}
}
@ -113,6 +136,11 @@ namespace OpenSim.Region.Communications.OGS1
public RegionInfo RequestNeighbourInfo(ulong regionHandle)
{
if (this.regions.ContainsKey(regionHandle))
{
return this.regions[regionHandle];
}
//TODO not a region in this instance so ask remote grid server
MainLog.Instance.Warn("Unimplemented - RequestNeighbourInfo()");
return null;
}
@ -209,7 +237,7 @@ namespace OpenSim.Region.Communications.OGS1
TcpChannel ch = new TcpChannel(8895);
ChannelServices.RegisterChannel(ch, true);
WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry( Type.GetType("OGS1InterRegionRemoting"), "InterRegions", WellKnownObjectMode.Singleton);
WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(Type.GetType("OGS1InterRegionRemoting"), "InterRegions", WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType(wellType);
InterRegionSingleton.Instance.OnArrival += this.IncomingArrival;
InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent;
@ -225,6 +253,7 @@ namespace OpenSim.Region.Communications.OGS1
}
//TODO need to see if we know about where this region is and use .net remoting
// to inform it.
Console.WriteLine("Inform remote region of child agent not implemented yet");
return false;
}

View File

@ -47,7 +47,6 @@ namespace OpenSim.Region.Communications.OGS1
}
public UserProfileData GetUserProfile(string name)
{
//try
//{
Hashtable param = new Hashtable();

View File

@ -57,7 +57,7 @@ namespace OpenSim.Region.Environment.Scenes
protected Quaternion m_rotation = new Quaternion(0,0,1,0);
public virtual Quaternion rotation
public virtual Quaternion Rotation
{
get
{
@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Scenes
m_pos = new LLVector3();
m_velocity = new LLVector3();
rotation = new Quaternion();
Rotation = new Quaternion();
m_name = "(basic entity)";
children = new List<EntityBase>();
}

View File

@ -83,7 +83,7 @@ namespace OpenSim.Region.Environment.Scenes
{
Primitive parentPrim = (Primitive)this.m_Parent;
Axiom.Math.Vector3 offsetPos = new Vector3(this.m_pos.X, this.m_pos.Y, this.m_pos.Z);
offsetPos = parentPrim.rotation * offsetPos;
offsetPos = parentPrim.Rotation * offsetPos;
return parentPrim.WorldPos + new LLVector3(offsetPos.x, offsetPos.y, offsetPos.z);
}
else
@ -139,7 +139,7 @@ namespace OpenSim.Region.Environment.Scenes
this.m_isRootPrim = isRoot;
this.m_RootParent = rootObject;
this.CreateFromPacket(addPacket, ownerID, localID);
this.rotation = Axiom.Math.Quaternion.Identity;
this.Rotation = Axiom.Math.Quaternion.Identity;
}
/// <summary>
@ -169,7 +169,7 @@ namespace OpenSim.Region.Environment.Scenes
dupe.LocalId = newLocalID;
dupe.Scale = new LLVector3(this.Scale.X, this.Scale.Y, this.Scale.Z);
dupe.rotation = new Quaternion(this.rotation.w, this.rotation.x, this.rotation.y, this.rotation.z);
dupe.Rotation = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z);
dupe.Pos = new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z);
return dupe;
@ -278,10 +278,10 @@ namespace OpenSim.Region.Environment.Scenes
this.m_RootParent.AddChildToList(this);
this.Pos = oldPos;
Axiom.Math.Vector3 axPos = new Axiom.Math.Vector3(this.m_pos.X, m_pos.Y, m_pos.Z);
axPos = this.m_Parent.rotation.Inverse() * axPos;
axPos = this.m_Parent.Rotation.Inverse() * axPos;
this.m_pos = new LLVector3(axPos.x, axPos.y, axPos.z);
Axiom.Math.Quaternion oldRot = new Quaternion(this.rotation.w, this.rotation.x, this.rotation.y, this.rotation.z);
this.rotation = this.m_Parent.rotation.Inverse() * this.rotation;
Axiom.Math.Quaternion oldRot = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z);
this.Rotation = this.m_Parent.Rotation.Inverse() * this.Rotation;
this.updateFlag = 1;
foreach (Primitive child in children)
@ -304,7 +304,7 @@ namespace OpenSim.Region.Environment.Scenes
axOldPos = oldParentRotation * axOldPos;
oldPos = new LLVector3(axOldPos.x, axOldPos.y, axOldPos.z);
oldPos += oldParentPosition;
Axiom.Math.Quaternion oldRot = new Quaternion(this.rotation.w, this.rotation.x, this.rotation.y, this.rotation.z);
Axiom.Math.Quaternion oldRot = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z);
this.m_isRootPrim = false;
this.m_Parent = newParent;
this.ParentID = newParent.LocalId;
@ -313,10 +313,10 @@ namespace OpenSim.Region.Environment.Scenes
this.m_RootParent.AddChildToList(this);
this.Pos = oldPos;
Axiom.Math.Vector3 axPos = new Axiom.Math.Vector3(this.m_pos.X, m_pos.Y, m_pos.Z);
axPos = this.m_Parent.rotation.Inverse() * axPos;
axPos = this.m_Parent.Rotation.Inverse() * axPos;
this.m_pos = new LLVector3(axPos.x, axPos.y, axPos.z);
this.rotation = oldParentRotation * this.rotation;
this.rotation = this.m_Parent.rotation.Inverse()* this.rotation ;
this.Rotation = oldParentRotation * this.Rotation;
this.Rotation = this.m_Parent.Rotation.Inverse()* this.Rotation ;
this.updateFlag = 1;
foreach (Primitive child in children)
{
@ -401,7 +401,7 @@ namespace OpenSim.Region.Environment.Scenes
LLVector3 oldPos = new LLVector3(Pos.X, Pos.Y, Pos.Z);
LLVector3 diff = oldPos - newPos;
Axiom.Math.Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z);
axDiff = this.rotation.Inverse() * axDiff;
axDiff = this.Rotation.Inverse() * axDiff;
diff.X = axDiff.x;
diff.Y = axDiff.y;
diff.Z = axDiff.z;
@ -431,7 +431,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="rot"></param>
public void UpdateGroupRotation(LLQuaternion rot)
{
this.rotation = new Axiom.Math.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
this.Rotation = new Axiom.Math.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
this.updateFlag = 2;
}
@ -443,7 +443,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="rot"></param>
public void UpdateGroupMouseRotation(LLVector3 pos, LLQuaternion rot)
{
this.rotation = new Axiom.Math.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
this.Rotation = new Axiom.Math.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
this.Pos = pos;
this.updateFlag = 2;
}
@ -456,16 +456,16 @@ namespace OpenSim.Region.Environment.Scenes
{
//Console.WriteLine("updating single prim rotation");
Axiom.Math.Quaternion axRot = new Axiom.Math.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
Axiom.Math.Quaternion oldParentRot = new Quaternion(this.rotation.w, this.rotation.x, this.rotation.y, this.rotation.z);
this.rotation = axRot;
Axiom.Math.Quaternion oldParentRot = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z);
this.Rotation = axRot;
foreach (Primitive prim in this.children)
{
Axiom.Math.Vector3 axPos = new Vector3(prim.m_pos.X, prim.m_pos.Y, prim.m_pos.Z);
axPos = oldParentRot * axPos;
axPos = axRot.Inverse() * axPos;
prim.m_pos = new LLVector3(axPos.x, axPos.y, axPos.z);
prim.rotation = oldParentRot * prim.rotation ;
prim.rotation = axRot.Inverse()* prim.rotation;
prim.Rotation = oldParentRot * prim.Rotation ;
prim.Rotation = axRot.Inverse()* prim.Rotation;
prim.updateFlag = 2;
}
this.updateFlag = 2;
@ -528,7 +528,7 @@ namespace OpenSim.Region.Environment.Scenes
LLVector3 lPos;
lPos = this.Pos;
LLQuaternion lRot;
lRot = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w);
lRot = new LLQuaternion(this.Rotation.x, this.Rotation.y, this.Rotation.z, this.Rotation.w);
remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.m_Shape, lPos, lRot, new LLUUID("00000000-0000-0000-9999-000000000005"), this.m_flags, this.uuid, this.OwnerID, this.Text, this.ParentID);
}
@ -571,7 +571,7 @@ namespace OpenSim.Region.Environment.Scenes
Quaternion lRot;
lPos = this.Pos;
lRot = this.rotation;
lRot = this.Rotation;
LLQuaternion mRot = new LLQuaternion(lRot.x, lRot.y, lRot.z, lRot.w);
RemoteClient.SendPrimTerseUpdate(this.m_regionHandle, 64096, this.LocalId, lPos, mRot);

View File

@ -445,7 +445,7 @@ namespace OpenSim.Region.Environment.Scenes
else
{
lPos = this.Pos;
lRot = this.rotation;
lRot = this.Rotation;
}
LLQuaternion mRot = new LLQuaternion(lRot.x, lRot.y, lRot.z, lRot.w);
RemoteClient.SendPrimTerseUpdate(this.m_regionHandle, 64096, this.LocalId, lPos, mRot);

View File

@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment.Scenes
case 1: // Say
if ((dis < 30) && (dis > -30))
{
Console.WriteLine("sending chat");
//Console.WriteLine("sending chat");
client.SendChatMessage(message, type, fromPos, fromName,
fromAgentID);
}

View File

@ -685,15 +685,12 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void InformClientOfNeighbours(IClientAPI remoteClient)
{
// Console.WriteLine("informing client of neighbouring regions");
List<RegionInfo> neighbours = this.commsManager.GridServer.RequestNeighbours(this.m_regInfo);
//Console.WriteLine("we have " + neighbours.Count + " neighbouring regions");
if (neighbours != null)
{
for (int i = 0; i < neighbours.Count; i++)
{
// Console.WriteLine("sending neighbours data");
AgentCircuitData agent = remoteClient.RequestClientInfo();
agent.BaseFolder = LLUUID.Zero;
agent.InventoryFolder = LLUUID.Zero;

View File

@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Scenes
Wearables = AvatarWearable.DefaultWearables;
Animations = new ScenePresence.AvatarAnimations();
Animations.LoadAnims();
this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
//register for events
@ -160,7 +160,7 @@ namespace OpenSim.Region.Environment.Scenes
{
this.Velocity = new LLVector3(0, 0, 0);
this.Pos = new LLVector3(128, 128, 70);
}
}
@ -276,25 +276,31 @@ namespace OpenSim.Region.Environment.Scenes
{
this.AddNewMovement(agent_control_v3, q);
}
UpdateMovementAnimations(update_movementflag);
UpdateMovementAnimations(update_movementflag);
}
protected void UpdateMovementAnimations(bool update_movementflag)
{
if (update_movementflag)
{
if (movementflag != 0) {
if (this._physActor.Flying) {
this.SendAnimPack(Animations.AnimsLLUUID["FLY"], 1);
} else {
this.SendAnimPack(Animations.AnimsLLUUID["WALK"], 1);
}
} else {
this.SendAnimPack(Animations.AnimsLLUUID["STAND"], 1);
}
}
}
protected void UpdateMovementAnimations(bool update_movementflag)
{
if (update_movementflag)
{
if (movementflag != 0)
{
if (this._physActor.Flying)
{
this.SendAnimPack(Animations.AnimsLLUUID["FLY"], 1);
}
else
{
this.SendAnimPack(Animations.AnimsLLUUID["WALK"], 1);
}
}
else
{
this.SendAnimPack(Animations.AnimsLLUUID["STAND"], 1);
}
}
}
protected void AddNewMovement(Vector3 vec, Quaternion rotation)
@ -423,13 +429,13 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="seq"></param>
public void SendAnimPack(LLUUID animID, int seq)
{
this.current_anim = animID;
this.anim_seq = anim_seq;
List<ScenePresence> avatars = this.m_world.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{
avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId);
}
this.current_anim = animID;
this.anim_seq = anim_seq;
List<ScenePresence> avatars = this.m_world.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{
avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId);
}
}
/// <summary>
@ -437,7 +443,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void SendAnimPack()
{
this.SendAnimPack(this.current_anim, this.anim_seq);
this.SendAnimPack(this.current_anim, this.anim_seq);
}
#endregion
@ -506,7 +512,7 @@ namespace OpenSim.Region.Environment.Scenes
if (res)
{
this.MakeChildAgent();
this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.InternalEndPoint );
this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.InternalEndPoint);
}
}
}

View File

@ -47,13 +47,13 @@ namespace SimpleApp
udpServer.ServerListener();
ClientView.TerrainManager = new TerrainManager(new SecondLife());
BaseHttpServer httpServer = new BaseHttpServer(internalEndPoint.Port);
NetworkServersInfo serverInfo = new NetworkServersInfo();
CommunicationsLocal communicationsManager = new CommunicationsLocal(serverInfo);
CommunicationsLocal communicationsManager = new CommunicationsLocal(serverInfo, httpServer);
RegionInfo regionInfo = new RegionInfo( 1000, 1000, internalEndPoint, "127.0.0.1" );
BaseHttpServer httpServer = new BaseHttpServer( internalEndPoint.Port );
MyWorld world = new MyWorld(packetServer.ClientManager, regionInfo, m_circuitManager, communicationsManager, assetCache, httpServer);
world.PhysScene = PhysicsScene.Null;
udpServer.LocalWorld = world;

View File

@ -512,6 +512,7 @@
<Reference name="System.Xml"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Data" />
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="libsecondlife.dll"/>
<Files>
@ -567,6 +568,7 @@
<Reference name="OpenSim.Framework.Communications"/>
<Reference name="OpenSim.Framework.UserManagement" />
<Reference name="OpenSim.Framework.Data" />
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="libsecondlife.dll"/>
<Reference name="OpenSim.Framework"/>