From c3a40b7d42276f152d8f4f6a7a3ad4eca3c6d7a8 Mon Sep 17 00:00:00 2001
From: MW
Date: Sat, 26 May 2007 14:34:57 +0000
Subject: Die WebFrontEnd, Die Grid class!
---
OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs | 228 +--------------------
OpenSim/OpenSim.RegionServer/ClientView.Grid.cs | 138 +------------
.../ClientView.ProcessPackets.cs | 35 +---
OpenSim/OpenSim.RegionServer/ClientView.cs | 118 +----------
OpenSim/OpenSim.RegionServer/Grid.cs | 78 +------
.../OpenSim.RegionServer.csproj | 51 +++--
OpenSim/OpenSim.RegionServer/PacketServer.cs | 5 +-
OpenSim/OpenSim.RegionServer/RegionInfo.cs | 52 +----
OpenSim/OpenSim.RegionServer/world/Avatar.cs | 21 +-
.../world/World.PacketHandlers.cs | 109 +---------
OpenSim/OpenSim.RegionServer/world/World.cs | 1 +
11 files changed, 47 insertions(+), 789 deletions(-)
(limited to 'OpenSim/OpenSim.RegionServer')
diff --git a/OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs b/OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs
index 2299fa4..1f508ce 100644
--- a/OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs
+++ b/OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs
@@ -19,238 +19,16 @@ namespace OpenSim.CAPS
private string NewAccountForm;
private string LoginForm;
private string passWord = "Admin";
- private World m_world;
- private LoginServer _userServer;
- private InventoryCache _inventoryCache;
- public AdminWebFront(string password, World world, InventoryCache inventoryCache, LoginServer userserver)
+
+ public AdminWebFront(string password)
{
- _inventoryCache = inventoryCache;
- _userServer = userserver;
- m_world = world;
passWord = password;
- LoadAdminPage();
}
public void LoadMethods( BaseHttpServer server )
{
- server.AddRestHandler("GET", "/Admin", GetAdminPage);
- server.AddRestHandler("GET", "/Admin/Welcome", GetWelcomePage);
- server.AddRestHandler("GET", "/Admin/Accounts", GetAccountsPage );
- server.AddRestHandler("GET", "/Admin/Clients", GetConnectedClientsPage);
- server.AddRestHandler("GET", "/Admin/Entities", GetEntitiesPage);
- server.AddRestHandler("GET", "/Admin/Scripts", GetScriptsPage);
- server.AddRestHandler("GET", "/Admin/AddTestScript", AddTestScript );
- server.AddRestHandler("GET", "/ClientInventory", GetClientsInventory);
-
- server.AddRestHandler("POST", "/Admin/NewAccount", PostNewAccount );
- server.AddRestHandler("POST", "/Admin/Login", PostLogin );
- }
-
- private string GetWelcomePage(string request, string path, string param)
- {
- string responseString;
- responseString = "Welcome to the OpenSim Admin Page";
- responseString += "
" + LoginForm;
- return responseString;
- }
-
- private string PostLogin(string requestBody, string path, string param)
- {
- string responseString;
-// Console.WriteLine(requestBody);
- if (requestBody == passWord)
- {
- responseString = "
Login Successful
";
- }
- else
- {
- responseString = " Password Error
";
- responseString += " Please Login with the correct password
";
- responseString += "
" + LoginForm;
- }
- return responseString;
- }
-
- private string PostNewAccount(string requestBody, string path, string param)
- {
- string responseString;
- string firstName = "";
- string secondName = "";
- string userPasswd = "";
- string[] comp;
- string[] passw;
- string[] line;
- string delimStr = "&";
- char[] delimiter = delimStr.ToCharArray();
- string delimStr2 = "=";
- char[] delimiter2 = delimStr2.ToCharArray();
-
- //Console.WriteLine(requestBody);
- comp = requestBody.Split(delimiter);
- passw = comp[3].Split(delimiter2);
- if (passw[1] == passWord) // check admin password is correct
- {
-
- line = comp[0].Split(delimiter2); //split firstname
- if (line.Length > 1)
- {
- firstName = line[1];
- }
- line = comp[1].Split(delimiter2); //split secondname
- if (line.Length > 1)
- {
- secondName = line[1];
- }
- line = comp[2].Split(delimiter2); //split user password
- if (line.Length > 1)
- {
- userPasswd = line[1];
- }
- if (this._userServer != null)
- {
- this._userServer.CreateUserAccount(firstName, secondName, userPasswd);
- }
- responseString = " New Account created
";
- }
- else
- {
- responseString = " Admin password is incorrect, please login with the correct password
";
- responseString += "
" + LoginForm;
- }
- return responseString;
+
}
-
- private string GetConnectedClientsPage(string request, string path, string param)
- {
- string responseString;
- responseString = " Listing connected Clients
";
- OpenSim.world.Avatar TempAv;
- foreach (libsecondlife.LLUUID UUID in m_world.Entities.Keys)
- {
- if (m_world.Entities[UUID].ToString() == "OpenSim.world.Avatar")
- {
- TempAv = (OpenSim.world.Avatar)m_world.Entities[UUID];
- responseString += " Client: ";
- responseString += TempAv.firstname + " , " + TempAv.lastname + " , " + UUID + " , " + TempAv.ControllingClient.SessionID + " , " + TempAv.ControllingClient.CircuitCode + " , " + TempAv.ControllingClient.userEP.ToString();
- responseString += "
";
- }
- }
- return responseString;
- }
-
- private string AddTestScript(string request, string path, string param)
- {
- int index = path.LastIndexOf('/');
-
- string lluidStr = path.Substring(index+1);
-
- LLUUID id;
-
- if( LLUUID.TryParse( lluidStr, out id ) )
- {
- // This is just here for concept purposes... Remove!
- m_world.AddScript( m_world.Entities[id], new FollowRandomAvatar());
- return String.Format("Added new script to object [{0}]", id);
- }
- else
- {
- return String.Format("Couldn't parse [{0}]", lluidStr );
- }
- }
-
- private string GetScriptsPage(string request, string path, string param)
- {
- return String.Empty;
- }
-
- private string GetEntitiesPage(string request, string path, string param)
- {
- string responseString;
- responseString = " Listing current entities
";
-
- foreach (Entity entity in m_world.Entities.Values)
- {
- string testScriptLink = "javascript:loadXMLDoc('Admin/AddTestScript/" + entity.uuid.ToString() + "');";
- responseString += String.Format( "- [{0}] \"{1}\" @ {2} add test script
", entity.uuid, entity.Name, entity.Pos, testScriptLink );
- }
- responseString += "
";
- return responseString;
- }
-
- private string GetClientsInventory(string request, string path, string param)
- {
- string[] line;
- string delimStr = "/";
- char[] delimiter = delimStr.ToCharArray();
- string responseString;
- responseString = " Listing Inventory
";
-
- line = path.Split(delimiter);
- if (line.Length > 2)
- {
- if (line[1] == "ClientInventory")
- {
- AgentInventory inven = this._inventoryCache.GetAgentsInventory(new libsecondlife.LLUUID(line[2]));
- responseString += " Client: " + inven.AgentID.ToStringHyphenated() +"
";
- if (inven != null)
- {
- foreach (InventoryItem item in inven.InventoryItems.Values)
- {
- responseString += " InventoryItem: ";
- responseString += item.Name +" , "+ item.ItemID +" , "+ item.Type +" , "+ item.FolderID +" , "+ item.AssetID +" , "+ item.Description ;
- responseString += "
";
- }
- }
- }
- }
- return responseString;
- }
-
- private string GetCachedAssets(string request, string path, string param)
- {
- return "";
- }
-
- private string GetAccountsPage(string request, string path, string param)
- {
- string responseString;
- responseString = " Account management
";
- responseString += "
";
- responseString += " Create New Account
";
- responseString += NewAccountForm;
- return responseString;
- }
-
- private string GetAdminPage(string request, string path, string param)
- {
- return AdminPage;
- }
-
- private void LoadAdminPage()
- {
- try
- {
- StreamReader SR;
-
- SR = File.OpenText("testadmin.htm");
- AdminPage = SR.ReadToEnd();
- SR.Close();
-
- SR = File.OpenText("newaccountform.htm");
- NewAccountForm = SR.ReadToEnd();
- SR.Close();
-
- SR = File.OpenText("login.htm");
- LoginForm = SR.ReadToEnd();
- SR.Close();
- }
- catch (Exception e)
- {
- Console.WriteLine(e.ToString());
- }
-
- }
-
}
}
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs b/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs
index 1121839..b4e4b5f 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs
@@ -23,145 +23,11 @@ namespace OpenSim
public void EnableNeighbours()
{
- if ((this.m_gridServer.GetName() == "Remote") && (!this.m_child))
- {
- Hashtable SimParams;
- ArrayList SendParams;
- XmlRpcRequest GridReq;
- XmlRpcResponse GridResp;
- List enablePackets = new List();
-
- RemoteGridBase gridServer = (RemoteGridBase)this.m_gridServer;
-
- foreach (Hashtable neighbour in gridServer.neighbours)
- {
- try
- {
- string neighbourIPStr = (string)neighbour["sim_ip"];
- System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr);
- ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]);
- string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString();
-
- Console.WriteLine(reqUrl);
-
- SimParams = new Hashtable();
- SimParams["session_id"] = this.SessionID.ToString();
- SimParams["secure_session_id"] = this.SecureSessionID.ToString();
- SimParams["firstname"] = this.ClientAvatar.firstname;
- SimParams["lastname"] = this.ClientAvatar.lastname;
- SimParams["agent_id"] = this.AgentID.ToString();
- SimParams["circuit_code"] = (Int32)this.CircuitCode;
- SimParams["child_agent"] = "1";
- SendParams = new ArrayList();
- SendParams.Add(SimParams);
-
- GridReq = new XmlRpcRequest("expect_user", SendParams);
- GridResp = GridReq.Send(reqUrl, 3000);
- EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
- enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
- enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
-
-
- byte[] byteIP = neighbourIP.GetAddressBytes();
- enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
- enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
- enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
- enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
- enablesimpacket.SimulatorInfo.Port = neighbourPort;
- enablePackets.Add(enablesimpacket);
- }
- catch (Exception e)
- {
- OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Could not connect to neighbour " + neighbour["sim_ip"] + ":" + neighbour["sim_port"] + ", continuing.");
- }
- }
- Thread.Sleep(3000);
- foreach (Packet enable in enablePackets)
- {
- this.OutPacket(enable);
- }
- enablePackets.Clear();
-
- }
+
}
public void CrossSimBorder(LLVector3 avatarpos)
- { // VERY VERY BASIC
-
- LLVector3 newpos = avatarpos;
- uint neighbourx = this.m_regionData.RegionLocX;
- uint neighboury = this.m_regionData.RegionLocY;
-
- if (avatarpos.X < 0)
- {
- neighbourx -= 1;
- newpos.X = 254;
- }
- if (avatarpos.X > 255)
- {
- neighbourx += 1;
- newpos.X = 1;
- }
- if (avatarpos.Y < 0)
- {
- neighboury -= 1;
- newpos.Y = 254;
- }
- if (avatarpos.Y > 255)
- {
- neighboury += 1;
- newpos.Y = 1;
- }
- OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:CrossSimBorder() - Crossing border to neighbouring sim at [" + neighbourx.ToString() + "," + neighboury.ToString() + "]");
-
- Hashtable SimParams;
- ArrayList SendParams;
- XmlRpcRequest GridReq;
- XmlRpcResponse GridResp;
- foreach (Hashtable borderingSim in ((RemoteGridBase)m_gridServer).neighbours)
- {
- if (((string)borderingSim["region_locx"]).Equals(neighbourx.ToString()) && ((string)borderingSim["region_locy"]).Equals(neighboury.ToString()))
- {
- Console.WriteLine("found the neighbouring sim");
- SimParams = new Hashtable();
- SimParams["firstname"] = this.ClientAvatar.firstname;
- SimParams["lastname"] = this.ClientAvatar.lastname;
- SimParams["circuit_code"] = this.CircuitCode.ToString();
- SimParams["pos_x"] = newpos.X.ToString();
- SimParams["pos_y"] = newpos.Y.ToString();
- SimParams["pos_z"] = newpos.Z.ToString();
- SendParams = new ArrayList();
- SendParams.Add(SimParams);
-
- GridReq = new XmlRpcRequest("agent_crossing", SendParams);
- GridResp = GridReq.Send("http://" + borderingSim["sim_ip"] + ":" + borderingSim["sim_port"], 3000);
-
- CrossedRegionPacket NewSimPack = new CrossedRegionPacket();
- NewSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock();
- NewSimPack.AgentData.AgentID = this.AgentID;
- NewSimPack.AgentData.SessionID = this.SessionID;
- NewSimPack.Info = new CrossedRegionPacket.InfoBlock();
- NewSimPack.Info.Position = newpos;
- NewSimPack.Info.LookAt = new LLVector3(0.99f, 0.042f, 0); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!!
- NewSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock();
- NewSimPack.RegionData.RegionHandle = Helpers.UIntsToLong((uint)(Convert.ToInt32(borderingSim["region_locx"]) * 256), (uint)(Convert.ToInt32(borderingSim["region_locy"]) * 256));
- System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse((string)borderingSim["sim_ip"]);
- byte[] byteIP = neighbourIP.GetAddressBytes();
- NewSimPack.RegionData.SimIP = (uint)byteIP[3] << 24;
- NewSimPack.RegionData.SimIP += (uint)byteIP[2] << 16;
- NewSimPack.RegionData.SimIP += (uint)byteIP[1] << 8;
- NewSimPack.RegionData.SimIP += (uint)byteIP[0];
- NewSimPack.RegionData.SimPort = (ushort)Convert.ToInt32(borderingSim["sim_port"]);
- NewSimPack.RegionData.SeedCapability = new byte[0];
- this.OutPacket(NewSimPack);
- this.DowngradeClient();
- /* lock (PacketQueue)
- {
- ProcessOutPacket(NewSimPack);
- DowngradeClient();
- }*/
- }
- }
+ {
}
}
}
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
index 977162f..6a33432 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
@@ -20,40 +20,7 @@ namespace OpenSim
{
public partial class ClientView
{
- public delegate void GenericCall(ClientView remoteClient);
- public delegate void GenericCall2();
- public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary.
- public delegate void GenericCall4(Packet packet, ClientView remoteClient);
- public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
- public delegate void ObjectSelect(uint localID, ClientView remoteClient);
- public delegate void UpdatePrimFlags(uint localID, Packet packet, ClientView remoteClient);
- public delegate void UpdatePrimTexture(uint localID, byte[] texture, ClientView remoteClient);
- public delegate void UpdatePrimVector(uint localID, LLVector3 pos, ClientView remoteClient);
- public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, ClientView remoteClient);
- public delegate void StatusChange(bool status);
-
- public event ChatFromViewer OnChatFromViewer;
- public event RezObject OnRezObject;
- public event GenericCall4 OnDeRezObject;
- public event ModifyTerrain OnModifyTerrain;
- public event GenericCall OnRegionHandShakeReply;
- public event GenericCall OnRequestWearables;
- public event SetAppearance OnSetAppearance;
- public event GenericCall2 OnCompleteMovementToRegion;
- public event GenericCall3 OnAgentUpdate;
- public event StartAnim OnStartAnim;
- public event GenericCall OnRequestAvatarsData;
- public event LinkObjects OnLinkObjects;
- public event GenericCall4 OnAddPrim;
- public event UpdateShape OnUpdatePrimShape;
- public event ObjectSelect OnObjectSelect;
- public event UpdatePrimFlags OnUpdatePrimFlags;
- public event UpdatePrimTexture OnUpdatePrimTexture;
- public event UpdatePrimVector OnUpdatePrimPosition;
- public event UpdatePrimRotation OnUpdatePrimRotation;
- public event UpdatePrimVector OnUpdatePrimScale;
- public event StatusChange OnChildAgentStatus;
- public event GenericCall2 OnStopMovement;
+
protected override void ProcessInPacket(Packet Pack)
{
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.cs b/OpenSim/OpenSim.RegionServer/ClientView.cs
index 295cd7b..a422102 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.cs
@@ -315,133 +315,21 @@ namespace OpenSim
this.ClientThread.Abort();
}
- #region World/Avatar To Viewer Methods
-
- public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
- {
- System.Text.Encoding enc = System.Text.Encoding.ASCII;
- libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
- reply.ChatData.Audible = 1;
- reply.ChatData.Message = message;
- reply.ChatData.ChatType = type;
- reply.ChatData.SourceType = 1;
- reply.ChatData.Position = fromPos;
- reply.ChatData.FromName = enc.GetBytes(fromName + "\0");
- reply.ChatData.OwnerID = fromAgentID;
- reply.ChatData.SourceID = fromAgentID;
-
- this.OutPacket(reply);
- }
-
- public void SendAppearance(AvatarWearable[] wearables)
- {
- AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket();
- aw.AgentData.AgentID = this.AgentID;
- aw.AgentData.SerialNum = 0;
- aw.AgentData.SessionID = this.SessionID;
-
- aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13];
- AgentWearablesUpdatePacket.WearableDataBlock awb;
- for (int i = 0; i < wearables.Length; i++)
- {
- awb = new AgentWearablesUpdatePacket.WearableDataBlock();
- awb.WearableType = (byte)i;
- awb.AssetID = wearables[i].AssetID;
- awb.ItemID = wearables[i].ItemID;
- aw.WearableData[i] = awb;
- }
-
- this.OutPacket(aw);
- }
- #endregion
-
#region Inventory Creation
private void SetupInventory(AuthenticateResponse sessionInfo)
{
- AgentInventory inventory = null;
- if (sessionInfo.LoginInfo.InventoryFolder != null)
- {
- inventory = this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder);
- if (sessionInfo.LoginInfo.BaseFolder != null)
- {
- if (!inventory.HasFolder(sessionInfo.LoginInfo.BaseFolder))
- {
- m_inventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder);
- }
- this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder;
- AssetBase[] inventorySet = m_assetCache.CreateNewInventorySet(this.AgentID);
- if (inventorySet != null)
- {
- for (int i = 0; i < inventorySet.Length; i++)
- {
- if (inventorySet[i] != null)
- {
- m_inventoryCache.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]);
- }
- }
- }
- }
- }
+
}
private AgentInventory CreateInventory(LLUUID baseFolder)
{
AgentInventory inventory = null;
- if (this.m_userServer != null)
- {
- // a user server is set so request the inventory from it
- Console.WriteLine("getting inventory from user server");
- inventory = m_inventoryCache.FetchAgentsInventory(this.AgentID, m_userServer);
- }
- else
- {
- inventory = new AgentInventory();
- inventory.AgentID = this.AgentID;
- inventory.CreateRootFolder(this.AgentID, false);
- m_inventoryCache.AddNewAgentsInventory(inventory);
- m_inventoryCache.CreateNewInventoryFolder(this, baseFolder);
- }
+
return inventory;
}
private void CreateInventoryItem(CreateInventoryItemPacket packet)
{
- if (!(packet.InventoryBlock.Type == 3 || packet.InventoryBlock.Type == 7))
- {
- System.Console.WriteLine("Attempted to create " + Util.FieldToString(packet.InventoryBlock.Name) + " in inventory. Unsupported type");
- return;
- }
-
- //lets try this out with creating a notecard
- AssetBase asset = new AssetBase();
-
- asset.Name = Util.FieldToString(packet.InventoryBlock.Name);
- asset.Description = Util.FieldToString(packet.InventoryBlock.Description);
- asset.InvType = packet.InventoryBlock.InvType;
- asset.Type = packet.InventoryBlock.Type;
- asset.FullID = LLUUID.Random();
-
- switch (packet.InventoryBlock.Type)
- {
- case 7: // Notecard
- asset.Data = new byte[0];
- break;
-
- case 3: // Landmark
- String content;
- content = "Landmark version 2\n";
- content += "region_id " + m_regionData.SimUUID + "\n";
- String strPos = String.Format("%.2f %.2f %.2f>",
- this.ClientAvatar.Pos.X,
- this.ClientAvatar.Pos.Y,
- this.ClientAvatar.Pos.Z);
- content += "local_pos " + strPos + "\n";
- asset.Data = (new System.Text.ASCIIEncoding()).GetBytes(content);
- break;
- default:
- break;
- }
- m_assetCache.AddAsset(asset);
- m_inventoryCache.AddNewInventoryItem(this, packet.InventoryBlock.FolderID, asset);
+
}
#endregion
diff --git a/OpenSim/OpenSim.RegionServer/Grid.cs b/OpenSim/OpenSim.RegionServer/Grid.cs
index db5b8fe..0b8db4d 100644
--- a/OpenSim/OpenSim.RegionServer/Grid.cs
+++ b/OpenSim/OpenSim.RegionServer/Grid.cs
@@ -9,82 +9,6 @@ namespace OpenSim
{
public class Grid
{
- public IAssetServer AssetServer;
- public IGridServer GridServer;
- public IUserServer UserServer;
- public string AssetDll = "";
- public string GridDll = "";
-
- public Grid()
- {
- }
-
- public virtual void Initialise()
- {
- //load the dlls
- this.AssetServer = this.LoadAssetDll(this.AssetDll);
- this.GridServer = this.LoadGridDll(this.GridDll);
- }
- public virtual void Close()
- {
- this.AssetServer.Close();
- this.GridServer.Close();
- }
-
- private IAssetServer LoadAssetDll(string dllName)
- {
- Assembly pluginAssembly = Assembly.LoadFrom(dllName);
- IAssetServer server = null;
-
- foreach (Type pluginType in pluginAssembly.GetTypes())
- {
- if (pluginType.IsPublic)
- {
- if (!pluginType.IsAbstract)
- {
- Type typeInterface = pluginType.GetInterface("IAssetPlugin", true);
-
- if (typeInterface != null)
- {
- IAssetPlugin plug = (IAssetPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
- server = plug.GetAssetServer();
- break;
- }
-
- typeInterface = null;
- }
- }
- }
- pluginAssembly = null;
- return server;
- }
-
- private IGridServer LoadGridDll(string dllName)
- {
- Assembly pluginAssembly = Assembly.LoadFrom(dllName);
- IGridServer server = null;
-
- foreach (Type pluginType in pluginAssembly.GetTypes())
- {
- if (pluginType.IsPublic)
- {
- if (!pluginType.IsAbstract)
- {
- Type typeInterface = pluginType.GetInterface("IGridPlugin", true);
-
- if (typeInterface != null)
- {
- IGridPlugin plug = (IGridPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
- server = plug.GetGridServer();
- break;
- }
-
- typeInterface = null;
- }
- }
- }
- pluginAssembly = null;
- return server;
- }
+
}
}
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index f06e16a..08a9e4c 100644
--- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -1,4 +1,4 @@
-
+
Local
8.0.50727
@@ -6,7 +6,8 @@
{632E1BFD-0000-0000-0000-000000000000}
Debug
AnyCPU
-
+
+
OpenSim.RegionServer
@@ -15,9 +16,11 @@
IE50
false
Library
-
+
+
OpenSim.RegionServer
-
+
+
@@ -28,7 +31,8 @@
TRACE;DEBUG
-
+
+
True
4096
False
@@ -37,7 +41,8 @@
False
False
4
-
+
+
False
@@ -46,7 +51,8 @@
TRACE
-
+
+
False
4096
True
@@ -55,26 +61,28 @@
False
False
4
-
+
+
-
+
System.dll
False
-
+
+
System.Xml.dll
False
-
+
..\..\bin\libsecondlife.dll
False
-
+
..\..\bin\Axiom.MathLib.dll
False
-
+
..\..\bin\Db4objects.Db4o.dll
False
@@ -84,43 +92,43 @@
OpenSim.Terrain.BasicTerrain
{2270B8FE-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Framework
{8ACA2445-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Framework.Console
{A7CD0630-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.GenericConfig.Xml
{E88EF749-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Physics.Manager
{8BE16150-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Servers
{8BB20F0A-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
XMLRPC
{8E81D43C-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
@@ -136,6 +144,7 @@
Code
+
Code
@@ -255,4 +264,4 @@
-
+
\ No newline at end of file
diff --git a/OpenSim/OpenSim.RegionServer/PacketServer.cs b/OpenSim/OpenSim.RegionServer/PacketServer.cs
index 9c8f65c..6c6f4ca 100644
--- a/OpenSim/OpenSim.RegionServer/PacketServer.cs
+++ b/OpenSim/OpenSim.RegionServer/PacketServer.cs
@@ -56,10 +56,7 @@ namespace OpenSim
public virtual void RegisterClientPacketHandlers()
{
- if (this._localWorld != null)
- {
- ClientView.AddPacketHandler(PacketType.UUIDNameRequest, this.RequestUUIDName);
- }
+
}
#region Client Packet Handlers
diff --git a/OpenSim/OpenSim.RegionServer/RegionInfo.cs b/OpenSim/OpenSim.RegionServer/RegionInfo.cs
index f82495a..76f05b6 100644
--- a/OpenSim/OpenSim.RegionServer/RegionInfo.cs
+++ b/OpenSim/OpenSim.RegionServer/RegionInfo.cs
@@ -32,53 +32,6 @@ namespace OpenSim
}
- public void SaveToGrid()
- {
- //we really want to keep any server connection code out of here and out of the code code
- // and put it in the server connection classes (those inheriting from IGridServer etc)
- string reqtext;
- reqtext = "";
- reqtext += "" + this.GridSendKey + "";
- reqtext += "";
- reqtext += "" + this.SimUUID.ToString() + "";
- reqtext += "" + this.RegionName + "";
- reqtext += "" + this.IPListenAddr + "";
- reqtext += "" + this.IPListenPort.ToString() + "";
- reqtext += "" + this.RegionLocX.ToString() + "";
- reqtext += "" + this.RegionLocY.ToString() + "";
- reqtext += "1";
- reqtext += "";
- reqtext += "";
-
- byte[] reqdata = (new System.Text.ASCIIEncoding()).GetBytes(reqtext);
- string newpath = "";
- if (this.GridURL.EndsWith("/"))
- {
- newpath = this.GridURL + "sims/";
- }
- else
- {
- newpath = this.GridURL + "/sims/";
- }
-
- WebRequest GridSaveReq = WebRequest.Create(newpath + this.SimUUID.ToString());
- GridSaveReq.Method = "POST";
- GridSaveReq.ContentType = "application/x-www-form-urlencoded";
- GridSaveReq.ContentLength = reqdata.Length;
-
- Stream stOut = GridSaveReq.GetRequestStream();
- stOut.Write(reqdata, 0, reqdata.Length);
- stOut.Close();
-
- WebResponse gridresp = GridSaveReq.GetResponse();
- StreamReader stIn = new StreamReader(gridresp.GetResponseStream(), Encoding.ASCII);
- string GridResponse = stIn.ReadToEnd();
- stIn.Close();
- gridresp.Close();
-
- OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse);
- }
-
public void InitConfig(bool sandboxMode, IGenericConfig configData)
{
this.isSandbox = sandboxMode;
@@ -233,10 +186,7 @@ namespace OpenSim
}
this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
- if (!this.isSandbox)
- {
- this.SaveToGrid();
- }
+
configData.Commit();
}
catch (Exception e)
diff --git a/OpenSim/OpenSim.RegionServer/world/Avatar.cs b/OpenSim/OpenSim.RegionServer/world/Avatar.cs
index a95b65d..cca266b 100644
--- a/OpenSim/OpenSim.RegionServer/world/Avatar.cs
+++ b/OpenSim/OpenSim.RegionServer/world/Avatar.cs
@@ -90,21 +90,7 @@ namespace OpenSim.world
public void ChildStatusChange(bool status)
{
- Console.WriteLine("child agent status change");
- this.childAvatar = status;
-
- if (this.childAvatar == true)
- {
- this.StopMovement();
- }
- else
- {
- LLVector3 startp = ControllingClient.StartPos;
- lock (m_world.LockPhysicsEngine)
- {
- this._physActor.Position = new PhysicsVector(startp.X, startp.Y, startp.Z);
- }
- }
+
}
public override void addForces()
@@ -147,13 +133,12 @@ namespace OpenSim.world
public static void LoadAnims()
{
- Avatar.Animations = new AvatarAnimations();
- Avatar.Animations.LoadAnims();
+
}
public override void LandRenegerated()
{
- Pos = new LLVector3(100.0f, 100.0f, m_world.Terrain[(int)Pos.X, (int)Pos.Y] + 50.0f);
+
}
}
diff --git a/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs b/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs
index 4f32335..ee5a23a 100644
--- a/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs
+++ b/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs
@@ -87,42 +87,7 @@ namespace OpenSim.world
if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero)
{
//currently following code not used (or don't know of any case of destination being zero
- libsecondlife.LLUUID[] DeRezEnts;
- DeRezEnts = new libsecondlife.LLUUID[DeRezPacket.ObjectData.Length];
- int i = 0;
- foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
- {
-
- //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
- foreach (Entity ent in this.Entities.Values)
- {
- if (ent.localid == Data.ObjectLocalID)
- {
- DeRezEnts[i++] = ent.uuid;
- this.localStorage.RemovePrim(ent.uuid);
- KillObjectPacket kill = new KillObjectPacket();
- kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
- kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
- kill.ObjectData[0].ID = ent.localid;
- foreach (ClientView client in m_clientThreads.Values)
- {
- client.OutPacket(kill);
- }
- //Uncommenting this means an old UUID will be re-used, thus crashing the asset server
- //Uncomment when prim/object UUIDs are random or such
- //2007-03-22 - Randomskk
- //this._primCount--;
- OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Deleted UUID " + ent.uuid);
- }
- }
- }
- foreach (libsecondlife.LLUUID uuid in DeRezEnts)
- {
- lock (Entities)
- {
- Entities.Remove(uuid);
- }
- }
+
}
else
{
@@ -292,77 +257,5 @@ namespace OpenSim.world
}
}
}
-
- /*
- public void RequestMapBlock(ClientView simClient, int minX, int minY, int maxX, int maxY)
- {
- System.Text.Encoding _enc = System.Text.Encoding.ASCII;
- if (((m_regInfo.RegionLocX > minX) && (m_regInfo.RegionLocX < maxX)) && ((m_regInfo.RegionLocY > minY) && (m_regInfo.RegionLocY < maxY)))
- {
- MapBlockReplyPacket mapReply = new MapBlockReplyPacket();
- mapReply.AgentData.AgentID = simClient.AgentID;
- mapReply.AgentData.Flags = 0;
- mapReply.Data = new MapBlockReplyPacket.DataBlock[1];
- mapReply.Data[0] = new MapBlockReplyPacket.DataBlock();
- mapReply.Data[0].MapImageID = new LLUUID("00000000-0000-0000-9999-000000000007");
- mapReply.Data[0].X = (ushort)m_regInfo.RegionLocX;
- mapReply.Data[0].Y = (ushort)m_regInfo.RegionLocY;
- mapReply.Data[0].WaterHeight = (byte)m_regInfo.RegionWaterHeight;
- mapReply.Data[0].Name = _enc.GetBytes(this.m_regionName);
- mapReply.Data[0].RegionFlags = 72458694;
- mapReply.Data[0].Access = 13;
- mapReply.Data[0].Agents = 1; //should send number of clients connected
- simClient.OutPacket(mapReply);
- }
- }
- public bool RezObjectHandler(ClientView simClient, Packet packet)
- {
- RezObjectPacket rezPacket = (RezObjectPacket)packet;
- AgentInventory inven = this._inventoryCache.GetAgentsInventory(simClient.AgentID);
- if (inven != null)
- {
- if (inven.InventoryItems.ContainsKey(rezPacket.InventoryData.ItemID))
- {
- AssetBase asset = this._assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID);
- if (asset != null)
- {
- PrimData primd = new PrimData(asset.Data);
- Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
- nPrim.CreateFromStorage(primd, rezPacket.RezData.RayEnd, this._primCount, true);
- this.Entities.Add(nPrim.uuid, nPrim);
- this._primCount++;
- this._inventoryCache.DeleteInventoryItem(simClient, rezPacket.InventoryData.ItemID);
- }
- }
- }
- return true;
- }
- public bool ModifyTerrain(ClientView simClient, Packet packet)
- {
- ModifyLandPacket modify = (ModifyLandPacket)packet;
-
- switch (modify.ModifyBlock.Action)
- {
- case 1:
- // raise terrain
- if (modify.ParcelData.Length > 0)
- {
- Terrain.raise(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1);
- RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West);
- }
- break;
- case 2:
- //lower terrain
- if (modify.ParcelData.Length > 0)
- {
- Terrain.lower(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1);
- RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West);
- }
- break;
- }
- return true;
- }
- */
-
}
}
diff --git a/OpenSim/OpenSim.RegionServer/world/World.cs b/OpenSim/OpenSim.RegionServer/world/World.cs
index bb24011..ec9bbc9 100644
--- a/OpenSim/OpenSim.RegionServer/world/World.cs
+++ b/OpenSim/OpenSim.RegionServer/world/World.cs
@@ -548,6 +548,7 @@ namespace OpenSim.world
agentClient.OnUpdatePrimRotation += new ClientView.UpdatePrimRotation(this.UpdatePrimRotation);
agentClient.OnUpdatePrimScale += new ClientView.UpdatePrimVector(this.UpdatePrimScale);
agentClient.OnDeRezObject += new ClientView.GenericCall4(this.DeRezObject);
+
Avatar newAvatar = null;
try
{
--
cgit v1.1