Compare commits

...

21 Commits

Author SHA1 Message Date
lbsa71 8acb60df0d * Added "show queues" command that shows throttling queues for all clients.
*** This only works for LLCLientView at the moment ***
2008-12-18 13:02:26 +00:00
MW 9eced15408 Merged Trunk Revisions 7738, 7739 and 7740 to 0.6.0-stable branch. Fix some permission bugs 2008-12-17 13:46:39 +00:00
MW 17673df6f7 Merged Revision 7654 from Trunk to 0.6.0-stable branch. A patch from jonc to correct the loading of Raw terrain files. 2008-12-16 14:09:59 +00:00
MW 8c19809ed2 Merged Revision 7650 from Trunk to 0.6.0-stable branch. A patch from jonc to add a "terrain flip x/y" command. 2008-12-16 13:57:48 +00:00
MW d19212c3e4 Applied the changes to PermissionsModule.cs from trunk revision 7301 (which was a patch from Christopher Yeoh's (IBM)) so that permissions are propagated when giving Inventory items to other users. 2008-12-15 18:45:02 +00:00
MW 648de85737 Merged Trunk Revision 7203 to 0.6.0 stable branch , a MSSQL fix from Ruud Lathrop. Mantis #2591 2008-12-08 17:17:29 +00:00
MW 58f3fa71c2 Made BaseOpenSimServer.ShutdownSpecific() public. As the OpenSimBase.Shutdown() includes a Environment.Exit(0); which is not always wanted when shutting down, like from a windows service.
Again not really a bug fix per se, but its not going to change stablebility.
2008-12-02 11:26:38 +00:00
MW 66737b9c0c Added two new "trusted" url handlers to the Inventory server, to allow the user server to get a list of items in a folder and add a new item.
Not really bug fixes but as trunk is so unstable at the moment am adding them to 0.6.0-stable branch as well
2008-12-02 10:43:01 +00:00
MW 4295c125aa Applying Trunk revision 7562 to the 0.6.0 stable branch
Added a Catch(InvalidOperationException) to BaseHttpServer.HandleRequest(). Which is thrown due to errors in the XML deserializing. Without this catch is it easy to bring down any of the opensim servers on purpose by just sending corrupt xml to them.
2008-12-01 11:28:41 +00:00
MW a2c55d7fdb applied Melanie's Avatar hip offset changes from Trunk revision 7286 to the 0.6 stable branch 2008-11-25 19:44:50 +00:00
MW fdbe41926b made the messaging server OpenMessage_Main constructor public (from private) so it can be subclassed. Not exactly a bug fix per se but makes is a small change that makes this branch more usable. 2008-11-25 15:21:51 +00:00
Justin Clarke Casey f9530eb0c7 * Apply http://opensimulator.org/mantis/view.php?id=2633 to stable branch
* This stops object persistence at shutdown persisting objects that should not be saved.
* Thanks idb.
2008-11-17 20:39:54 +00:00
MW c3bb6643e8 Applied melanie's changes from Trunk Revision 7239 to 0.6 stable branch. To fix avatar crossing issues. 2008-11-14 10:54:19 +00:00
MW af4ff8686b Applied Diva's patch from mantis #2590/ Trunk Revision 7200 to 0.6 stable branch 2008-11-14 10:38:47 +00:00
MW 9cf75f649d Applied idb's patch to fix avatar height from Trunk Revision 7218 to the 0.6 stable branch 2008-11-14 10:07:55 +00:00
MW afc2ddaaec applying Mysql inventory fixes from Trunk revision 7285 to 0.6 stable branch 2008-11-14 09:58:36 +00:00
MW 335cffbfed applying AvatarFactory fix from trunk revision 7284 to the 0.6 stable branch 2008-11-14 09:55:03 +00:00
MW 8f0bf406fb Applying Mantis patch 2597 (applied to trunk in revision 7274) to 0.6 stable branch 2008-11-13 15:42:19 +00:00
lbsa71 f888656bca * Re-applied r7223 2008-11-13 13:32:15 +00:00
lbsa71 e762d9b612 * Copied 0.6.0-release to 0.6.0-stable in accordance with the 'fortification' discussion on opensim-dev.
* 'stable' should be used only for stability fixes.
2008-11-13 12:55:57 +00:00
Charles Krinke fbafaab342 made a copy 2008-11-08 14:33:51 +00:00
31 changed files with 473 additions and 195 deletions

View File

@ -54,6 +54,7 @@ Patches
* jhurliman * jhurliman
* jimbo2120 (IBM) * jimbo2120 (IBM)
* John R Sohn (XenReborn) * John R Sohn (XenReborn)
* jonc
* Junta Kohime * Junta Kohime
* Kayne * Kayne
* Kevin Cozens * Kevin Cozens
@ -63,6 +64,7 @@ Patches
* M.Igarashi * M.Igarashi
* Mic Bowman * Mic Bowman
* mikkopa/_someone - RealXtend * mikkopa/_someone - RealXtend
* Mircea Kitsune
* nlin * nlin
* nornalbion * nornalbion
* openlifegrid.com * openlifegrid.com
@ -79,7 +81,6 @@ Patches
* Y. Nitta * Y. Nitta
* YZh * YZh
* Zha Ewry * Zha Ewry
* Mircea Kitsune
LSL Devs LSL Devs

View File

@ -0,0 +1,25 @@
BEGIN TRANSACTION
ALTER TABLE dbo.estate_managers DROP CONSTRAINT PK_estate_managers
CREATE NONCLUSTERED INDEX IX_estate_managers ON dbo.estate_managers
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
ALTER TABLE dbo.estate_groups DROP CONSTRAINT PK_estate_groups
CREATE NONCLUSTERED INDEX IX_estate_groups ON dbo.estate_groups
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
ALTER TABLE dbo.estate_users DROP CONSTRAINT PK_estate_users
CREATE NONCLUSTERED INDEX IX_estate_users ON dbo.estate_users
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -0,0 +1,25 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estateban
(
EstateID int NOT NULL,
bannedUUID varchar(36) NOT NULL,
bannedIp varchar(16) NULL,
bannedIpHostMask varchar(16) NULL,
bannedNameMask varchar(64) NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estateban)
EXEC('INSERT INTO dbo.Tmp_estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask)
SELECT EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask FROM dbo.estateban')
DROP TABLE dbo.estateban
EXECUTE sp_rename N'dbo.Tmp_estateban', N'estateban', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estateban ON dbo.estateban
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -142,7 +142,12 @@ namespace OpenSim.Data.MySQL
MySqlDataReader reader = result.ExecuteReader(); MySqlDataReader reader = result.ExecuteReader();
while (reader.Read()) while (reader.Read())
items.Add(readInventoryItem(reader)); {
// A null item (because something went wrong) breaks everything in the folder
InventoryItemBase item = readInventoryItem(reader);
if (item != null)
items.Add(item);
}
reader.Close(); reader.Close();
result.Dispose(); result.Dispose();
@ -301,24 +306,36 @@ namespace OpenSim.Data.MySQL
try try
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
// Be a bit safer in parsing these because the
// database doesn't enforce them to be not null, and
// the inventory still works if these are weird in the
// db
UUID Owner = UUID.Zero;
UUID Creator = UUID.Zero;
UUID GroupID = UUID.Zero;
UUID.TryParse((string)reader["avatarID"], out Owner);
UUID.TryParse((string)reader["creatorID"], out Creator);
UUID.TryParse((string)reader["groupID"], out GroupID);
item.Owner = Owner;
item.Creator = Creator;
item.GroupID = GroupID;
// Rest of the parsing. If these UUID's fail, we're dead anyway
item.ID = new UUID((string) reader["inventoryID"]); item.ID = new UUID((string) reader["inventoryID"]);
item.AssetID = new UUID((string) reader["assetID"]); item.AssetID = new UUID((string) reader["assetID"]);
item.AssetType = (int) reader["assetType"]; item.AssetType = (int) reader["assetType"];
item.Folder = new UUID((string) reader["parentFolderID"]); item.Folder = new UUID((string) reader["parentFolderID"]);
item.Owner = new UUID((string) reader["avatarID"]);
item.Name = (string) reader["inventoryName"]; item.Name = (string) reader["inventoryName"];
item.Description = (string) reader["inventoryDescription"]; item.Description = (string) reader["inventoryDescription"];
item.NextPermissions = (uint) reader["inventoryNextPermissions"]; item.NextPermissions = (uint) reader["inventoryNextPermissions"];
item.CurrentPermissions = (uint) reader["inventoryCurrentPermissions"]; item.CurrentPermissions = (uint) reader["inventoryCurrentPermissions"];
item.InvType = (int) reader["invType"]; item.InvType = (int) reader["invType"];
item.Creator = new UUID((string) reader["creatorID"]);
item.BasePermissions = (uint) reader["inventoryBasePermissions"]; item.BasePermissions = (uint) reader["inventoryBasePermissions"];
item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"];
item.SalePrice = (int) reader["salePrice"]; item.SalePrice = (int) reader["salePrice"];
item.SaleType = Convert.ToByte(reader["saleType"]); item.SaleType = Convert.ToByte(reader["saleType"]);
item.CreationDate = (int) reader["creationDate"]; item.CreationDate = (int) reader["creationDate"];
item.GroupID = new UUID(reader["groupID"].ToString());
item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]); item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
item.Flags = (uint) reader["flags"]; item.Flags = (uint) reader["flags"];
@ -814,8 +831,11 @@ namespace OpenSim.Data.MySQL
List<InventoryItemBase> list = new List<InventoryItemBase>(); List<InventoryItemBase> list = new List<InventoryItemBase>();
while (result.Read()) while (result.Read())
list.Add(readInventoryItem(result)); {
InventoryItemBase item = readInventoryItem(result);
if (item != null)
list.Add(item);
}
return list; return list;
} }
catch (Exception e) catch (Exception e)

View File

@ -231,6 +231,7 @@ namespace OpenSim.Framework
} }
protected float m_avatarHeight = 0; protected float m_avatarHeight = 0;
protected float m_hipOffset = 0;
public virtual float AvatarHeight public virtual float AvatarHeight
{ {
@ -238,6 +239,11 @@ namespace OpenSim.Framework
set { m_avatarHeight = value; } set { m_avatarHeight = value; }
} }
public virtual float HipOffset
{
get { return m_hipOffset; }
}
public AvatarAppearance() public AvatarAppearance()
{ {
m_wearables = new AvatarWearable[MAX_WEARABLES]; m_wearables = new AvatarWearable[MAX_WEARABLES];
@ -271,22 +277,20 @@ namespace OpenSim.Framework
{ {
Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length); Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length);
m_texture = textureEnt; m_texture = textureEnt;
// m_log.DebugFormat("[APPEARANCE]: Setting an avatar appearance with {0} faces", m_texture.FaceTextures.Length);
// for (int i = 0; i < m_texture.FaceTextures.Length; i++)
// {
// Primitive.TextureEntryFace face = m_texture.FaceTextures[i];
// String textureIdString = (face != null ? face.TextureID.ToString() : "none");
// m_log.DebugFormat("[APPEARANCE]: Texture {0} is {1}", i, textureIdString);
// }
m_visualparams = visualParam.ToArray(); m_visualparams = visualParam.ToArray();
m_avatarHeight = 1.23077f // Shortest possible avatar height
// Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters. + 0.516945f * (float)m_visualparams[25] / 255.0f // Body height
// (float)m_visualParams[25] = Height + 0.072514f * (float)m_visualparams[120] / 255.0f // Head size
// (float)m_visualParams[125] = LegLength + 0.3836f * (float)m_visualparams[125] / 255.0f // Leg length
m_avatarHeight = (1.50856f + (((float) m_visualparams[25]/255.0f)*(2.525506f - 1.50856f))) + 0.08f * (float)m_visualparams[77] / 255.0f // Shoe heel height
+ (((float) m_visualparams[125]/255.0f)/1.5f); + 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height
+ 0.076f * (float)m_visualparams[148] / 255.0f; // Neck length
m_hipOffset = (0.615385f // Half of avatar
+ 0.08f * (float)m_visualparams[77] / 255.0f // Shoe heel height
+ 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height
+ 0.3836f * (float)m_visualparams[125] / 255.0f // Leg length
- m_avatarHeight / 2) * 0.3f - 0.04f;
System.Console.WriteLine("Height {0} Hip offset {1}", m_avatarHeight, m_hipOffset);
} }
public virtual void SetWearable(int wearableId, AvatarWearable wearable) public virtual void SetWearable(int wearableId, AvatarWearable wearable)

View File

@ -330,10 +330,11 @@ namespace OpenSim.Framework.Communications.Cache
/// <summary> /// <summary>
/// Create a folder in this agent's inventory. /// Create a folder in this agent's inventory.
/// </summary>
/// ///
/// If the inventory service has not yet delievered the inventory /// If the inventory service has not yet delievered the inventory
/// for this user then the request will be queued. /// for this user then the request will be queued.
/// </summary> ///
/// <param name="parentID"></param> /// <param name="parentID"></param>
/// <returns></returns> /// <returns></returns>
public bool CreateFolder(string folderName, UUID folderID, ushort folderType, UUID parentID) public bool CreateFolder(string folderName, UUID folderID, ushort folderType, UUID parentID)

View File

@ -224,11 +224,12 @@ namespace OpenSim.Framework.Communications.Cache
/// <summary> /// <summary>
/// Handle a client request to update the inventory folder /// Handle a client request to update the inventory folder
/// </summary>
/// ///
/// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
/// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing,
/// and needs to be changed. /// and needs to be changed.
/// </summary> ///
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
/// <param name="folderID"></param> /// <param name="folderID"></param>
/// <param name="type"></param> /// <param name="type"></param>

View File

@ -45,6 +45,7 @@ namespace OpenSim.Framework
public interface IScene public interface IScene
{ {
RegionInfo RegionInfo { get; } RegionInfo RegionInfo { get; }
uint NextAvatarLocalId { get; }
RegionStatus Region_Status { get; set; } RegionStatus Region_Status { get; set; }
ClientManager ClientManager { get; } ClientManager ClientManager { get; }

View File

@ -470,6 +470,11 @@ namespace OpenSim.Framework.Servers
{ {
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e); m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e);
} }
catch (InvalidOperationException e)
{
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e);
SendHTML500(response);
}
} }
private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler) private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler)

View File

@ -103,7 +103,7 @@ namespace OpenSim.Framework.Servers
/// <summary> /// <summary>
/// Should be overriden and referenced by descendents if they need to perform extra shutdown processing /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
/// </summary> /// </summary>
protected virtual void ShutdownSpecific() {} public virtual void ShutdownSpecific() {}
/// <summary> /// <summary>
/// Print statistics to the logfile, if they are active /// Print statistics to the logfile, if they are active
@ -373,7 +373,7 @@ namespace OpenSim.Framework.Servers
/// That is something that cannot be determined within this class. So /// That is something that cannot be determined within this class. So
/// all attempts to use the console MUST be verified. /// all attempts to use the console MUST be verified.
/// </summary> /// </summary>
private void Notice(string msg) protected void Notice(string msg)
{ {
if (m_console != null) if (m_console != null)
{ {

View File

@ -195,7 +195,7 @@ namespace OpenSim.Grid.GridServer
*/ */
} }
protected override void ShutdownSpecific() public override void ShutdownSpecific()
{ {
foreach (IGridPlugin plugin in m_plugins) plugin.Dispose(); foreach (IGridPlugin plugin in m_plugins) plugin.Dispose();
} }

View File

@ -209,6 +209,23 @@ namespace OpenSim.Grid.InventoryServer
return invCollection; return invCollection;
} }
public List<InventoryItemBase> GetFolderItems(Guid folderID)
{
List<InventoryItemBase> allItems = new List<InventoryItemBase>();
List<InventoryItemBase> items = RequestFolderItems(new UUID(folderID));
if (items != null)
{
allItems.InsertRange(0, items);
}
m_log.InfoFormat(
"[GRID AGENT INVENTORY]: Sending back inventory response containing {0} items", allItems.Count.ToString());
return allItems;
}
/// <summary> /// <summary>
/// Guid to UUID wrapper for same name IInventoryServices method /// Guid to UUID wrapper for same name IInventoryServices method
/// </summary> /// </summary>

View File

@ -105,10 +105,18 @@ namespace OpenSim.Grid.InventoryServer
new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( new RestDeserialiseSecureHandler<InventoryFolderBase, bool>(
"POST", "/PurgeFolder/", m_inventoryService.PurgeFolder, m_inventoryService.CheckAuthSession)); "POST", "/PurgeFolder/", m_inventoryService.PurgeFolder, m_inventoryService.CheckAuthSession));
m_httpServer.AddStreamHandler(
new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>>(
"POST", "/GetItems/", m_inventoryService.GetFolderItems, m_inventoryService.CheckTrustSource));
m_httpServer.AddStreamHandler( m_httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler<InventoryItemBase, bool>( new RestDeserialiseSecureHandler<InventoryItemBase, bool>(
"POST", "/NewItem/", m_inventoryService.AddItem, m_inventoryService.CheckAuthSession)); "POST", "/NewItem/", m_inventoryService.AddItem, m_inventoryService.CheckAuthSession));
m_httpServer.AddStreamHandler(
new RestDeserialiseTrustedHandler<InventoryItemBase, bool>(
"POST", "/AddNewItem/", m_inventoryService.AddItem, m_inventoryService.CheckTrustSource));
m_httpServer.AddStreamHandler( m_httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler<InventoryItemBase, bool>( new RestDeserialiseSecureHandler<InventoryItemBase, bool>(
"POST", "/DeleteItem/", m_inventoryService.DeleteItem, m_inventoryService.CheckAuthSession)); "POST", "/DeleteItem/", m_inventoryService.DeleteItem, m_inventoryService.CheckAuthSession));

View File

@ -62,7 +62,7 @@ namespace OpenSim.Grid.MessagingServer
messageserver.Work(); messageserver.Work();
} }
private OpenMessage_Main() public OpenMessage_Main()
{ {
m_console = new ConsoleBase("Messaging", this); m_console = new ConsoleBase("Messaging", this);
MainConsole.Instance = m_console; MainConsole.Instance = m_console;
@ -174,7 +174,7 @@ namespace OpenSim.Grid.MessagingServer
m_console.Notice("register - (Re-)registers with user-server. This might be necessary if the userserver crashed/restarted"); m_console.Notice("register - (Re-)registers with user-server. This might be necessary if the userserver crashed/restarted");
} }
protected override void ShutdownSpecific() public override void ShutdownSpecific()
{ {
msgsvc.deregisterWithUserServer(); msgsvc.deregisterWithUserServer();
} }

View File

@ -393,7 +393,7 @@ namespace OpenSim.Grid.UserServer
} }
protected override void ShutdownSpecific() public override void ShutdownSpecific()
{ {
m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation;
} }

View File

@ -41,7 +41,7 @@ using OpenSim.Framework.Statistics;
using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver; using OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver;
using Timer=System.Timers.Timer; using Timer = System.Timers.Timer;
namespace OpenSim namespace OpenSim
{ {
@ -63,7 +63,8 @@ namespace OpenSim
/// </summary> /// </summary>
private static List<ConsolePluginCommand> m_PluginCommandInfos = new List<ConsolePluginCommand>(); private static List<ConsolePluginCommand> m_PluginCommandInfos = new List<ConsolePluginCommand>();
public OpenSim(IConfigSource configSource) : base(configSource) public OpenSim(IConfigSource configSource)
: base(configSource)
{ {
} }
@ -98,7 +99,7 @@ namespace OpenSim
base.StartupSpecific(); base.StartupSpecific();
//Run Startup Commands //Run Startup Commands
if (String.IsNullOrEmpty( m_startupCommandsFile )) if (String.IsNullOrEmpty(m_startupCommandsFile))
{ {
m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); m_log.Info("[STARTUP]: No startup command script specified. Moving on...");
} }
@ -121,7 +122,7 @@ namespace OpenSim
RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving"); RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving");
// For now, start at the 'root' level by default // For now, start at the 'root' level by default
ChangeSelectedRegion(new string[] {"root"}); ChangeSelectedRegion(new string[] { "root" });
} }
private void RunAutoTimerScript(object sender, EventArgs e) private void RunAutoTimerScript(object sender, EventArgs e)
@ -138,7 +139,7 @@ namespace OpenSim
{ {
for (int i = 0; i < cmdparams.Length; i++) for (int i = 0; i < cmdparams.Length; i++)
{ {
m_log.Info("[EchoTest]: <arg" + i + ">"+cmdparams[i]+"</arg" + i + ">"); m_log.Info("[EchoTest]: <arg" + i + ">" + cmdparams[i] + "</arg" + i + ">");
} }
} }
@ -216,7 +217,7 @@ namespace OpenSim
public override void RunCmd(string command, string[] cmdparams) public override void RunCmd(string command, string[] cmdparams)
{ {
base.RunCmd(command, cmdparams); base.RunCmd(command, cmdparams);
RunPluginCommands(command , cmdparams); RunPluginCommands(command, cmdparams);
switch (command) switch (command)
{ {
@ -373,9 +374,9 @@ namespace OpenSim
} }
else else
{ {
// IConfig c = DefaultConfig().Configs[cmdparams[1]]; // IConfig c = DefaultConfig().Configs[cmdparams[1]];
// if (c == null) // if (c == null)
// c = DefaultConfig().AddConfig(cmdparams[1]); // c = DefaultConfig().AddConfig(cmdparams[1]);
IConfig c; IConfig c;
IConfigSource source = new IniConfigSource(); IConfigSource source = new IniConfigSource();
c = source.AddConfig(cmdparams[1]); c = source.AddConfig(cmdparams[1]);
@ -728,9 +729,49 @@ namespace OpenSim
scene.RegionInfo.RegionLocY + " , Region Port: " + scene.RegionInfo.InternalEndPoint.Port.ToString()); scene.RegionInfo.RegionLocY + " , Region Port: " + scene.RegionInfo.InternalEndPoint.Port.ToString());
}); });
break; break;
case "queues":
Notice(GetQueuesReport());
break;
} }
} }
private string GetQueuesReport()
{
string report = String.Empty;
m_sceneManager.ForEachScene(delegate(Scene scene)
{
scene.ForEachClient(delegate(IClientAPI client)
{
if (client is IStatsCollector)
{
report = report + client.FirstName +
" " + client.LastName + "\n";
IStatsCollector stats =
(IStatsCollector)client;
report = report + string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}\n",
"Send",
"In",
"Out",
"Resend",
"Land",
"Wind",
"Cloud",
"Task",
"Texture",
"Asset");
report = report + stats.Report() +
"\n\n";
}
});
});
return report;
}
/// <summary> /// <summary>
/// Create a new user /// Create a new user
/// </summary> /// </summary>
@ -747,19 +788,19 @@ namespace OpenSim
firstName = MainConsole.Instance.CmdPrompt("First name", "Default"); firstName = MainConsole.Instance.CmdPrompt("First name", "Default");
else firstName = cmdparams[1]; else firstName = cmdparams[1];
if ( cmdparams.Length < 3 ) if (cmdparams.Length < 3)
lastName = MainConsole.Instance.CmdPrompt("Last name", "User"); lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
else lastName = cmdparams[2]; else lastName = cmdparams[2];
if ( cmdparams.Length < 4 ) if (cmdparams.Length < 4)
password = MainConsole.Instance.PasswdPrompt("Password"); password = MainConsole.Instance.PasswdPrompt("Password");
else password = cmdparams[3]; else password = cmdparams[3];
if ( cmdparams.Length < 5 ) if (cmdparams.Length < 5)
regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString())); regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString()));
else regX = Convert.ToUInt32(cmdparams[4]); else regX = Convert.ToUInt32(cmdparams[4]);
if ( cmdparams.Length < 6 ) if (cmdparams.Length < 6)
regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString()));
else regY = Convert.ToUInt32(cmdparams[5]); else regY = Convert.ToUInt32(cmdparams[5]);
@ -787,11 +828,11 @@ namespace OpenSim
firstName = MainConsole.Instance.CmdPrompt("First name"); firstName = MainConsole.Instance.CmdPrompt("First name");
else firstName = cmdparams[2]; else firstName = cmdparams[2];
if ( cmdparams.Length < 4 ) if (cmdparams.Length < 4)
lastName = MainConsole.Instance.CmdPrompt("Last name"); lastName = MainConsole.Instance.CmdPrompt("Last name");
else lastName = cmdparams[3]; else lastName = cmdparams[3];
if ( cmdparams.Length < 5 ) if (cmdparams.Length < 5)
newPassword = MainConsole.Instance.PasswdPrompt("New password"); newPassword = MainConsole.Instance.PasswdPrompt("New password");
else newPassword = cmdparams[4]; else newPassword = cmdparams[4];
@ -828,14 +869,14 @@ namespace OpenSim
} }
if (cmdparams.Length > 2) if (cmdparams.Length > 2)
{ {
loadOffset.X = (float) Convert.ToDecimal(cmdparams[2]); loadOffset.X = (float)Convert.ToDecimal(cmdparams[2]);
if (cmdparams.Length > 3) if (cmdparams.Length > 3)
{ {
loadOffset.Y = (float) Convert.ToDecimal(cmdparams[3]); loadOffset.Y = (float)Convert.ToDecimal(cmdparams[3]);
} }
if (cmdparams.Length > 4) if (cmdparams.Length > 4)
{ {
loadOffset.Z = (float) Convert.ToDecimal(cmdparams[4]); loadOffset.Z = (float)Convert.ToDecimal(cmdparams[4]);
} }
m_console.Error("loadOffsets <X,Y,Z> = <" + loadOffset.X + "," + loadOffset.Y + "," + m_console.Error("loadOffsets <X,Y,Z> = <" + loadOffset.X + "," + loadOffset.Y + "," +
loadOffset.Z + ">"); loadOffset.Z + ">");
@ -947,7 +988,7 @@ namespace OpenSim
string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME); string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME);
new InventoryArchiveWriteRequest( new InventoryArchiveWriteRequest(
m_sceneManager.CurrentOrFirstScene,m_commsManager).execute( m_sceneManager.CurrentOrFirstScene, m_commsManager).execute(
firstName, lastName, invPath, savePath); firstName, lastName, invPath, savePath);
} }
@ -971,7 +1012,7 @@ namespace OpenSim
{ {
ConsolePluginCommand bestMatch = null; ConsolePluginCommand bestMatch = null;
int bestLength = 0; int bestLength = 0;
String cmdWithParams = cmd + " " + String.Join(" ",withParams); String cmdWithParams = cmd + " " + String.Join(" ", withParams);
foreach (ConsolePluginCommand cmdinfo in m_PluginCommandInfos) foreach (ConsolePluginCommand cmdinfo in m_PluginCommandInfos)
{ {
int matchLen = cmdinfo.matchLength(cmdWithParams); int matchLen = cmdinfo.matchLength(cmdWithParams);
@ -982,7 +1023,7 @@ namespace OpenSim
} }
} }
if (bestMatch == null) return false; if (bestMatch == null) return false;
bestMatch.Run(cmd,withParams);//.Substring(bestLength)); bestMatch.Run(cmd, withParams);//.Substring(bestLength));
return true; return true;
} }

View File

@ -542,7 +542,7 @@ namespace OpenSim
/// <summary> /// <summary>
/// Performs any last-minute sanity checking and shuts down the region server /// Performs any last-minute sanity checking and shuts down the region server
/// </summary> /// </summary>
protected override void ShutdownSpecific() public override void ShutdownSpecific()
{ {
if (proxyUrl.Length > 0) if (proxyUrl.Length > 0)
{ {

View File

@ -51,7 +51,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Handles new client connections /// Handles new client connections
/// Constructor takes a single Packet and authenticates everything /// Constructor takes a single Packet and authenticates everything
/// </summary> /// </summary>
public class LLClientView : IClientAPI public class LLClientView : IClientAPI, IStatsCollector
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -116,7 +116,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected UUID m_activeGroupID = UUID.Zero; protected UUID m_activeGroupID = UUID.Zero;
protected string m_activeGroupName = String.Empty; protected string m_activeGroupName = String.Empty;
protected ulong m_activeGroupPowers; protected ulong m_activeGroupPowers;
protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>(); protected Dictionary<UUID, ulong> m_groupPowers = new Dictionary<UUID, ulong>();
/* Instantiated Designated Event Delegates */ /* Instantiated Designated Event Delegates */
//- used so we don't create new objects for each incoming packet and then toss it out later */ //- used so we don't create new objects for each incoming packet and then toss it out later */
@ -2224,9 +2224,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
awb.ItemID = wearables[i].ItemID; awb.ItemID = wearables[i].ItemID;
aw.WearableData[i] = awb; aw.WearableData[i] = awb;
// m_log.DebugFormat( // m_log.DebugFormat(
// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}", // "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}",
// awb.ItemID, awb.AssetID, i, Name); // awb.ItemID, awb.AssetID, i, Name);
} }
OutPacket(aw, ThrottleOutPacketType.Task); OutPacket(aw, ThrottleOutPacketType.Task);
@ -2732,7 +2732,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendBannedUserList(UUID invoice, EstateBan[] bl, uint estateID) public void SendBannedUserList(UUID invoice, EstateBan[] bl, uint estateID)
{ {
List<UUID>BannedUsers = new List<UUID>(); List<UUID> BannedUsers = new List<UUID>();
for (int i = 0; i < bl.Length; i++) for (int i = 0; i < bl.Length; i++)
{ {
@ -3475,7 +3475,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public bool HandleGenericMessage(IClientAPI sender, Packet pack) public bool HandleGenericMessage(IClientAPI sender, Packet pack)
{ {
GenericMessagePacket gmpack = (GenericMessagePacket) pack; GenericMessagePacket gmpack = (GenericMessagePacket)pack;
handlerGenericMessage = OnGenericMessage; handlerGenericMessage = OnGenericMessage;
List<string> msg = new List<string>(); List<string> msg = new List<string>();
@ -3888,7 +3888,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public virtual void InPacket(object NewPack) public virtual void InPacket(object NewPack)
{ {
// Cast NewPack to Packet. // Cast NewPack to Packet.
m_PacketHandler.InPacket((Packet) NewPack); m_PacketHandler.InPacket((Packet)NewPack);
} }
@ -3981,7 +3981,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Main packet processing conditional // Main packet processing conditional
switch (Pack.Type) switch (Pack.Type)
{ {
#region Scene/Avatar #region Scene/Avatar
case PacketType.GenericMessage: case PacketType.GenericMessage:
GenericMessagePacket gmpack = (GenericMessagePacket)Pack; GenericMessagePacket gmpack = (GenericMessagePacket)Pack;
@ -4143,7 +4143,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
break; break;
case PacketType.DeRezObject: case PacketType.DeRezObject:
DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) Pack; DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)Pack;
handlerDeRezObject = OnDeRezObject; handlerDeRezObject = OnDeRezObject;
if (handlerDeRezObject != null) if (handlerDeRezObject != null)
{ {
@ -4494,9 +4494,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
#endregion #endregion
#region Objects/m_sceneObjects #region Objects/m_sceneObjects
case PacketType.ObjectLink: case PacketType.ObjectLink:
ObjectLinkPacket link = (ObjectLinkPacket)Pack; ObjectLinkPacket link = (ObjectLinkPacket)Pack;
@ -4950,9 +4950,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
#endregion #endregion
#region Inventory/Asset/Other related packets #region Inventory/Asset/Other related packets
case PacketType.RequestImage: case PacketType.RequestImage:
RequestImagePacket imageRequest = (RequestImagePacket)Pack; RequestImagePacket imageRequest = (RequestImagePacket)Pack;
@ -5009,7 +5009,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (ti.OwnerID != AgentId) if (ti.OwnerID != AgentId)
break; break;
if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
break; break;
if (ti.AssetID != requestID) if (ti.AssetID != requestID)
@ -5565,7 +5565,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
#endregion #endregion
case PacketType.UUIDNameRequest: case PacketType.UUIDNameRequest:
UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack;
@ -5579,7 +5579,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
#region Parcel related packets #region Parcel related packets
case PacketType.RegionHandleRequest: case PacketType.RegionHandleRequest:
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
@ -5774,9 +5774,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
#endregion #endregion
#region Estate Packets #region Estate Packets
case PacketType.EstateOwnerMessage: case PacketType.EstateOwnerMessage:
EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack;
@ -5802,21 +5802,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
// case "texturebase": // case "texturebase":
// if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(AgentId, false)) // if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(AgentId, false))
// { // {
// foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) // foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
// { // {
// string s = Utils.BytesToString(block.Parameter); // string s = Utils.BytesToString(block.Parameter);
// string[] splitField = s.Split(' '); // string[] splitField = s.Split(' ');
// if (splitField.Length == 2) // if (splitField.Length == 2)
// { // {
// UUID tempUUID = new UUID(splitField[1]); // UUID tempUUID = new UUID(splitField[1]);
// OnSetEstateTerrainBaseTexture(this, Convert.ToInt16(splitField[0]), tempUUID); // OnSetEstateTerrainBaseTexture(this, Convert.ToInt16(splitField[0]), tempUUID);
// } // }
// } // }
// } // }
// break; // break;
case "texturedetail": case "texturedetail":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(AgentId, false)) if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(AgentId, false))
{ {
@ -6066,9 +6066,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
#endregion #endregion
#region GodPackets #region GodPackets
case PacketType.RequestGodlikePowers: case PacketType.RequestGodlikePowers:
RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack; RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack;
@ -6114,9 +6114,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//OutPacket(kupack, ThrottleOutPacketType.Task); //OutPacket(kupack, ThrottleOutPacketType.Task);
break; break;
#endregion #endregion
#region Economy/Transaction Packets #region Economy/Transaction Packets
case PacketType.MoneyBalanceRequest: case PacketType.MoneyBalanceRequest:
MoneyBalanceRequestPacket moneybalancerequestpacket = (MoneyBalanceRequestPacket)Pack; MoneyBalanceRequestPacket moneybalancerequestpacket = (MoneyBalanceRequestPacket)Pack;
@ -6187,9 +6187,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
#endregion #endregion
#region Script Packets #region Script Packets
case PacketType.GetScriptRunning: case PacketType.GetScriptRunning:
GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack; GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack;
@ -6218,9 +6218,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
#endregion #endregion
#region Gesture Managment #region Gesture Managment
case PacketType.ActivateGestures: case PacketType.ActivateGestures:
ActivateGesturesPacket activateGesturePacket = (ActivateGesturesPacket)Pack; ActivateGesturesPacket activateGesturePacket = (ActivateGesturesPacket)Pack;
@ -6258,10 +6258,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
#endregion #endregion
#region unimplemented handlers #region unimplemented handlers
case PacketType.StartPingCheck: case PacketType.StartPingCheck:
// Send the client the ping response back // Send the client the ping response back
@ -6279,10 +6279,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//m_log.Warn("[CLIENT]: unhandled ViewerStats packet"); //m_log.Warn("[CLIENT]: unhandled ViewerStats packet");
break; break;
//case PacketType.GenericMessage: //case PacketType.GenericMessage:
// TODO: handle this packet // TODO: handle this packet
//m_log.Warn("[CLIENT]: unhandled GenericMessage packet"); //m_log.Warn("[CLIENT]: unhandled GenericMessage packet");
//break; //break;
case PacketType.MapItemRequest: case PacketType.MapItemRequest:
// TODO: handle this packet // TODO: handle this packet
MapItemRequestPacket mirpk = (MapItemRequestPacket)Pack; MapItemRequestPacket mirpk = (MapItemRequestPacket)Pack;
@ -6290,8 +6290,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerMapItemRequest = OnMapItemRequest; handlerMapItemRequest = OnMapItemRequest;
if (handlerMapItemRequest != null) if (handlerMapItemRequest != null)
{ {
handlerMapItemRequest(this,mirpk.AgentData.Flags, mirpk.AgentData.EstateID, handlerMapItemRequest(this, mirpk.AgentData.Flags, mirpk.AgentData.EstateID,
mirpk.AgentData.Godlike,mirpk.RequestData.ItemType, mirpk.AgentData.Godlike, mirpk.RequestData.ItemType,
mirpk.RequestData.RegionHandle); mirpk.RequestData.RegionHandle);
} }
@ -6894,7 +6894,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_log.Warn("[CLIENT]: unhandled packet " + Pack); m_log.Warn("[CLIENT]: unhandled packet " + Pack);
break; break;
#endregion #endregion
} }
PacketPool.Instance.ReturnPacket(Pack); PacketPool.Instance.ReturnPacket(Pack);
@ -7209,7 +7209,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
ParcelMediaCommandMessagePacket commandMessagePacket = new ParcelMediaCommandMessagePacket(); ParcelMediaCommandMessagePacket commandMessagePacket = new ParcelMediaCommandMessagePacket();
commandMessagePacket.CommandBlock.Flags = flags; commandMessagePacket.CommandBlock.Flags = flags;
commandMessagePacket.CommandBlock.Command =(uint) command; commandMessagePacket.CommandBlock.Command = (uint)command;
commandMessagePacket.CommandBlock.Time = time; commandMessagePacket.CommandBlock.Time = time;
OutPacket(commandMessagePacket, ThrottleOutPacketType.Unknown); OutPacket(commandMessagePacket, ThrottleOutPacketType.Unknown);
@ -7238,7 +7238,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region Camera #region Camera
public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters) public void SendSetFollowCamProperties(UUID objectID, SortedDictionary<int, float> parameters)
{ {
SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties); SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties);
packet.ObjectData.ObjectID = objectID; packet.ObjectData.ObjectID = objectID;
@ -7256,7 +7256,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(packet, ThrottleOutPacketType.Task); OutPacket(packet, ThrottleOutPacketType.Task);
} }
public void SendClearFollowCamProperties (UUID objectID) public void SendClearFollowCamProperties(UUID objectID)
{ {
ClearFollowCamPropertiesPacket packet = (ClearFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ClearFollowCamProperties); ClearFollowCamPropertiesPacket packet = (ClearFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ClearFollowCamProperties);
packet.ObjectData.ObjectID = objectID; packet.ObjectData.ObjectID = objectID;
@ -7265,7 +7265,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion #endregion
public void SendRegionHandle(UUID regionID, ulong handle) { public void SendRegionHandle(UUID regionID, ulong handle)
{
RegionIDAndHandleReplyPacket reply = (RegionIDAndHandleReplyPacket)PacketPool.Instance.GetPacket(PacketType.RegionIDAndHandleReply); RegionIDAndHandleReplyPacket reply = (RegionIDAndHandleReplyPacket)PacketPool.Instance.GetPacket(PacketType.RegionIDAndHandleReply);
reply.ReplyBlock.RegionID = regionID; reply.ReplyBlock.RegionID = regionID;
reply.ReplyBlock.RegionHandle = handle; reply.ReplyBlock.RegionHandle = handle;
@ -7321,14 +7322,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
switch (option) switch (option)
{ {
case "ReliableIsImportant": case "ReliableIsImportant":
bool val; bool val;
if (bool.TryParse(value, out val)) if (bool.TryParse(value, out val))
m_PacketHandler.ReliableIsImportant = val; m_PacketHandler.ReliableIsImportant = val;
break; break;
default: default:
break; break;
} }
} }
@ -7586,7 +7587,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
mirplk.AgentData.AgentID = AgentId; mirplk.AgentData.AgentID = AgentId;
mirplk.RequestData.ItemType = mapitemtype; mirplk.RequestData.ItemType = mapitemtype;
mirplk.Data = new MapItemReplyPacket.DataBlock[replies.Length]; mirplk.Data = new MapItemReplyPacket.DataBlock[replies.Length];
for (int i = 0; i < replies.Length; i++ ) for (int i = 0; i < replies.Length; i++)
{ {
MapItemReplyPacket.DataBlock mrdata = new MapItemReplyPacket.DataBlock(); MapItemReplyPacket.DataBlock mrdata = new MapItemReplyPacket.DataBlock();
mrdata.X = replies[i].x; mrdata.X = replies[i].x;
@ -7676,5 +7677,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
KillPacket kp = new KillPacket(); KillPacket kp = new KillPacket();
OutPacket(kp, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority); OutPacket(kp, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority);
} }
public string Report()
{
LLPacketHandler handler = (LLPacketHandler)m_PacketHandler;
return handler.PacketQueue.GetStats();
}
} }
} }

View File

@ -576,7 +576,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// See IPullStatsProvider // See IPullStatsProvider
public string GetStats() public string GetStats()
{ {
return string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}", return string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}",
SendQueue.Count(), SendQueue.Count(),
IncomingPacketQueue.Count, IncomingPacketQueue.Count,
OutgoingPacketQueue.Count, OutgoingPacketQueue.Count,

View File

@ -1547,7 +1547,16 @@ namespace OpenSim.Region.Communications.OGS1
IPAddress ia; IPAddress ia;
IPAddress.TryParse(address, out ia); IPAddress.TryParse(address, out ia);
IPEndPoint m_EndPoint = new IPEndPoint(ia, (int)port); IPEndPoint m_EndPoint;
try
{
m_EndPoint = new IPEndPoint(ia, (int)port);
}
catch (Exception)
{
m_log.Debug("[OGS1 GRID SERVICES]: Invalid remoting address: " + address);
return false;
}
AsyncCallback callback = delegate(IAsyncResult iar) AsyncCallback callback = delegate(IAsyncResult iar)
{ {

View File

@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory
public bool IsSharedModule public bool IsSharedModule
{ {
get { return true; } get { return false; }
} }
public void NewClient(IClientAPI client) public void NewClient(IClientAPI client)

View File

@ -64,6 +64,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
// Bypasses the permissions engine // Bypasses the permissions engine
private bool m_bypassPermissions = false; private bool m_bypassPermissions = false;
private bool m_bypassPermissionsValue = true; private bool m_bypassPermissionsValue = true;
private bool m_propagatePermissions = false;
private bool m_debugPermissions = false; private bool m_debugPermissions = false;
private bool m_allowGridGods = false; private bool m_allowGridGods = false;
private bool m_RegionOwnerIsGod = false; private bool m_RegionOwnerIsGod = false;
@ -144,6 +145,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
m_allowGridGods = myConfig.GetBoolean("allow_grid_gods", false); m_allowGridGods = myConfig.GetBoolean("allow_grid_gods", false);
m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
m_propagatePermissions = myConfig.GetBoolean("propagate_permissions", true);
m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true);
m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true);
@ -276,7 +278,10 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
public bool PropagatePermissions() public bool PropagatePermissions()
{ {
return false; if (m_bypassPermissions)
return false;
return m_propagatePermissions;
} }
public bool BypassPermissions() public bool BypassPermissions()
@ -586,6 +591,17 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
//They can't even edit the object //They can't even edit the object
return false; return false;
} }
SceneObjectPart part = scene.GetSceneObjectPart(objectID);
if (part == null)
return false;
if ((part.OwnerMask & PERM_COPY) == 0)
return false;
if ((part.ParentGroup.GetEffectivePermissions() & PERM_COPY) == 0)
return false;
//If they can rez, they can duplicate //If they can rez, they can duplicate
return CanRezObject(objectCount, owner, objectPosition, scene); return CanRezObject(objectCount, owner, objectPosition, scene);
} }
@ -983,7 +999,18 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
if ((task.RootPart.EveryoneMask & PERM_COPY) != 0) if ((task.RootPart.EveryoneMask & PERM_COPY) != 0)
permission = true; permission = true;
if ((task.GetEffectivePermissions() & PERM_COPY) == 0)
permission = false;
} }
else
{
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID];
if ((task.GetEffectivePermissions() & PERM_COPY) == 0)
permission = false;
}
return permission; return permission;
} }

View File

@ -88,23 +88,23 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
FileStream s = file.Open(FileMode.Open, FileAccess.Read); FileStream s = file.Open(FileMode.Open, FileAccess.Read);
BinaryReader bs = new BinaryReader(s); BinaryReader bs = new BinaryReader(s);
int currFileYOffset = 0; int currFileYOffset = fileHeight - 1;
// if our region isn't on the first Y section of the areas to be landscaped, then // if our region isn't on the first Y section of the areas to be landscaped, then
// advance to our section of the file // advance to our section of the file
while (currFileYOffset < offsetY) while (currFileYOffset > offsetY)
{ {
// read a whole strip of regions // read a whole strip of regions
int heightsToRead = sectionHeight * (fileWidth * sectionWidth); int heightsToRead = sectionHeight * (fileWidth * sectionWidth);
bs.ReadBytes(heightsToRead * 13); // because there are 13 fun channels bs.ReadBytes(heightsToRead * 13); // because there are 13 fun channels
currFileYOffset++; currFileYOffset--;
} }
// got to the Y start offset within the file of our region // got to the Y start offset within the file of our region
// so read the file bits associated with our region // so read the file bits associated with our region
int y; int y;
// for each Y within our Y offset // for each Y within our Y offset
for (y = 0; y < sectionHeight; y++) for (y = sectionHeight - 1; y >= 0; y--)
{ {
int currFileXOffset = 0; int currFileXOffset = 0;
@ -155,7 +155,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
int x; int x;
for (x = 0; x < retval.Width; x++) for (x = 0; x < retval.Width; x++)
{ {
retval[x, y] = bs.ReadByte() * (bs.ReadByte() / 128.0); retval[x, (retval.Height - 1) - y] = bs.ReadByte() * (bs.ReadByte() / 128.0);
bs.ReadBytes(11); // Advance the stream to next bytes. bs.ReadBytes(11); // Advance the stream to next bytes.
} }
} }
@ -183,7 +183,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
{ {
for (int x = 0; x < map.Width; x++) for (int x = 0; x < map.Width; x++)
{ {
double t = map[x, y]; double t = map[x, (map.Height - 1) - y];
int index = 0; int index = 0;
// The lookup table is pre-sorted, so we either find an exact match or // The lookup table is pre-sorted, so we either find an exact match or

View File

@ -752,6 +752,47 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
CheckForTerrainUpdates(); CheckForTerrainUpdates();
} }
private void InterfaceFlipTerrain(Object[] args)
{
String direction = (String)args[0];
if( direction.ToLower().StartsWith("y"))
{
for (int x = 0; x < Constants.RegionSize; x++)
{
for (int y = 0; y < Constants.RegionSize / 2; y++)
{
double height = m_channel[x, y];
double flippedHeight = m_channel[x, (int)Constants.RegionSize - 1 - y];
m_channel[x, y] = flippedHeight;
m_channel[x, (int)Constants.RegionSize - 1 - y] = height;
}
}
}
else if (direction.ToLower().StartsWith("x"))
{
for (int y = 0; y < Constants.RegionSize; y++)
{
for (int x = 0; x < Constants.RegionSize / 2; x++)
{
double height = m_channel[x, y];
double flippedHeight = m_channel[(int)Constants.RegionSize - 1 - x, y];
m_channel[x, y] = flippedHeight;
m_channel[(int)Constants.RegionSize - 1 - x, y] = height;
}
}
}
else
{
m_log.Error("Unrecognised direction - need x or y");
}
CheckForTerrainUpdates();
}
private void InterfaceElevateTerrain(Object[] args) private void InterfaceElevateTerrain(Object[] args)
{ {
int x, y; int x, y;
@ -910,6 +951,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
Command revertRegionCommand = Command revertRegionCommand =
new Command("revert", CommandIntentions.COMMAND_HAZARDOUS, InterfaceRevertTerrain, "Loads the revert map terrain into the regions heightmap."); new Command("revert", CommandIntentions.COMMAND_HAZARDOUS, InterfaceRevertTerrain, "Loads the revert map terrain into the regions heightmap.");
Command flipCommand =
new Command("flip", CommandIntentions.COMMAND_HAZARDOUS, InterfaceFlipTerrain, "Flips the current terrain about the X or Y axis");
flipCommand.AddArgument("direction", "[x|y] the direction to flip the terrain in", "String");
// Debug // Debug
Command showDebugStatsCommand = Command showDebugStatsCommand =
new Command("stats", CommandIntentions.COMMAND_STATISTICAL, InterfaceShowDebugStats, new Command("stats", CommandIntentions.COMMAND_STATISTICAL, InterfaceShowDebugStats,
@ -937,6 +982,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
m_commander.RegisterCommand("newbrushes", experimentalBrushesCommand); m_commander.RegisterCommand("newbrushes", experimentalBrushesCommand);
m_commander.RegisterCommand("stats", showDebugStatsCommand); m_commander.RegisterCommand("stats", showDebugStatsCommand);
m_commander.RegisterCommand("effect", pluginRunCommand); m_commander.RegisterCommand("effect", pluginRunCommand);
m_commander.RegisterCommand("flip", flipCommand);
// Add this to our scene so scripts can call these functions // Add this to our scene so scripts can call these functions
m_scene.RegisterModuleCommander("Terrain", m_commander); m_scene.RegisterModuleCommander("Terrain", m_commander);

View File

@ -163,6 +163,8 @@ namespace OpenSim.Region.Environment.Scenes
private Thread HeartbeatThread; private Thread HeartbeatThread;
private volatile bool shuttingdown = false; private volatile bool shuttingdown = false;
private object m_deleting_scene_object = new object();
#endregion #endregion
#region Properties #region Properties
@ -639,6 +641,17 @@ namespace OpenSim.Region.Environment.Scenes
// Stop updating the scene objects and agents. // Stop updating the scene objects and agents.
//m_heartbeatTimer.Close(); //m_heartbeatTimer.Close();
shuttingdown = true; shuttingdown = true;
m_log.Debug("[SCENE]: Persisting changed objects");
List<EntityBase> entities = GetEntities();
foreach (EntityBase entity in entities)
{
if (!entity.IsDeleted && entity is SceneObjectGroup && ((SceneObjectGroup)entity).HasGroupChanged)
{
((SceneObjectGroup)entity).ProcessBackup(m_storageManager.DataStore);
}
}
// close the inner scene // close the inner scene
m_innerScene.Close(); m_innerScene.Close();
// De-register with region communications (events cleanup) // De-register with region communications (events cleanup)
@ -1823,7 +1836,11 @@ namespace OpenSim.Region.Environment.Scenes
{ {
//SceneObjectPart rootPart = group.GetChildPart(group.UUID); //SceneObjectPart rootPart = group.GetChildPart(group.UUID);
group.RemoveScriptInstances(); // Serialise calls to RemoveScriptInstances to avoid
// deadlocking on m_parts inside SceneObjectGroup
lock (m_deleting_scene_object) {
group.RemoveScriptInstances();
}
foreach (SceneObjectPart part in group.Children.Values) foreach (SceneObjectPart part in group.Children.Values)
{ {
@ -4030,7 +4047,7 @@ namespace OpenSim.Region.Environment.Scenes
return m_innerScene.TryGetAvatarByName(avatarName, out avatar); return m_innerScene.TryGetAvatarByName(avatarName, out avatar);
} }
internal void ForEachClient(Action<IClientAPI> action) public void ForEachClient(Action<IClientAPI> action)
{ {
m_innerScene.ForEachClient(action); m_innerScene.ForEachClient(action);
} }

View File

@ -80,6 +80,7 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_eventManager; } get { return m_eventManager; }
} }
protected SceneExternalChecks m_externalChecks; protected SceneExternalChecks m_externalChecks;
public SceneExternalChecks ExternalChecks public SceneExternalChecks ExternalChecks
{ {
@ -88,6 +89,8 @@ namespace OpenSim.Region.Environment.Scenes
protected string m_datastore; protected string m_datastore;
private uint m_nextAvatarLocalId = 8880000;
private AssetCache m_assetCache; private AssetCache m_assetCache;
public AssetCache AssetCache public AssetCache AssetCache
@ -161,6 +164,11 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_regInfo; } get { return m_regInfo; }
} }
public uint NextAvatarLocalId
{
get { return m_nextAvatarLocalId++; }
}
#region admin stuff #region admin stuff
/// <summary> /// <summary>

View File

@ -1192,6 +1192,9 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="datastore"></param> /// <param name="datastore"></param>
public void ProcessBackup(IRegionDataStore datastore) public void ProcessBackup(IRegionDataStore datastore)
{ {
if (!m_isBackedUp)
return;
// Since this is the top of the section of call stack for backing up a particular scene object, don't let // Since this is the top of the section of call stack for backing up a particular scene object, don't let
// any exception propogate upwards. // any exception propogate upwards.

View File

@ -492,7 +492,7 @@ namespace OpenSim.Region.Environment.Scenes
m_scene = world; m_scene = world;
m_uuid = client.AgentId; m_uuid = client.AgentId;
m_regionInfo = reginfo; m_regionInfo = reginfo;
m_localId = m_scene.AllocateLocalId(); m_localId = m_scene.NextAvatarLocalId;
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
if (gm != null) if (gm != null)
@ -758,7 +758,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y); float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y);
float newPosZ = posZLimit + localAVHeight; float newPosZ = posZLimit + localAVHeight / 2;
if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
{ {
pos.Z = newPosZ; pos.Z = newPosZ;
@ -1751,6 +1751,7 @@ namespace OpenSim.Region.Environment.Scenes
Vector3 pos = m_pos; Vector3 pos = m_pos;
Vector3 vel = Velocity; Vector3 vel = Velocity;
Quaternion rot = m_bodyRot; Quaternion rot = m_bodyRot;
pos.Z -= m_appearance.HipOffset;
remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z), remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z),
new Vector3(vel.X, vel.Y, vel.Z), rot); new Vector3(vel.X, vel.Y, vel.Z), rot);
@ -1834,6 +1835,9 @@ namespace OpenSim.Region.Environment.Scenes
// Note: because Quaternion is a struct, it can't be null // Note: because Quaternion is a struct, it can't be null
Quaternion rot = m_bodyRot; Quaternion rot = m_bodyRot;
Vector3 pos = m_pos;
pos.Z -= m_appearance.HipOffset;
remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid,
LocalId, m_pos, m_appearance.Texture.ToBytes(), LocalId, m_pos, m_appearance.Texture.ToBytes(),
m_parentID, rot); m_parentID, rot);
@ -1899,6 +1903,9 @@ namespace OpenSim.Region.Environment.Scenes
// Note: because Quaternion is a struct, it can't be null // Note: because Quaternion is a struct, it can't be null
Quaternion rot = m_bodyRot; Quaternion rot = m_bodyRot;
Vector3 pos = m_pos;
pos.Z -= m_appearance.HipOffset;
m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId,
m_pos, m_appearance.Texture.ToBytes(), m_parentID, rot); m_pos, m_appearance.Texture.ToBytes(), m_parentID, rot);
@ -2214,6 +2221,8 @@ namespace OpenSim.Region.Environment.Scenes
CrossAttachmentsIntoNewRegion(neighbourHandle, true); CrossAttachmentsIntoNewRegion(neighbourHandle, true);
// m_scene.SendKillObject(m_localId);
m_scene.NotifyMyCoarseLocationChange(); m_scene.NotifyMyCoarseLocationChange();
// the user may change their profile information in other region, // the user may change their profile information in other region,
// so the userinfo in UserProfileCache is not reliable any more, delete it // so the userinfo in UserProfileCache is not reliable any more, delete it
@ -2263,6 +2272,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY) public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY)
{ {
//
if (!IsChildAgent) if (!IsChildAgent)
return; return;

View File

@ -55,7 +55,7 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
public class OdeCharacter : PhysicsActor public class OdeCharacter : PhysicsActor
{ {
//private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private PhysicsVector _position; private PhysicsVector _position;
private d.Vector3 _zeroPosition; private d.Vector3 _zeroPosition;
@ -145,7 +145,8 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
m_colliderarr[i] = false; m_colliderarr[i] = false;
} }
CAPSULE_LENGTH = (size.Z - ((size.Z * height_fudge_factor))); CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
//m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString());
lock (_parent_scene.OdeLock) lock (_parent_scene.OdeLock)
{ {
@ -395,7 +396,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// float capsuleradius = CAPSULE_RADIUS; // float capsuleradius = CAPSULE_RADIUS;
//capsuleradius = 0.2f; //capsuleradius = 0.2f;
CAPSULE_LENGTH = (SetSize.Z - ((SetSize.Z * heightFudgeFactor))); // subtract 43% of the size CAPSULE_LENGTH = (SetSize.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
//m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString()); //m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString());
d.BodyDestroy(Body); d.BodyDestroy(Body);

View File

@ -2589,6 +2589,7 @@
<Reference name="OpenSim.Framework"/> <Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Data"/> <Reference name="OpenSim.Data"/>
<Reference name="OpenSim.Framework.Servers"/> <Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Framework.Statistics"/>
<Reference name="OpenSim.Framework.Console"/> <Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Region.Environment"/> <Reference name="OpenSim.Region.Environment"/>
<Reference name="OpenSim.Region.ClientStack"/> <Reference name="OpenSim.Region.ClientStack"/>