The regionUUID is now being passed to the datastore calls.

afrisby
MW 2007-08-20 15:49:06 +00:00
parent 4af33c4da6
commit 31a81e17be
9 changed files with 65 additions and 34 deletions

View File

@ -41,7 +41,7 @@ using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Communications.Caches;
using Timer=System.Timers.Timer;
using Timer = System.Timers.Timer;
namespace OpenSim.Region.ClientStack
{
@ -84,7 +84,7 @@ namespace OpenSim.Region.ClientStack
private int probesWithNoIngressPackets = 0;
private int lastPacketsReceived = 0;
public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions )
public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions)
{
m_moneyBalance = 1000;
@ -96,7 +96,7 @@ namespace OpenSim.Region.ClientStack
// m_inventoryCache = inventoryCache;
m_authenticateSessionsHandler = authenSessions;
MainLog.Instance.Verbose( "OpenSimClient.cs - Started up new client thread to handle incoming request");
MainLog.Instance.Verbose("OpenSimClient.cs - Started up new client thread to handle incoming request");
cirpack = initialcirpack;
userEP = remoteEP;
@ -186,14 +186,15 @@ namespace OpenSim.Region.ClientStack
protected virtual void ClientLoop()
{
MainLog.Instance.Verbose( "OpenSimClient.cs:ClientLoop() - Entered loop");
MainLog.Instance.Verbose("OpenSimClient.cs:ClientLoop() - Entered loop");
while (true)
{
QueItem nextPacket = PacketQueue.Dequeue();
if (nextPacket.Incoming)
{
//is a incoming packet
if (nextPacket.Packet.Type != PacketType.AgentUpdate) {
if (nextPacket.Packet.Type != PacketType.AgentUpdate)
{
packetsReceived++;
}
ProcessInPacket(nextPacket.Packet);
@ -209,15 +210,21 @@ namespace OpenSim.Region.ClientStack
protected void CheckClientConnectivity(object sender, ElapsedEventArgs e)
{
if (packetsReceived == lastPacketsReceived) {
if (packetsReceived == lastPacketsReceived)
{
probesWithNoIngressPackets++;
if (probesWithNoIngressPackets > 30) {
if (probesWithNoIngressPackets > 30)
{
this.KillClient();
} else {
}
else
{
// this will normally trigger at least one packet (ping response)
SendStartPingCheck(0);
}
} else {
}
else
{
// Something received in the meantime - we can reset the counters
probesWithNoIngressPackets = 0;
lastPacketsReceived = packetsReceived;
@ -232,7 +239,7 @@ namespace OpenSim.Region.ClientStack
clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
clientPingTimer.Enabled = true;
MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to scene");
MainLog.Instance.Verbose("OpenSimClient.cs:InitNewClient() - Adding viewer agent to scene");
this.m_scene.AddNewClient(this, false);
}

View File

@ -47,10 +47,10 @@ namespace OpenSim.Region.Interfaces
/// <param name="dbname">The name of the database to store to (may not be applicable)</param>
void Initialise(string filename, string dbname);
void StoreObject(SceneObjectGroup obj);
void RemoveObject(LLUUID uuid);
void StoreObject(SceneObjectGroup obj, LLUUID regionUUID);
void RemoveObject(LLUUID uuid, LLUUID regionUUID);
List<SceneObjectGroup> LoadObjects();
List<SceneObjectGroup> LoadObjects(LLUUID regionUUID);
void StoreTerrain(double[,] terrain);
double[,] LoadTerrain();

View File

@ -270,7 +270,7 @@ namespace OpenSim.Region.Environment.Scenes
remoteClient.SendInventoryItemUpdate(item);
}
storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID);
storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID, m_regInfo.SimUUID);
((SceneObjectGroup)selectedEnt).DeleteGroup();
lock (Entities)

View File

@ -180,6 +180,8 @@ namespace OpenSim.Region.Environment.Scenes
ScenePresence.LoadAnims();
httpListener = httpServer;
}
#endregion
@ -497,7 +499,7 @@ namespace OpenSim.Region.Environment.Scenes
public void LoadPrimsFromStorage()
{
MainLog.Instance.Verbose("Loading objects from datastore");
List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects();
List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(this.m_regInfo.SimUUID);
foreach (SceneObjectGroup prim in PrimsFromDB)
{
AddEntityFromStorage(prim);
@ -919,9 +921,7 @@ namespace OpenSim.Region.Environment.Scenes
if (agent.CapsPath != "")
{
//Console.WriteLine("new user, so creating caps handler for it");
Caps cap =
new Caps(assetCache, httpListener, m_regInfo.ExternalHostName, m_regInfo.ExternalEndPoint.Port,
agent.CapsPath, agent.AgentID);
Caps cap = new Caps(assetCache, httpListener, m_regInfo.ExternalHostName, m_regInfo.ExternalEndPoint.Port, agent.CapsPath, agent.AgentID);
Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + "/CAPS/" + agent.CapsPath + "0000/");
cap.RegisterHandlers();
cap.AddNewInventoryItem = this.AddInventoryItem;

View File

@ -436,12 +436,26 @@ namespace OpenSim.Region.Environment.Scenes
linkPart.SetParent(this);
//TODO: rest of parts
foreach (SceneObjectPart part in objectGroup.Children.Values)
{
if (part.UUID != objectGroup.m_rootPart.UUID)
{
this.LinkNonRootPart(part);
}
}
m_scene.EventManager.OnBackup -= objectGroup.ProcessBackup;
m_scene.DeleteEntity(objectGroup.UUID);
this.ScheduleGroupForFullUpdate();
}
private void LinkNonRootPart(SceneObjectPart part)
{
part.SetParent(this);
part.ParentID = this.m_rootPart.LocalID;
this.m_parts.Add(part.UUID, part);
}
/// <summary>
///
/// </summary>
@ -812,7 +826,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="datastore"></param>
public void ProcessBackup(OpenSim.Region.Interfaces.IRegionDataStore datastore)
{
datastore.StoreObject(this);
datastore.StoreObject(this, m_scene.RegionInfo.SimUUID);
}
#endregion

View File

@ -496,6 +496,16 @@ namespace OpenSim.Region.Environment.Scenes
this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
this.ControllingClient.SendViewerTime(this.m_scene.TimePhase);
//Please don't remove the following code (at least not yet), just leave it commented out
//gives the user god powers, should help with debuging things in the future
/*
GrantGodlikePowersPacket grant = new GrantGodlikePowersPacket();
grant.AgentData.AgentID = this.ControllingClient.AgentId;
grant.AgentData.SessionID = this.ControllingClient.SessionId;
grant.GrantData.GodLevel = 255;
grant.GrantData.Token = LLUUID.Random();
this.ControllingClient.OutPacket(grant);*/
}
/// <summary>

View File

@ -43,12 +43,12 @@ namespace OpenSim.DataStore.DB4oStorage
return;
}
public void StoreObject(SceneObjectGroup obj)
public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
{
db.Set(obj);
}
public void RemoveObject(LLUUID obj)
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{
IObjectSet result = db.Query(new SceneObjectQuery(obj));
if (result.Count > 0)
@ -58,7 +58,7 @@ namespace OpenSim.DataStore.DB4oStorage
}
}
public List<SceneObjectGroup> LoadObjects()
public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
{
IObjectSet result = db.Get(typeof(SceneObjectGroup));
List<SceneObjectGroup> retvals = new List<SceneObjectGroup>();

View File

@ -485,7 +485,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage
}
}
public void StoreObject(SceneObjectGroup obj)
public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
{
foreach (SceneObjectPart prim in obj.Children.Values)
{
@ -498,7 +498,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage
// MainLog.Instance.Verbose("Dump of prims:", ds.GetXml());
}
public void RemoveObject(LLUUID obj)
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{
DataTable prims = ds.Tables["prims"];
DataTable shapes = ds.Tables["primshapes"];
@ -520,7 +520,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage
shapeDa.Update(ds, "primshapes");
}
public List<SceneObjectGroup> LoadObjects()
public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
{
Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>();
List<SceneObjectGroup> retvals = new List<SceneObjectGroup>();

View File

@ -18,17 +18,17 @@ namespace OpenSim.DataStore.NullStorage
return;
}
public void StoreObject(SceneObjectGroup obj)
public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
{
}
public void RemoveObject(LLUUID obj)
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{
}
public List<SceneObjectGroup> LoadObjects()
public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
{
return new List<SceneObjectGroup>();
}