mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -211,7 +211,17 @@ namespace OpenSim
|
||||
else
|
||||
{
|
||||
string basepath = Path.GetFullPath(Util.configDir());
|
||||
string path = Path.Combine(basepath, file);
|
||||
// Resolve relative paths with wildcards
|
||||
string chunkWithoutWildcards = file;
|
||||
string chunkWithWildcards = string.Empty;
|
||||
int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' });
|
||||
if (wildcardIndex != -1)
|
||||
{
|
||||
chunkWithoutWildcards = file.Substring(0, wildcardIndex);
|
||||
chunkWithWildcards = file.Substring(wildcardIndex);
|
||||
}
|
||||
string path = Path.Combine(basepath, chunkWithoutWildcards);
|
||||
path = Path.GetFullPath(path) + chunkWithWildcards;
|
||||
string[] paths = Util.Glob(path);
|
||||
foreach (string p in paths)
|
||||
{
|
||||
|
||||
@@ -418,7 +418,7 @@ namespace OpenSim
|
||||
{
|
||||
MainConsole.Instance.Output(
|
||||
String.Format(
|
||||
"Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}",
|
||||
"Kicking user: {0,-16} {1,-16} {2,-37} in region: {3,-16}",
|
||||
presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName));
|
||||
|
||||
// kick client...
|
||||
@@ -530,7 +530,10 @@ namespace OpenSim
|
||||
regionFile = cmd[3];
|
||||
|
||||
IScene scene;
|
||||
CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene);
|
||||
RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source);
|
||||
PopulateRegionEstateInfo(regInfo);
|
||||
CreateRegion(regInfo, true, out scene);
|
||||
regInfo.EstateSettings.Save();
|
||||
}
|
||||
else if (cmd[3].EndsWith(".ini"))
|
||||
{
|
||||
@@ -541,7 +544,10 @@ namespace OpenSim
|
||||
regionFile = cmd[3];
|
||||
|
||||
IScene scene;
|
||||
CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]), true, out scene);
|
||||
RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]);
|
||||
PopulateRegionEstateInfo(regInfo);
|
||||
CreateRegion(regInfo, true, out scene);
|
||||
regInfo.EstateSettings.Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -861,7 +867,7 @@ namespace OpenSim
|
||||
MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count));
|
||||
|
||||
MainConsole.Instance.Output(
|
||||
String.Format("{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}", "Firstname", "Lastname",
|
||||
String.Format("{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", "Firstname", "Lastname",
|
||||
"Agent ID", "Root/Child", "Region", "Position"));
|
||||
|
||||
foreach (ScenePresence presence in agents)
|
||||
@@ -880,7 +886,7 @@ namespace OpenSim
|
||||
|
||||
MainConsole.Instance.Output(
|
||||
String.Format(
|
||||
"{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}",
|
||||
"{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}",
|
||||
presence.Firstname,
|
||||
presence.Lastname,
|
||||
presence.UUID,
|
||||
|
||||
@@ -395,9 +395,13 @@ namespace OpenSim
|
||||
scene.SnmpService.BootInfo("Creating region texture", scene);
|
||||
}
|
||||
|
||||
// moved these here as the terrain texture has to be created after the modules are initialized
|
||||
// moved these here as the map texture has to be created after the modules are initialized
|
||||
// and has to happen before the region is registered with the grid.
|
||||
scene.CreateTerrainTexture();
|
||||
IWorldMapModule mapModule = scene.RequestModuleInterface<IWorldMapModule>();
|
||||
if (mapModule != null)
|
||||
mapModule.GenerateMaptile();
|
||||
else
|
||||
m_log.WarnFormat("[STARTUP]: No map module available to generate map tile");
|
||||
|
||||
// TODO : Try setting resource for region xstats here on scene
|
||||
MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
|
||||
@@ -867,6 +871,60 @@ namespace OpenSim
|
||||
{
|
||||
regionnum = m_sceneManager.Scenes.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the estate information for the provided RegionInfo object.
|
||||
/// </summary>
|
||||
/// <param name="regInfo">
|
||||
/// A <see cref="RegionInfo"/>
|
||||
/// </param>
|
||||
public void PopulateRegionEstateInfo(RegionInfo regInfo)
|
||||
{
|
||||
if (m_storageManager.EstateDataStore != null)
|
||||
{
|
||||
regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, false);
|
||||
}
|
||||
|
||||
if (regInfo.EstateSettings.EstateID == 0) // No record at all
|
||||
{
|
||||
MainConsole.Instance.Output("Your region is not part of an estate.");
|
||||
while (true)
|
||||
{
|
||||
string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() {"yes", "no"});
|
||||
if (response == "no")
|
||||
{
|
||||
// Create a new estate
|
||||
regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, true);
|
||||
|
||||
regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
|
||||
//regInfo.EstateSettings.Save();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
response = MainConsole.Instance.CmdPrompt("Estate name to join", "None");
|
||||
if (response == "None")
|
||||
continue;
|
||||
|
||||
List<int> estateIDs = m_storageManager.EstateDataStore.GetEstates(response);
|
||||
if (estateIDs.Count < 1)
|
||||
{
|
||||
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
|
||||
continue;
|
||||
}
|
||||
|
||||
int estateID = estateIDs[0];
|
||||
|
||||
regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID);
|
||||
|
||||
if (m_storageManager.EstateDataStore.LinkRegion(regInfo.RegionID, estateID))
|
||||
break;
|
||||
|
||||
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1442,16 +1442,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public void SendTeleportLocationStart()
|
||||
public void SendTeleportStart(uint flags)
|
||||
{
|
||||
//TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart);
|
||||
TeleportStartPacket tpStart = new TeleportStartPacket();
|
||||
tpStart.Info.TeleportFlags = 16; // Teleport via location
|
||||
TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart);
|
||||
//TeleportStartPacket tpStart = new TeleportStartPacket();
|
||||
tpStart.Info.TeleportFlags = flags; //16; // Teleport via location
|
||||
|
||||
// Hack to get this out immediately and skip throttles
|
||||
OutPacket(tpStart, ThrottleOutPacketType.Unknown);
|
||||
}
|
||||
|
||||
public void SendTeleportProgress(uint flags, string message)
|
||||
{
|
||||
TeleportProgressPacket tpProgress = (TeleportProgressPacket)PacketPool.Instance.GetPacket(PacketType.TeleportProgress);
|
||||
tpProgress.AgentData.AgentID = this.AgentId;
|
||||
tpProgress.Info.TeleportFlags = flags;
|
||||
tpProgress.Info.Message = Util.StringToBytes256(message);
|
||||
|
||||
// Hack to get this out immediately and skip throttles
|
||||
OutPacket(tpProgress, ThrottleOutPacketType.Unknown);
|
||||
}
|
||||
|
||||
public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance)
|
||||
{
|
||||
MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply);
|
||||
@@ -3041,7 +3052,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
OSDMap GroupDataMap = new OSDMap(6);
|
||||
OSDMap NewGroupDataMap = new OSDMap(1);
|
||||
GroupDataMap.Add("GroupPowers", OSD.FromBinary(m.GroupPowers));
|
||||
GroupDataMap.Add("GroupPowers", OSD.FromULong(m.GroupPowers));
|
||||
GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(m.AcceptNotices));
|
||||
GroupDataMap.Add("GroupTitle", OSD.FromString(m.GroupTitle));
|
||||
GroupDataMap.Add("GroupID", OSD.FromUUID(m.GroupID));
|
||||
@@ -6332,7 +6343,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
#endregion
|
||||
|
||||
ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData;
|
||||
// ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData;
|
||||
|
||||
ObjectDuplicate handlerObjectDuplicate = null;
|
||||
|
||||
@@ -11765,8 +11776,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("[");
|
||||
if (this.priority != null)
|
||||
sb.Append(this.priority.ToString());
|
||||
sb.Append(this.priority.ToString());
|
||||
sb.Append(",");
|
||||
if (this.value != null)
|
||||
sb.Append(this.value.ToString());
|
||||
|
||||
@@ -58,6 +58,11 @@ namespace OpenSim.Region.ClientStack
|
||||
|
||||
protected StorageManager m_storageManager;
|
||||
|
||||
public StorageManager StorageManager
|
||||
{
|
||||
get { return m_storageManager; }
|
||||
}
|
||||
|
||||
protected ClientStackManager m_clientStackManager;
|
||||
|
||||
public SceneManager SceneManager
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
{
|
||||
string deadAvatarMessage;
|
||||
ScenePresence killingAvatar = null;
|
||||
string killingAvatarMessage;
|
||||
// string killingAvatarMessage;
|
||||
|
||||
if (killerObjectLocalID == 0)
|
||||
deadAvatarMessage = "You committed suicide!";
|
||||
@@ -118,14 +118,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
deadAvatarMessage = String.Format("You impaled yourself on {0} owned by {1}!", part.Name, deadAvatar.Scene.GetUserName(part.OwnerID));
|
||||
else
|
||||
{
|
||||
killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name);
|
||||
// killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name);
|
||||
deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name);
|
||||
// killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name);
|
||||
deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnClientClosed += ClientLoggedOut;
|
||||
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
@@ -98,9 +99,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
||||
scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
@@ -108,6 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
||||
scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
|
||||
m_Scenelist.Remove(scene);
|
||||
}
|
||||
|
||||
@@ -136,6 +138,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
// Inventory giving is conducted via instant message
|
||||
client.OnInstantMessage += OnInstantMessage;
|
||||
}
|
||||
|
||||
protected void OnSetRootAgentScene(UUID id, Scene scene)
|
||||
{
|
||||
m_AgentRegions[id] = scene;
|
||||
}
|
||||
|
||||
private Scene FindClientScene(UUID agentId)
|
||||
{
|
||||
@@ -160,7 +167,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
if (scene == null) // Something seriously wrong here.
|
||||
return;
|
||||
|
||||
|
||||
if (im.dialog == (byte) InstantMessageDialog.InventoryOffered)
|
||||
{
|
||||
//m_log.DebugFormat("Asset type {0}", ((AssetType)im.binaryBucket[0]));
|
||||
@@ -348,11 +354,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
}
|
||||
}
|
||||
|
||||
public void SetRootAgentScene(UUID agentID, Scene scene)
|
||||
{
|
||||
m_AgentRegions[agentID] = scene;
|
||||
}
|
||||
|
||||
public bool NeedSceneCacheClear(UUID agentID, Scene scene)
|
||||
{
|
||||
if (!m_AgentRegions.ContainsKey(agentID))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -174,9 +174,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
position.Z = newPosZ;
|
||||
}
|
||||
|
||||
// Only send this if the event queue is null
|
||||
if (eq == null)
|
||||
sp.ControllingClient.SendTeleportLocationStart();
|
||||
sp.ControllingClient.SendTeleportStart(teleportFlags);
|
||||
|
||||
sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
|
||||
sp.Teleport(position);
|
||||
@@ -257,9 +255,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
ulong destinationHandle = finalDestination.RegionHandle;
|
||||
|
||||
if (eq == null)
|
||||
sp.ControllingClient.SendTeleportLocationStart();
|
||||
|
||||
// Let's do DNS resolution only once in this process, please!
|
||||
// This may be a costly operation. The reg.ExternalEndPoint field is not a passive field,
|
||||
// it's actually doing a lot of work.
|
||||
@@ -277,6 +272,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return;
|
||||
}
|
||||
|
||||
sp.ControllingClient.SendTeleportStart(teleportFlags);
|
||||
|
||||
// the avatar.Close below will clear the child region list. We need this below for (possibly)
|
||||
// closing the child agents, so save it here (we need a copy as it is Clear()-ed).
|
||||
//List<ulong> childRegions = new List<ulong>(avatar.GetKnownRegionList());
|
||||
@@ -307,7 +304,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
string reason = String.Empty;
|
||||
|
||||
// Let's create an agent there if one doesn't exist yet.
|
||||
if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason))
|
||||
bool logout = false;
|
||||
if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
|
||||
{
|
||||
sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}",
|
||||
reason));
|
||||
@@ -319,6 +317,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
{
|
||||
//sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
|
||||
|
||||
#region IP Translation for NAT
|
||||
IClientIPEndpoint ipepClient;
|
||||
if (sp.ClientView.TryGet(out ipepClient))
|
||||
@@ -396,6 +396,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
agent.Position = position;
|
||||
SetCallbackURL(agent, sp.Scene.RegionInfo);
|
||||
|
||||
//sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent...");
|
||||
|
||||
if (!UpdateAgent(reg, finalDestination, agent))
|
||||
{
|
||||
// Region doesn't take it
|
||||
@@ -434,8 +436,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
|
||||
CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
|
||||
|
||||
// Well, this is it. The agent is over there.
|
||||
|
||||
KillEntity(sp.Scene, sp.LocalId);
|
||||
|
||||
// May need to logout or other cleanup
|
||||
AgentHasMovedAway(sp.ControllingClient.SessionId, logout);
|
||||
|
||||
// Now let's make it officially a child agent
|
||||
sp.MakeChildAgent();
|
||||
|
||||
@@ -483,8 +490,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
}
|
||||
|
||||
protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason)
|
||||
protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
|
||||
{
|
||||
logout = false;
|
||||
return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
|
||||
}
|
||||
|
||||
@@ -500,6 +508,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
}
|
||||
|
||||
protected virtual void AgentHasMovedAway(UUID sessionID, bool logout)
|
||||
{
|
||||
}
|
||||
|
||||
protected void KillEntity(Scene scene, uint localID)
|
||||
{
|
||||
scene.SendKillObject(localID);
|
||||
@@ -1286,18 +1298,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return handles;
|
||||
}
|
||||
|
||||
private void Dump(string msg, List<ulong> handles)
|
||||
{
|
||||
m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg);
|
||||
foreach (ulong handle in handles)
|
||||
{
|
||||
uint x, y;
|
||||
Utils.LongToUInts(handle, out x, out y);
|
||||
x = x / Constants.RegionSize;
|
||||
y = y / Constants.RegionSize;
|
||||
m_log.InfoFormat("({0}, {1})", x, y);
|
||||
}
|
||||
}
|
||||
// private void Dump(string msg, List<ulong> handles)
|
||||
// {
|
||||
// m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg);
|
||||
// foreach (ulong handle in handles)
|
||||
// {
|
||||
// uint x, y;
|
||||
// Utils.LongToUInts(handle, out x, out y);
|
||||
// x = x / Constants.RegionSize;
|
||||
// y = y / Constants.RegionSize;
|
||||
// m_log.InfoFormat("({0}, {1})", x, y);
|
||||
// }
|
||||
// }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -140,9 +140,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason)
|
||||
protected override void AgentHasMovedAway(UUID sessionID, bool logout)
|
||||
{
|
||||
if (logout)
|
||||
// Log them out of this grid
|
||||
m_aScene.PresenceService.LogoutAgent(sessionID);
|
||||
}
|
||||
|
||||
protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
|
||||
{
|
||||
reason = string.Empty;
|
||||
logout = false;
|
||||
int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
|
||||
if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
||||
{
|
||||
@@ -152,9 +160,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString();
|
||||
IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver);
|
||||
bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason);
|
||||
if (success)
|
||||
// Log them out of this grid
|
||||
m_aScene.PresenceService.LogoutAgent(agentCircuit.SessionID);
|
||||
logout = success; // flag for later logout from this grid; this is an HG TP
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -54,12 +54,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
|
||||
}
|
||||
|
||||
private static byte[] uintToByteArray(uint uIntValue)
|
||||
{
|
||||
byte[] resultbytes = Utils.UIntToBytes(uIntValue);
|
||||
if (BitConverter.IsLittleEndian)
|
||||
Array.Reverse(resultbytes);
|
||||
|
||||
return resultbytes;
|
||||
{
|
||||
byte[] result = new byte[4];
|
||||
Utils.UIntToBytesBig(uIntValue, result, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static OSD buildEvent(string eventName, OSD eventBody)
|
||||
@@ -160,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
|
||||
info.Add("SimAccess", OSD.FromInteger(simAccess));
|
||||
info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes()));
|
||||
info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port));
|
||||
info.Add("TeleportFlags", OSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation
|
||||
info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation
|
||||
|
||||
OSDArray infoArr = new OSDArray();
|
||||
infoArr.Add(info);
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
try
|
||||
{
|
||||
asset1.ID = url + "/" + asset.ID;
|
||||
UUID temp = UUID.Zero;
|
||||
// UUID temp = UUID.Zero;
|
||||
// TODO: if the creator is local, stick this grid's URL in front
|
||||
//if (UUID.TryParse(asset.Metadata.CreatorID, out temp))
|
||||
// asset1.Metadata.CreatorID = ??? + "/" + asset.Metadata.CreatorID;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
get { return m_assMapper; }
|
||||
}
|
||||
|
||||
private bool m_Initialized = false;
|
||||
// private bool m_Initialized = false;
|
||||
|
||||
#region INonSharedRegionModule
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -572,7 +572,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
if (attachment)
|
||||
{
|
||||
group.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom;
|
||||
group.RootPart.Flags |= PrimFlags.Phantom;
|
||||
group.RootPart.IsAttachment = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library
|
||||
private static bool m_HasRunOnce = false;
|
||||
|
||||
private bool m_Enabled = false;
|
||||
private string m_LibraryName = "OpenSim Library";
|
||||
// private string m_LibraryName = "OpenSim Library";
|
||||
private Scene m_Scene;
|
||||
|
||||
private ILibraryService m_Library;
|
||||
@@ -212,13 +212,13 @@ namespace OpenSim.Region.CoreModules.Framework.Library
|
||||
}
|
||||
}
|
||||
|
||||
private void DumpLibrary()
|
||||
{
|
||||
InventoryFolderImpl lib = m_Library.LibraryRootFolder;
|
||||
|
||||
m_log.DebugFormat(" - folder {0}", lib.Name);
|
||||
DumpFolder(lib);
|
||||
}
|
||||
// private void DumpLibrary()
|
||||
// {
|
||||
// InventoryFolderImpl lib = m_Library.LibraryRootFolder;
|
||||
//
|
||||
// m_log.DebugFormat(" - folder {0}", lib.Name);
|
||||
// DumpFolder(lib);
|
||||
// }
|
||||
//
|
||||
// private void DumpLibrary()
|
||||
// {
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BinaryLoggingModule")]
|
||||
public class BinaryLoggingModule : INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected bool m_collectStats;
|
||||
protected Scene m_scene = null;
|
||||
|
||||
public string Name { get { return "Binary Statistics Logging Module"; } }
|
||||
public Type ReplaceableInterface { get { return null; } }
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
try
|
||||
{
|
||||
IConfig statConfig = source.Configs["Statistics.Binary"];
|
||||
if (statConfig.Contains("enabled") && statConfig.GetBoolean("enabled"))
|
||||
{
|
||||
if (statConfig.Contains("collect_region_stats"))
|
||||
{
|
||||
if (statConfig.GetBoolean("collect_region_stats"))
|
||||
{
|
||||
m_collectStats = true;
|
||||
}
|
||||
}
|
||||
if (statConfig.Contains("region_stats_period_seconds"))
|
||||
{
|
||||
m_statLogPeriod = TimeSpan.FromSeconds(statConfig.GetInt("region_stats_period_seconds"));
|
||||
}
|
||||
if (statConfig.Contains("stats_dir"))
|
||||
{
|
||||
m_statsDir = statConfig.GetString("stats_dir");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// if it doesn't work, we don't collect anything
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (m_collectStats)
|
||||
m_scene.StatsReporter.OnSendStatsResult += LogSimStats;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
public class StatLogger
|
||||
{
|
||||
public DateTime StartTime;
|
||||
public string Path;
|
||||
public System.IO.BinaryWriter Log;
|
||||
}
|
||||
|
||||
static StatLogger m_statLog = null;
|
||||
static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300);
|
||||
static string m_statsDir = String.Empty;
|
||||
static Object m_statLockObject = new Object();
|
||||
|
||||
private void LogSimStats(SimStats stats)
|
||||
{
|
||||
SimStatsPacket pack = new SimStatsPacket();
|
||||
pack.Region = new SimStatsPacket.RegionBlock();
|
||||
pack.Region.RegionX = stats.RegionX;
|
||||
pack.Region.RegionY = stats.RegionY;
|
||||
pack.Region.RegionFlags = stats.RegionFlags;
|
||||
pack.Region.ObjectCapacity = stats.ObjectCapacity;
|
||||
//pack.Region = //stats.RegionBlock;
|
||||
pack.Stat = stats.StatsBlock;
|
||||
pack.Header.Reliable = false;
|
||||
|
||||
// note that we are inside the reporter lock when called
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
// hide some time information into the packet
|
||||
pack.Header.Sequence = (uint)now.Ticks;
|
||||
|
||||
lock (m_statLockObject) // m_statLog is shared so make sure there is only executer here
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m_statLog == null || now > m_statLog.StartTime + m_statLogPeriod)
|
||||
{
|
||||
// First log file or time has expired, start writing to a new log file
|
||||
if (m_statLog != null && m_statLog.Log != null)
|
||||
{
|
||||
m_statLog.Log.Close();
|
||||
}
|
||||
m_statLog = new StatLogger();
|
||||
m_statLog.StartTime = now;
|
||||
m_statLog.Path = (m_statsDir.Length > 0 ? m_statsDir + System.IO.Path.DirectorySeparatorChar.ToString() : "")
|
||||
+ String.Format("stats-{0}.log", now.ToString("yyyyMMddHHmmss"));
|
||||
m_statLog.Log = new BinaryWriter(File.Open(m_statLog.Path, FileMode.Append, FileAccess.Write));
|
||||
}
|
||||
|
||||
// Write the serialized data to disk
|
||||
if (m_statLog != null && m_statLog.Log != null)
|
||||
m_statLog.Log.Write(pack.ToBytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.Error("statistics gathering failed: " + ex.Message, ex);
|
||||
if (m_statLog != null && m_statLog.Log != null)
|
||||
{
|
||||
m_statLog.Log.Close();
|
||||
}
|
||||
m_statLog = null;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||
private string httpsCN = "";
|
||||
private bool httpSSL = false;
|
||||
private uint httpsslport = 0;
|
||||
private bool GridMode = false;
|
||||
// private bool GridMode = false;
|
||||
|
||||
#region IRegionModule Members
|
||||
|
||||
@@ -126,10 +126,10 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||
|
||||
}
|
||||
|
||||
if (startupcfg != null)
|
||||
{
|
||||
GridMode = enabled = startupcfg.GetBoolean("gridmode", false);
|
||||
}
|
||||
// if (startupcfg != null)
|
||||
// {
|
||||
// GridMode = enabled = startupcfg.GetBoolean("gridmode", false);
|
||||
// }
|
||||
|
||||
if (cfg != null)
|
||||
{
|
||||
@@ -1213,18 +1213,19 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||
}
|
||||
}
|
||||
|
||||
private string CreateRandomStr(int len)
|
||||
{
|
||||
Random rnd = new Random(Environment.TickCount);
|
||||
string returnstring = "";
|
||||
string chars = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
returnstring += chars.Substring(rnd.Next(chars.Length), 1);
|
||||
}
|
||||
return returnstring;
|
||||
}
|
||||
// private string CreateRandomStr(int len)
|
||||
// {
|
||||
// Random rnd = new Random(Environment.TickCount);
|
||||
// string returnstring = "";
|
||||
// string chars = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
//
|
||||
// for (int i = 0; i < len; i++)
|
||||
// {
|
||||
// returnstring += chars.Substring(rnd.Next(chars.Length), 1);
|
||||
// }
|
||||
// return returnstring;
|
||||
// }
|
||||
|
||||
// Temporary hack to allow teleporting to and from Vaak
|
||||
private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,6 @@ using System.Reflection;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Statistics;
|
||||
|
||||
using OpenSim.Services.Connectors;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
@@ -48,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
|
||||
private bool m_Enabled = false;
|
||||
private bool m_Initialized = false;
|
||||
private Scene m_Scene;
|
||||
// private Scene m_Scene;
|
||||
private InventoryServicesConnector m_RemoteConnector;
|
||||
|
||||
public Type ReplaceableInterface
|
||||
@@ -105,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_Scene = scene;
|
||||
// m_Scene = scene;
|
||||
//m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName);
|
||||
|
||||
if (!m_Enabled)
|
||||
|
||||
@@ -32,7 +32,6 @@ using System.Reflection;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Statistics;
|
||||
|
||||
using OpenSim.Services.Connectors;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
@@ -48,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
|
||||
private bool m_Enabled = false;
|
||||
private bool m_Initialized = false;
|
||||
private Scene m_Scene;
|
||||
// private Scene m_Scene;
|
||||
private XInventoryServicesConnector m_RemoteConnector;
|
||||
|
||||
public Type ReplaceableInterface
|
||||
@@ -109,7 +108,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_Scene = scene;
|
||||
// m_Scene = scene;
|
||||
//m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName);
|
||||
|
||||
if (!m_Enabled)
|
||||
|
||||
@@ -345,7 +345,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
if (!s.IsChildAgent)
|
||||
{
|
||||
s.ControllingClient.SendTeleportLocationStart();
|
||||
m_scene.TeleportClientHome(user, s.ControllingClient);
|
||||
}
|
||||
}
|
||||
@@ -480,7 +479,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
ScenePresence s = m_scene.GetScenePresence(prey);
|
||||
if (s != null)
|
||||
{
|
||||
s.ControllingClient.SendTeleportLocationStart();
|
||||
m_scene.TeleportClientHome(prey, s.ControllingClient);
|
||||
}
|
||||
}
|
||||
@@ -500,7 +498,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
// Also make sure they are actually in the region
|
||||
if (p != null && !p.IsChildAgent)
|
||||
{
|
||||
p.ControllingClient.SendTeleportLocationStart();
|
||||
m_scene.TeleportClientHome(p.UUID, p.ControllingClient);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,12 +147,12 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
}
|
||||
|
||||
private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason)
|
||||
{
|
||||
ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y);
|
||||
reason = "You are not allowed to enter this sim.";
|
||||
return nearestParcel != null;
|
||||
}
|
||||
// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason)
|
||||
// {
|
||||
// ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y);
|
||||
// reason = "You are not allowed to enter this sim.";
|
||||
// return nearestParcel != null;
|
||||
// }
|
||||
|
||||
void EventManagerOnNewClient(IClientAPI client)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Scenes.Serialization;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.World.Objects.BuySell
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BuySellModule")]
|
||||
public class BuySellModule : IBuySellModule, INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected Scene m_scene = null;
|
||||
protected IDialogModule m_dialogModule;
|
||||
|
||||
public string Name { get { return "Object BuySell Module"; } }
|
||||
public Type ReplaceableInterface { get { return null; } }
|
||||
|
||||
public void Initialise(IConfigSource source) {}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<IBuySellModule>(this);
|
||||
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
m_dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
RemoveRegion(m_scene);
|
||||
}
|
||||
|
||||
public void SubscribeToClientEvents(IClientAPI client)
|
||||
{
|
||||
client.OnObjectSaleInfo += ObjectSaleInfo;
|
||||
}
|
||||
|
||||
protected void ObjectSaleInfo(
|
||||
IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice)
|
||||
{
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
|
||||
if (part == null || part.ParentGroup == null)
|
||||
return;
|
||||
|
||||
if (part.ParentGroup.IsDeleted)
|
||||
return;
|
||||
|
||||
part = part.ParentGroup.RootPart;
|
||||
|
||||
part.ObjectSaleType = saleType;
|
||||
part.SalePrice = salePrice;
|
||||
|
||||
part.ParentGroup.HasGroupChanged = true;
|
||||
|
||||
part.GetProperties(client);
|
||||
}
|
||||
|
||||
public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType)
|
||||
{
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
|
||||
|
||||
if (part == null)
|
||||
return false;
|
||||
|
||||
if (part.ParentGroup == null)
|
||||
return false;
|
||||
|
||||
SceneObjectGroup group = part.ParentGroup;
|
||||
|
||||
switch (saleType)
|
||||
{
|
||||
case 1: // Sell as original (in-place sale)
|
||||
uint effectivePerms = group.GetEffectivePermissions();
|
||||
|
||||
if ((effectivePerms & (uint)PermissionMask.Transfer) == 0)
|
||||
{
|
||||
if (m_dialogModule != null)
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
|
||||
return false;
|
||||
}
|
||||
|
||||
group.SetOwnerId(remoteClient.AgentId);
|
||||
group.SetRootPartOwner(part, remoteClient.AgentId, remoteClient.ActiveGroupId);
|
||||
|
||||
List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
|
||||
|
||||
if (m_scene.Permissions.PropagatePermissions())
|
||||
{
|
||||
foreach (SceneObjectPart child in partList)
|
||||
{
|
||||
child.Inventory.ChangeInventoryOwner(remoteClient.AgentId);
|
||||
child.TriggerScriptChangedEvent(Changed.OWNER);
|
||||
child.ApplyNextOwnerPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
part.ObjectSaleType = 0;
|
||||
part.SalePrice = 10;
|
||||
|
||||
group.HasGroupChanged = true;
|
||||
part.GetProperties(remoteClient);
|
||||
part.TriggerScriptChangedEvent(Changed.OWNER);
|
||||
group.ResumeScripts();
|
||||
part.ScheduleFullUpdate();
|
||||
|
||||
break;
|
||||
|
||||
case 2: // Sell a copy
|
||||
Vector3 inventoryStoredPosition = new Vector3
|
||||
(((group.AbsolutePosition.X > (int)Constants.RegionSize)
|
||||
? 250
|
||||
: group.AbsolutePosition.X)
|
||||
,
|
||||
(group.AbsolutePosition.X > (int)Constants.RegionSize)
|
||||
? 250
|
||||
: group.AbsolutePosition.X,
|
||||
group.AbsolutePosition.Z);
|
||||
|
||||
Vector3 originalPosition = group.AbsolutePosition;
|
||||
|
||||
group.AbsolutePosition = inventoryStoredPosition;
|
||||
|
||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
|
||||
group.AbsolutePosition = originalPosition;
|
||||
|
||||
uint perms = group.GetEffectivePermissions();
|
||||
|
||||
if ((perms & (uint)PermissionMask.Transfer) == 0)
|
||||
{
|
||||
if (m_dialogModule != null)
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
|
||||
return false;
|
||||
}
|
||||
|
||||
AssetBase asset = m_scene.CreateAsset(
|
||||
group.GetPartName(localID),
|
||||
group.GetPartDescription(localID),
|
||||
(sbyte)AssetType.Object,
|
||||
Utils.StringToBytes(sceneObjectXml),
|
||||
group.OwnerID);
|
||||
m_scene.AssetService.Store(asset);
|
||||
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
item.CreatorId = part.CreatorID.ToString();
|
||||
|
||||
item.ID = UUID.Random();
|
||||
item.Owner = remoteClient.AgentId;
|
||||
item.AssetID = asset.FullID;
|
||||
item.Description = asset.Description;
|
||||
item.Name = asset.Name;
|
||||
item.AssetType = asset.Type;
|
||||
item.InvType = (int)InventoryType.Object;
|
||||
item.Folder = categoryID;
|
||||
|
||||
uint nextPerms=(perms & 7) << 13;
|
||||
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
||||
perms &= ~(uint)PermissionMask.Copy;
|
||||
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
||||
perms &= ~(uint)PermissionMask.Transfer;
|
||||
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
||||
perms &= ~(uint)PermissionMask.Modify;
|
||||
|
||||
item.BasePermissions = perms & part.NextOwnerMask;
|
||||
item.CurrentPermissions = perms & part.NextOwnerMask;
|
||||
item.NextPermissions = part.NextOwnerMask;
|
||||
item.EveryOnePermissions = part.EveryoneMask &
|
||||
part.NextOwnerMask;
|
||||
item.GroupPermissions = part.GroupMask &
|
||||
part.NextOwnerMask;
|
||||
item.CurrentPermissions |= 16; // Slam!
|
||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||
|
||||
if (m_scene.InventoryService.AddItem(item))
|
||||
{
|
||||
remoteClient.SendInventoryItemCreateUpdate(item, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_dialogModule != null)
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // Sell contents
|
||||
List<UUID> invList = part.Inventory.GetInventoryList();
|
||||
|
||||
bool okToSell = true;
|
||||
|
||||
foreach (UUID invID in invList)
|
||||
{
|
||||
TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID);
|
||||
if ((item1.CurrentPermissions &
|
||||
(uint)PermissionMask.Transfer) == 0)
|
||||
{
|
||||
okToSell = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!okToSell)
|
||||
{
|
||||
if (m_dialogModule != null)
|
||||
m_dialogModule.SendAlertToUser(
|
||||
remoteClient, "This item's inventory doesn't appear to be for sale");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (invList.Count > 0)
|
||||
m_scene.MoveTaskInventoryItems(remoteClient.AgentId, part.Name, part, invList);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -588,8 +588,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
client.OnModifyTerrain += client_OnModifyTerrain;
|
||||
client.OnBakeTerrain += client_OnBakeTerrain;
|
||||
client.OnLandUndo += client_OnLandUndo;
|
||||
client.OnUnackedTerrain += client_OnUnackedTerrain;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Checks to see if the terrain has been modified since last check
|
||||
/// but won't attempt to limit those changes to the limits specified in the estate settings
|
||||
@@ -810,6 +811,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter
|
||||
}
|
||||
}
|
||||
|
||||
protected void client_OnUnackedTerrain(IClientAPI client, int patchX, int patchY)
|
||||
{
|
||||
//m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
|
||||
client.SendLayerData(patchX, patchY, m_scene.Heightmap.GetFloatsSerialised());
|
||||
}
|
||||
|
||||
private void StoreUndoState()
|
||||
{
|
||||
|
||||
@@ -138,14 +138,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
remoteClient.SendMapBlock(blocks, 2);
|
||||
}
|
||||
|
||||
private Scene GetClientScene(IClientAPI client)
|
||||
{
|
||||
foreach (Scene s in m_scenes)
|
||||
{
|
||||
if (client.Scene.RegionInfo.RegionHandle == s.RegionInfo.RegionHandle)
|
||||
return s;
|
||||
}
|
||||
return m_scene;
|
||||
}
|
||||
// private Scene GetClientScene(IClientAPI client)
|
||||
// {
|
||||
// foreach (Scene s in m_scenes)
|
||||
// {
|
||||
// if (client.Scene.RegionInfo.RegionHandle == s.RegionInfo.RegionHandle)
|
||||
// return s;
|
||||
// }
|
||||
// return m_scene;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1000,11 +1000,24 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
return responsemap;
|
||||
}
|
||||
|
||||
public void RegenerateMaptile(byte[] data)
|
||||
public void GenerateMaptile()
|
||||
{
|
||||
// Cannot create a map for a nonexistant heightmap
|
||||
if (m_scene.Heightmap == null)
|
||||
return;
|
||||
|
||||
//create a texture asset of the terrain
|
||||
IMapImageGenerator terrain = m_scene.RequestModuleInterface<IMapImageGenerator>();
|
||||
if (terrain == null)
|
||||
return;
|
||||
|
||||
byte[] data = terrain.WriteJpeg2000Image("defaultstripe.png");
|
||||
if (data == null)
|
||||
return;
|
||||
|
||||
UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
|
||||
|
||||
m_log.Debug("[MAPTILE]: STORING MAPTILE IMAGE");
|
||||
m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE");
|
||||
|
||||
m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Random();
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||
xmlobject.AppendChild(node);
|
||||
|
||||
node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", "");
|
||||
node.InnerText = String.Format("{0:x}", m_rootPart.ObjectFlags);
|
||||
node.InnerText = String.Format("{0:x}", (uint)m_rootPart.Flags);
|
||||
xmlobject.AppendChild(node);
|
||||
|
||||
node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", "");
|
||||
|
||||
@@ -520,7 +520,11 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void SendTeleportLocationStart()
|
||||
public virtual void SendTeleportStart(uint flags)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void SendTeleportProgress(uint flags, string message)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
47
OpenSim/Region/Framework/Interfaces/IBuySellModule.cs
Normal file
47
OpenSim/Region/Framework/Interfaces/IBuySellModule.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
{
|
||||
public interface IBuySellModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Try to buy an object
|
||||
/// </summary>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="categoryID"></param>
|
||||
/// <param name="localID"></param>
|
||||
/// <param name="saleType"></param>
|
||||
/// <returns>
|
||||
/// True on a successful purchase, false on failure
|
||||
/// </returns>
|
||||
bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType);
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,6 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
{
|
||||
public interface ICloudModule : IRegionModule
|
||||
@@ -35,4 +34,4 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// </summary>
|
||||
float CloudCover(int x, int y, int z);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// </summary>
|
||||
public interface IInventoryTransferModule
|
||||
{
|
||||
void SetRootAgentScene(UUID agentID, Scene scene);
|
||||
bool NeedSceneCacheClear(UUID agentID, Scene scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,9 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
{
|
||||
public interface IWorldMapModule
|
||||
{
|
||||
void RegenerateMaptile(byte[] data);
|
||||
/// <summary>
|
||||
/// Generate a map tile for the scene. a terrain texture for this scene
|
||||
/// </summary>
|
||||
void GenerateMaptile();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -687,7 +687,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary>
|
||||
/// Create a new asset data structure.
|
||||
/// </summary>
|
||||
private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID)
|
||||
public AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID)
|
||||
{
|
||||
AssetBase asset = new AssetBase(UUID.Random(), name, assetType, creatorID.ToString());
|
||||
asset.Description = description;
|
||||
@@ -869,7 +869,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
ScenePresence presence;
|
||||
if (TryGetScenePresence(remoteClient.AgentId, out presence))
|
||||
{
|
||||
byte[] data = null;
|
||||
// byte[] data = null;
|
||||
|
||||
AssetBase asset = new AssetBase();
|
||||
asset.FullID = olditemID;
|
||||
@@ -877,8 +877,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
asset.Name = name;
|
||||
asset.Description = description;
|
||||
|
||||
CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch());
|
||||
|
||||
CreateNewInventoryItem(
|
||||
remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType,
|
||||
(uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All,
|
||||
(uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -911,7 +913,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
InventoryService.DeleteFolders(remoteClient.AgentId, folderIDs);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Send the details of a prim's inventory to the client.
|
||||
/// </summary>
|
||||
|
||||
@@ -496,73 +496,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
#endregion
|
||||
|
||||
#region BinaryStats
|
||||
|
||||
public class StatLogger
|
||||
{
|
||||
public DateTime StartTime;
|
||||
public string Path;
|
||||
public System.IO.BinaryWriter Log;
|
||||
}
|
||||
static StatLogger m_statLog = null;
|
||||
static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300);
|
||||
static string m_statsDir = String.Empty;
|
||||
static Object m_statLockObject = new Object();
|
||||
private void LogSimStats(SimStats stats)
|
||||
{
|
||||
SimStatsPacket pack = new SimStatsPacket();
|
||||
pack.Region = new SimStatsPacket.RegionBlock();
|
||||
pack.Region.RegionX = stats.RegionX;
|
||||
pack.Region.RegionY = stats.RegionY;
|
||||
pack.Region.RegionFlags = stats.RegionFlags;
|
||||
pack.Region.ObjectCapacity = stats.ObjectCapacity;
|
||||
//pack.Region = //stats.RegionBlock;
|
||||
pack.Stat = stats.StatsBlock;
|
||||
pack.Header.Reliable = false;
|
||||
|
||||
// note that we are inside the reporter lock when called
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
// hide some time information into the packet
|
||||
pack.Header.Sequence = (uint)now.Ticks;
|
||||
|
||||
lock (m_statLockObject) // m_statLog is shared so make sure there is only executer here
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m_statLog == null || now > m_statLog.StartTime + m_statLogPeriod)
|
||||
{
|
||||
// First log file or time has expired, start writing to a new log file
|
||||
if (m_statLog != null && m_statLog.Log != null)
|
||||
{
|
||||
m_statLog.Log.Close();
|
||||
}
|
||||
m_statLog = new StatLogger();
|
||||
m_statLog.StartTime = now;
|
||||
m_statLog.Path = (m_statsDir.Length > 0 ? m_statsDir + System.IO.Path.DirectorySeparatorChar.ToString() : "")
|
||||
+ String.Format("stats-{0}.log", now.ToString("yyyyMMddHHmmss"));
|
||||
m_statLog.Log = new BinaryWriter(File.Open(m_statLog.Path, FileMode.Append, FileAccess.Write));
|
||||
}
|
||||
|
||||
// Write the serialized data to disk
|
||||
if (m_statLog != null && m_statLog.Log != null)
|
||||
m_statLog.Log.Write(pack.ToBytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.Error("statistics gathering failed: " + ex.Message, ex);
|
||||
if (m_statLog != null && m_statLog.Log != null)
|
||||
{
|
||||
m_statLog.Log.Close();
|
||||
}
|
||||
m_statLog = null;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public Scene(RegionInfo regInfo, AgentCircuitManager authen,
|
||||
@@ -628,45 +561,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_storageManager.EstateDataStore != null)
|
||||
{
|
||||
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false);
|
||||
if (m_regInfo.EstateSettings.EstateID == 0) // No record at all
|
||||
{
|
||||
MainConsole.Instance.Output("Your region is not part of an estate.");
|
||||
while (true)
|
||||
{
|
||||
string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() {"yes", "no"});
|
||||
if (response == "no")
|
||||
{
|
||||
// Create a new estate
|
||||
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, true);
|
||||
|
||||
m_regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", m_regInfo.EstateSettings.EstateName);
|
||||
m_regInfo.EstateSettings.Save();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
response = MainConsole.Instance.CmdPrompt("Estate name to join", "None");
|
||||
if (response == "None")
|
||||
continue;
|
||||
|
||||
List<int> estateIDs = m_storageManager.EstateDataStore.GetEstates(response);
|
||||
if (estateIDs.Count < 1)
|
||||
{
|
||||
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
|
||||
continue;
|
||||
}
|
||||
|
||||
int estateID = estateIDs[0];
|
||||
|
||||
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID);
|
||||
|
||||
if (m_storageManager.EstateDataStore.LinkRegion(m_regInfo.RegionID, estateID))
|
||||
break;
|
||||
|
||||
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Region Settings
|
||||
@@ -771,38 +665,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
|
||||
CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
|
||||
|
||||
#region BinaryStats
|
||||
|
||||
try
|
||||
{
|
||||
IConfig statConfig = m_config.Configs["Statistics.Binary"];
|
||||
if (statConfig.Contains("enabled") && statConfig.GetBoolean("enabled"))
|
||||
{
|
||||
if (statConfig.Contains("collect_region_stats"))
|
||||
{
|
||||
if (statConfig.GetBoolean("collect_region_stats"))
|
||||
{
|
||||
// if enabled, add us to the event. If not enabled, I won't get called
|
||||
StatsReporter.OnSendStatsResult += LogSimStats;
|
||||
}
|
||||
}
|
||||
if (statConfig.Contains("region_stats_period_seconds"))
|
||||
{
|
||||
m_statLogPeriod = TimeSpan.FromSeconds(statConfig.GetInt("region_stats_period_seconds"));
|
||||
}
|
||||
if (statConfig.Contains("stats_dir"))
|
||||
{
|
||||
m_statsDir = statConfig.GetString("stats_dir");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// if it doesn't work, we don't collect anything
|
||||
}
|
||||
|
||||
#endregion BinaryStats
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -1844,33 +1706,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a terrain texture for this scene
|
||||
/// </summary>
|
||||
public void CreateTerrainTexture()
|
||||
{
|
||||
//create a texture asset of the terrain
|
||||
IMapImageGenerator terrain = RequestModuleInterface<IMapImageGenerator>();
|
||||
|
||||
// Cannot create a map for a nonexistant heightmap yet.
|
||||
if (Heightmap == null)
|
||||
return;
|
||||
|
||||
if (terrain == null)
|
||||
return;
|
||||
|
||||
byte[] data = terrain.WriteJpeg2000Image("defaultstripe.png");
|
||||
if (data != null)
|
||||
{
|
||||
IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>();
|
||||
|
||||
if (mapModule != null)
|
||||
mapModule.RegenerateMaptile(data);
|
||||
else
|
||||
m_log.DebugFormat("[SCENE]: MapModule is null, can't save maptile");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Load Land
|
||||
@@ -1929,7 +1764,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
AddRestoredSceneObject(group, true, true);
|
||||
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||
rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted;
|
||||
rootPart.Flags &= ~PrimFlags.Scripted;
|
||||
rootPart.TrimPermissions();
|
||||
group.CheckSculptAndLoad();
|
||||
//rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
|
||||
@@ -2248,7 +2083,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
foreach (SceneObjectPart part in group.Children.Values)
|
||||
{
|
||||
if (part.IsJoint() && ((part.ObjectFlags&(uint)PrimFlags.Physics) != 0))
|
||||
if (part.IsJoint() && ((part.Flags & PrimFlags.Physics) != 0))
|
||||
{
|
||||
PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed?
|
||||
}
|
||||
@@ -2761,7 +2596,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (!VerifyClient(aCircuit, ep, out vialogin))
|
||||
{
|
||||
// uh-oh, this is fishy
|
||||
m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.",
|
||||
m_log.WarnFormat("[SCENE]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.",
|
||||
client.AgentId, client.SessionId, ep.ToString());
|
||||
try
|
||||
{
|
||||
@@ -2769,13 +2604,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace);
|
||||
m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
|
||||
m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
|
||||
|
||||
ScenePresence sp = CreateAndAddScenePresence(client);
|
||||
if (aCircuit != null)
|
||||
@@ -2804,7 +2639,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Do the verification here
|
||||
if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0)
|
||||
{
|
||||
m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
|
||||
m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
|
||||
vialogin = true;
|
||||
IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
|
||||
if (userVerification != null && ep != null)
|
||||
@@ -2814,11 +2649,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString()))
|
||||
{
|
||||
// uh-oh, this is fishy
|
||||
m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
|
||||
m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
|
||||
m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2849,7 +2684,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace);
|
||||
m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2879,7 +2714,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public virtual void SubscribeToClientTerrainEvents(IClientAPI client)
|
||||
{
|
||||
client.OnRegionHandShakeReply += SendLayerData;
|
||||
client.OnUnackedTerrain += TerrainUnAcked;
|
||||
}
|
||||
|
||||
public virtual void SubscribeToClientPrimEvents(IClientAPI client)
|
||||
@@ -2919,8 +2753,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
client.OnUndo += m_sceneGraph.HandleUndo;
|
||||
client.OnRedo += m_sceneGraph.HandleRedo;
|
||||
client.OnObjectDescription += m_sceneGraph.PrimDescription;
|
||||
client.OnObjectDrop += m_sceneGraph.DropObject;
|
||||
client.OnObjectSaleInfo += ObjectSaleInfo;
|
||||
client.OnObjectDrop += m_sceneGraph.DropObject;
|
||||
client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable;
|
||||
client.OnObjectOwner += ObjectOwner;
|
||||
}
|
||||
@@ -3011,7 +2844,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client)
|
||||
{
|
||||
client.OnRegionHandShakeReply -= SendLayerData;
|
||||
client.OnUnackedTerrain -= TerrainUnAcked;
|
||||
}
|
||||
|
||||
public virtual void UnSubscribeToClientPrimEvents(IClientAPI client)
|
||||
@@ -3050,7 +2882,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
client.OnRedo -= m_sceneGraph.HandleRedo;
|
||||
client.OnObjectDescription -= m_sceneGraph.PrimDescription;
|
||||
client.OnObjectDrop -= m_sceneGraph.DropObject;
|
||||
client.OnObjectSaleInfo -= ObjectSaleInfo;
|
||||
client.OnObjectIncludeInSearch -= m_sceneGraph.MakeObjectSearchable;
|
||||
client.OnObjectOwner -= ObjectOwner;
|
||||
}
|
||||
@@ -4625,23 +4456,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
client.SendRegionHandle(regionID, handle);
|
||||
}
|
||||
|
||||
public void TerrainUnAcked(IClientAPI client, int patchX, int patchY)
|
||||
{
|
||||
//m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
|
||||
client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
|
||||
}
|
||||
|
||||
public void SetRootAgentScene(UUID agentID)
|
||||
{
|
||||
IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
|
||||
if (inv == null)
|
||||
return;
|
||||
|
||||
inv.SetRootAgentScene(agentID, this);
|
||||
|
||||
EventManager.TriggerSetRootAgentScene(agentID, this);
|
||||
}
|
||||
|
||||
public bool NeedSceneCacheClear(UUID agentID)
|
||||
{
|
||||
IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
|
||||
@@ -4651,184 +4465,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return inv.NeedSceneCacheClear(agentID, this);
|
||||
}
|
||||
|
||||
public void ObjectSaleInfo(IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice)
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
if (part == null || part.ParentGroup == null)
|
||||
return;
|
||||
|
||||
if (part.ParentGroup.IsDeleted)
|
||||
return;
|
||||
|
||||
part = part.ParentGroup.RootPart;
|
||||
|
||||
part.ObjectSaleType = saleType;
|
||||
part.SalePrice = salePrice;
|
||||
|
||||
part.ParentGroup.HasGroupChanged = true;
|
||||
|
||||
part.GetProperties(client);
|
||||
}
|
||||
|
||||
public bool PerformObjectBuy(IClientAPI remoteClient, UUID categoryID,
|
||||
uint localID, byte saleType)
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
|
||||
if (part == null)
|
||||
return false;
|
||||
|
||||
if (part.ParentGroup == null)
|
||||
return false;
|
||||
|
||||
SceneObjectGroup group = part.ParentGroup;
|
||||
|
||||
switch (saleType)
|
||||
{
|
||||
case 1: // Sell as original (in-place sale)
|
||||
uint effectivePerms=group.GetEffectivePermissions();
|
||||
|
||||
if ((effectivePerms & (uint)PermissionMask.Transfer) == 0)
|
||||
{
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
|
||||
return false;
|
||||
}
|
||||
|
||||
group.SetOwnerId(remoteClient.AgentId);
|
||||
group.SetRootPartOwner(part, remoteClient.AgentId,
|
||||
remoteClient.ActiveGroupId);
|
||||
|
||||
List<SceneObjectPart> partList =
|
||||
new List<SceneObjectPart>(group.Children.Values);
|
||||
|
||||
if (Permissions.PropagatePermissions())
|
||||
{
|
||||
foreach (SceneObjectPart child in partList)
|
||||
{
|
||||
child.Inventory.ChangeInventoryOwner(remoteClient.AgentId);
|
||||
child.TriggerScriptChangedEvent(Changed.OWNER);
|
||||
child.ApplyNextOwnerPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
part.ObjectSaleType = 0;
|
||||
part.SalePrice = 10;
|
||||
|
||||
group.HasGroupChanged = true;
|
||||
part.GetProperties(remoteClient);
|
||||
part.TriggerScriptChangedEvent(Changed.OWNER);
|
||||
group.ResumeScripts();
|
||||
part.ScheduleFullUpdate();
|
||||
|
||||
break;
|
||||
|
||||
case 2: // Sell a copy
|
||||
|
||||
|
||||
Vector3 inventoryStoredPosition = new Vector3
|
||||
(((group.AbsolutePosition.X > (int)Constants.RegionSize)
|
||||
? 250
|
||||
: group.AbsolutePosition.X)
|
||||
,
|
||||
(group.AbsolutePosition.X > (int)Constants.RegionSize)
|
||||
? 250
|
||||
: group.AbsolutePosition.X,
|
||||
group.AbsolutePosition.Z);
|
||||
|
||||
Vector3 originalPosition = group.AbsolutePosition;
|
||||
|
||||
group.AbsolutePosition = inventoryStoredPosition;
|
||||
|
||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
|
||||
group.AbsolutePosition = originalPosition;
|
||||
|
||||
uint perms=group.GetEffectivePermissions();
|
||||
|
||||
if ((perms & (uint)PermissionMask.Transfer) == 0)
|
||||
{
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
|
||||
return false;
|
||||
}
|
||||
|
||||
AssetBase asset = CreateAsset(
|
||||
group.GetPartName(localID),
|
||||
group.GetPartDescription(localID),
|
||||
(sbyte)AssetType.Object,
|
||||
Utils.StringToBytes(sceneObjectXml),
|
||||
group.OwnerID);
|
||||
AssetService.Store(asset);
|
||||
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
item.CreatorId = part.CreatorID.ToString();
|
||||
|
||||
item.ID = UUID.Random();
|
||||
item.Owner = remoteClient.AgentId;
|
||||
item.AssetID = asset.FullID;
|
||||
item.Description = asset.Description;
|
||||
item.Name = asset.Name;
|
||||
item.AssetType = asset.Type;
|
||||
item.InvType = (int)InventoryType.Object;
|
||||
item.Folder = categoryID;
|
||||
|
||||
uint nextPerms=(perms & 7) << 13;
|
||||
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
||||
perms &= ~(uint)PermissionMask.Copy;
|
||||
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
||||
perms &= ~(uint)PermissionMask.Transfer;
|
||||
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
||||
perms &= ~(uint)PermissionMask.Modify;
|
||||
|
||||
item.BasePermissions = perms & part.NextOwnerMask;
|
||||
item.CurrentPermissions = perms & part.NextOwnerMask;
|
||||
item.NextPermissions = part.NextOwnerMask;
|
||||
item.EveryOnePermissions = part.EveryoneMask &
|
||||
part.NextOwnerMask;
|
||||
item.GroupPermissions = part.GroupMask &
|
||||
part.NextOwnerMask;
|
||||
item.CurrentPermissions |= 16; // Slam!
|
||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||
|
||||
if (InventoryService.AddItem(item))
|
||||
remoteClient.SendInventoryItemCreateUpdate(item, 0);
|
||||
else
|
||||
{
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // Sell contents
|
||||
List<UUID> invList = part.Inventory.GetInventoryList();
|
||||
|
||||
bool okToSell = true;
|
||||
|
||||
foreach (UUID invID in invList)
|
||||
{
|
||||
TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID);
|
||||
if ((item1.CurrentPermissions &
|
||||
(uint)PermissionMask.Transfer) == 0)
|
||||
{
|
||||
okToSell = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!okToSell)
|
||||
{
|
||||
m_dialogModule.SendAlertToUser(
|
||||
remoteClient, "This item's inventory doesn't appear to be for sale");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (invList.Count > 0)
|
||||
MoveTaskInventoryItems(remoteClient.AgentId, part.Name,
|
||||
part, invList);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void CleanTempObjects()
|
||||
{
|
||||
List<EntityBase> objs = GetEntities();
|
||||
@@ -4969,7 +4605,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
// turn the proxy non-physical, which also stops its client-side interpolation
|
||||
bool wasUsingPhysics = ((jointProxyObject.ObjectFlags & (uint)PrimFlags.Physics) != 0);
|
||||
bool wasUsingPhysics = ((jointProxyObject.Flags & PrimFlags.Physics) != 0);
|
||||
if (wasUsingPhysics)
|
||||
{
|
||||
jointProxyObject.UpdatePrimFlags(false, false, true, false); // FIXME: possible deadlock here; check to make sure all the scene alterations set into motion here won't deadlock
|
||||
|
||||
@@ -1588,9 +1588,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void aggregateScriptEvents()
|
||||
{
|
||||
uint objectflagupdate=(uint)RootPart.GetEffectiveObjectFlags();
|
||||
PrimFlags objectflagupdate = (PrimFlags)RootPart.GetEffectiveObjectFlags();
|
||||
|
||||
scriptEvents aggregateScriptEvents=0;
|
||||
scriptEvents aggregateScriptEvents = 0;
|
||||
|
||||
lockPartsForRead(true);
|
||||
{
|
||||
@@ -1600,7 +1600,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (part == null)
|
||||
continue;
|
||||
if (part != RootPart)
|
||||
part.ObjectFlags = objectflagupdate;
|
||||
part.Flags = objectflagupdate;
|
||||
aggregateScriptEvents |= part.AggregateScriptEvents;
|
||||
|
||||
}
|
||||
|
||||
@@ -1348,7 +1348,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void AddFlag(PrimFlags flag)
|
||||
{
|
||||
// PrimFlags prevflag = Flags;
|
||||
if ((ObjectFlags & (uint) flag) == 0)
|
||||
if ((Flags & flag) == 0)
|
||||
{
|
||||
//m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString());
|
||||
Flags |= flag;
|
||||
@@ -1638,7 +1638,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
dupe.Velocity = new Vector3(0, 0, 0);
|
||||
dupe.Acceleration = new Vector3(0, 0, 0);
|
||||
dupe.AngularVelocity = new Vector3(0, 0, 0);
|
||||
dupe.ObjectFlags = ObjectFlags;
|
||||
dupe.Flags = Flags;
|
||||
|
||||
dupe._ownershipCost = _ownershipCost;
|
||||
dupe._objectSaleType = _objectSaleType;
|
||||
@@ -1675,7 +1675,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_parentGroup.Scene.AssetService.Get(dupe.m_shape.SculptTexture.ToString(), dupe, AssetReceived);
|
||||
}
|
||||
|
||||
bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0);
|
||||
bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0);
|
||||
dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
|
||||
}
|
||||
|
||||
@@ -4299,9 +4299,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void UpdatePrimFlags(bool UsePhysics, bool IsTemporary, bool IsPhantom, bool IsVD)
|
||||
{
|
||||
bool wasUsingPhysics = ((ObjectFlags & (uint) PrimFlags.Physics) != 0);
|
||||
bool wasTemporary = ((ObjectFlags & (uint)PrimFlags.TemporaryOnRez) != 0);
|
||||
bool wasPhantom = ((ObjectFlags & (uint)PrimFlags.Phantom) != 0);
|
||||
bool wasUsingPhysics = ((Flags & PrimFlags.Physics) != 0);
|
||||
bool wasTemporary = ((Flags & PrimFlags.TemporaryOnRez) != 0);
|
||||
bool wasPhantom = ((Flags & PrimFlags.Phantom) != 0);
|
||||
bool wasVD = VolumeDetectActive;
|
||||
|
||||
if ((UsePhysics == wasUsingPhysics) && (wasTemporary == IsTemporary) && (wasPhantom == IsPhantom) && (IsVD==wasVD))
|
||||
|
||||
@@ -905,7 +905,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_grouptitle = gm.GetGroupTitle(m_uuid);
|
||||
|
||||
m_rootRegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
m_scene.SetRootAgentScene(m_uuid);
|
||||
|
||||
m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene);
|
||||
|
||||
// Moved this from SendInitialData to ensure that m_appearance is initialized
|
||||
// before the inventory is processed in MakeRootAgent. This fixes a race condition
|
||||
|
||||
@@ -1045,11 +1045,15 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||
|
||||
}
|
||||
|
||||
public void SendTeleportLocationStart()
|
||||
public void SendTeleportStart(uint flags)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void SendTeleportProgress(uint flags, string message)
|
||||
{
|
||||
}
|
||||
|
||||
public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance)
|
||||
{
|
||||
|
||||
|
||||
@@ -1129,7 +1129,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
OSDMap NewGroupDataMap = new OSDMap(1);
|
||||
|
||||
GroupDataMap.Add("GroupID", OSD.FromUUID(membership.GroupID));
|
||||
GroupDataMap.Add("GroupPowers", OSD.FromBinary(membership.GroupPowers));
|
||||
GroupDataMap.Add("GroupPowers", OSD.FromULong(membership.GroupPowers));
|
||||
GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(membership.AcceptNotices));
|
||||
GroupDataMap.Add("GroupInsigniaID", OSD.FromUUID(membership.GroupPicture));
|
||||
GroupDataMap.Add("Contribution", OSD.FromInteger(membership.Contribution));
|
||||
|
||||
@@ -72,8 +72,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
|
||||
|
||||
private IConfigSource m_gConfig;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Region UUIDS indexed by AgentID
|
||||
/// </summary>
|
||||
@@ -85,7 +83,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
|
||||
|
||||
// private int m_stipend = 1000;
|
||||
|
||||
private int ObjectCapacity = 45000;
|
||||
// private int ObjectCapacity = 45000;
|
||||
private int ObjectCount = 0;
|
||||
private int PriceEnergyUnit = 0;
|
||||
private int PriceGroupCreate = 0;
|
||||
@@ -267,13 +265,11 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
|
||||
PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1);
|
||||
m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void GetClientFunds(IClientAPI client)
|
||||
{
|
||||
CheckExistAndRefreshFunds(client.AgentId);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -815,7 +811,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
|
||||
remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false);
|
||||
return;
|
||||
}
|
||||
s.PerformObjectBuy(remoteClient, categoryID, localID, saleType);
|
||||
|
||||
IBuySellModule module = s.RequestModuleInterface<IBuySellModule>();
|
||||
if (module != null)
|
||||
module.BuyObject(remoteClient, categoryID, localID, saleType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -825,7 +824,5 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
|
||||
RegionMoneyRequest = 1,
|
||||
Gift = 2,
|
||||
Purchase = 3
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -611,7 +611,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void SendTeleportLocationStart()
|
||||
public virtual void SendTeleportStart(uint flags)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void SendTeleportProgress(uint flags, string message)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -4405,7 +4405,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(
|
||||
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
|
||||
{
|
||||
presence.ControllingClient.SendTeleportLocationStart();
|
||||
World.TeleportClientHome(agentId, presence.ControllingClient);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -673,7 +673,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
regionName = regInfo.RegionName;
|
||||
}
|
||||
}
|
||||
presence.ControllingClient.SendTeleportLocationStart();
|
||||
World.RequestTeleportLocation(presence.ControllingClient, regionName,
|
||||
new Vector3((float)position.x, (float)position.y, (float)position.z),
|
||||
new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation);
|
||||
@@ -705,7 +704,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
== World.LandChannel.GetLandObject(
|
||||
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
|
||||
{
|
||||
presence.ControllingClient.SendTeleportLocationStart();
|
||||
World.RequestTeleportLocation(presence.ControllingClient, regionHandle,
|
||||
new Vector3((float)position.x, (float)position.y, (float)position.z),
|
||||
new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation);
|
||||
|
||||
Reference in New Issue
Block a user