Compare commits
65 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76f411147d | ||
|
|
15ce73caca | ||
|
|
a27e5a9c95 | ||
|
|
daee2eda93 | ||
|
|
a15b00d3ef | ||
|
|
1b906ef2ad | ||
|
|
68a4ef5ef6 | ||
|
|
90dc5f47e7 | ||
|
|
19d271d3fc | ||
|
|
4a329098e8 | ||
|
|
99b9c1a9d5 | ||
|
|
1c3ee5d1ce | ||
|
|
b489c85226 | ||
|
|
dcea23906b | ||
|
|
20c65ac438 | ||
|
|
bcb9577495 | ||
|
|
d22715126c | ||
|
|
a114367b9b | ||
|
|
2ffc055f7e | ||
|
|
14e9bf894c | ||
|
|
f4cd35322f | ||
|
|
7bdcf9eb26 | ||
|
|
9846a1e56e | ||
|
|
4cc97df8f3 | ||
|
|
0ef64fbe03 | ||
|
|
fbccff4994 | ||
|
|
84184708de | ||
|
|
8f8b478d36 | ||
|
|
b817c337dc | ||
|
|
d03e878d53 | ||
|
|
b313d16493 | ||
|
|
784263f5e3 | ||
|
|
6baa13ab7a | ||
|
|
0e16e0fb6a | ||
|
|
ba98d6fffe | ||
|
|
972f73ed2b | ||
|
|
c5ff37bf3e | ||
|
|
6b867773a8 | ||
|
|
912aac3447 | ||
|
|
4486b7d8e8 | ||
|
|
1267094a51 | ||
|
|
2b842958cc | ||
|
|
80ec2ac167 | ||
|
|
df960d5767 | ||
|
|
c0760f9f91 | ||
|
|
c906128191 | ||
|
|
f574d3c8fc | ||
|
|
ebe5e1731d | ||
|
|
2ebb421331 | ||
|
|
a9e8bd59a3 | ||
|
|
4589ce61bc | ||
|
|
33e66107be | ||
|
|
db90dea9bd | ||
|
|
04544b4510 | ||
|
|
0b17a66e68 | ||
|
|
04986bbb15 | ||
|
|
b0d02adeee | ||
|
|
48b962c401 | ||
|
|
04a195266b | ||
|
|
21393af631 | ||
|
|
189c67db95 | ||
|
|
b92b9228ef | ||
|
|
f49897a419 | ||
|
|
aab30f5e67 | ||
|
|
e7fd732209 |
@@ -235,4 +235,11 @@ CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
|
||||
regionName
|
||||
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
|
||||
COMMIT
|
||||
COMMIT
|
||||
|
||||
:VERSION 9
|
||||
|
||||
BEGIN TRANSACTION
|
||||
ALTER TABLE regions ADD parcelMapTexture uniqueidentifier NULL;
|
||||
|
||||
COMMIT
|
||||
|
||||
@@ -472,3 +472,95 @@ COMMIT;
|
||||
BEGIN;
|
||||
ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 23
|
||||
BEGIN;
|
||||
CREATE TABLE regionwindlight (
|
||||
region_id VARCHAR(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY,
|
||||
water_color_r FLOAT NOT NULL DEFAULT '4.000000',
|
||||
water_color_g FLOAT NOT NULL DEFAULT '38.000000',
|
||||
water_color_b FLOAT NOT NULL DEFAULT '64.000000',
|
||||
water_color_i FLOAT NOT NULL DEFAULT '1.000000',
|
||||
water_fog_density_exponent FLOAT NOT NULL DEFAULT '4.0',
|
||||
underwater_fog_modifier FLOAT NOT NULL DEFAULT '0.25',
|
||||
reflection_wavelet_scale_1 FLOAT NOT NULL DEFAULT '2.0',
|
||||
reflection_wavelet_scale_2 FLOAT NOT NULL DEFAULT '2.0',
|
||||
reflection_wavelet_scale_3 FLOAT NOT NULL DEFAULT '2.0',
|
||||
fresnel_scale FLOAT NOT NULL DEFAULT '0.40',
|
||||
fresnel_offset FLOAT NOT NULL DEFAULT '0.50',
|
||||
refract_scale_above FLOAT NOT NULL DEFAULT '0.03',
|
||||
refract_scale_below FLOAT NOT NULL DEFAULT '0.20',
|
||||
blur_multiplier FLOAT NOT NULL DEFAULT '0.040',
|
||||
big_wave_direction_x FLOAT NOT NULL DEFAULT '1.05',
|
||||
big_wave_direction_y FLOAT NOT NULL DEFAULT '-0.42',
|
||||
little_wave_direction_x FLOAT NOT NULL DEFAULT '1.11',
|
||||
little_wave_direction_y FLOAT NOT NULL DEFAULT '-1.16',
|
||||
normal_map_texture VARCHAR(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4',
|
||||
horizon_r FLOAT NOT NULL DEFAULT '0.25',
|
||||
horizon_g FLOAT NOT NULL DEFAULT '0.25',
|
||||
horizon_b FLOAT NOT NULL DEFAULT '0.32',
|
||||
horizon_i FLOAT NOT NULL DEFAULT '0.32',
|
||||
haze_horizon FLOAT NOT NULL DEFAULT '0.19',
|
||||
blue_density_r FLOAT NOT NULL DEFAULT '0.12',
|
||||
blue_density_g FLOAT NOT NULL DEFAULT '0.22',
|
||||
blue_density_b FLOAT NOT NULL DEFAULT '0.38',
|
||||
blue_density_i FLOAT NOT NULL DEFAULT '0.38',
|
||||
haze_density FLOAT NOT NULL DEFAULT '0.70',
|
||||
density_multiplier FLOAT NOT NULL DEFAULT '0.18',
|
||||
distance_multiplier FLOAT NOT NULL DEFAULT '0.8',
|
||||
max_altitude INTEGER NOT NULL DEFAULT '1605',
|
||||
sun_moon_color_r FLOAT NOT NULL DEFAULT '0.24',
|
||||
sun_moon_color_g FLOAT NOT NULL DEFAULT '0.26',
|
||||
sun_moon_color_b FLOAT NOT NULL DEFAULT '0.30',
|
||||
sun_moon_color_i FLOAT NOT NULL DEFAULT '0.30',
|
||||
sun_moon_position FLOAT NOT NULL DEFAULT '0.317',
|
||||
ambient_r FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_g FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_b FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_i FLOAT NOT NULL DEFAULT '0.35',
|
||||
east_angle FLOAT NOT NULL DEFAULT '0.00',
|
||||
sun_glow_focus FLOAT NOT NULL DEFAULT '0.10',
|
||||
sun_glow_size FLOAT NOT NULL DEFAULT '1.75',
|
||||
scene_gamma FLOAT NOT NULL DEFAULT '1.00',
|
||||
star_brightness FLOAT NOT NULL DEFAULT '0.00',
|
||||
cloud_color_r FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_g FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_b FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_i FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_x FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_y FLOAT NOT NULL DEFAULT '0.53',
|
||||
cloud_density FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_coverage FLOAT NOT NULL DEFAULT '0.27',
|
||||
cloud_scale FLOAT NOT NULL DEFAULT '0.42',
|
||||
cloud_detail_x FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_detail_y FLOAT NOT NULL DEFAULT '0.53',
|
||||
cloud_detail_density FLOAT NOT NULL DEFAULT '0.12',
|
||||
cloud_scroll_x FLOAT NOT NULL DEFAULT '0.20',
|
||||
cloud_scroll_x_lock INTEGER NOT NULL DEFAULT '0',
|
||||
cloud_scroll_y FLOAT NOT NULL DEFAULT '0.01',
|
||||
cloud_scroll_y_lock INTEGER NOT NULL DEFAULT '0',
|
||||
draw_classic_clouds INTEGER NOT NULL DEFAULT '1');
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
:VERSION 24
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `spawn_points` (
|
||||
`RegionID` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
|
||||
`Yaw` float NOT NULL,
|
||||
`Pitch` float NOT NULL,
|
||||
`Distance` float NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 25
|
||||
|
||||
BEGIN;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
COMMIT;
|
||||
|
||||
@@ -81,6 +81,9 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="dbconnect">connect string</param>
|
||||
override public void Initialise(string dbconnect)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
if (dbconnect == string.Empty)
|
||||
{
|
||||
dbconnect = "URI=file:Asset.db,version=3";
|
||||
|
||||
@@ -65,6 +65,9 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
if (!m_initialized)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_Connection = new SqliteConnection(connectionString);
|
||||
m_Connection.Open();
|
||||
|
||||
|
||||
@@ -69,6 +69,9 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
public void Initialise(string connectionString)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_connectionString = connectionString;
|
||||
|
||||
m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
|
||||
|
||||
@@ -48,6 +48,8 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
protected SQLiteFramework(string connectionString)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -77,6 +77,9 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
m_Initialized = true;
|
||||
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
if (dbconnect == string.Empty)
|
||||
{
|
||||
dbconnect = "URI=file:inventoryStore.db,version=3";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -52,6 +52,9 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
public SQLiteXInventoryData(string conn, string realm)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>(
|
||||
conn, "inventoryfolders", "XInventoryStore");
|
||||
m_Items = new SqliteItemHandler(
|
||||
|
||||
@@ -49,15 +49,16 @@ namespace OpenSim.Framework.Serialization.External
|
||||
/// <param name="nodeToFill"></param>
|
||||
/// <param name="processors">/param>
|
||||
/// <param name="xtr"></param>
|
||||
public static void ExecuteReadProcessors<NodeType>(
|
||||
/// <returns>true on successful, false if there were any processing failures</returns>
|
||||
public static bool ExecuteReadProcessors<NodeType>(
|
||||
NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr)
|
||||
{
|
||||
ExecuteReadProcessors(
|
||||
return ExecuteReadProcessors(
|
||||
nodeToFill,
|
||||
processors,
|
||||
xtr,
|
||||
(o, name, e)
|
||||
=> m_log.ErrorFormat(
|
||||
=> m_log.DebugFormat(
|
||||
"[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}",
|
||||
name, e.Message, e.StackTrace));
|
||||
}
|
||||
@@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External
|
||||
/// <param name="parseExceptionAction">
|
||||
/// Action to take if there is a parsing problem. This will usually just be to log the exception
|
||||
/// </param>
|
||||
public static void ExecuteReadProcessors<NodeType>(
|
||||
/// <returns>true on successful, false if there were any processing failures</returns>
|
||||
public static bool ExecuteReadProcessors<NodeType>(
|
||||
NodeType nodeToFill,
|
||||
Dictionary<string, Action<NodeType, XmlTextReader>> processors,
|
||||
XmlTextReader xtr,
|
||||
Action<NodeType, string, Exception> parseExceptionAction)
|
||||
{
|
||||
bool errors = false;
|
||||
|
||||
string nodeName = string.Empty;
|
||||
while (xtr.NodeType != XmlNodeType.EndElement)
|
||||
{
|
||||
@@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
errors = true;
|
||||
parseExceptionAction(nodeToFill, nodeName, e);
|
||||
|
||||
if (xtr.NodeType == XmlNodeType.EndElement)
|
||||
@@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External
|
||||
xtr.ReadOuterXml(); // ignore
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
UUID.TryParse(node.InnerText, out uuid);
|
||||
creator = userService.GetUserAccount(scopeID, uuid);
|
||||
}
|
||||
|
||||
if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
|
||||
hasCreatorData = true;
|
||||
|
||||
@@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External
|
||||
doc.Save(wr);
|
||||
return wr.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -308,7 +308,9 @@ namespace OpenSim.Framework.Servers
|
||||
// clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
|
||||
// the clr version number doesn't match the project version number under Mono.
|
||||
//m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
|
||||
m_log.Info("[STARTUP]: Operating system version: " + Environment.OSVersion + Environment.NewLine);
|
||||
m_log.InfoFormat(
|
||||
"[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n",
|
||||
Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32");
|
||||
|
||||
StartupSpecific();
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Security.Cryptography;
|
||||
@@ -375,6 +376,50 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is the platform Windows?
|
||||
/// </summary>
|
||||
/// <returns>true if so, false otherwise</returns>
|
||||
public static bool IsWindows()
|
||||
{
|
||||
PlatformID platformId = Environment.OSVersion.Platform;
|
||||
|
||||
return (platformId == PlatformID.Win32NT
|
||||
|| platformId == PlatformID.Win32S
|
||||
|| platformId == PlatformID.Win32Windows
|
||||
|| platformId == PlatformID.WinCE);
|
||||
}
|
||||
|
||||
public static bool LoadArchSpecificWindowsDll(string libraryName)
|
||||
{
|
||||
// We do this so that OpenSimulator on Windows loads the correct native library depending on whether
|
||||
// it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
|
||||
// will find it already loaded later on.
|
||||
//
|
||||
// This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
|
||||
// controlled in config files.
|
||||
string nativeLibraryPath;
|
||||
|
||||
if (Util.Is64BitProcess())
|
||||
nativeLibraryPath = "lib64/" + libraryName;
|
||||
else
|
||||
nativeLibraryPath = "lib32/" + libraryName;
|
||||
|
||||
m_log.DebugFormat("[UTIL]: Loading native Windows library at {0}", nativeLibraryPath);
|
||||
|
||||
if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[UTIL]: Couldn't find native Windows library at {0}", nativeLibraryPath);
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsEnvironmentSupported(ref string reason)
|
||||
@@ -1457,6 +1502,27 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to trigger an early library load on Windows systems.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Required to get 32-bit and 64-bit processes to automatically use the
|
||||
/// appropriate native library.
|
||||
/// </remarks>
|
||||
/// <param name="dllToLoad"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern IntPtr LoadLibrary(string dllToLoad);
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the current process is 64 bit
|
||||
/// </summary>
|
||||
/// <returns>true if so, false if not</returns>
|
||||
public static bool Is64BitProcess()
|
||||
{
|
||||
return IntPtr.Size == 8;
|
||||
}
|
||||
|
||||
#region FireAndForget Threading Pattern
|
||||
|
||||
@@ -903,47 +903,64 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
private void HandleUseCircuitCode(object o)
|
||||
{
|
||||
// DateTime startTime = DateTime.Now;
|
||||
object[] array = (object[])o;
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
|
||||
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
|
||||
IPEndPoint remoteEndPoint = null;
|
||||
IClientAPI client = null;
|
||||
|
||||
try
|
||||
{
|
||||
// DateTime startTime = DateTime.Now;
|
||||
object[] array = (object[])o;
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
|
||||
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
|
||||
|
||||
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
|
||||
|
||||
remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
|
||||
AuthenticateResponse sessionInfo;
|
||||
if (IsClientAuthorized(uccp, out sessionInfo))
|
||||
{
|
||||
// Begin the process of adding the client to the simulator
|
||||
client
|
||||
= AddClient(
|
||||
uccp.CircuitCode.Code,
|
||||
uccp.CircuitCode.ID,
|
||||
uccp.CircuitCode.SessionID,
|
||||
remoteEndPoint,
|
||||
sessionInfo);
|
||||
|
||||
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
|
||||
// Send ack straight away to let the viewer know that the connection is active.
|
||||
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
||||
// circuit code to the existing child agent. This is not particularly obvious.
|
||||
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
|
||||
|
||||
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
||||
if (client != null)
|
||||
client.SceneAgent.SendInitialDataToMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't create clients for unauthorized requesters.
|
||||
m_log.WarnFormat(
|
||||
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
|
||||
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
|
||||
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
|
||||
|
||||
IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
|
||||
AuthenticateResponse sessionInfo;
|
||||
if (IsClientAuthorized(uccp, out sessionInfo))
|
||||
{
|
||||
// Begin the process of adding the client to the simulator
|
||||
IClientAPI client
|
||||
= AddClient(
|
||||
uccp.CircuitCode.Code,
|
||||
uccp.CircuitCode.ID,
|
||||
uccp.CircuitCode.SessionID,
|
||||
remoteEndPoint,
|
||||
sessionInfo);
|
||||
|
||||
// Send ack straight away to let the viewer know that the connection is active.
|
||||
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
||||
// circuit code to the existing child agent. This is not particularly obvious.
|
||||
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
|
||||
|
||||
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
||||
if (client != null)
|
||||
client.SceneAgent.SendInitialDataToMe();
|
||||
}
|
||||
else
|
||||
catch (Exception e)
|
||||
{
|
||||
// Don't create clients for unauthorized requesters.
|
||||
m_log.WarnFormat(
|
||||
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
|
||||
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
|
||||
m_log.ErrorFormat(
|
||||
"[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
|
||||
remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
|
||||
client != null ? client.Name : "unknown",
|
||||
client != null ? client.AgentId.ToString() : "unknown",
|
||||
e.Message,
|
||||
e.StackTrace);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
|
||||
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -111,6 +111,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
|
||||
#region IAvatarFactoryModule
|
||||
|
||||
/// </summary>
|
||||
/// <param name="sp"></param>
|
||||
/// <param name="texture"></param>
|
||||
/// <param name="visualParam"></param>
|
||||
public void SetAppearance(IScenePresence sp, AvatarAppearance appearance)
|
||||
{
|
||||
SetAppearance(sp, appearance.Texture, appearance.VisualParams);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set appearance data (texture asset IDs and slider settings)
|
||||
/// </summary>
|
||||
@@ -156,14 +165,23 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
|
||||
|
||||
// WriteBakedTexturesReport(sp, m_log.DebugFormat);
|
||||
if (!ValidateBakedTextureCache(sp))
|
||||
|
||||
// If bake textures are missing and this is not an NPC, request a rebake from client
|
||||
if (!ValidateBakedTextureCache(sp) && (((ScenePresence)sp).PresenceType != PresenceType.Npc))
|
||||
RequestRebake(sp, true);
|
||||
|
||||
// This appears to be set only in the final stage of the appearance
|
||||
// update transaction. In theory, we should be able to do an immediate
|
||||
// appearance send and save here.
|
||||
}
|
||||
|
||||
|
||||
// NPC should send to clients immediately and skip saving appearance
|
||||
if (((ScenePresence)sp).PresenceType == PresenceType.Npc)
|
||||
{
|
||||
SendAppearance((ScenePresence)sp);
|
||||
return;
|
||||
}
|
||||
|
||||
// save only if there were changes, send no matter what (doesn't hurt to send twice)
|
||||
if (changed)
|
||||
QueueAppearanceSave(sp.ControllingClient.AgentId);
|
||||
@@ -174,6 +192,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
// m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString());
|
||||
}
|
||||
|
||||
private void SendAppearance(ScenePresence sp)
|
||||
{
|
||||
// Send the appearance to everyone in the scene
|
||||
sp.SendAppearanceToAllOtherAgents();
|
||||
|
||||
// Send animations back to the avatar as well
|
||||
sp.Animator.SendAnimPack();
|
||||
}
|
||||
|
||||
public bool SendAppearance(UUID agentId)
|
||||
{
|
||||
// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId);
|
||||
@@ -185,12 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
return false;
|
||||
}
|
||||
|
||||
// Send the appearance to everyone in the scene
|
||||
sp.SendAppearanceToAllOtherAgents();
|
||||
|
||||
// Send animations back to the avatar as well
|
||||
sp.Animator.SendAnimPack();
|
||||
|
||||
SendAppearance(sp);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -474,6 +496,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
SetAppearanceAssets(sp.UUID, sp.Appearance);
|
||||
|
||||
m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
|
||||
|
||||
// Trigger this here because it's the final step in the set/queue/save process for appearance setting.
|
||||
// Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes).
|
||||
m_scene.EventManager.TriggerAvatarAppearanceChanged(sp);
|
||||
}
|
||||
|
||||
private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance)
|
||||
@@ -626,4 +652,4 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -994,6 +994,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
neighbourRegion.RegionHandle);
|
||||
return agent;
|
||||
}
|
||||
// No turning back
|
||||
agent.IsChildAgent = true;
|
||||
|
||||
string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
|
||||
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
|
||||
@@ -1138,7 +1141,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
/// <summary>
|
||||
/// This informs all neighbouring regions about agent "avatar".
|
||||
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
||||
/// </summary>
|
||||
/// <param name="sp"></param>
|
||||
public void EnableChildAgents(ScenePresence sp)
|
||||
@@ -1258,12 +1260,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle)
|
||||
{
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
try
|
||||
{
|
||||
d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
|
||||
InformClientOfNeighbourCompleted,
|
||||
d);
|
||||
// Let's put this back at sync, so that it doesn't clog
|
||||
// the network, especially for regions in the same physical server.
|
||||
// We're really not in a hurry here.
|
||||
InformClientOfNeighbourAsync(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent);
|
||||
//InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
//d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
|
||||
// InformClientOfNeighbourCompleted,
|
||||
// d);
|
||||
}
|
||||
|
||||
catch (ArgumentOutOfRangeException)
|
||||
|
||||
@@ -551,9 +551,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
|
||||
// action, remoteClient.Name, userID);
|
||||
}
|
||||
else if (so.RootPart.OwnerID == so.RootPart.GroupID)
|
||||
{
|
||||
// Group owned objects go to the last owner before the object was transferred.
|
||||
userID = so.RootPart.LastOwnerID;
|
||||
}
|
||||
else
|
||||
{
|
||||
// All returns / deletes go to the object owner
|
||||
// Other returns / deletes go to the object owner
|
||||
//
|
||||
userID = so.RootPart.OwnerID;
|
||||
|
||||
|
||||
@@ -65,13 +65,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
}
|
||||
}
|
||||
|
||||
internal struct ScopedRegionPosition
|
||||
{
|
||||
public UUID m_scopeID;
|
||||
public ulong m_regionHandle;
|
||||
public ScopedRegionPosition(UUID scopeID, ulong handle)
|
||||
{
|
||||
m_scopeID = scopeID;
|
||||
m_regionHandle = handle;
|
||||
}
|
||||
}
|
||||
|
||||
private ExpiringCache<ScopedRegionUUID, GridRegion> m_UUIDCache;
|
||||
private ExpiringCache<ScopedRegionName, ScopedRegionUUID> m_NameCache;
|
||||
private ExpiringCache<ScopedRegionPosition, GridRegion> m_PositionCache;
|
||||
|
||||
public RegionInfoCache()
|
||||
{
|
||||
m_UUIDCache = new ExpiringCache<ScopedRegionUUID, GridRegion>();
|
||||
m_NameCache = new ExpiringCache<ScopedRegionName, ScopedRegionUUID>();
|
||||
m_NameCache = new ExpiringCache<ScopedRegionName, ScopedRegionUUID>();
|
||||
m_PositionCache = new ExpiringCache<ScopedRegionPosition, GridRegion>();
|
||||
}
|
||||
|
||||
public void Cache(GridRegion rinfo)
|
||||
@@ -96,6 +109,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
{
|
||||
ScopedRegionName name = new ScopedRegionName(scopeID,rinfo.RegionName);
|
||||
m_NameCache.AddOrUpdate(name, id, CACHE_EXPIRATION_SECONDS);
|
||||
|
||||
ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, rinfo.RegionHandle);
|
||||
m_PositionCache.AddOrUpdate(pos, rinfo, CACHE_EXPIRATION_SECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,6 +130,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
return null;
|
||||
}
|
||||
|
||||
public GridRegion Get(UUID scopeID, ulong handle, out bool inCache)
|
||||
{
|
||||
inCache = false;
|
||||
|
||||
GridRegion rinfo = null;
|
||||
ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, handle);
|
||||
if (m_PositionCache.TryGetValue(pos, out rinfo))
|
||||
{
|
||||
inCache = true;
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public GridRegion Get(UUID scopeID, string name, out bool inCache)
|
||||
{
|
||||
inCache = false;
|
||||
|
||||
@@ -186,10 +186,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
|
||||
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
||||
{
|
||||
GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
|
||||
bool inCache = false;
|
||||
GridRegion rinfo = m_RegionInfoCache.Get(scopeID, Util.UIntsToLong((uint)x, (uint)y), out inCache);
|
||||
if (inCache)
|
||||
return rinfo;
|
||||
|
||||
rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
|
||||
if (rinfo == null)
|
||||
rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y);
|
||||
|
||||
m_RegionInfoCache.Cache(rinfo);
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -272,7 +272,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
ParcelFlags.AllowGroupScripts |
|
||||
ParcelFlags.CreateGroupObjects |
|
||||
ParcelFlags.AllowAPrimitiveEntry |
|
||||
ParcelFlags.AllowGroupObjectEntry);
|
||||
ParcelFlags.AllowGroupObjectEntry |
|
||||
ParcelFlags.AllowFly);
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale))
|
||||
|
||||
@@ -707,7 +707,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
// Object owners should be able to edit their own content
|
||||
if (currentUser == objectOwner)
|
||||
{
|
||||
permission = true;
|
||||
// there is no way that later code can change this back to false
|
||||
// so just return true immediately and short circuit the more
|
||||
// expensive group checks
|
||||
return true;
|
||||
|
||||
//permission = true;
|
||||
}
|
||||
else if (group.IsAttachment)
|
||||
{
|
||||
|
||||
@@ -148,6 +148,113 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
|
||||
<OtherParts />
|
||||
</SceneObjectGroup>";
|
||||
|
||||
private string badFloatsXml = @"
|
||||
<SceneObjectGroup>
|
||||
<RootPart>
|
||||
<SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
|
||||
<AllowedDrop>false</AllowedDrop>
|
||||
<CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID>
|
||||
<FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID>
|
||||
<InventorySerial>1</InventorySerial>
|
||||
<TaskInventory />
|
||||
<ObjectFlags>0</ObjectFlags>
|
||||
<UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID>
|
||||
<LocalId>2698615125</LocalId>
|
||||
<Name>NaughtyPrim</Name>
|
||||
<Material>0</Material>
|
||||
<PassTouches>false</PassTouches>
|
||||
<RegionHandle>1099511628032000</RegionHandle>
|
||||
<ScriptAccessPin>0</ScriptAccessPin>
|
||||
<GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition>
|
||||
<OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition>
|
||||
<RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset>
|
||||
<Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
|
||||
<RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity>
|
||||
<AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
|
||||
<Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
|
||||
<Description />
|
||||
<Color />
|
||||
<Text />
|
||||
<SitName />
|
||||
<TouchName />
|
||||
<LinkNum>0</LinkNum>
|
||||
<ClickAction>0</ClickAction>
|
||||
<Shape>
|
||||
<ProfileCurve>1</ProfileCurve>
|
||||
<TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry>
|
||||
<ExtraParams>AA==</ExtraParams>
|
||||
<PathBegin>0</PathBegin>
|
||||
<PathCurve>16</PathCurve>
|
||||
<PathEnd>0</PathEnd>
|
||||
<PathRadiusOffset>0</PathRadiusOffset>
|
||||
<PathRevolutions>0</PathRevolutions>
|
||||
<PathScaleX>100</PathScaleX>
|
||||
<PathScaleY>100</PathScaleY>
|
||||
<PathShearX>0</PathShearX>
|
||||
<PathShearY>0</PathShearY>
|
||||
<PathSkew>0</PathSkew>
|
||||
<PathTaperX>0</PathTaperX>
|
||||
<PathTaperY>0</PathTaperY>
|
||||
<PathTwist>0</PathTwist>
|
||||
<PathTwistBegin>0</PathTwistBegin>
|
||||
<PCode>9</PCode>
|
||||
<ProfileBegin>0</ProfileBegin>
|
||||
<ProfileEnd>0</ProfileEnd>
|
||||
<ProfileHollow>0</ProfileHollow>
|
||||
<Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
|
||||
<State>0</State>
|
||||
<ProfileShape>Square</ProfileShape>
|
||||
<HollowShape>Same</HollowShape>
|
||||
<SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture>
|
||||
<SculptType>0</SculptType><SculptData />
|
||||
<FlexiSoftness>0</FlexiSoftness>
|
||||
<FlexiTension>0,5</FlexiTension>
|
||||
<FlexiDrag>yo mamma</FlexiDrag>
|
||||
<FlexiGravity>0</FlexiGravity>
|
||||
<FlexiWind>0</FlexiWind>
|
||||
<FlexiForceX>0</FlexiForceX>
|
||||
<FlexiForceY>0</FlexiForceY>
|
||||
<FlexiForceZ>0</FlexiForceZ>
|
||||
<LightColorR>0</LightColorR>
|
||||
<LightColorG>0</LightColorG>
|
||||
<LightColorB>0</LightColorB>
|
||||
<LightColorA>1</LightColorA>
|
||||
<LightRadius>0</LightRadius>
|
||||
<LightCutoff>0</LightCutoff>
|
||||
<LightFalloff>0</LightFalloff>
|
||||
<LightIntensity>1</LightIntensity>
|
||||
<FlexiEntry>false</FlexiEntry>
|
||||
<LightEntry>false</LightEntry>
|
||||
<SculptEntry>false</SculptEntry>
|
||||
</Shape>
|
||||
<Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
|
||||
<UpdateFlag>0</UpdateFlag>
|
||||
<SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation>
|
||||
<SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition>
|
||||
<SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
|
||||
<SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL>
|
||||
<ParentID>0</ParentID>
|
||||
<CreationDate>1211330445</CreationDate>
|
||||
<Category>0</Category>
|
||||
<SalePrice>0</SalePrice>
|
||||
<ObjectSaleType>0</ObjectSaleType>
|
||||
<OwnershipCost>0</OwnershipCost>
|
||||
<GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID>
|
||||
<OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID>
|
||||
<LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID>
|
||||
<BaseMask>2147483647</BaseMask>
|
||||
<OwnerMask>2147483647</OwnerMask>
|
||||
<GroupMask>0</GroupMask>
|
||||
<EveryoneMask>0</EveryoneMask>
|
||||
<NextOwnerMask>2147483647</NextOwnerMask>
|
||||
<Flags>None</Flags>
|
||||
<CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
|
||||
<CollisionSoundVolume>0</CollisionSoundVolume>
|
||||
</SceneObjectPart>
|
||||
</RootPart>
|
||||
<OtherParts />
|
||||
</SceneObjectGroup>";
|
||||
|
||||
private string xml2 = @"
|
||||
<SceneObjectGroup>
|
||||
<SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
|
||||
@@ -256,6 +363,32 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
|
||||
// TODO: Check other properties
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDeserializeBadFloatsXml()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml);
|
||||
SceneObjectPart rootPart = so.RootPart;
|
||||
|
||||
Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
|
||||
Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
|
||||
Assert.That(rootPart.Name, Is.EqualTo("NaughtyPrim"));
|
||||
|
||||
// This terminates the deserialization earlier if couldn't be parsed.
|
||||
// TODO: Need to address this
|
||||
Assert.That(rootPart.GroupPosition.X, Is.EqualTo(147.23f));
|
||||
|
||||
Assert.That(rootPart.Shape.PathCurve, Is.EqualTo(16));
|
||||
|
||||
// Defaults for bad parses
|
||||
Assert.That(rootPart.Shape.FlexiTension, Is.EqualTo(0));
|
||||
Assert.That(rootPart.Shape.FlexiDrag, Is.EqualTo(0));
|
||||
|
||||
// TODO: Check other properties
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSerializeXml()
|
||||
{
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
|
||||
public interface IAvatarFactoryModule
|
||||
{
|
||||
void SetAppearance(IScenePresence sp, AvatarAppearance appearance);
|
||||
void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -173,6 +173,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
|
||||
public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
|
||||
|
||||
public delegate void AvatarAppearanceChange(ScenePresence avatar);
|
||||
public event AvatarAppearanceChange OnAvatarAppearanceChange;
|
||||
|
||||
public event Action<ScenePresence> OnSignificantClientMovement;
|
||||
|
||||
public delegate void IncomingInstantMessage(GridInstantMessage message);
|
||||
@@ -184,10 +187,62 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public event ClientClosed OnClientClosed;
|
||||
|
||||
// Fired when a script is created
|
||||
// The indication that a new script exists in this region.
|
||||
public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
|
||||
public event NewScript OnNewScript;
|
||||
public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
|
||||
{
|
||||
NewScript handlerNewScript = OnNewScript;
|
||||
if (handlerNewScript != null)
|
||||
{
|
||||
foreach (NewScript d in handlerNewScript.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(clientID, part, itemID);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset
|
||||
// An indication that the script has changed.
|
||||
public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
|
||||
public event UpdateScript OnUpdateScript;
|
||||
public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
|
||||
{
|
||||
UpdateScript handlerUpdateScript = OnUpdateScript;
|
||||
if (handlerUpdateScript != null)
|
||||
{
|
||||
foreach (UpdateScript d in handlerUpdateScript.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(clientId, itemId, primId, isScriptRunning, newAssetID);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is fired when a scene object property that a script might be interested in (such as color, scale or
|
||||
/// inventory) changes. Only enough information is sent for the LSL changed event
|
||||
/// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed)
|
||||
/// ScriptChangedEvent is fired when a scene object property that a script might be interested
|
||||
/// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event.
|
||||
/// This is not an indication that the script has changed (see OnUpdateScript for that).
|
||||
/// This event is sent to a script to tell it that some property changed on
|
||||
/// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed .
|
||||
/// </summary>
|
||||
public event ScriptChangedEvent OnScriptChangedEvent;
|
||||
public delegate void ScriptChangedEvent(uint localID, uint change);
|
||||
@@ -1238,6 +1293,27 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerAvatarAppearanceChanged(ScenePresence avatar)
|
||||
{
|
||||
AvatarAppearanceChange handler = OnAvatarAppearanceChange;
|
||||
if (handler != null)
|
||||
{
|
||||
foreach (AvatarAppearanceChange d in handler.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(avatar);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerIncomingInstantMessage(GridInstantMessage message)
|
||||
{
|
||||
IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;
|
||||
|
||||
@@ -283,6 +283,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Script saved", false);
|
||||
}
|
||||
|
||||
// Tell anyone managing scripts that a script has been reloaded/changed
|
||||
EventManager.TriggerUpdateScript(remoteClient.AgentId, itemId, primId, isScriptRunning, item.AssetID);
|
||||
|
||||
part.ParentGroup.ResumeScripts();
|
||||
return errors;
|
||||
}
|
||||
@@ -1624,9 +1628,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// have state in inventory
|
||||
part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0);
|
||||
|
||||
// tell anyone watching that there is a new script in town
|
||||
EventManager.TriggerNewScript(agentID, part, copyID);
|
||||
|
||||
// m_log.InfoFormat("[PRIMINVENTORY]: " +
|
||||
// "Rezzed script {0} into prim local ID {1} for user {2}",
|
||||
// item.inventoryName, localID, remoteClient.Name);
|
||||
|
||||
part.ParentGroup.ResumeScripts();
|
||||
|
||||
return part;
|
||||
@@ -1707,6 +1715,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
part.Inventory.AddInventoryItem(taskItem, false);
|
||||
part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
|
||||
|
||||
// tell anyone managing scripts that a new script exists
|
||||
EventManager.TriggerNewScript(agentID, part, taskItem.ItemID);
|
||||
|
||||
part.ParentGroup.ResumeScripts();
|
||||
|
||||
return part;
|
||||
@@ -1926,7 +1938,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
foreach (SceneObjectGroup g in deleteGroups)
|
||||
{
|
||||
AddReturn(g.OwnerID, g.Name, g.AbsolutePosition, "parcel owner return");
|
||||
AddReturn(g.OwnerID == g.GroupID ? g.LastOwnerID : g.OwnerID, g.Name, g.AbsolutePosition, "parcel owner return");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -864,16 +864,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
try
|
||||
{
|
||||
ForEachRootScenePresence(delegate(ScenePresence agent)
|
||||
{
|
||||
//agent.ControllingClient.new
|
||||
//this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
|
||||
{
|
||||
//agent.ControllingClient.new
|
||||
//this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
|
||||
|
||||
List<ulong> old = new List<ulong>();
|
||||
old.Add(otherRegion.RegionHandle);
|
||||
agent.DropOldNeighbours(old);
|
||||
if (m_teleportModule != null)
|
||||
m_teleportModule.EnableChildAgent(agent, otherRegion);
|
||||
});
|
||||
List<ulong> old = new List<ulong>();
|
||||
old.Add(otherRegion.RegionHandle);
|
||||
agent.DropOldNeighbours(old);
|
||||
if (m_teleportModule != null && agent.PresenceType != PresenceType.Npc)
|
||||
m_teleportModule.EnableChildAgent(agent, otherRegion);
|
||||
});
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
@@ -881,7 +881,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// This shouldn't happen too often anymore.
|
||||
m_log.Error("[SCENE]: Couldn't inform client of regionup because we got a null reference exception");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1009,10 +1008,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
try
|
||||
{
|
||||
ForEachRootScenePresence(delegate(ScenePresence agent)
|
||||
{
|
||||
if (m_teleportModule != null)
|
||||
m_teleportModule.EnableChildAgent(agent, r);
|
||||
});
|
||||
{
|
||||
if (m_teleportModule != null && agent.PresenceType != PresenceType.Npc)
|
||||
m_teleportModule.EnableChildAgent(agent, r);
|
||||
});
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
@@ -3259,8 +3258,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// also return a reason.</returns>
|
||||
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup)
|
||||
{
|
||||
bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
|
||||
(teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
|
||||
bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 ||
|
||||
(teleportFlags & (uint)TPFlags.ViaHGLogin) != 0);
|
||||
bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0);
|
||||
bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0);
|
||||
|
||||
reason = String.Empty;
|
||||
|
||||
//Teleport flags:
|
||||
@@ -3272,9 +3274,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Don't disable this log message - it's too helpful
|
||||
m_log.DebugFormat(
|
||||
"[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6}, position {7})",
|
||||
RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
|
||||
agent.AgentID, agent.circuitcode, teleportFlags, agent.startpos);
|
||||
"[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9})",
|
||||
RegionInfo.RegionName, (agent.child ? "child" : "root"),agent.firstname, agent.lastname,
|
||||
agent.AgentID, agent.circuitcode, agent.IPAddress, agent.Viewer, ((TPFlags)teleportFlags).ToString(), agent.startpos);
|
||||
|
||||
if (LoginsDisabled)
|
||||
{
|
||||
@@ -3427,6 +3429,29 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
agent.startpos.Z = 720;
|
||||
}
|
||||
}
|
||||
|
||||
// Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
|
||||
if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
|
||||
RegionInfo.EstateSettings.AllowDirectTeleport == false &&
|
||||
!viahome && !godlike)
|
||||
{
|
||||
SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
|
||||
// Can have multiple SpawnPoints
|
||||
List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints();
|
||||
if ( spawnpoints.Count > 1)
|
||||
{
|
||||
// We have multiple SpawnPoints, Route the agent to a random one
|
||||
agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count)].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
|
||||
}
|
||||
else
|
||||
{
|
||||
// We have a single SpawnPoint and will route the agent to it
|
||||
agent.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Honor parcel landing type and position.
|
||||
if (land != null)
|
||||
{
|
||||
|
||||
@@ -156,16 +156,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// that the region position is cached or performance will degrade
|
||||
Utils.LongToUInts(regionHandle, out x, out y);
|
||||
GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
|
||||
bool v = true;
|
||||
if (! simulatorList.Contains(dest.ServerURI))
|
||||
{
|
||||
// we havent seen this simulator before, add it to the list
|
||||
// and send it an update
|
||||
simulatorList.Add(dest.ServerURI);
|
||||
// Let move this to sync. Mono definitely does not like async networking.
|
||||
m_scene.SimulationService.UpdateAgent(dest, cAgentData);
|
||||
|
||||
SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync;
|
||||
d.BeginInvoke(cAgentData, m_regionInfo.ScopeID, dest,
|
||||
SendChildAgentDataUpdateCompleted,
|
||||
d);
|
||||
// Leaving this here as a reminder that we tried, and it sucks.
|
||||
//SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync;
|
||||
//d.BeginInvoke(cAgentData, m_regionInfo.ScopeID, dest,
|
||||
// SendChildAgentDataUpdateCompleted,
|
||||
// d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.ErrorFormat(
|
||||
"[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}",
|
||||
sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -368,12 +368,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()",
|
||||
// m_parentScene.RegionInfo.RegionName, sceneObject.UUID);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
|
||||
// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
|
||||
// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
|
||||
|
||||
SceneObjectPart[] parts = sceneObject.Parts;
|
||||
@@ -409,7 +409,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
lock (SceneObjectGroupsByFullID)
|
||||
SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
|
||||
|
||||
|
||||
lock (SceneObjectGroupsByFullPartID)
|
||||
{
|
||||
foreach (SceneObjectPart part in parts)
|
||||
@@ -1592,7 +1592,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID,agentID))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
|
||||
{
|
||||
group.UpdateExtraParam(primLocalID, type, inUse, data);
|
||||
}
|
||||
@@ -1609,7 +1609,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.Permissions.CanEditObject(group.GetPartsFullID(primLocalID), agentID))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
|
||||
{
|
||||
ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock();
|
||||
shapeData.ObjectLocalID = shapeBlock.ObjectLocalID;
|
||||
|
||||
@@ -1330,7 +1330,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.DebugFormat(
|
||||
"[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
|
||||
RootPart.UUID);
|
||||
m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel autoreturn");
|
||||
m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn");
|
||||
m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero,
|
||||
DeRezAction.Return, UUID.Zero);
|
||||
|
||||
|
||||
@@ -303,6 +303,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// ~SceneObjectPart()
|
||||
// {
|
||||
// Console.WriteLine(
|
||||
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
|
||||
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
|
||||
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
|
||||
@@ -1553,9 +1556,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
dupe.GroupPosition = GroupPosition;
|
||||
dupe.OffsetPosition = OffsetPosition;
|
||||
dupe.RotationOffset = RotationOffset;
|
||||
dupe.Velocity = new Vector3(0, 0, 0);
|
||||
dupe.Acceleration = new Vector3(0, 0, 0);
|
||||
dupe.AngularVelocity = new Vector3(0, 0, 0);
|
||||
dupe.Velocity = Velocity;
|
||||
dupe.Acceleration = Acceleration;
|
||||
dupe.AngularVelocity = AngularVelocity;
|
||||
dupe.Flags = Flags;
|
||||
|
||||
dupe.OwnershipCost = OwnershipCost;
|
||||
|
||||
@@ -291,13 +291,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public PhysicsActor PhysicsActor { get; private set; }
|
||||
|
||||
private byte m_movementflag;
|
||||
|
||||
public byte MovementFlag
|
||||
{
|
||||
set { m_movementflag = value; }
|
||||
get { return m_movementflag; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Record user movement inputs.
|
||||
/// </summary>
|
||||
public byte MovementFlag { get; private set; }
|
||||
|
||||
private bool m_updateflag;
|
||||
|
||||
@@ -1222,7 +1219,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
|
||||
if (m_agentTransfer != null)
|
||||
m_agentTransfer.EnableChildAgents(this);
|
||||
Util.FireAndForget(delegate { m_agentTransfer.EnableChildAgents(this); });
|
||||
|
||||
IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
||||
if (friendsModule != null)
|
||||
@@ -2741,7 +2738,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
AgentPosition agentpos = new AgentPosition();
|
||||
agentpos.CopyFrom(cadu);
|
||||
|
||||
m_scene.SendOutChildAgentUpdates(agentpos, this);
|
||||
// Let's get this out of the update loop
|
||||
Util.FireAndForget(delegate { m_scene.SendOutChildAgentUpdates(agentpos, this); });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
@@ -570,13 +571,15 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
|
||||
private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
|
||||
{
|
||||
bool errors = false;
|
||||
obj.Shape = ReadShape(reader, "Shape", out errors);
|
||||
List<string> errorNodeNames;
|
||||
obj.Shape = ReadShape(reader, "Shape", out errorNodeNames);
|
||||
|
||||
if (errors)
|
||||
if (errorNodeNames != null)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors. Please see earlier log entries.",
|
||||
obj.Name, obj.UUID);
|
||||
"[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors in properties {2}.",
|
||||
obj.Name, obj.UUID, string.Join(", ", errorNodeNames.ToArray()));
|
||||
}
|
||||
}
|
||||
|
||||
private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
|
||||
@@ -1470,7 +1473,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
m_SOPXmlProcessors,
|
||||
reader,
|
||||
(o, nodeName, e)
|
||||
=> m_log.ErrorFormat(
|
||||
=> m_log.DebugFormat(
|
||||
"[SceneObjectSerializer]: Exception while parsing {0} in object {1} {2}: {3}{4}",
|
||||
((SceneObjectPart)o).Name, ((SceneObjectPart)o).UUID, nodeName, e.Message, e.StackTrace));
|
||||
|
||||
@@ -1519,17 +1522,18 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="name">The name of the xml element containing the shape</param>
|
||||
/// <param name="errors">true if any errors were encountered during parsing, false otherwise</param>
|
||||
/// <param name="errors">a list containing the failing node names. If no failures then null.</param>
|
||||
/// <returns>The shape parsed</returns>
|
||||
public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors)
|
||||
public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out List<string> errorNodeNames)
|
||||
{
|
||||
errors = false;
|
||||
List<string> internalErrorNodeNames = null;
|
||||
|
||||
PrimitiveBaseShape shape = new PrimitiveBaseShape();
|
||||
|
||||
if (reader.IsEmptyElement)
|
||||
{
|
||||
reader.Read();
|
||||
errorNodeNames = null;
|
||||
return shape;
|
||||
}
|
||||
|
||||
@@ -1540,12 +1544,22 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
m_ShapeXmlProcessors,
|
||||
reader,
|
||||
(o, nodeName, e)
|
||||
=> m_log.ErrorFormat(
|
||||
"[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
|
||||
nodeName, e.Message, e.StackTrace));
|
||||
=>
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
|
||||
// nodeName, e.Message, e.StackTrace);
|
||||
if (internalErrorNodeNames == null)
|
||||
internalErrorNodeNames = new List<string>();
|
||||
|
||||
internalErrorNodeNames.Add(nodeName);
|
||||
}
|
||||
);
|
||||
|
||||
reader.ReadEndElement(); // Shape
|
||||
|
||||
errorNodeNames = internalErrorNodeNames;
|
||||
|
||||
return shape;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using NUnit.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -43,6 +44,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
[TestFixture]
|
||||
public class SceneObjectBasicTests
|
||||
{
|
||||
// [TearDown]
|
||||
// public void TearDown()
|
||||
// {
|
||||
// Console.WriteLine("TearDown");
|
||||
// GC.Collect();
|
||||
// Thread.Sleep(3000);
|
||||
// }
|
||||
|
||||
// public class GcNotify
|
||||
// {
|
||||
// public static AutoResetEvent gcEvent = new AutoResetEvent(false);
|
||||
// private static bool _initialized = false;
|
||||
//
|
||||
// public static void Initialize()
|
||||
// {
|
||||
// if (!_initialized)
|
||||
// {
|
||||
// _initialized = true;
|
||||
// new GcNotify();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private GcNotify(){}
|
||||
//
|
||||
// ~GcNotify()
|
||||
// {
|
||||
// if (!Environment.HasShutdownStarted &&
|
||||
// !AppDomain.CurrentDomain.IsFinalizingForUnload())
|
||||
// {
|
||||
// Console.WriteLine("GcNotify called");
|
||||
// gcEvent.Set();
|
||||
// new GcNotify();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Test adding an object to a scene.
|
||||
/// </summary>
|
||||
@@ -147,11 +184,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
public void TestDeleteSceneObject()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
|
||||
|
||||
TestScene scene = SceneHelpers.SetupScene();
|
||||
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
||||
scene.DeleteSceneObject(part.ParentGroup, false);
|
||||
|
||||
|
||||
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
|
||||
Assert.That(retrievedPart, Is.Null);
|
||||
}
|
||||
|
||||
@@ -63,9 +63,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
// Capability string prefixes
|
||||
private static readonly string m_parcelVoiceInfoRequestPath = "0007/";
|
||||
private static readonly string m_provisionVoiceAccountRequestPath = "0008/";
|
||||
private static readonly string m_chatSessionRequestPath = "0009/";
|
||||
private static readonly string m_parcelVoiceInfoRequestPath = "0207/";
|
||||
private static readonly string m_provisionVoiceAccountRequestPath = "0208/";
|
||||
private static readonly string m_chatSessionRequestPath = "0209/";
|
||||
|
||||
// Control info
|
||||
private static bool m_Enabled = false;
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
|
||||
using Nwc.XmlRpc;
|
||||
|
||||
@@ -167,6 +168,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
private bool m_debugEnabled = false;
|
||||
|
||||
private Dictionary<string, bool> m_pendingRequests = new Dictionary<string,bool>();
|
||||
|
||||
private ExpiringCache<string, OSDMap> m_memoryCache;
|
||||
private int m_cacheTimeout = 30;
|
||||
|
||||
@@ -1348,6 +1351,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
// Immediately forward the request if the cache is disabled.
|
||||
if (m_cacheTimeout == 0)
|
||||
{
|
||||
m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: cache is disabled");
|
||||
return WebUtil.PostToService(m_groupsServerURI, requestArgs);
|
||||
}
|
||||
|
||||
@@ -1355,6 +1359,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
if (requestArgs["RequestMethod"] == "RemoveGeneric"
|
||||
|| requestArgs["RequestMethod"] == "AddGeneric")
|
||||
{
|
||||
m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: clearing generics cache");
|
||||
|
||||
// Any and all updates cause the cache to clear
|
||||
m_memoryCache.Clear();
|
||||
|
||||
@@ -1366,18 +1372,67 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
// Create the cache key for the request and see if we have it cached
|
||||
string CacheKey = WebUtil.BuildQueryString(requestArgs);
|
||||
OSDMap response = null;
|
||||
if (!m_memoryCache.TryGetValue(CacheKey, out response))
|
||||
{
|
||||
// if it wasn't in the cache, pass the request to the Simian Grid Services
|
||||
response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
|
||||
|
||||
// and cache the response
|
||||
m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout));
|
||||
// This code uses a leader/follower pattern. On a cache miss, the request is added
|
||||
// to a queue; the first thread to add it to the queue completes the request while
|
||||
// follow on threads busy wait for the results, this situation seems to happen
|
||||
// often when checking permissions
|
||||
while (true)
|
||||
{
|
||||
OSDMap response = null;
|
||||
bool firstRequest = false;
|
||||
|
||||
lock (m_memoryCache)
|
||||
{
|
||||
if (m_memoryCache.TryGetValue(CacheKey, out response))
|
||||
return response;
|
||||
|
||||
if (! m_pendingRequests.ContainsKey(CacheKey))
|
||||
{
|
||||
m_pendingRequests.Add(CacheKey,true);
|
||||
firstRequest = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (firstRequest)
|
||||
{
|
||||
// if it wasn't in the cache, pass the request to the Simian Grid Services
|
||||
try
|
||||
{
|
||||
response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.InfoFormat("[SIMIAN GROUPS CONNECTOR] request failed {0}",CacheKey);
|
||||
}
|
||||
|
||||
// and cache the response
|
||||
lock (m_memoryCache)
|
||||
{
|
||||
m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout));
|
||||
m_pendingRequests.Remove(CacheKey);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Thread.Sleep(50); // waiting for a web request to complete, 50msecs is reasonable
|
||||
}
|
||||
|
||||
// return cached response
|
||||
return response;
|
||||
// if (!m_memoryCache.TryGetValue(CacheKey, out response))
|
||||
// {
|
||||
// m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: query not in the cache");
|
||||
// Util.PrintCallStack();
|
||||
|
||||
// // if it wasn't in the cache, pass the request to the Simian Grid Services
|
||||
// response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
|
||||
|
||||
// // and cache the response
|
||||
// m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout));
|
||||
// }
|
||||
|
||||
// // return cached response
|
||||
// return response;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -230,8 +230,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
|
||||
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
|
||||
|
||||
m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
|
||||
m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
|
||||
// m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
|
||||
// m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
|
||||
|
||||
m_log.InfoFormat("[RegionReady]: Logins enabled for {0}", m_scene.RegionInfo.RegionName);
|
||||
|
||||
if ( m_uri != string.Empty )
|
||||
{
|
||||
|
||||
@@ -96,15 +96,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
if (!m_avatars.ContainsKey(agentId))
|
||||
return false;
|
||||
|
||||
// Delete existing sp attachments
|
||||
scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, false);
|
||||
|
||||
AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true);
|
||||
sp.Appearance = npcAppearance;
|
||||
// Set new sp appearance. Also sends to clients.
|
||||
scene.RequestModuleInterface<IAvatarFactoryModule>().SetAppearance(sp, new AvatarAppearance(appearance, true));
|
||||
|
||||
// Rez needed sp attachments
|
||||
scene.AttachmentsModule.RezAttachments(sp);
|
||||
|
||||
IAvatarFactoryModule module = scene.RequestModuleInterface<IAvatarFactoryModule>();
|
||||
module.SendAppearance(sp.UUID);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -121,8 +121,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[NPC MODULE]: Creating NPC {0} {1} {2} at {3} in {4}",
|
||||
firstname, lastname, npcAvatar.AgentId, position, scene.RegionInfo.RegionName);
|
||||
"[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}",
|
||||
firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName);
|
||||
|
||||
AgentCircuitData acd = new AgentCircuitData();
|
||||
acd.AgentID = npcAvatar.AgentId;
|
||||
|
||||
@@ -51,6 +51,9 @@ public class BSPlugin : IPhysicsPlugin
|
||||
{
|
||||
if (_mScene == null)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("BulletSim.dll");
|
||||
|
||||
_mScene = new BSScene(sceneIdentifier);
|
||||
}
|
||||
return (_mScene);
|
||||
|
||||
@@ -30,7 +30,8 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Nini.Config;
|
||||
using log4net;
|
||||
using log4net;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Region.Physics.Manager
|
||||
{
|
||||
|
||||
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
private bool GenerateCoordsAndFacesFromPrimMeshData(
|
||||
string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces)
|
||||
{
|
||||
m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
|
||||
// m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
|
||||
|
||||
coords = new List<Coord>();
|
||||
faces = new List<Face>();
|
||||
@@ -321,7 +321,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
|
||||
if (primShape.SculptData.Length <= 0)
|
||||
{
|
||||
m_log.Error("[MESH]: asset data is zero length");
|
||||
m_log.ErrorFormat("[MESH]: asset data for {0} is zero length", primName);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,22 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
internal UUID m_uuid { get; private set; }
|
||||
internal bool bad = false;
|
||||
|
||||
/// <summary>
|
||||
/// ODE Avatar.
|
||||
/// </summary>
|
||||
/// <param name="avName"></param>
|
||||
/// <param name="parent_scene"></param>
|
||||
/// <param name="pos"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="pid_d"></param>
|
||||
/// <param name="pid_p"></param>
|
||||
/// <param name="capsule_radius"></param>
|
||||
/// <param name="tensor"></param>
|
||||
/// <param name="density">
|
||||
/// Only used right now to return information to LSL. Not actually used to set mass in ODE!
|
||||
/// </param>
|
||||
/// <param name="walk_divisor"></param>
|
||||
/// <param name="rundivisor"></param>
|
||||
public OdeCharacter(
|
||||
String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p,
|
||||
float capsule_radius, float tensor, float density,
|
||||
@@ -786,6 +802,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
Vector3 vec = Vector3.Zero;
|
||||
d.Vector3 vel = d.BodyGetLinearVel(Body);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[ODE CHARACTER]: Current velocity in Move() is <{0},{1},{2}>, target {3} for {4}",
|
||||
// vel.X, vel.Y, vel.Z, _target_velocity, Name);
|
||||
|
||||
float movementdivisor = 1f;
|
||||
|
||||
if (!m_alwaysRun)
|
||||
@@ -884,18 +904,20 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
if (flying)
|
||||
{
|
||||
// This also acts as anti-gravity so that we hover when flying rather than fall.
|
||||
vec.Z = (_target_velocity.Z - vel.Z) * (PID_D);
|
||||
}
|
||||
}
|
||||
|
||||
if (flying)
|
||||
{
|
||||
// Anti-gravity so that we hover when flying rather than fall.
|
||||
vec.Z += ((-1 * _parent_scene.gravityz) * m_mass);
|
||||
|
||||
//Added for auto fly height. Kitto Flora
|
||||
//d.Vector3 pos = d.BodyGetPosition(Body);
|
||||
float target_altitude = _parent_scene.GetTerrainHeightAtXY(_position.X, _position.Y) + MinimumGroundFlightOffset;
|
||||
|
||||
|
||||
if (_position.Z < target_altitude)
|
||||
{
|
||||
vec.Z += (target_altitude - _position.Z) * PID_P * 5.0f;
|
||||
@@ -921,6 +943,25 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
d.Vector3 newVel = d.BodyGetLinearVel(Body);
|
||||
if (newVel.X >= 256 || newVel.X <= 256 || newVel.Y >= 256 || newVel.Y <= 256 || newVel.Z >= 256 || newVel.Z <= 256)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[ODE CHARACTER]: Limiting falling velocity from {0} to {1} for {2}", newVel.Z, -9.8, Name);
|
||||
|
||||
newVel.X = Util.Clamp<float>(newVel.X, -255f, 255f);
|
||||
newVel.Y = Util.Clamp<float>(newVel.Y, -255f, 255f);
|
||||
|
||||
if (!flying)
|
||||
newVel.Z
|
||||
= Util.Clamp<float>(
|
||||
newVel.Z, -_parent_scene.AvatarTerminalVelocity, _parent_scene.AvatarTerminalVelocity);
|
||||
else
|
||||
newVel.Z = Util.Clamp<float>(newVel.Z, -255f, 255f);
|
||||
|
||||
d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
/// </summary>
|
||||
public class OdePlugin : IPhysicsPlugin
|
||||
{
|
||||
//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 OdeScene m_scene;
|
||||
|
||||
@@ -59,13 +59,23 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
if (m_scene == null)
|
||||
{
|
||||
// We do this so that OpenSimulator on Windows loads the correct native ODE library depending on whether
|
||||
// it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
|
||||
// will find it already loaded later on.
|
||||
//
|
||||
// This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
|
||||
// controlled in Ode.NET.dll.config
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("ode.dll");
|
||||
|
||||
// Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
|
||||
// http://opensimulator.org/mantis/view.php?id=2750).
|
||||
d.InitODE();
|
||||
|
||||
m_scene = new OdeScene(sceneIdentifier);
|
||||
}
|
||||
return (m_scene);
|
||||
|
||||
return m_scene;
|
||||
}
|
||||
|
||||
public string GetName()
|
||||
|
||||
@@ -144,6 +144,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
public float gravityy = 0f;
|
||||
public float gravityz = -9.8f;
|
||||
|
||||
public float AvatarTerminalVelocity { get; set; }
|
||||
|
||||
private float contactsurfacelayer = 0.001f;
|
||||
|
||||
private int worldHashspaceLow = -4;
|
||||
@@ -459,6 +461,15 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
gravityy = physicsconfig.GetFloat("world_gravityy", 0f);
|
||||
gravityz = physicsconfig.GetFloat("world_gravityz", -9.8f);
|
||||
|
||||
float avatarTerminalVelocity = physicsconfig.GetFloat("avatar_terminal_velocity", 54f);
|
||||
AvatarTerminalVelocity = Util.Clamp<float>(avatarTerminalVelocity, 0, 255f);
|
||||
if (AvatarTerminalVelocity != avatarTerminalVelocity)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[ODE SCENE]: avatar_terminal_velocity of {0} is invalid. Clamping to {1}",
|
||||
avatarTerminalVelocity, AvatarTerminalVelocity);
|
||||
}
|
||||
|
||||
worldHashspaceLow = physicsconfig.GetInt("world_hashspace_size_low", -4);
|
||||
worldHashspaceHigh = physicsconfig.GetInt("world_hashspace_size_high", 128);
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* 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.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly : AssemblyTitle("RealPhysXplugin")]
|
||||
[assembly : AssemblyDescription("")]
|
||||
[assembly : AssemblyConfiguration("")]
|
||||
[assembly : AssemblyCompany("http://opensimulator.org")]
|
||||
[assembly : AssemblyProduct("RealPhysXplugin")]
|
||||
[assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers 2007-2009")]
|
||||
[assembly : AssemblyTrademark("")]
|
||||
[assembly : AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
|
||||
[assembly : ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.6.5.*")]
|
||||
@@ -1,349 +0,0 @@
|
||||
/*
|
||||
* 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 Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using PhysXWrapper;
|
||||
using Quaternion=OpenMetaverse.Quaternion;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Physics.PhysXPlugin
|
||||
{
|
||||
public class PhysXCharacter : PhysicsActor
|
||||
{
|
||||
private Vector3 _position;
|
||||
private Vector3 _velocity;
|
||||
private Vector3 m_rotationalVelocity = Vector3.Zero;
|
||||
private Vector3 _acceleration;
|
||||
private NxCharacter _character;
|
||||
private bool flying;
|
||||
private bool iscolliding = false;
|
||||
private float gravityAccel;
|
||||
|
||||
public PhysXCharacter(NxCharacter character)
|
||||
{
|
||||
_character = character;
|
||||
}
|
||||
|
||||
public override int PhysicsActorType
|
||||
{
|
||||
get { return (int) ActorTypes.Agent; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool SetAlwaysRun
|
||||
{
|
||||
get { return false; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override uint LocalID
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool Grabbed
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool Selected
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override float Buoyancy
|
||||
{
|
||||
get { return 0f; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool FloatOnWater
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool IsPhysical
|
||||
{
|
||||
get { return false; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool ThrottleUpdates
|
||||
{
|
||||
get { return false; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool Flying
|
||||
{
|
||||
get { return flying; }
|
||||
set { flying = value; }
|
||||
}
|
||||
|
||||
public override bool IsColliding
|
||||
{
|
||||
get { return iscolliding; }
|
||||
set { iscolliding = value; }
|
||||
}
|
||||
|
||||
public override bool CollidingGround
|
||||
{
|
||||
get { return false; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool CollidingObj
|
||||
{
|
||||
get { return false; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override Vector3 RotationalVelocity
|
||||
{
|
||||
get { return m_rotationalVelocity; }
|
||||
set { m_rotationalVelocity = value; }
|
||||
}
|
||||
|
||||
public override bool Stopped
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override Vector3 Position
|
||||
{
|
||||
get { return _position; }
|
||||
set
|
||||
{
|
||||
_position = value;
|
||||
Vec3 ps = new Vec3();
|
||||
ps.X = value.X;
|
||||
ps.Y = value.Y;
|
||||
ps.Z = value.Z;
|
||||
_character.Position = ps;
|
||||
}
|
||||
}
|
||||
|
||||
public override Vector3 Size
|
||||
{
|
||||
get { return Vector3.Zero; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public override float Mass
|
||||
{
|
||||
get { return 0f; }
|
||||
}
|
||||
|
||||
public override Vector3 Force
|
||||
{
|
||||
get { return Vector3.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override int VehicleType
|
||||
{
|
||||
get { return 0; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override void VehicleFloatParam(int param, float value)
|
||||
{
|
||||
}
|
||||
|
||||
public override void VehicleVectorParam(int param, Vector3 value)
|
||||
{
|
||||
}
|
||||
|
||||
public override void VehicleRotationParam(int param, Quaternion rotation)
|
||||
{
|
||||
}
|
||||
|
||||
public override void VehicleFlags(int param, bool remove)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetVolumeDetect(int param)
|
||||
{
|
||||
}
|
||||
|
||||
public override Vector3 CenterOfMass
|
||||
{
|
||||
get { return Vector3.Zero; }
|
||||
}
|
||||
|
||||
public override Vector3 GeometricCenter
|
||||
{
|
||||
get { return Vector3.Zero; }
|
||||
}
|
||||
|
||||
public override Vector3 Velocity
|
||||
{
|
||||
get { return _velocity; }
|
||||
set { _velocity = value; }
|
||||
}
|
||||
|
||||
public override float CollisionScore
|
||||
{
|
||||
get { return 0f; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public override bool Kinematic
|
||||
{
|
||||
get { return false; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public override Quaternion Orientation
|
||||
{
|
||||
get { return Quaternion.Identity; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public override Vector3 Acceleration
|
||||
{
|
||||
get { return _acceleration; }
|
||||
set { _acceleration = value; }
|
||||
}
|
||||
|
||||
public override void AddForce(Vector3 force, bool pushforce)
|
||||
{
|
||||
}
|
||||
|
||||
public override Vector3 Torque
|
||||
{
|
||||
get { return Vector3.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override void AddAngularForce(Vector3 force, bool pushforce)
|
||||
{
|
||||
}
|
||||
|
||||
public override void link(PhysicsActor obj)
|
||||
{
|
||||
}
|
||||
|
||||
public override void delink()
|
||||
{
|
||||
}
|
||||
|
||||
public override void LockAngularMotion(Vector3 axis)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetMomentum(Vector3 momentum)
|
||||
{
|
||||
}
|
||||
|
||||
public void Move(float timeStep)
|
||||
{
|
||||
Vec3 vec = new Vec3();
|
||||
vec.X = _velocity.X*timeStep;
|
||||
vec.Y = _velocity.Y*timeStep;
|
||||
if (flying)
|
||||
{
|
||||
vec.Z = (_velocity.Z)*timeStep;
|
||||
}
|
||||
else
|
||||
{
|
||||
gravityAccel += -9.8f;
|
||||
vec.Z = (gravityAccel + _velocity.Z)*timeStep;
|
||||
}
|
||||
int res = _character.Move(vec);
|
||||
if (res == 1)
|
||||
{
|
||||
gravityAccel = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override PrimitiveBaseShape Shape
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public void UpdatePosition()
|
||||
{
|
||||
Vec3 vec = _character.Position;
|
||||
_position.X = vec.X;
|
||||
_position.Y = vec.Y;
|
||||
_position.Z = vec.Z;
|
||||
}
|
||||
|
||||
public override void CrossingFailure()
|
||||
{
|
||||
}
|
||||
|
||||
public override Vector3 PIDTarget { set { return; } }
|
||||
public override bool PIDActive { set { return; } }
|
||||
public override float PIDTau { set { return; } }
|
||||
|
||||
public override float PIDHoverHeight { set { return; } }
|
||||
public override bool PIDHoverActive { set { return; } }
|
||||
public override PIDHoverType PIDHoverType { set { return; } }
|
||||
public override float PIDHoverTau { set { return; } }
|
||||
|
||||
public override Quaternion APIDTarget
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool APIDActive
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override float APIDStrength
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override float APIDDamping
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override void SubscribeEvents(int ms)
|
||||
{
|
||||
|
||||
}
|
||||
public override void UnSubscribeEvents()
|
||||
{
|
||||
|
||||
}
|
||||
public override bool SubscribedEvents()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* 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 Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using PhysXWrapper;
|
||||
using Quaternion=OpenMetaverse.Quaternion;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Physics.PhysXPlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Will be the PhysX plugin but for now will be a very basic physics engine
|
||||
/// </summary>
|
||||
public class PhysXPlugin : IPhysicsPlugin
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private PhysXScene _mScene;
|
||||
|
||||
public PhysXPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
public bool Init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public PhysicsScene GetScene(string sceneIdentifier)
|
||||
{
|
||||
if (_mScene == null)
|
||||
{
|
||||
_mScene = new PhysXScene(sceneIdentifier);
|
||||
}
|
||||
return (_mScene);
|
||||
}
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return ("RealPhysX");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,341 +0,0 @@
|
||||
/*
|
||||
* 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 Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using PhysXWrapper;
|
||||
using Quaternion=OpenMetaverse.Quaternion;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Physics.PhysXPlugin
|
||||
{
|
||||
public class PhysXPrim : PhysicsActor
|
||||
{
|
||||
private Vector3 _velocity;
|
||||
private Vector3 _acceleration;
|
||||
private Vector3 m_rotationalVelocity;
|
||||
private NxActor _prim;
|
||||
|
||||
public PhysXPrim(NxActor prim)
|
||||
{
|
||||
_velocity = Vector3.Zero;
|
||||
_acceleration = Vector3.Zero;
|
||||
_prim = prim;
|
||||
}
|
||||
|
||||
public override int PhysicsActorType
|
||||
{
|
||||
get { return (int) ActorTypes.Prim; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool IsPhysical
|
||||
{
|
||||
get { return false; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool SetAlwaysRun
|
||||
{
|
||||
get { return false; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override uint LocalID
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool Grabbed
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool Selected
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override float Buoyancy
|
||||
{
|
||||
get { return 0f; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool FloatOnWater
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool ThrottleUpdates
|
||||
{
|
||||
get { return false; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override Vector3 RotationalVelocity
|
||||
{
|
||||
get { return m_rotationalVelocity; }
|
||||
set { m_rotationalVelocity = value; }
|
||||
}
|
||||
|
||||
public override bool Flying
|
||||
{
|
||||
get { return false; //no flying prims for you
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
public override bool IsColliding
|
||||
{
|
||||
get { return false; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public override bool CollidingGround
|
||||
{
|
||||
get { return false; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool CollidingObj
|
||||
{
|
||||
get { return false; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool Stopped
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override Vector3 Position
|
||||
{
|
||||
get
|
||||
{
|
||||
Vector3 pos = Vector3.Zero;
|
||||
Vec3 vec = _prim.Position;
|
||||
pos.X = vec.X;
|
||||
pos.Y = vec.Y;
|
||||
pos.Z = vec.Z;
|
||||
return pos;
|
||||
}
|
||||
set
|
||||
{
|
||||
Vector3 vec = value;
|
||||
Vec3 pos = new Vec3();
|
||||
pos.X = vec.X;
|
||||
pos.Y = vec.Y;
|
||||
pos.Z = vec.Z;
|
||||
_prim.Position = pos;
|
||||
}
|
||||
}
|
||||
|
||||
public override PrimitiveBaseShape Shape
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override Vector3 Velocity
|
||||
{
|
||||
get { return _velocity; }
|
||||
set { _velocity = value; }
|
||||
}
|
||||
|
||||
public override Vector3 Torque
|
||||
{
|
||||
get { return Vector3.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override float CollisionScore
|
||||
{
|
||||
get { return 0f; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public override bool Kinematic
|
||||
{
|
||||
get { return _prim.Kinematic; }
|
||||
set { _prim.Kinematic = value; }
|
||||
}
|
||||
|
||||
public override Quaternion Orientation
|
||||
{
|
||||
get
|
||||
{
|
||||
Quaternion res;
|
||||
PhysXWrapper.Quaternion quat = _prim.GetOrientation();
|
||||
res.W = quat.W;
|
||||
res.X = quat.X;
|
||||
res.Y = quat.Y;
|
||||
res.Z = quat.Z;
|
||||
return res;
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
public override Vector3 Acceleration
|
||||
{
|
||||
get { return _acceleration; }
|
||||
set { _acceleration = value; }
|
||||
}
|
||||
|
||||
public override void AddForce(Vector3 force, bool pushforce)
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddAngularForce(Vector3 force, bool pushforce)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetMomentum(Vector3 momentum)
|
||||
{
|
||||
}
|
||||
|
||||
public override Vector3 Size
|
||||
{
|
||||
get { return Vector3.Zero; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public override void link(PhysicsActor obj)
|
||||
{
|
||||
}
|
||||
|
||||
public override void delink()
|
||||
{
|
||||
}
|
||||
|
||||
public override void LockAngularMotion(Vector3 axis)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override float Mass
|
||||
{
|
||||
get { return 0f; }
|
||||
}
|
||||
|
||||
public override Vector3 Force
|
||||
{
|
||||
get { return Vector3.Zero; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override int VehicleType
|
||||
{
|
||||
get { return 0; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override void VehicleFloatParam(int param, float value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void VehicleVectorParam(int param, Vector3 value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void VehicleRotationParam(int param, Quaternion rotation)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void VehicleFlags(int param, bool remove) { }
|
||||
|
||||
public override void SetVolumeDetect(int param)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override Vector3 CenterOfMass
|
||||
{
|
||||
get { return Vector3.Zero; }
|
||||
}
|
||||
|
||||
public override Vector3 GeometricCenter
|
||||
{
|
||||
get { return Vector3.Zero; }
|
||||
}
|
||||
|
||||
public override void CrossingFailure()
|
||||
{
|
||||
}
|
||||
|
||||
public override Vector3 PIDTarget { set { return; } }
|
||||
public override bool PIDActive { set { return; } }
|
||||
public override float PIDTau { set { return; } }
|
||||
|
||||
public override float PIDHoverHeight { set { return; } }
|
||||
public override bool PIDHoverActive { set { return; } }
|
||||
public override PIDHoverType PIDHoverType { set { return; } }
|
||||
public override float PIDHoverTau { set { return; } }
|
||||
|
||||
public override Quaternion APIDTarget
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override bool APIDActive
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override float APIDStrength
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
public override float APIDDamping
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void SubscribeEvents(int ms)
|
||||
{
|
||||
|
||||
}
|
||||
public override void UnSubscribeEvents()
|
||||
{
|
||||
|
||||
}
|
||||
public override bool SubscribedEvents()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
* 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 Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using PhysXWrapper;
|
||||
using Quaternion=OpenMetaverse.Quaternion;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Physics.PhysXPlugin
|
||||
{
|
||||
public class PhysXScene : PhysicsScene
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private List<PhysXCharacter> _characters = new List<PhysXCharacter>();
|
||||
private List<PhysXPrim> _prims = new List<PhysXPrim>();
|
||||
private float[] _heightMap = null;
|
||||
private NxPhysicsSDK mySdk;
|
||||
private NxScene scene;
|
||||
|
||||
// protected internal string sceneIdentifier;
|
||||
public PhysXScene(string _sceneIdentifier)
|
||||
{
|
||||
//sceneIdentifier = _sceneIdentifier;
|
||||
|
||||
mySdk = NxPhysicsSDK.CreateSDK();
|
||||
m_log.Info("Sdk created - now creating scene");
|
||||
scene = mySdk.CreateScene();
|
||||
}
|
||||
|
||||
public override void Initialise(IMesher meshmerizer, IConfigSource config)
|
||||
{
|
||||
// Does nothing right now
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void SetWaterLevel(float baseheight)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
|
||||
{
|
||||
Vec3 pos = new Vec3();
|
||||
pos.X = position.X;
|
||||
pos.Y = position.Y;
|
||||
pos.Z = position.Z;
|
||||
PhysXCharacter act = new PhysXCharacter(scene.AddCharacter(pos));
|
||||
act.Flying = isFlying;
|
||||
act.Position = position;
|
||||
_characters.Add(act);
|
||||
return act;
|
||||
}
|
||||
|
||||
public override void RemovePrim(PhysicsActor prim)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RemoveAvatar(PhysicsActor actor)
|
||||
{
|
||||
}
|
||||
|
||||
private PhysicsActor AddPrim(Vector3 position, Vector3 size, Quaternion rotation)
|
||||
{
|
||||
Vec3 pos = new Vec3();
|
||||
pos.X = position.X;
|
||||
pos.Y = position.Y;
|
||||
pos.Z = position.Z;
|
||||
Vec3 siz = new Vec3();
|
||||
siz.X = size.X;
|
||||
siz.Y = size.Y;
|
||||
siz.Z = size.Z;
|
||||
PhysXPrim act = new PhysXPrim(scene.AddNewBox(pos, siz));
|
||||
_prims.Add(act);
|
||||
return act;
|
||||
}
|
||||
|
||||
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
|
||||
Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
|
||||
{
|
||||
return AddPrim(position, size, rotation);
|
||||
}
|
||||
|
||||
public override void AddPhysicsActorTaint(PhysicsActor prim)
|
||||
{
|
||||
}
|
||||
|
||||
public override float Simulate(float timeStep)
|
||||
{
|
||||
float fps = 0f;
|
||||
try
|
||||
{
|
||||
foreach (PhysXCharacter actor in _characters)
|
||||
{
|
||||
actor.Move(timeStep);
|
||||
}
|
||||
scene.Simulate(timeStep);
|
||||
scene.FetchResults();
|
||||
scene.UpdateControllers();
|
||||
|
||||
foreach (PhysXCharacter actor in _characters)
|
||||
{
|
||||
actor.UpdatePosition();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(e.Message);
|
||||
}
|
||||
return fps;
|
||||
}
|
||||
|
||||
public override void GetResults()
|
||||
{
|
||||
}
|
||||
|
||||
public override bool IsThreaded
|
||||
{
|
||||
// for now we won't be multithreaded
|
||||
get { return (false); }
|
||||
}
|
||||
|
||||
public override void SetTerrain(float[] heightMap)
|
||||
{
|
||||
if (_heightMap != null)
|
||||
{
|
||||
m_log.Debug("PhysX - deleting old terrain");
|
||||
scene.DeleteTerrain();
|
||||
}
|
||||
_heightMap = heightMap;
|
||||
scene.AddTerrain(heightMap);
|
||||
}
|
||||
|
||||
public override void DeleteTerrain()
|
||||
{
|
||||
scene.DeleteTerrain();
|
||||
}
|
||||
|
||||
public override Dictionary<uint, float> GetTopColliders()
|
||||
{
|
||||
Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
|
||||
return returncolliders;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2233,7 +2233,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
return NpcCreate(firstname, lastname, position, notecard, false, true);
|
||||
return NpcCreate(firstname, lastname, position, notecard, false, false);
|
||||
}
|
||||
|
||||
public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options)
|
||||
@@ -2244,7 +2244,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return NpcCreate(
|
||||
firstname, lastname, position, notecard,
|
||||
(options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0,
|
||||
(options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) == 0);
|
||||
(options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) != 0);
|
||||
}
|
||||
|
||||
private LSL_Key NpcCreate(
|
||||
@@ -2595,7 +2595,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
UUID npcID = new UUID(npc.m_string);
|
||||
|
||||
if (module.CheckPermissions(npcID, m_host.OwnerID))
|
||||
AvatarPlayAnimation(npcID.ToString(), animation);
|
||||
AvatarStopAnimation(npcID.ToString(), animation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using log4net;
|
||||
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.ScriptEngine.Shared;
|
||||
@@ -41,6 +40,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
{
|
||||
public class SensorRepeat
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public AsyncCommandManager m_CmdManager;
|
||||
|
||||
public SensorRepeat(AsyncCommandManager CmdManager)
|
||||
@@ -447,11 +448,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
|
||||
Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence =>
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SENSOR REPEAT]: Inspecting scene presence {0}, type {1} on sensor sweep for {2}, type {3}",
|
||||
// presence.Name, presence.PresenceType, ts.name, ts.type);
|
||||
|
||||
if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
|
||||
{
|
||||
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
|
||||
if (npcData == null || !npcData.SenseAsAgent)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SENSOR REPEAT]: Discarding NPC {0} from agent sense sweep for script item id {1}",
|
||||
// presence.Name, ts.itemID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ((ts.type & AGENT) == 0)
|
||||
@@ -464,7 +474,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
{
|
||||
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
|
||||
if (npcData != null && npcData.SenseAsAgent)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SENSOR REPEAT]: Discarding NPC {0} from non-agent sense sweep for script item id {1}",
|
||||
// presence.Name, ts.itemID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace OpenSim.Services.Connectors.Friends
|
||||
public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend)
|
||||
{
|
||||
string reply = string.Empty;
|
||||
string uri = m_ServerURI = "/friends";
|
||||
string uri = m_ServerURI + "/friends";
|
||||
try
|
||||
{
|
||||
reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
|
||||
|
||||
@@ -153,6 +153,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
return UpdateAgent(destination, (IAgentData)data, 200000); // yes, 200 seconds
|
||||
}
|
||||
|
||||
private ExpiringCache<string, bool> _failedSims = new ExpiringCache<string, bool>();
|
||||
/// <summary>
|
||||
/// Send updated position information about an agent in this region to a neighbor
|
||||
/// This operation may be called very frequently if an avatar is moving about in
|
||||
@@ -160,6 +161,10 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
/// </summary>
|
||||
public bool UpdateAgent(GridRegion destination, AgentPosition data)
|
||||
{
|
||||
bool v = true;
|
||||
if (_failedSims.TryGetValue(destination.ServerURI, out v))
|
||||
return false;
|
||||
|
||||
// The basic idea of this code is that the first thread that needs to
|
||||
// send an update for a specific avatar becomes the worker for any subsequent
|
||||
// requests until there are no more outstanding requests. Further, only send the most
|
||||
@@ -183,9 +188,10 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
// Otherwise update the reference and start processing
|
||||
m_updateAgentQueue[uri] = data;
|
||||
}
|
||||
|
||||
|
||||
AgentPosition pos = null;
|
||||
while (true)
|
||||
bool success = true;
|
||||
while (success)
|
||||
{
|
||||
lock (m_updateAgentQueue)
|
||||
{
|
||||
@@ -205,11 +211,16 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
}
|
||||
}
|
||||
|
||||
UpdateAgent(destination, (IAgentData)pos, 10000);
|
||||
success = UpdateAgent(destination, (IAgentData)pos, 10000);
|
||||
}
|
||||
|
||||
// unreachable
|
||||
// return true;
|
||||
// we get here iff success == false
|
||||
// blacklist sim for 2 minutes
|
||||
lock (m_updateAgentQueue)
|
||||
{
|
||||
_failedSims.AddOrUpdate(destination.ServerURI, true, 120);
|
||||
m_updateAgentQueue.Remove(uri);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -188,9 +188,9 @@ namespace OpenSim.Services.HypergridService
|
||||
string authURL = string.Empty;
|
||||
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||
authURL = aCircuit.ServiceURLs["HomeURI"].ToString();
|
||||
m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9}",
|
||||
m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9} Teleport Flags {10}",
|
||||
aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName,
|
||||
aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0);
|
||||
aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString());
|
||||
|
||||
//
|
||||
// Check client
|
||||
@@ -315,6 +315,10 @@ namespace OpenSim.Services.HypergridService
|
||||
// Finally launch the agent at the destination
|
||||
//
|
||||
Constants.TeleportFlags loginFlag = isFirstLogin ? Constants.TeleportFlags.ViaLogin : Constants.TeleportFlags.ViaHGLogin;
|
||||
|
||||
// Preserve our TeleportFlags we have gathered so-far
|
||||
loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags;
|
||||
|
||||
m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag);
|
||||
return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
|
||||
}
|
||||
|
||||
@@ -465,6 +465,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
|
||||
position = pinfo.HomePosition;
|
||||
lookAt = pinfo.HomeLookAt;
|
||||
flags |= TeleportFlags.ViaHome;
|
||||
}
|
||||
|
||||
if (tryDefaults)
|
||||
@@ -753,6 +754,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
{
|
||||
circuitCode = (uint)Util.RandomClass.Next(); ;
|
||||
aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0);
|
||||
aCircuit.teleportFlags |= (uint)flags;
|
||||
success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason);
|
||||
if (!success && m_GridService != null)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,8 @@ namespace OpenSim.Tests.Common.Mock
|
||||
|
||||
~TestScene()
|
||||
{
|
||||
Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName);
|
||||
//Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName);
|
||||
Console.WriteLine("TestScene destructor called");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -49,6 +49,13 @@ namespace OpenSim.Tests.Torture
|
||||
[TestFixture]
|
||||
public class ObjectTortureTests
|
||||
{
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
}
|
||||
|
||||
// [Test]
|
||||
// public void Test0000Clean()
|
||||
// {
|
||||
@@ -141,8 +148,18 @@ namespace OpenSim.Tests.Torture
|
||||
string.Format("Object {0} could not be retrieved", i));
|
||||
}
|
||||
|
||||
// This does not work to fire the SceneObjectGroup destructors - something else is hanging on to them.
|
||||
// scene.DeleteAllSceneObjects();
|
||||
// When a scene object is added to a scene, it is placed in the update list for sending to viewers
|
||||
// (though in this case we have none). When it is deleted, it is not removed from the update which is
|
||||
// fine since it will later be ignored.
|
||||
//
|
||||
// However, that means that we need to manually run an update here to clear out that list so that deleted
|
||||
// objects will be clean up by the garbage collector before the next stress test is run.
|
||||
scene.Update();
|
||||
|
||||
// Currently, we need to do this in order to garbage collect the scene objects ready for the next test run.
|
||||
// However, what we really need to do is find out why the entire scene is not garbage collected in
|
||||
// teardown.
|
||||
scene.DeleteAllSceneObjects();
|
||||
|
||||
Console.WriteLine(
|
||||
"Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",
|
||||
|
||||
@@ -484,7 +484,6 @@
|
||||
;; such as the Meta7 viewer.
|
||||
;; It has no ill effect on viewers which do not support server-side
|
||||
;; windlight settings.
|
||||
;; Currently we only have support for MySQL databases.
|
||||
; enable_windlight = false
|
||||
|
||||
|
||||
@@ -573,10 +572,15 @@
|
||||
; DeleteScriptsOnStartup = true
|
||||
|
||||
;; Set this to true (the default) to load each script into a separate
|
||||
;; AppDomain. Setting this to false will load all script assemblies into the
|
||||
;; current AppDomain, which will reduce the per-script overhead at the
|
||||
;; expense of reduced security and the inability to garbage collect the
|
||||
;; script assemblies
|
||||
;; AppDomain.
|
||||
;;
|
||||
;; Setting this to false will load all script assemblies into the
|
||||
;; current AppDomain, which will significantly improve script loading times.
|
||||
;; It will also reduce initial per-script memory overhead.
|
||||
;;
|
||||
;; However, setting this to false will also prevent script DLLs from being unloaded from memory if the script is deleted.
|
||||
;; This may cause an OutOfMemory problem over time when avatars with scripted attachments move in and out of the region.
|
||||
;; Some Windows users have also reported script loading problems when AppDomainLoading = false
|
||||
; AppDomainLoading = true
|
||||
|
||||
;# {DefaultCompileLanguage} {Enabled:true} {Default script language?} {lsl vb cs} lsl
|
||||
|
||||
@@ -655,6 +655,11 @@
|
||||
world_gravityy = 0
|
||||
world_gravityz = -9.8
|
||||
|
||||
; Terminal velocity of a falling avatar
|
||||
; This is the same http://en.wikipedia.org/wiki/Terminal_velocity#Examples
|
||||
; Max value is 255, min value is 0
|
||||
avatar_terminal_velocity = 54
|
||||
|
||||
; World Step size. (warning these are dangerous. Changing these will probably cause your scene to explode dramatically)
|
||||
; reference: fps = (0.089/ODE_STEPSIZE) * 1000;
|
||||
world_stepsize = 0.0178
|
||||
@@ -1065,7 +1070,6 @@
|
||||
[LightShare]
|
||||
; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer.
|
||||
; It has no ill effect on viewers which do not support server-side windlight settings.
|
||||
; Currently we only have support for MySQL databases.
|
||||
enable_windlight = false
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
bin/lib64/ode.dll
Executable file
BIN
bin/lib64/ode.dll
Executable file
Binary file not shown.
BIN
bin/lib64/sqlite3.dll
Executable file
BIN
bin/lib64/sqlite3.dll
Executable file
Binary file not shown.
25
prebuild.xml
25
prebuild.xml
@@ -521,31 +521,6 @@
|
||||
</Files>
|
||||
</Project>
|
||||
|
||||
<Project frameworkVersion="v3_5" name="OpenSim.Region.Physics.PhysXPlugin" path="OpenSim/Region/Physics/PhysXPlugin" type="Library">
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>../../../../bin/Physics/</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>../../../../bin/Physics/</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<ReferencePath>../../../../bin/</ReferencePath>
|
||||
<Reference name="System"/>
|
||||
<Reference name="OpenMetaverseTypes" path="../../../../bin/"/>
|
||||
<Reference name="Nini" path="../../../../bin/"/>
|
||||
<Reference name="PhysX_Wrapper_Dotnet" path="../../../../bin/"/>
|
||||
<Reference name="OpenSim.Framework"/>
|
||||
<Reference name="OpenSim.Region.Physics.Manager"/>
|
||||
<Reference name="log4net" path="../../../../bin/"/>
|
||||
<Files>
|
||||
<Match pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
</Project>
|
||||
|
||||
<Project frameworkVersion="v3_5" name="OpenSim.Region.Physics.OdePlugin" path="OpenSim/Region/Physics/OdePlugin" type="Library">
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
|
||||
Reference in New Issue
Block a user