More Refactoring.

Merged changes from trunk r237
physics-inventorytesting
MW 2007-03-19 18:04:04 +00:00
parent 77638d3023
commit ddf0174be9
30 changed files with 250 additions and 182 deletions

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Interfaces
{
public class AgentCircuitData
{
public AgentCircuitData() { }
public LLUUID AgentID;
public LLUUID SessionID;
public LLUUID SecureSessionID;
public string firstname;
public string lastname;
public uint circuitcode;
}
}

View File

@ -55,14 +55,14 @@ namespace OpenSim.Framework.Interfaces
void AssetNotFound(AssetBase asset);
}
public interface IAssetPlugin
{
IAssetServer GetAssetServer();
}
public struct ARequest
{
public LLUUID AssetID;
public bool IsTexture;
}
public interface IAssetPlugin
{
IAssetServer GetAssetServer();
}
}

View File

@ -59,6 +59,10 @@ namespace OpenSim.Framework.Interfaces
public string GridURL;
public string GridSendKey;
public string GridRecvKey;
public string UserURL;
public string UserSendKey;
public string UserRecvKey;
public abstract void InitConfig(bool sandboxMode);
public abstract void LoadFromGrid();

View File

@ -44,46 +44,15 @@ namespace OpenSim.Framework.Interfaces
public interface IGridServer
{
UUIDBlock RequestUUIDBlock();
void RequestNeighbours(); //should return a array of neighbouring regions
NeighbourInfo[] RequestNeighbours(); //should return a array of neighbouring regions
AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
string GetName();
bool RequestConnection();
void SetServerInfo(string ServerUrl, string ServerKey);
void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
void Close();
}
public abstract class RemoteGridBase : IGridServer
{
public abstract Dictionary<uint, agentcircuitdata> agentcircuits
{
get;
set;
}
public abstract UUIDBlock RequestUUIDBlock();
public abstract void RequestNeighbours();
public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract string GetName();
public abstract bool RequestConnection();
public abstract void SetServerInfo(string ServerUrl, string ServerKey);
public abstract void Close();
}
public abstract class LocalGridBase : IGridServer
{
public abstract UUIDBlock RequestUUIDBlock();
public abstract void RequestNeighbours();
public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract string GetName();
public abstract bool RequestConnection();
public abstract void SetServerInfo(string ServerUrl, string ServerKey);
public abstract void AddNewSession(Login session);
public abstract void Close();
}
public struct UUIDBlock
{
public LLUUID BlockStart;
@ -102,35 +71,8 @@ namespace OpenSim.Framework.Interfaces
}
public class Login
{
public string First = "Test";
public string Last = "User";
public LLUUID Agent;
public LLUUID Session;
public LLUUID InventoryFolder;
public LLUUID BaseFolder;
public Login()
{
}
}
public interface IGridPlugin
{
IGridServer GetGridServer();
}
public class agentcircuitdata
{
public agentcircuitdata() { }
public LLUUID AgentID;
public LLUUID SessionID;
public LLUUID SecureSessionID;
public string firstname;
public string lastname;
public uint circuitcode;
}
}

View File

@ -9,5 +9,6 @@ namespace OpenSim.Framework.Interfaces
public interface IUserServer
{
AgentInventory RequestAgentsInventory(LLUUID agentID);
void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Interfaces
{
public abstract class LocalGridBase : IGridServer
{
public abstract UUIDBlock RequestUUIDBlock();
public abstract NeighbourInfo[] RequestNeighbours();
public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract string GetName();
public abstract bool RequestConnection();
public abstract void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
public abstract void AddNewSession(Login session);
public abstract void Close();
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Interfaces
{
public class Login
{
public string First = "Test";
public string Last = "User";
public LLUUID Agent;
public LLUUID Session;
public LLUUID InventoryFolder;
public LLUUID BaseFolder;
public Login()
{
}
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Interfaces
{
public class NeighbourInfo
{
public NeighbourInfo()
{
}
public ulong regionhandle;
public uint RegionLocX;
public uint RegionLocY;
public string sim_ip;
public uint sim_port;
}
}

View File

@ -39,6 +39,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AgentCiruitData.cs" />
<Compile Include="AssetBase.cs" />
<Compile Include="BlockingQueue.cs" />
<Compile Include="HeightMapGenHills.cs" />
@ -48,8 +49,12 @@
<Compile Include="ILocalStorage.cs" />
<Compile Include="Inventory.cs" />
<Compile Include="IUserServer.cs" />
<Compile Include="LocalGridBase.cs" />
<Compile Include="Login.cs" />
<Compile Include="LoginService.cs" />
<Compile Include="NeighbourInfo.cs" />
<Compile Include="PrimData.cs" />
<Compile Include="RemoteGridBase.cs" />
<Compile Include="SimProfile.cs" />
<Compile Include="SimProfileBase.cs" />
<Compile Include="UserProfile.cs" />

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Interfaces
{
public abstract class RemoteGridBase : IGridServer
{
public abstract Dictionary<uint, AgentCircuitData> agentcircuits
{
get;
set;
}
public abstract UUIDBlock RequestUUIDBlock();
public abstract NeighbourInfo[] RequestNeighbours();
public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract string GetName();
public abstract bool RequestConnection();
public abstract void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
public abstract void Close();
}
}

View File

@ -29,13 +29,4 @@ namespace OpenSim.Framework.Utilities
}
}
public class QueItem
{
public QueItem()
{
}
public Packet Packet;
public bool Incoming;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -63,7 +63,7 @@ namespace OpenSim
ServerConsole.MainConsole.Instance.WriteLine("SimHttp.cs:StartHTTP() - Spawned main thread OK");
Listener = new HttpListener();
Listener.Prefixes.Add("http://+:" + OpenSim_Main.Instance.Cfg.IPListenPort + "/");
Listener.Prefixes.Add("http://+:" + OpenSimMain.Instance.Cfg.IPListenPort + "/");
Listener.Start();
HttpListenerContext context;
@ -89,16 +89,16 @@ namespace OpenSim
switch (request.MethodName)
{
case "expect_user":
agentcircuitdata agent_data = new agentcircuitdata();
AgentCircuitData agent_data = new AgentCircuitData();
agent_data.SessionID = new LLUUID((string)requestData["session_id"]);
agent_data.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
agent_data.firstname = (string)requestData["firstname"];
agent_data.lastname = (string)requestData["lastname"];
agent_data.AgentID = new LLUUID((string)requestData["agent_id"]);
agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
if (OpenSim_Main.Instance.GridServers.GridServer.GetName() == "Remote")
if (OpenSimMain.Instance.GridServers.GridServer.GetName() == "Remote")
{
((RemoteGridBase)OpenSim_Main.Instance.GridServers.GridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data);
((RemoteGridBase)OpenSimMain.Instance.GridServers.GridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data);
}
return "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>";
break;

View File

@ -63,7 +63,11 @@ namespace Db40SimConfig
this.AssetURL=ServerConsole.MainConsole.Instance.CmdPrompt("Asset server URL: ");
this.AssetSendKey=ServerConsole.MainConsole.Instance.CmdPrompt("Asset server key: ");
this.GridURL=ServerConsole.MainConsole.Instance.CmdPrompt("Grid server URL: ");
this.GridSendKey=ServerConsole.MainConsole.Instance.CmdPrompt("Grid server key: ");
this.GridSendKey = ServerConsole.MainConsole.Instance.CmdPrompt("Key to send to grid server: ");
this.GridRecvKey = ServerConsole.MainConsole.Instance.CmdPrompt("Key to expect from grid server: ");
this.UserURL = ServerConsole.MainConsole.Instance.CmdPrompt("User server URL: ");
this.UserSendKey = ServerConsole.MainConsole.Instance.CmdPrompt("Key to send to user server: ");
this.UserRecvKey = ServerConsole.MainConsole.Instance.CmdPrompt("Key to expect from user server: ");
}
this.RegionHandle = Util.UIntsToLong((RegionLocX*256), (RegionLocY*256));
}

View File

@ -29,8 +29,8 @@ namespace OpenSim.Framework.LocalServers
uint circode = (uint)response["circuit_code"];
theUser.AddSimCircuit(circode, LLUUID.Random());
response["home"] = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}";
response["sim_port"] = OpenSim_Main.Instance.Cfg.IPListenPort;
response["sim_ip"] = OpenSim_Main.Instance.Cfg.IPListenAddr;
response["sim_port"] = OpenSimMain.Instance.Cfg.IPListenPort;
response["sim_ip"] = OpenSimMain.Instance.Cfg.IPListenAddr;
response["region_y"] = (Int32)996 * 256;
response["region_x"] = (Int32)997* 256;
@ -67,7 +67,7 @@ namespace OpenSim.Framework.LocalServers
_login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]);
//working on local computer if so lets add to the gridserver's list of sessions?
if (OpenSim_Main.Instance.GridServers.GridServer.GetName() == "Local")
if (OpenSimMain.Instance.GridServers.GridServer.GetName() == "Local")
{
((LocalGridBase)this._gridServer).AddNewSession(_login);
}

View File

@ -289,8 +289,8 @@ namespace OpenSim.Framework.LocalServers
XmlRpcResponse response = (XmlRpcResponse)(new XmlRpcResponseDeserializer()).Deserialize(this._defaultResponse);
Hashtable responseData = (Hashtable)response.Value;
responseData["sim_port"] = OpenSim_Main.Instance.Cfg.IPListenPort;
responseData["sim_ip"] = OpenSim_Main.Instance.Cfg.IPListenAddr;
responseData["sim_port"] = OpenSimMain.Instance.Cfg.IPListenPort;
responseData["sim_ip"] = OpenSimMain.Instance.Cfg.IPListenAddr;
responseData["agent_id"] = Agent.ToStringHyphenated();
responseData["session_id"] = Session.ToStringHyphenated();
responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
@ -324,7 +324,7 @@ namespace OpenSim.Framework.LocalServers
_login.InventoryFolder = InventoryFolderID;
//working on local computer if so lets add to the gridserver's list of sessions?
if (OpenSim_Main.Instance.GridServers.GridServer.GetName() == "Local")
if (OpenSimMain.Instance.GridServers.GridServer.GetName() == "Local")
{
((LocalGridBase)this._gridServer).AddNewSession(_login);
}
@ -399,6 +399,11 @@ namespace OpenSim.Framework.LocalServers
return aInventory;
}
public void SetServerInfo(string ServerUrl, string SendKey, string RecvKey)
{
}
}

View File

@ -291,13 +291,13 @@ namespace LocalGridServers
UUIDBlock uuidBlock = new UUIDBlock();
return(uuidBlock);
}
public override void RequestNeighbours()
public override NeighbourInfo[] RequestNeighbours()
{
return;
return null;
}
public override void SetServerInfo(string ServerUrl, string ServerKey)
public override void SetServerInfo(string ServerUrl, string SendKey, string RecvKey)
{
}

View File

@ -50,11 +50,11 @@ namespace OpenSim
/// <summary>
/// Description of MainForm.
/// </summary>
public class OpenSim_Main
public class OpenSimMain
{
private static OpenSim_Main instance = null;
private static OpenSimMain instance = null;
public static OpenSim_Main Instance
public static OpenSimMain Instance
{
get
{
@ -93,7 +93,7 @@ namespace OpenSim
Console.WriteLine("Starting...\n");
ServerConsole.MainConsole.Instance = new MServerConsole(ServerConsole.ConsoleBase.ConsoleType.Local, "", 0);
instance = new OpenSim_Main();
instance = new OpenSimMain();
Instance.sandbox = false;
Instance.loginserver = false;
@ -117,28 +117,28 @@ namespace OpenSim
}
}
OpenSim_Main.Instance.GridServers = new Grid();
OpenSimMain.Instance.GridServers = new Grid();
if (Instance.sandbox)
{
OpenSim_Main.Instance.GridServers.AssetDll = "LocalGridServers.dll";
OpenSim_Main.Instance.GridServers.GridDll = "LocalGridServers.dll";
OpenSim_Main.Instance.GridServers.LoadPlugins();
OpenSimMain.Instance.GridServers.AssetDll = "LocalGridServers.dll";
OpenSimMain.Instance.GridServers.GridDll = "LocalGridServers.dll";
OpenSimMain.Instance.GridServers.LoadPlugins();
ServerConsole.MainConsole.Instance.WriteLine("Starting in Sandbox mode");
}
else
{
OpenSim_Main.Instance.GridServers.AssetDll = "RemoteGridServers.dll";
OpenSim_Main.Instance.GridServers.GridDll = "RemoteGridServers.dll";
OpenSim_Main.Instance.GridServers.LoadPlugins();
OpenSimMain.Instance.GridServers.AssetDll = "RemoteGridServers.dll";
OpenSimMain.Instance.GridServers.GridDll = "RemoteGridServers.dll";
OpenSimMain.Instance.GridServers.LoadPlugins();
ServerConsole.MainConsole.Instance.WriteLine("Starting in Grid mode");
}
if (Instance.loginserver && Instance.sandbox)
{
LoginServer loginServer = new LoginServer(OpenSim_Main.Instance.GridServers.GridServer);
LoginServer loginServer = new LoginServer(OpenSimMain.Instance.GridServers.GridServer);
loginServer.Startup();
}
Instance.AssetCache = new AssetCache(OpenSim_Main.Instance.GridServers.AssetServer);
Instance.AssetCache = new AssetCache(OpenSimMain.Instance.GridServers.AssetServer);
Instance.InventoryCache = new InventoryManager();
Instance.Startup();
@ -149,7 +149,7 @@ namespace OpenSim
}
}
private OpenSim_Main()
private OpenSimMain()
{
}
@ -175,8 +175,8 @@ namespace OpenSim
Instance.LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this._physicsEngine); //should be reading from the config file what physics engine to use
Instance.LocalWorld.PhysScene.SetTerrain(Instance.LocalWorld.LandMap);
OpenSim_Main.Instance.GridServers.AssetServer.SetServerInfo(OpenSim_Main.Instance.Cfg.AssetURL, OpenSim_Main.Instance.Cfg.AssetSendKey);
OpenSim_Main.Instance.GridServers.GridServer.SetServerInfo(OpenSim_Main.Instance.Cfg.GridURL, OpenSim_Main.Instance.Cfg.GridSendKey);
OpenSimMain.Instance.GridServers.AssetServer.SetServerInfo(OpenSimMain.Instance.Cfg.AssetURL, OpenSimMain.Instance.Cfg.AssetSendKey);
OpenSimMain.Instance.GridServers.GridServer.SetServerInfo(OpenSimMain.Instance.Cfg.GridURL, OpenSimMain.Instance.Cfg.GridSendKey, OpenSimMain.Instance.Cfg.GridRecvKey);
Instance.LocalWorld.LoadStorageDLL("Db4LocalStorage.dll"); //all these dll names shouldn't be hard coded.
Instance.LocalWorld.LoadPrimsFromStorage();
@ -277,8 +277,8 @@ namespace OpenSim
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Killing clients");
// IMPLEMENT THIS
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Closing console and terminating");
OpenSim_Main.Instance.LocalWorld.Close();
OpenSim_Main.Instance.GridServers.Close();
OpenSimMain.Instance.LocalWorld.Close();
OpenSimMain.Instance.GridServers.Close();
ServerConsole.MainConsole.Instance.Close();
Environment.Exit(0);
}

View File

@ -6,7 +6,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}</ProjectGuid>
<StartupObject>OpenSim.OpenSim_Main</StartupObject>
<StartupObject>OpenSim.OpenSimMain</StartupObject>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>

View File

@ -103,15 +103,15 @@ namespace OpenSim
switch (Pack.Type)
{
case PacketType.CompleteAgentMovement:
ClientAvatar.CompleteMovement(OpenSim_Main.Instance.LocalWorld);
ClientAvatar.CompleteMovement(OpenSimMain.Instance.LocalWorld);
ClientAvatar.SendInitialPosition();
break;
case PacketType.RegionHandshakeReply:
OpenSim_Main.Instance.LocalWorld.SendLayerData(this);
OpenSimMain.Instance.LocalWorld.SendLayerData(this);
break;
case PacketType.AgentWearablesRequest:
ClientAvatar.SendInitialAppearance();
foreach (OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values)
foreach (OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values)
{
if (client.AgentID != this.AgentID)
{
@ -120,10 +120,10 @@ namespace OpenSim
client.ClientAvatar.SendAppearanceToOtherAgent(this);
}
}
OpenSim_Main.Instance.LocalWorld.GetInitialPrims(this);
OpenSimMain.Instance.LocalWorld.GetInitialPrims(this);
break;
case PacketType.ObjectAdd:
OpenSim_Main.Instance.LocalWorld.AddNewPrim((ObjectAddPacket)Pack, this);
OpenSimMain.Instance.LocalWorld.AddNewPrim((ObjectAddPacket)Pack, this);
break;
case PacketType.ObjectLink:
ServerConsole.MainConsole.Instance.WriteLine(Pack.ToString());
@ -135,7 +135,7 @@ namespace OpenSim
ObjectShapePacket shape = (ObjectShapePacket)Pack;
for (int i = 0; i < shape.ObjectData.Length; i++)
{
foreach (Entity ent in OpenSim_Main.Instance.LocalWorld.Entities.Values)
foreach (Entity ent in OpenSimMain.Instance.LocalWorld.Entities.Values)
{
if (ent.localid == shape.ObjectData[i].ObjectLocalID)
{
@ -152,7 +152,7 @@ namespace OpenSim
if (multipleupdate.ObjectData[i].Type == 9) //change position
{
libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
foreach (Entity ent in OpenSim_Main.Instance.LocalWorld.Entities.Values)
foreach (Entity ent in OpenSimMain.Instance.LocalWorld.Entities.Values)
{
if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
{
@ -166,7 +166,7 @@ namespace OpenSim
else if (multipleupdate.ObjectData[i].Type == 10)//rotation
{
libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
foreach (Entity ent in OpenSim_Main.Instance.LocalWorld.Entities.Values)
foreach (Entity ent in OpenSimMain.Instance.LocalWorld.Entities.Values)
{
if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
{
@ -179,7 +179,7 @@ namespace OpenSim
{
libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
foreach (Entity ent in OpenSim_Main.Instance.LocalWorld.Entities.Values)
foreach (Entity ent in OpenSimMain.Instance.LocalWorld.Entities.Values)
{
if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
{
@ -193,13 +193,13 @@ namespace OpenSim
RequestImagePacket imageRequest = (RequestImagePacket)Pack;
for (int i = 0; i < imageRequest.RequestImage.Length; i++)
{
OpenSim_Main.Instance.AssetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image);
OpenSimMain.Instance.AssetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image);
}
break;
case PacketType.TransferRequest:
//Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request");
TransferRequestPacket transfer = (TransferRequestPacket)Pack;
OpenSim_Main.Instance.AssetCache.AddAssetRequest(this, transfer);
OpenSimMain.Instance.AssetCache.AddAssetRequest(this, transfer);
break;
case PacketType.AgentUpdate:
ClientAvatar.HandleUpdate((AgentUpdatePacket)Pack);
@ -219,17 +219,17 @@ namespace OpenSim
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
kill.ObjectData[0].ID = this.ClientAvatar.localid;
foreach (OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values)
foreach (OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values)
{
client.OutPacket(kill);
}
OpenSim_Main.Instance.GridServers.GridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
lock (OpenSim_Main.Instance.LocalWorld.Entities)
OpenSimMain.Instance.GridServers.GridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
lock (OpenSimMain.Instance.LocalWorld.Entities)
{
OpenSim_Main.Instance.LocalWorld.Entities.Remove(this.AgentID);
OpenSimMain.Instance.LocalWorld.Entities.Remove(this.AgentID);
}
//need to do other cleaning up here too
OpenSim_Main.Instance.ClientThreads.Remove(this.userEP);
OpenSimMain.Instance.ClientThreads.Remove(this.userEP);
this.ClientThread.Abort();
break;
case PacketType.ChatFromViewer:
@ -246,7 +246,7 @@ namespace OpenSim
reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0");
reply.ChatData.OwnerID = this.AgentID;
reply.ChatData.SourceID = this.AgentID;
foreach (OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values)
foreach (OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values)
{
client.OutPacket(reply);
}
@ -255,7 +255,7 @@ namespace OpenSim
ObjectImagePacket imagePack = (ObjectImagePacket)Pack;
for (int i = 0; i < imagePack.ObjectData.Length; i++)
{
foreach (Entity ent in OpenSim_Main.Instance.LocalWorld.Entities.Values)
foreach (Entity ent in OpenSimMain.Instance.LocalWorld.Entities.Values)
{
if (ent.localid == imagePack.ObjectData[i].ObjectLocalID)
{
@ -266,7 +266,7 @@ namespace OpenSim
break;
case PacketType.ObjectFlagUpdate:
ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack;
foreach (Entity ent in OpenSim_Main.Instance.LocalWorld.Entities.Values)
foreach (Entity ent in OpenSimMain.Instance.LocalWorld.Entities.Values)
{
if (ent.localid == flags.AgentData.ObjectLocalID)
{
@ -321,11 +321,11 @@ namespace OpenSim
case PacketType.FetchInventory:
Console.WriteLine("fetch item packet");
FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack;
OpenSim_Main.Instance.InventoryCache.FetchInventory(this, FetchInventory);
OpenSimMain.Instance.InventoryCache.FetchInventory(this, FetchInventory);
break;
case PacketType.FetchInventoryDescendents:
FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack;
OpenSim_Main.Instance.InventoryCache.FetchInventoryDescendents(this, Fetch);
OpenSimMain.Instance.InventoryCache.FetchInventoryDescendents(this, Fetch);
break;
}
}
@ -464,11 +464,11 @@ namespace OpenSim
if (Pack.Header.Zerocoded)
{
int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
OpenSim_Main.Instance.Server.SendTo(ZeroOutBuffer, packetsize, SocketFlags.None, userEP);
OpenSimMain.Instance.Server.SendTo(ZeroOutBuffer, packetsize, SocketFlags.None, userEP);
}
else
{
OpenSim_Main.Instance.Server.SendTo(sendbuffer, sendbuffer.Length, SocketFlags.None, userEP);
OpenSimMain.Instance.Server.SendTo(sendbuffer, sendbuffer.Length, SocketFlags.None, userEP);
}
}
catch (Exception)
@ -569,14 +569,14 @@ namespace OpenSim
private void InitNewClient()
{
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
OpenSim_Main.Instance.LocalWorld.AddViewerAgent(this);
world.Entity tempent = OpenSim_Main.Instance.LocalWorld.Entities[this.AgentID];
OpenSimMain.Instance.LocalWorld.AddViewerAgent(this);
world.Entity tempent = OpenSimMain.Instance.LocalWorld.Entities[this.AgentID];
this.ClientAvatar = (world.Avatar)tempent;
}
private void AuthUser()
{
AuthenticateResponse sessionInfo = OpenSim_Main.Instance.GridServers.GridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
AuthenticateResponse sessionInfo = OpenSimMain.Instance.GridServers.GridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
if (!sessionInfo.Authorised)
{
//session/circuit not authorised
@ -595,16 +595,16 @@ namespace OpenSim
this.ClientAvatar.lastname = sessionInfo.LoginInfo.Last;
// Create Inventory, currently only works for sandbox mode
if (OpenSim_Main.Instance.sandbox)
if (OpenSimMain.Instance.sandbox)
{
if (sessionInfo.LoginInfo.InventoryFolder != null)
{
this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder);
if (sessionInfo.LoginInfo.BaseFolder != null)
{
OpenSim_Main.Instance.InventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder);
OpenSimMain.Instance.InventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder);
this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder;
AssetBase[] inventorySet = OpenSim_Main.Instance.AssetCache.CreateNewInventorySet(this.AgentID);
AssetBase[] inventorySet = OpenSimMain.Instance.AssetCache.CreateNewInventorySet(this.AgentID);
if (inventorySet != null)
{
for (int i = 0; i < inventorySet.Length; i++)
@ -612,7 +612,7 @@ namespace OpenSim
if (inventorySet[i] != null)
{
Console.WriteLine(Helpers.FieldToString(inventorySet[i].Data));
OpenSim_Main.Instance.InventoryCache.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]);
OpenSimMain.Instance.InventoryCache.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]);
}
}
}
@ -628,9 +628,19 @@ namespace OpenSim
{
AgentInventory inventory = new AgentInventory();
inventory.AgentID = this.AgentID;
OpenSim_Main.Instance.InventoryCache.AddNewAgentsInventory(inventory);
OpenSim_Main.Instance.InventoryCache.CreateNewInventoryFolder(this, baseFolder);
OpenSimMain.Instance.InventoryCache.AddNewAgentsInventory(inventory);
OpenSimMain.Instance.InventoryCache.CreateNewInventoryFolder(this, baseFolder);
}
}
public class QueItem
{
public QueItem()
{
}
public Packet Packet;
public bool Incoming;
}
}

View File

@ -156,11 +156,11 @@ namespace OpenSim
break;
case "regenerate":
OpenSim_Main.Instance.LocalWorld.RegenerateTerrain();
OpenSimMain.Instance.LocalWorld.RegenerateTerrain();
break;
case "shutdown":
OpenSim_Main.Shutdown();
OpenSimMain.Shutdown();
break;
}
return null;
@ -170,16 +170,16 @@ namespace OpenSim
public override void ShowCommands(string ShowWhat) {
switch(ShowWhat) {
case "uptime":
this.WriteLine("OpenSim has been running since " + OpenSim_Main.Instance.startuptime.ToString());
this.WriteLine("That is " + (DateTime.Now-OpenSim_Main.Instance.startuptime).ToString());
this.WriteLine("OpenSim has been running since " + OpenSimMain.Instance.startuptime.ToString());
this.WriteLine("That is " + (DateTime.Now-OpenSimMain.Instance.startuptime).ToString());
break;
case "users":
OpenSim.world.Avatar TempAv;
this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}","Firstname", "Lastname","Agent ID", "Session ID", "Circuit", "IP"));
foreach (libsecondlife.LLUUID UUID in OpenSim_Main.Instance.LocalWorld.Entities.Keys) {
if(OpenSim_Main.Instance.LocalWorld.Entities[UUID].ToString()== "OpenSim.world.Avatar")
foreach (libsecondlife.LLUUID UUID in OpenSimMain.Instance.LocalWorld.Entities.Keys) {
if(OpenSimMain.Instance.LocalWorld.Entities[UUID].ToString()== "OpenSim.world.Avatar")
{
TempAv=(OpenSim.world.Avatar)OpenSim_Main.Instance.LocalWorld.Entities[UUID];
TempAv=(OpenSim.world.Avatar)OpenSimMain.Instance.LocalWorld.Entities[UUID];
this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}",TempAv.firstname, TempAv.lastname,UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()));
}
}
@ -190,7 +190,7 @@ namespace OpenSim
// Displays a prompt to the user and then runs the command they entered
public override void MainConsolePrompt() {
string[] tempstrarray;
string tempstr = this.CmdPrompt("OpenSim-" + OpenSim_Main.Instance.Cfg.RegionHandle.ToString() + " # ");
string tempstr = this.CmdPrompt("OpenSim-" + OpenSimMain.Instance.Cfg.RegionHandle.ToString() + " # ");
tempstrarray = tempstr.Split(' ');
string cmd=tempstrarray[0];
Array.Reverse(tempstrarray);

View File

@ -70,9 +70,10 @@ namespace RemoteGridServers
{
private string GridServerUrl;
private string GridSendKey;
private Dictionary<uint, agentcircuitdata> AgentCircuits = new Dictionary<uint, agentcircuitdata>();
private string GridRecvKey;
private Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
public override Dictionary<uint, agentcircuitdata> agentcircuits
public override Dictionary<uint, AgentCircuitData> agentcircuits
{
get { return AgentCircuits; }
set { AgentCircuits = value; }
@ -90,7 +91,7 @@ namespace RemoteGridServers
public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
{
agentcircuitdata validcircuit = null;
AgentCircuitData validcircuit = null;
if (this.AgentCircuits.ContainsKey(circuitcode))
{
validcircuit = this.AgentCircuits[circuitcode];
@ -145,15 +146,16 @@ namespace RemoteGridServers
return (uuidBlock);
}
public override void RequestNeighbours()
public override NeighbourInfo[] RequestNeighbours()
{
return;
return null;
}
public override void SetServerInfo(string ServerUrl, string ServerKey)
public override void SetServerInfo(string ServerUrl, string SendKey, string RecvKey)
{
this.GridServerUrl = ServerUrl;
this.GridSendKey = ServerKey;
this.GridSendKey = SendKey;
this.GridRecvKey = RecvKey;
}
public override string GetName()

View File

@ -28,8 +28,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ServerConsole.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="ServerConsole.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C# Express 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Second-server", "Second-server.csproj", "{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim.csproj", "{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhysicsManager", "physics\PhysicsManager.csproj", "{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}"
EndProject

View File

@ -27,9 +27,9 @@ namespace OpenSim.world
{
ServerConsole.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)");
ControllingClient = TheClient;
localid = 8880000 + (OpenSim_Main.Instance.LocalWorld._localNumber++);
localid = 8880000 + (OpenSimMain.Instance.LocalWorld._localNumber++);
position = new LLVector3(100.0f, 100.0f, 30.0f);
position.Z = OpenSim_Main.Instance.LocalWorld.LandMap[(int)position.Y * 256 + (int)position.X] + 1;
position.Z = OpenSimMain.Instance.LocalWorld.LandMap[(int)position.Y * 256 + (int)position.X] + 1;
}
public PhysicsActor PhysActor
@ -73,11 +73,11 @@ namespace OpenSim.world
//use CreateTerseBlock()
ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
terse.RegionData.RegionHandle = OpenSim_Main.Instance.Cfg.RegionHandle; // FIXME
terse.RegionData.RegionHandle = OpenSimMain.Instance.Cfg.RegionHandle; // FIXME
terse.RegionData.TimeDilation = 64096;
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
terse.ObjectData[0] = terseBlock;
foreach (OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values)
foreach (OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values)
{
client.OutPacket(terse);
}
@ -95,11 +95,11 @@ namespace OpenSim.world
//It has been a while since last update was sent so lets send one.
ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
terse.RegionData.RegionHandle = OpenSim_Main.Instance.Cfg.RegionHandle; // FIXME
terse.RegionData.RegionHandle = OpenSimMain.Instance.Cfg.RegionHandle; // FIXME
terse.RegionData.TimeDilation = 64096;
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
terse.ObjectData[0] = terseBlock;
foreach (OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values)
foreach (OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values)
{
client.OutPacket(terse);
}
@ -141,7 +141,7 @@ namespace OpenSim.world
AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
mov.AgentData.SessionID = this.ControllingClient.SessionID;
mov.AgentData.AgentID = this.ControllingClient.AgentID;
mov.Data.RegionHandle = OpenSim_Main.Instance.Cfg.RegionHandle;
mov.Data.RegionHandle = OpenSimMain.Instance.Cfg.RegionHandle;
// TODO - dynamicalise this stuff
mov.Data.Timestamp = 1172750370;
mov.Data.Position = new LLVector3(100f, 100f, 23f);
@ -156,7 +156,7 @@ namespace OpenSim.world
System.Text.Encoding _enc = System.Text.Encoding.ASCII;
//send a objectupdate packet with information about the clients avatar
ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
objupdate.RegionData.RegionHandle = OpenSim_Main.Instance.Cfg.RegionHandle;
objupdate.RegionData.RegionHandle = OpenSimMain.Instance.Cfg.RegionHandle;
objupdate.RegionData.TimeDilation = 64096;
objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
@ -171,9 +171,9 @@ namespace OpenSim.world
byte[] pb = pos2.GetBytes();
Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
OpenSim_Main.Instance.LocalWorld._localNumber++;
OpenSimMain.Instance.LocalWorld._localNumber++;
foreach (OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values)
foreach (OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values)
{
client.OutPacket(objupdate);
if (client.AgentID != ControllingClient.AgentID)
@ -215,7 +215,7 @@ namespace OpenSim.world
System.Text.Encoding _enc = System.Text.Encoding.ASCII;
//send a objectupdate packet with information about the clients avatar
ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
objupdate.RegionData.RegionHandle = OpenSim_Main.Instance.Cfg.RegionHandle;
objupdate.RegionData.RegionHandle = OpenSimMain.Instance.Cfg.RegionHandle;
objupdate.RegionData.TimeDilation = 64096;
objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
@ -394,7 +394,7 @@ namespace OpenSim.world
handshake.RegionInfo.SimAccess = 13;
handshake.RegionInfo.WaterHeight = 20;
handshake.RegionInfo.RegionFlags = 72458694;
handshake.RegionInfo.SimName = _enc.GetBytes(OpenSim_Main.Instance.Cfg.RegionName + "\0");
handshake.RegionInfo.SimName = _enc.GetBytes(OpenSimMain.Instance.Cfg.RegionName + "\0");
handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975");
handshake.RegionInfo.TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3");

View File

@ -99,7 +99,7 @@ namespace OpenSim.world
{
if (this.newPrimFlag)
{
foreach (OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values)
foreach (OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values)
{
client.OutPacket(OurPacket);
}
@ -108,11 +108,11 @@ namespace OpenSim.world
else if (this.updateFlag)
{
ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
terse.RegionData.RegionHandle = OpenSim_Main.Instance.Cfg.RegionHandle; // FIXME
terse.RegionData.RegionHandle = OpenSimMain.Instance.Cfg.RegionHandle; // FIXME
terse.RegionData.TimeDilation = 64096;
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
terse.ObjectData[0] = this.CreateImprovedBlock();
foreach (OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values)
foreach (OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values)
{
client.OutPacket(terse);
}
@ -120,7 +120,7 @@ namespace OpenSim.world
}
else if (this.dirtyFlag)
{
foreach (OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values)
foreach (OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values)
{
UpdateClient(client);
}
@ -131,11 +131,11 @@ namespace OpenSim.world
if (this._physActor != null && this.physicsEnabled)
{
ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
terse.RegionData.RegionHandle = OpenSim_Main.Instance.Cfg.RegionHandle; // FIXME
terse.RegionData.RegionHandle = OpenSimMain.Instance.Cfg.RegionHandle; // FIXME
terse.RegionData.TimeDilation = 64096;
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
terse.ObjectData[0] = this.CreateImprovedBlock();
foreach (OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values)
foreach (OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values)
{
client.OutPacket(terse);
}
@ -254,7 +254,7 @@ namespace OpenSim.world
public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID)
{
ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
objupdate.RegionData.RegionHandle = OpenSim_Main.Instance.Cfg.RegionHandle;
objupdate.RegionData.RegionHandle = OpenSimMain.Instance.Cfg.RegionHandle;
objupdate.RegionData.TimeDilation = 64096;
objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
@ -322,7 +322,7 @@ namespace OpenSim.world
{
//need to clean this up as it shares a lot of code with CreateFromPacket()
ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
objupdate.RegionData.RegionHandle = OpenSim_Main.Instance.Cfg.RegionHandle;
objupdate.RegionData.RegionHandle = OpenSimMain.Instance.Cfg.RegionHandle;
objupdate.RegionData.TimeDilation = 64096;
objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
@ -478,7 +478,7 @@ namespace OpenSim.world
this.primData.LocalID = this.localid;
this.primData.Position = this.position;
this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w);
OpenSim_Main.Instance.LocalWorld.localStorage.StorePrim(this.primData);
OpenSimMain.Instance.LocalWorld.localStorage.StorePrim(this.primData);
}
}

View File

@ -114,9 +114,9 @@ namespace OpenSim.world
HeightmapGenHills hills = new HeightmapGenHills();
this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
this.phyScene.SetTerrain(this.LandMap);
OpenSim_Main.Instance.Cfg.SaveMap(this.LandMap);
OpenSimMain.Instance.Cfg.SaveMap(this.LandMap);
foreach(OpenSimClient client in OpenSim_Main.Instance.ClientThreads.Values) {
foreach(OpenSimClient client in OpenSimMain.Instance.ClientThreads.Values) {
this.SendLayerData(client);
}
}