Formatting cleanup. Add copyright headers.

mysql-performance
Jeff Ames 2010-01-04 06:10:45 +09:00
parent 9f273717a2
commit 70d5b1c34c
54 changed files with 1075 additions and 838 deletions

View File

@ -757,24 +757,24 @@ namespace OpenSim.Client.MXP.ClientStack
public event MuteListRequest OnMuteListRequest; public event MuteListRequest OnMuteListRequest;
public event AvatarInterestUpdate OnAvatarInterestUpdate; public event AvatarInterestUpdate OnAvatarInterestUpdate;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgentEvent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgentEvent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReportEvent;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveStateEvent;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUserEvent;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUserEvent;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntryEvent;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessageEvent;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;

View File

@ -1,4 +1,31 @@
using System; /*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
@ -375,24 +402,24 @@ namespace OpenSim.Client.Sirikata.ClientStack
public event MuteListRequest OnMuteListRequest; public event MuteListRequest OnMuteListRequest;
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgentEvent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgentEvent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReportEvent;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveStateEvent;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUserEvent;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUserEvent;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntryEvent;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessageEvent;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
public void SetDebugPacketLevel(int newDebug) public void SetDebugPacketLevel(int newDebug)
{ {
throw new System.NotImplementedException(); throw new System.NotImplementedException();

View File

@ -1,3 +1,30 @@
/*
* 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 pbd = global::Google.ProtocolBuffers.Descriptors; using pbd = global::Google.ProtocolBuffers.Descriptors;
using pb = global::Google.ProtocolBuffers; using pb = global::Google.ProtocolBuffers;
namespace Sirikata.Protocol { namespace Sirikata.Protocol {

View File

@ -1,4 +1,31 @@
using System; /*
* 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;
namespace PBJ namespace PBJ
{ {

View File

@ -1,3 +1,30 @@
/*
* 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 pbd = global::Google.ProtocolBuffers.Descriptors; using pbd = global::Google.ProtocolBuffers.Descriptors;
using pb = global::Google.ProtocolBuffers; using pb = global::Google.ProtocolBuffers;
namespace Sirikata.Persistence.Protocol { namespace Sirikata.Persistence.Protocol {
@ -812,7 +839,7 @@ namespace Sirikata.Persistence.Protocol {
public StorageElement Reads(int index) { public StorageElement Reads(int index) {
return new StorageElement(super.GetReads(index)); return new StorageElement(super.GetReads(index));
} }
public Builder AddReads(StorageElement value ) { public Builder AddReads(StorageElement value) {
super.AddReads(value._PBJSuper); super.AddReads(value._PBJSuper);
return this; return this;
} }
@ -919,7 +946,7 @@ namespace Sirikata.Persistence.Protocol {
public StorageElement Reads(int index) { public StorageElement Reads(int index) {
return new StorageElement(super.GetReads(index)); return new StorageElement(super.GetReads(index));
} }
public Builder AddReads(StorageElement value ) { public Builder AddReads(StorageElement value) {
super.AddReads(value._PBJSuper); super.AddReads(value._PBJSuper);
return this; return this;
} }
@ -1026,7 +1053,7 @@ namespace Sirikata.Persistence.Protocol {
public StorageElement Writes(int index) { public StorageElement Writes(int index) {
return new StorageElement(super.GetWrites(index)); return new StorageElement(super.GetWrites(index));
} }
public Builder AddWrites(StorageElement value ) { public Builder AddWrites(StorageElement value) {
super.AddWrites(value._PBJSuper); super.AddWrites(value._PBJSuper);
return this; return this;
} }
@ -1155,7 +1182,7 @@ namespace Sirikata.Persistence.Protocol {
public StorageElement Reads(int index) { public StorageElement Reads(int index) {
return new StorageElement(super.GetReads(index)); return new StorageElement(super.GetReads(index));
} }
public Builder AddReads(StorageElement value ) { public Builder AddReads(StorageElement value) {
super.AddReads(value._PBJSuper); super.AddReads(value._PBJSuper);
return this; return this;
} }
@ -1170,7 +1197,7 @@ namespace Sirikata.Persistence.Protocol {
public StorageElement Writes(int index) { public StorageElement Writes(int index) {
return new StorageElement(super.GetWrites(index)); return new StorageElement(super.GetWrites(index));
} }
public Builder AddWrites(StorageElement value ) { public Builder AddWrites(StorageElement value) {
super.AddWrites(value._PBJSuper); super.AddWrites(value._PBJSuper);
return this; return this;
} }
@ -1322,7 +1349,7 @@ namespace Sirikata.Persistence.Protocol {
public StorageElement Reads(int index) { public StorageElement Reads(int index) {
return new StorageElement(super.GetReads(index)); return new StorageElement(super.GetReads(index));
} }
public Builder AddReads(StorageElement value ) { public Builder AddReads(StorageElement value) {
super.AddReads(value._PBJSuper); super.AddReads(value._PBJSuper);
return this; return this;
} }
@ -1337,7 +1364,7 @@ namespace Sirikata.Persistence.Protocol {
public StorageElement Writes(int index) { public StorageElement Writes(int index) {
return new StorageElement(super.GetWrites(index)); return new StorageElement(super.GetWrites(index));
} }
public Builder AddWrites(StorageElement value ) { public Builder AddWrites(StorageElement value) {
super.AddWrites(value._PBJSuper); super.AddWrites(value._PBJSuper);
return this; return this;
} }
@ -1352,7 +1379,7 @@ namespace Sirikata.Persistence.Protocol {
public CompareElement Compares(int index) { public CompareElement Compares(int index) {
return new CompareElement(super.GetCompares(index)); return new CompareElement(super.GetCompares(index));
} }
public Builder AddCompares(CompareElement value ) { public Builder AddCompares(CompareElement value) {
super.AddCompares(value._PBJSuper); super.AddCompares(value._PBJSuper);
return this; return this;
} }
@ -1493,7 +1520,7 @@ namespace Sirikata.Persistence.Protocol {
public StorageElement Reads(int index) { public StorageElement Reads(int index) {
return new StorageElement(super.GetReads(index)); return new StorageElement(super.GetReads(index));
} }
public Builder AddReads(StorageElement value ) { public Builder AddReads(StorageElement value) {
super.AddReads(value._PBJSuper); super.AddReads(value._PBJSuper);
return this; return this;
} }

View File

@ -1,3 +1,30 @@
/*
* 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 pbd = global::Google.ProtocolBuffers.Descriptors; using pbd = global::Google.ProtocolBuffers.Descriptors;
using pb = global::Google.ProtocolBuffers; using pb = global::Google.ProtocolBuffers;
namespace Sirikata.Physics.Protocol { namespace Sirikata.Physics.Protocol {

View File

@ -1,3 +1,30 @@
/*
* 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 pbd = global::Google.ProtocolBuffers.Descriptors; using pbd = global::Google.ProtocolBuffers.Descriptors;
using pb = global::Google.ProtocolBuffers; using pb = global::Google.ProtocolBuffers;
namespace Sirikata.Protocol { namespace Sirikata.Protocol {
@ -3809,7 +3836,7 @@ namespace Sirikata.Protocol {
public ConnectToSpace SpaceProperties(int index) { public ConnectToSpace SpaceProperties(int index) {
return new ConnectToSpace(super.GetSpaceProperties(index)); return new ConnectToSpace(super.GetSpaceProperties(index));
} }
public Builder AddSpaceProperties(ConnectToSpace value ) { public Builder AddSpaceProperties(ConnectToSpace value) {
super.AddSpaceProperties(value._PBJSuper); super.AddSpaceProperties(value._PBJSuper);
return this; return this;
} }

View File

@ -1,3 +1,30 @@
/*
* 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 pbd = global::Google.ProtocolBuffers.Descriptors; using pbd = global::Google.ProtocolBuffers.Descriptors;
using pb = global::Google.ProtocolBuffers; using pb = global::Google.ProtocolBuffers;
namespace Sirikata.Subscription.Protocol { namespace Sirikata.Subscription.Protocol {

View File

@ -1,3 +1,30 @@
/*
* 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 pbd = global::Google.ProtocolBuffers.Descriptors; using pbd = global::Google.ProtocolBuffers.Descriptors;
using pb = global::Google.ProtocolBuffers; using pb = global::Google.ProtocolBuffers;
namespace Sirikata.PB { namespace Sirikata.PB {
@ -407,7 +434,7 @@ namespace Sirikata.PB {
public Types.SubMessage Submessers(int index) { public Types.SubMessage Submessers(int index) {
return new Types.SubMessage(super.GetSubmessers(index)); return new Types.SubMessage(super.GetSubmessers(index));
} }
public Builder AddSubmessers(Types.SubMessage value ) { public Builder AddSubmessers(Types.SubMessage value) {
super.AddSubmessers(value._PBJSuper); super.AddSubmessers(value._PBJSuper);
return this; return this;
} }
@ -1651,7 +1678,7 @@ namespace Sirikata.PB {
public Types.SubMessage Submessers(int index) { public Types.SubMessage Submessers(int index) {
return new Types.SubMessage(super.GetSubmessers(index)); return new Types.SubMessage(super.GetSubmessers(index));
} }
public Builder AddSubmessers(Types.SubMessage value ) { public Builder AddSubmessers(Types.SubMessage value) {
super.AddSubmessers(value._PBJSuper); super.AddSubmessers(value._PBJSuper);
return this; return this;
} }
@ -1709,7 +1736,7 @@ namespace Sirikata.PB {
public ExternalMessage Extmessers(int index) { public ExternalMessage Extmessers(int index) {
return new ExternalMessage(super.GetExtmessers(index)); return new ExternalMessage(super.GetExtmessers(index));
} }
public Builder AddExtmessers(ExternalMessage value ) { public Builder AddExtmessers(ExternalMessage value) {
super.AddExtmessers(value._PBJSuper); super.AddExtmessers(value._PBJSuper);
return this; return this;
} }

View File

@ -1,3 +1,30 @@
/*
* 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 pbd = global::Google.ProtocolBuffers.Descriptors; using pbd = global::Google.ProtocolBuffers.Descriptors;
using pb = global::Google.ProtocolBuffers; using pb = global::Google.ProtocolBuffers;
namespace Sirikata.Network.Protocol { namespace Sirikata.Network.Protocol {

View File

@ -93,7 +93,7 @@ namespace OpenSim.Client.Sirikata
public void PostInitialise() public void PostInitialise()
{ {
if(!m_enabled) if (!m_enabled)
return; return;
m_listener = new TcpListener(IPAddress.Any, 5943); m_listener = new TcpListener(IPAddress.Any, 5943);
@ -102,7 +102,7 @@ namespace OpenSim.Client.Sirikata
private void ListenLoop() private void ListenLoop()
{ {
while(m_running) while (m_running)
{ {
m_listener.BeginAcceptTcpClient(AcceptSocket, m_listener); m_listener.BeginAcceptTcpClient(AcceptSocket, m_listener);
} }

View File

@ -406,24 +406,24 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
public event AvatarInterestUpdate OnAvatarInterestUpdate = delegate { }; public event AvatarInterestUpdate OnAvatarInterestUpdate = delegate { };
public event PlacesQuery OnPlacesQuery = delegate { }; public event PlacesQuery OnPlacesQuery = delegate { };
public event FindAgentUpdate OnFindAgentEvent = delegate { }; public event FindAgentUpdate OnFindAgentEvent = delegate { };
public event TrackAgentUpdate OnTrackAgentEvent = delegate { }; public event TrackAgentUpdate OnTrackAgentEvent = delegate { };
public event NewUserReport OnUserReportEvent = delegate { }; public event NewUserReport OnUserReportEvent = delegate { };
public event SaveStateHandler OnSaveStateEvent = delegate { }; public event SaveStateHandler OnSaveStateEvent = delegate { };
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest = delegate { }; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest = delegate { };
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest = delegate { }; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest = delegate { };
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest = delegate { }; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest = delegate { };
public event FreezeUserUpdate OnParcelFreezeUserEvent = delegate { }; public event FreezeUserUpdate OnParcelFreezeUserEvent = delegate { };
public event EjectUserUpdate OnParcelEjectUserEvent = delegate { }; public event EjectUserUpdate OnParcelEjectUserEvent = delegate { };
public event ParcelBuyPass OnParcelBuyPass = delegate { }; public event ParcelBuyPass OnParcelBuyPass = delegate { };
public event ParcelGodMark OnParcelGodMark = delegate { }; public event ParcelGodMark OnParcelGodMark = delegate { };
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest = delegate { }; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest = delegate { };
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest = delegate { }; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest = delegate { };
public event SimWideDeletesDelegate OnSimWideDeletes = delegate { }; public event SimWideDeletesDelegate OnSimWideDeletes = delegate { };
public event SendPostcard OnSendPostcard = delegate { }; public event SendPostcard OnSendPostcard = delegate { };
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent = delegate { }; public event MuteListEntryUpdate OnUpdateMuteListEntryEvent = delegate { };
public event MuteListEntryRemove OnRemoveMuteListEntryEvent = delegate { }; public event MuteListEntryRemove OnRemoveMuteListEntryEvent = delegate { };
public event GodlikeMessage onGodlikeMessageEvent = delegate { }; public event GodlikeMessage onGodlikeMessageEvent = delegate { };
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent = delegate { }; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent = delegate { };

View File

@ -91,7 +91,7 @@ namespace OpenSim.Data.MySQL
rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true"; rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true";
opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true"; opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true";
if(rollbackStore) if (rollbackStore)
m_log.Warn("[MysqlInventory] Enabling rollback mode in: " + rollbackDir); m_log.Warn("[MysqlInventory] Enabling rollback mode in: " + rollbackDir);
database = database =
@ -552,7 +552,7 @@ namespace OpenSim.Data.MySQL
private void StoreRollbackItem(UUID ItemID) private void StoreRollbackItem(UUID ItemID)
{ {
if(rollbackStore == true) if (rollbackStore == true)
{ {
string todaysPath = RollbackGetTodaysPath(); string todaysPath = RollbackGetTodaysPath();
@ -1008,7 +1008,7 @@ namespace OpenSim.Data.MySQL
StoreRollbackFolder(f.ID); StoreRollbackFolder(f.ID);
deleteOneFolder(f.ID); deleteOneFolder(f.ID);
if(rollbackStore) if (rollbackStore)
{ {
foreach (InventoryItemBase itemBase in getInventoryInFolder(f.ID)) foreach (InventoryItemBase itemBase in getInventoryInFolder(f.ID))
{ {

View File

@ -828,7 +828,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendGroupActiveProposals(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary<int, string> VoteID, Dictionary<int, string> VoteInitiator, Dictionary<int, string> Majority, Dictionary<int, string> Quorum, Dictionary<int, string> TerseDateID, Dictionary<int, string> StartDateTime, Dictionary<int, string> EndDateTime, Dictionary<int, string> ProposalText) public void SendGroupActiveProposals(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary<int, string> VoteID, Dictionary<int, string> VoteInitiator, Dictionary<int, string> Majority, Dictionary<int, string> Quorum, Dictionary<int, string> TerseDateID, Dictionary<int, string> StartDateTime, Dictionary<int, string> EndDateTime, Dictionary<int, string> ProposalText)
{ {
foreach(KeyValuePair<int, string> Blank in VoteID) foreach (KeyValuePair<int, string> Blank in VoteID)
{ {
GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket();
@ -851,7 +851,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
GAPIRP.ProposalData[0] = ProposalData; GAPIRP.ProposalData[0] = ProposalData;
OutPacket(GAPIRP, ThrottleOutPacketType.Task); OutPacket(GAPIRP, ThrottleOutPacketType.Task);
} }
if(VoteID.Count == 0) if (VoteID.Count == 0)
{ {
GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket();
@ -878,7 +878,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendGroupVoteHistory(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary<int, string> VoteID, Dictionary<int, string> VoteInitiator, Dictionary<int, string> Majority, Dictionary<int, string> Quorum, Dictionary<int, string> TerseDateID, Dictionary<int, string> StartDateTime, Dictionary<int, string> EndDateTime, Dictionary<int, string> VoteType, Dictionary<int, string> VoteResult, Dictionary<int, string> ProposalText) public void SendGroupVoteHistory(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary<int, string> VoteID, Dictionary<int, string> VoteInitiator, Dictionary<int, string> Majority, Dictionary<int, string> Quorum, Dictionary<int, string> TerseDateID, Dictionary<int, string> StartDateTime, Dictionary<int, string> EndDateTime, Dictionary<int, string> VoteType, Dictionary<int, string> VoteResult, Dictionary<int, string> ProposalText)
{ {
foreach(KeyValuePair<int, string> Blank in VoteID) foreach (KeyValuePair<int, string> Blank in VoteID)
{ {
GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket();
@ -904,7 +904,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
GVHIRP.VoteItem[0] = VoteItem; GVHIRP.VoteItem[0] = VoteItem;
OutPacket(GVHIRP, ThrottleOutPacketType.Task); OutPacket(GVHIRP, ThrottleOutPacketType.Task);
} }
if(VoteID.Count == 0) if (VoteID.Count == 0)
{ {
GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket();

View File

@ -1119,23 +1119,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
} }
public void FindAgent(IClientAPI remoteClient, UUID hunter, UUID target) public void FindAgent(IClientAPI remoteClient, UUID hunter, UUID target)
{ {
List<FriendListItem> friendList = GetUserFriends(hunter); List<FriendListItem> friendList = GetUserFriends(hunter);
foreach (FriendListItem item in friendList) foreach (FriendListItem item in friendList)
{ {
if(item.onlinestatus == true) if (item.onlinestatus == true)
{ {
if(item.Friend == target && (item.FriendPerms & (uint)FriendRights.CanSeeOnMap) != 0) if (item.Friend == target && (item.FriendPerms & (uint)FriendRights.CanSeeOnMap) != 0)
{ {
ScenePresence SPTarget = ((Scene)remoteClient.Scene).GetScenePresence(target); ScenePresence SPTarget = ((Scene)remoteClient.Scene).GetScenePresence(target);
string regionname = SPTarget.Scene.RegionInfo.RegionName; string regionname = SPTarget.Scene.RegionInfo.RegionName;
remoteClient.SendScriptTeleportRequest("FindAgent", regionname,new Vector3(SPTarget.AbsolutePosition),new Vector3(SPTarget.Lookat)); remoteClient.SendScriptTeleportRequest("FindAgent", regionname,new Vector3(SPTarget.AbsolutePosition),new Vector3(SPTarget.Lookat));
} }
} }
else else
{ {
remoteClient.SendAgentAlertMessage("The agent you are looking for is not online.", false); remoteClient.SendAgentAlertMessage("The agent you are looking for is not online.", false);
} }
} }
} }
public List<FriendListItem> GetUserFriends(UUID agentID) public List<FriendListItem> GetUserFriends(UUID agentID)

View File

@ -118,7 +118,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
m_scene.ForEachClient( m_scene.ForEachClient(
delegate(IClientAPI controller) delegate(IClientAPI controller)
{ {
if (controller.AgentId != godID) if (controller.AgentId != godID)
controller.Kick(reasonStr); controller.Kick(reasonStr);
} }

View File

@ -484,10 +484,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
QueryDataMap.Add("GlobalZ", OSD.FromInteger((int)groupDataBlock.GlobalZ)); QueryDataMap.Add("GlobalZ", OSD.FromInteger((int)groupDataBlock.GlobalZ));
QueryDataMap.Add("Name", OSD.FromBinary(groupDataBlock.Name)); QueryDataMap.Add("Name", OSD.FromBinary(groupDataBlock.Name));
QueryDataMap.Add("OwnerID", OSD.FromUUID(groupDataBlock.OwnerID)); QueryDataMap.Add("OwnerID", OSD.FromUUID(groupDataBlock.OwnerID));
QueryDataMap.Add("SimName", OSD.FromBinary(groupDataBlock.SimName)); QueryDataMap.Add("SimName", OSD.FromBinary(groupDataBlock.SimName));
QueryDataMap.Add("SnapShotID", OSD.FromUUID(groupDataBlock.SnapshotID)); QueryDataMap.Add("SnapShotID", OSD.FromUUID(groupDataBlock.SnapshotID));
QueryDataMap.Add("ProductSku", OSD.FromInteger(0)); QueryDataMap.Add("ProductSku", OSD.FromInteger(0));
QueryDataMap.Add("Price", OSD.FromInteger(groupDataBlock.Price)); QueryDataMap.Add("Price", OSD.FromInteger(groupDataBlock.Price));
QueryData.Add(QueryDataMap); QueryData.Add(QueryDataMap);
} }

View File

@ -275,24 +275,24 @@ namespace OpenSim.Region.Examples.SimpleModule
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgentEvent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgentEvent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReportEvent;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveStateEvent;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUserEvent;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUserEvent;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntryEvent;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessageEvent;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
#pragma warning restore 67 #pragma warning restore 67

View File

@ -388,10 +388,10 @@ namespace OpenSim.Region.Framework.Scenes
get { return StatsReporter.getLastReportedSimFPS(); } get { return StatsReporter.getLastReportedSimFPS(); }
} }
public float[] SimulatorStats public float[] SimulatorStats
{ {
get { return StatsReporter.getLastReportedSimStats(); } get { return StatsReporter.getLastReportedSimStats(); }
} }
public string DefaultScriptEngine public string DefaultScriptEngine
{ {

View File

@ -1893,11 +1893,11 @@ namespace OpenSim.Region.Framework.Scenes
string data = ""; string data = "";
if (obj != null) if (obj != null)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object //If it is 1, it is to accept ONLY collisions from this object
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = obj.UUID; detobj.keyUUID = obj.UUID;
@ -1919,7 +1919,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object, so this other object will not work //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = obj.UUID; detobj.keyUUID = obj.UUID;
@ -1944,11 +1944,11 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar //If it is 1, it is to accept ONLY collisions from this avatar
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID; detobj.keyUUID = av.UUID;
@ -1970,7 +1970,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID; detobj.keyUUID = av.UUID;
@ -1998,7 +1998,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup.Scene == null) if (m_parentGroup.Scene == null)
return; return;
if(m_parentGroup.PassCollision == true) if (m_parentGroup.PassCollision == true)
{ {
//TODO: Add pass to root prim! //TODO: Add pass to root prim!
} }
@ -2029,11 +2029,11 @@ namespace OpenSim.Region.Framework.Scenes
string data = ""; string data = "";
if (obj != null) if (obj != null)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object //If it is 1, it is to accept ONLY collisions from this object
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = obj.UUID; detobj.keyUUID = obj.UUID;
@ -2055,7 +2055,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object, so this other object will not work //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = obj.UUID; detobj.keyUUID = obj.UUID;
@ -2080,11 +2080,11 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar //If it is 1, it is to accept ONLY collisions from this avatar
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID; detobj.keyUUID = av.UUID;
@ -2106,7 +2106,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID; detobj.keyUUID = av.UUID;
@ -2160,11 +2160,11 @@ namespace OpenSim.Region.Framework.Scenes
string data = ""; string data = "";
if (obj != null) if (obj != null)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object //If it is 1, it is to accept ONLY collisions from this object
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = obj.UUID; detobj.keyUUID = obj.UUID;
@ -2186,7 +2186,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object, so this other object will not work //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = obj.UUID; detobj.keyUUID = obj.UUID;
@ -2211,11 +2211,11 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar //If it is 1, it is to accept ONLY collisions from this avatar
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID; detobj.keyUUID = av.UUID;
@ -2237,7 +2237,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if(found) if (found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID; detobj.keyUUID = av.UUID;

View File

@ -1851,7 +1851,7 @@ namespace OpenSim.Region.Framework.Scenes
if (collisionPoint.ApproxEquals(m_requestedSitOffset + part.AbsolutePosition, 0.2f)) if (collisionPoint.ApproxEquals(m_requestedSitOffset + part.AbsolutePosition, 0.2f))
{ {
SitRaycastFindEdge(collisionPoint, normal); SitRaycastFindEdge(collisionPoint, normal);
m_log.DebugFormat("[SIT]: Raycast Avatar Position succeeded at point: {0}, normal:{1}", collisionPoint, normal ); m_log.DebugFormat("[SIT]: Raycast Avatar Position succeeded at point: {0}, normal:{1}", collisionPoint, normal);
} }
else else
{ {

View File

@ -82,7 +82,7 @@ namespace OpenSim.Region.Framework.Scenes
private int m_fps = 0; private int m_fps = 0;
// saved last reported value so there is something available for llGetRegionFPS // saved last reported value so there is something available for llGetRegionFPS
private float lastReportedSimFPS = 0; private float lastReportedSimFPS = 0;
private float[] lastReportedSimStats = new float[21]; private float[] lastReportedSimStats = new float[21];
private float m_pfps = 0; private float m_pfps = 0;
private int m_agentUpdates = 0; private int m_agentUpdates = 0;
@ -264,10 +264,10 @@ namespace OpenSim.Region.Framework.Scenes
sb[20].StatID = (uint)Stats.ScriptLinesPerSecond; sb[20].StatID = (uint)Stats.ScriptLinesPerSecond;
sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor; sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor;
for (int i = 0; i < 21; i++) for (int i = 0; i < 21; i++)
{ {
lastReportedSimStats[i] = sb[i].StatValue; lastReportedSimStats[i] = sb[i].StatValue;
} }
SimStats simStats SimStats simStats
= new SimStats( = new SimStats(
@ -448,10 +448,10 @@ namespace OpenSim.Region.Framework.Scenes
return lastReportedSimFPS; return lastReportedSimFPS;
} }
public float[] getLastReportedSimStats() public float[] getLastReportedSimStats()
{ {
return lastReportedSimStats; return lastReportedSimStats;
} }
public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes) public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes)
{ {

View File

@ -837,24 +837,24 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public event AvatarInterestUpdate OnAvatarInterestUpdate; public event AvatarInterestUpdate OnAvatarInterestUpdate;
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgentEvent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgentEvent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReportEvent;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveStateEvent;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUserEvent;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUserEvent;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntryEvent;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessageEvent;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
#pragma warning restore 67 #pragma warning restore 67

View File

@ -180,7 +180,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
/// <param name="msg">The message to send to the user</param> /// <param name="msg">The message to send to the user</param>
void Say(string msg); void Say(string msg);
void Say(string msg,int channel); void Say(string msg,int channel);
//// <value> //// <value>
/// Grants access to the objects inventory /// Grants access to the objects inventory

View File

@ -381,24 +381,24 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgentEvent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgentEvent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReportEvent;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveStateEvent;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUserEvent;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUserEvent;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntryEvent;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessageEvent;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
#pragma warning restore 67 #pragma warning restore 67

View File

@ -305,22 +305,22 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
public override Quaternion APIDTarget public override Quaternion APIDTarget
{ {
set { return; } set { return; }
} }
public override bool APIDActive public override bool APIDActive
{ {
set { return; } set { return; }
} }
public override float APIDStrength public override float APIDStrength
{ {
set { return; } set { return; }
} }
public override float APIDDamping public override float APIDDamping
{ {
set { return; } set { return; }
} }
public override void SubscribeEvents(int ms) public override void SubscribeEvents(int ms)

View File

@ -623,22 +623,22 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
public override Quaternion APIDTarget public override Quaternion APIDTarget
{ {
set { return; } set { return; }
} }
public override bool APIDActive public override bool APIDActive
{ {
set { return; } set { return; }
} }
public override float APIDStrength public override float APIDStrength
{ {
set { return; } set { return; }
} }
public override float APIDDamping public override float APIDDamping
{ {
set { return; } set { return; }
} }
/// <summary> /// <summary>

View File

@ -243,7 +243,7 @@ namespace OpenSim.Region.Physics.Manager
public abstract PIDHoverType PIDHoverType { set;} public abstract PIDHoverType PIDHoverType { set;}
public abstract float PIDHoverTau { set;} public abstract float PIDHoverTau { set;}
// For RotLookAt // For RotLookAt
public abstract Quaternion APIDTarget { set;} public abstract Quaternion APIDTarget { set;}
public abstract bool APIDActive { set;} public abstract bool APIDActive { set;}
public abstract float APIDStrength { set;} public abstract float APIDStrength { set;}

View File

@ -62,8 +62,8 @@ namespace OpenSim.Region.Physics.OdePlugin
get { return m_body; } get { return m_body; }
} }
private int frcount = 0; // Used to limit dynamics debug output to private int frcount = 0; // Used to limit dynamics debug output to
// every 100th frame // every 100th frame
// private OdeScene m_parentScene = null; // private OdeScene m_parentScene = null;
private IntPtr m_body = IntPtr.Zero; private IntPtr m_body = IntPtr.Zero;
@ -91,7 +91,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private float m_linearMotorDecayTimescale = 0; private float m_linearMotorDecayTimescale = 0;
private float m_linearMotorTimescale = 0; private float m_linearMotorTimescale = 0;
private Vector3 m_lastLinearVelocityVector = Vector3.Zero; private Vector3 m_lastLinearVelocityVector = Vector3.Zero;
// private bool m_LinearMotorSetLastFrame = false; // private bool m_LinearMotorSetLastFrame = false;
// private Vector3 m_linearMotorOffset = Vector3.Zero; // private Vector3 m_linearMotorOffset = Vector3.Zero;
//Angular properties //Angular properties
@ -104,7 +104,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body
// private Vector3 m_lastVertAttractor = Vector3.Zero; // what VA was last applied to body // private Vector3 m_lastVertAttractor = Vector3.Zero; // what VA was last applied to body
//Deflection properties //Deflection properties
// private float m_angularDeflectionEfficiency = 0; // private float m_angularDeflectionEfficiency = 0;
// private float m_angularDeflectionTimescale = 0; // private float m_angularDeflectionTimescale = 0;
// private float m_linearDeflectionEfficiency = 0; // private float m_linearDeflectionEfficiency = 0;
@ -121,18 +121,14 @@ namespace OpenSim.Region.Physics.OdePlugin
private float m_VhoverTimescale = 0f; private float m_VhoverTimescale = 0f;
private float m_VhoverTargetHeight = -1.0f; // if <0 then no hover, else its the current target height private float m_VhoverTargetHeight = -1.0f; // if <0 then no hover, else its the current target height
private float m_VehicleBuoyancy = 0f; //KF: m_VehicleBuoyancy is set by VEHICLE_BUOYANCY for a vehicle. private float m_VehicleBuoyancy = 0f; //KF: m_VehicleBuoyancy is set by VEHICLE_BUOYANCY for a vehicle.
// Modifies gravity. Slider between -1 (double-gravity) and 1 (full anti-gravity) // Modifies gravity. Slider between -1 (double-gravity) and 1 (full anti-gravity)
// KF: So far I have found no good method to combine a script-requested .Z velocity and gravity. // KF: So far I have found no good method to combine a script-requested .Z velocity and gravity.
// Therefore only m_VehicleBuoyancy=1 (0g) will use the script-requested .Z velocity. // Therefore only m_VehicleBuoyancy=1 (0g) will use the script-requested .Z velocity.
//Attractor properties //Attractor properties
private float m_verticalAttractionEfficiency = 1.0f; // damped private float m_verticalAttractionEfficiency = 1.0f; // damped
private float m_verticalAttractionTimescale = 500f; // Timescale > 300 means no vert attractor. private float m_verticalAttractionTimescale = 500f; // Timescale > 300 means no vert attractor.
internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue) internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue)
{ {
switch (pParam) switch (pParam)
@ -166,13 +162,13 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_bankingTimescale = pValue; // m_bankingTimescale = pValue;
break; break;
case Vehicle.BUOYANCY: case Vehicle.BUOYANCY:
if (pValue < -1f) pValue = -1f; if (pValue < -1f) pValue = -1f;
if (pValue > 1f) pValue = 1f; if (pValue > 1f) pValue = 1f;
m_VehicleBuoyancy = pValue; m_VehicleBuoyancy = pValue;
break; break;
// case Vehicle.HOVER_EFFICIENCY: // case Vehicle.HOVER_EFFICIENCY:
// if (pValue < 0f) pValue = 0f; // if (pValue < 0f) pValue = 0f;
// if (pValue > 1f) pValue = 1f; // if (pValue > 1f) pValue = 1f;
// m_VhoverEfficiency = pValue; // m_VhoverEfficiency = pValue;
// break; // break;
case Vehicle.HOVER_HEIGHT: case Vehicle.HOVER_HEIGHT:
@ -199,7 +195,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_linearMotorTimescale = pValue; m_linearMotorTimescale = pValue;
break; break;
case Vehicle.VERTICAL_ATTRACTION_EFFICIENCY: case Vehicle.VERTICAL_ATTRACTION_EFFICIENCY:
if (pValue < 0.1f) pValue = 0.1f; // Less goes unstable if (pValue < 0.1f) pValue = 0.1f; // Less goes unstable
if (pValue > 1.0f) pValue = 1.0f; if (pValue > 1.0f) pValue = 1.0f;
m_verticalAttractionEfficiency = pValue; m_verticalAttractionEfficiency = pValue;
break; break;
@ -229,7 +225,6 @@ namespace OpenSim.Region.Physics.OdePlugin
break; break;
} }
}//end ProcessFloatVehicleParam }//end ProcessFloatVehicleParam
internal void ProcessVectorVehicleParam(Vehicle pParam, Vector3 pValue) internal void ProcessVectorVehicleParam(Vehicle pParam, Vector3 pValue)
@ -242,12 +237,12 @@ namespace OpenSim.Region.Physics.OdePlugin
case Vehicle.ANGULAR_MOTOR_DIRECTION: case Vehicle.ANGULAR_MOTOR_DIRECTION:
m_angularMotorDirection = new Vector3(pValue.X, pValue.Y, pValue.Z); m_angularMotorDirection = new Vector3(pValue.X, pValue.Y, pValue.Z);
// Limit requested angular speed to 2 rps= 4 pi rads/sec // Limit requested angular speed to 2 rps= 4 pi rads/sec
if(m_angularMotorDirection.X > 12.56f) m_angularMotorDirection.X = 12.56f; if (m_angularMotorDirection.X > 12.56f) m_angularMotorDirection.X = 12.56f;
if(m_angularMotorDirection.X < - 12.56f) m_angularMotorDirection.X = - 12.56f; if (m_angularMotorDirection.X < - 12.56f) m_angularMotorDirection.X = - 12.56f;
if(m_angularMotorDirection.Y > 12.56f) m_angularMotorDirection.Y = 12.56f; if (m_angularMotorDirection.Y > 12.56f) m_angularMotorDirection.Y = 12.56f;
if(m_angularMotorDirection.Y < - 12.56f) m_angularMotorDirection.Y = - 12.56f; if (m_angularMotorDirection.Y < - 12.56f) m_angularMotorDirection.Y = - 12.56f;
if(m_angularMotorDirection.Z > 12.56f) m_angularMotorDirection.Z = 12.56f; if (m_angularMotorDirection.Z > 12.56f) m_angularMotorDirection.Z = 12.56f;
if(m_angularMotorDirection.Z < - 12.56f) m_angularMotorDirection.Z = - 12.56f; if (m_angularMotorDirection.Z < - 12.56f) m_angularMotorDirection.Z = - 12.56f;
m_angularMotorApply = 10; m_angularMotorApply = 10;
break; break;
case Vehicle.LINEAR_FRICTION_TIMESCALE: case Vehicle.LINEAR_FRICTION_TIMESCALE:
@ -261,7 +256,6 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z); // m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z);
break; break;
} }
}//end ProcessVectorVehicleParam }//end ProcessVectorVehicleParam
internal void ProcessRotationVehicleParam(Vehicle pParam, Quaternion pValue) internal void ProcessRotationVehicleParam(Vehicle pParam, Quaternion pValue)
@ -272,12 +266,11 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_referenceFrame = pValue; // m_referenceFrame = pValue;
break; break;
} }
}//end ProcessRotationVehicleParam }//end ProcessRotationVehicleParam
internal void ProcessTypeChange(Vehicle pType) internal void ProcessTypeChange(Vehicle pType)
{ {
// Set Defaults For Type // Set Defaults For Type
m_type = pType; m_type = pType;
switch (pType) switch (pType)
{ {
@ -358,7 +351,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_bankingTimescale = 1; // m_bankingTimescale = 1;
// m_referenceFrame = Quaternion.Identity; // m_referenceFrame = Quaternion.Identity;
m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.LIMIT_ROLL_ONLY | m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.LIMIT_ROLL_ONLY |
VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY); VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY);
m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.HOVER_WATER_ONLY | m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.HOVER_WATER_ONLY |
VehicleFlag.LIMIT_MOTOR_UP); VehicleFlag.LIMIT_MOTOR_UP);
break; break;
@ -432,23 +425,24 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
if (m_body == IntPtr.Zero || m_type == Vehicle.TYPE_NONE) if (m_body == IntPtr.Zero || m_type == Vehicle.TYPE_NONE)
return; return;
frcount++; // used to limit debug comment output frcount++; // used to limit debug comment output
if (frcount > 100) if (frcount > 100)
frcount = 0; frcount = 0;
MoveLinear(pTimestep, pParentScene); MoveLinear(pTimestep, pParentScene);
MoveAngular(pTimestep); MoveAngular(pTimestep);
}// end Step }// end Step
private void MoveLinear(float pTimestep, OdeScene _pParentScene) private void MoveLinear(float pTimestep, OdeScene _pParentScene)
{ {
if (!m_linearMotorDirection.ApproxEquals(Vector3.Zero, 0.01f)) // requested m_linearMotorDirection is significant if (!m_linearMotorDirection.ApproxEquals(Vector3.Zero, 0.01f)) // requested m_linearMotorDirection is significant
{ {
if(!d.BodyIsEnabled (Body)) d.BodyEnable (Body); if (!d.BodyIsEnabled(Body))
d.BodyEnable(Body);
// add drive to body // add drive to body
Vector3 addAmount = m_linearMotorDirection/(m_linearMotorTimescale/pTimestep); Vector3 addAmount = m_linearMotorDirection/(m_linearMotorTimescale/pTimestep);
m_lastLinearVelocityVector += (addAmount*10); // lastLinearVelocityVector is the current body velocity vector? m_lastLinearVelocityVector += (addAmount*10); // lastLinearVelocityVector is the current body velocity vector?
// This will work temporarily, but we really need to compare speed on an axis // This will work temporarily, but we really need to compare speed on an axis
// KF: Limit body velocity to applied velocity? // KF: Limit body velocity to applied velocity?
@ -466,194 +460,192 @@ namespace OpenSim.Region.Physics.OdePlugin
//Console.WriteLine("actual: " + m_linearMotorDirection); //Console.WriteLine("actual: " + m_linearMotorDirection);
} }
else else
{ // requested is not significant { // requested is not significant
// if what remains of applied is small, zero it. // if what remains of applied is small, zero it.
if (m_lastLinearVelocityVector.ApproxEquals(Vector3.Zero, 0.01f)) if (m_lastLinearVelocityVector.ApproxEquals(Vector3.Zero, 0.01f))
m_lastLinearVelocityVector = Vector3.Zero; m_lastLinearVelocityVector = Vector3.Zero;
} }
// convert requested object velocity to world-referenced vector
// convert requested object velocity to world-referenced vector
m_dir = m_lastLinearVelocityVector; m_dir = m_lastLinearVelocityVector;
d.Quaternion rot = d.BodyGetQuaternion(Body); d.Quaternion rot = d.BodyGetQuaternion(Body);
Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // rotq = rotation of object Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // rotq = rotation of object
m_dir *= rotq; // apply obj rotation to velocity vector m_dir *= rotq; // apply obj rotation to velocity vector
// add Gravity andBuoyancy // add Gravity andBuoyancy
// KF: So far I have found no good method to combine a script-requested // KF: So far I have found no good method to combine a script-requested
// .Z velocity and gravity. Therefore only 0g will used script-requested // .Z velocity and gravity. Therefore only 0g will used script-requested
// .Z velocity. >0g (m_VehicleBuoyancy < 1) will used modified gravity only. // .Z velocity. >0g (m_VehicleBuoyancy < 1) will used modified gravity only.
Vector3 grav = Vector3.Zero; Vector3 grav = Vector3.Zero;
if(m_VehicleBuoyancy < 1.0f) if (m_VehicleBuoyancy < 1.0f)
{ {
// There is some gravity, make a gravity force vector // There is some gravity, make a gravity force vector
// that is applied after object velocity. // that is applied after object velocity.
d.Mass objMass; d.Mass objMass;
d.BodyGetMass(Body, out objMass); d.BodyGetMass(Body, out objMass);
// m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g; // m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g;
grav.Z = _pParentScene.gravityz * objMass.mass * (1f - m_VehicleBuoyancy); grav.Z = _pParentScene.gravityz * objMass.mass * (1f - m_VehicleBuoyancy);
// Preserve the current Z velocity // Preserve the current Z velocity
d.Vector3 vel_now = d.BodyGetLinearVel(Body); d.Vector3 vel_now = d.BodyGetLinearVel(Body);
m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity
} // else its 1.0, no gravity. } // else its 1.0, no gravity.
// Check if hovering // Check if hovering
if( (m_flags & (VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT)) != 0) if ((m_flags & (VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT)) != 0)
{ {
// We should hover, get the target height // We should hover, get the target height
d.Vector3 pos = d.BodyGetPosition(Body); d.Vector3 pos = d.BodyGetPosition(Body);
if((m_flags & VehicleFlag.HOVER_WATER_ONLY) == VehicleFlag.HOVER_WATER_ONLY) if ((m_flags & VehicleFlag.HOVER_WATER_ONLY) == VehicleFlag.HOVER_WATER_ONLY)
{ {
m_VhoverTargetHeight = _pParentScene.GetWaterLevel() + m_VhoverHeight; m_VhoverTargetHeight = _pParentScene.GetWaterLevel() + m_VhoverHeight;
} }
else if((m_flags & VehicleFlag.HOVER_TERRAIN_ONLY) == VehicleFlag.HOVER_TERRAIN_ONLY) else if ((m_flags & VehicleFlag.HOVER_TERRAIN_ONLY) == VehicleFlag.HOVER_TERRAIN_ONLY)
{ {
m_VhoverTargetHeight = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y) + m_VhoverHeight; m_VhoverTargetHeight = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y) + m_VhoverHeight;
} }
else if((m_flags & VehicleFlag.HOVER_GLOBAL_HEIGHT) == VehicleFlag.HOVER_GLOBAL_HEIGHT) else if ((m_flags & VehicleFlag.HOVER_GLOBAL_HEIGHT) == VehicleFlag.HOVER_GLOBAL_HEIGHT)
{ {
m_VhoverTargetHeight = m_VhoverHeight; m_VhoverTargetHeight = m_VhoverHeight;
} }
if((m_flags & VehicleFlag.HOVER_UP_ONLY) == VehicleFlag.HOVER_UP_ONLY) if ((m_flags & VehicleFlag.HOVER_UP_ONLY) == VehicleFlag.HOVER_UP_ONLY)
{ {
// If body is aready heigher, use its height as target height // If body is aready heigher, use its height as target height
if(pos.Z > m_VhoverTargetHeight) m_VhoverTargetHeight = pos.Z; if (pos.Z > m_VhoverTargetHeight) m_VhoverTargetHeight = pos.Z;
} }
// m_VhoverEfficiency = 0f; // 0=boucy, 1=Crit.damped // m_VhoverEfficiency = 0f; // 0=boucy, 1=Crit.damped
// m_VhoverTimescale = 0f; // time to acheive height // m_VhoverTimescale = 0f; // time to acheive height
// pTimestep is time since last frame,in secs // pTimestep is time since last frame,in secs
float herr0 = pos.Z - m_VhoverTargetHeight; float herr0 = pos.Z - m_VhoverTargetHeight;
// Replace Vertical speed with correction figure if significant // Replace Vertical speed with correction figure if significant
if(Math.Abs(herr0) > 0.01f ) if (Math.Abs(herr0) > 0.01f)
{ {
d.Mass objMass; d.Mass objMass;
d.BodyGetMass(Body, out objMass); d.BodyGetMass(Body, out objMass);
m_dir.Z = - ( (herr0 * pTimestep * 50.0f) / m_VhoverTimescale); m_dir.Z = - ((herr0 * pTimestep * 50.0f) / m_VhoverTimescale);
//KF: m_VhoverEfficiency is not yet implemented //KF: m_VhoverEfficiency is not yet implemented
} }
else else
{ {
m_dir.Z = 0f; m_dir.Z = 0f;
} }
} }
// Apply velocity // Apply velocity
d.BodySetLinearVel(Body, m_dir.X, m_dir.Y, m_dir.Z); d.BodySetLinearVel(Body, m_dir.X, m_dir.Y, m_dir.Z);
// apply gravity force // apply gravity force
d.BodyAddForce(Body, grav.X, grav.Y, grav.Z); d.BodyAddForce(Body, grav.X, grav.Y, grav.Z);
// apply friction // apply friction
Vector3 decayamount = Vector3.One / (m_linearFrictionTimescale / pTimestep); Vector3 decayamount = Vector3.One / (m_linearFrictionTimescale / pTimestep);
m_lastLinearVelocityVector -= m_lastLinearVelocityVector * decayamount; m_lastLinearVelocityVector -= m_lastLinearVelocityVector * decayamount;
} // end MoveLinear() } // end MoveLinear()
private void MoveAngular(float pTimestep) private void MoveAngular(float pTimestep)
{ {
/* /*
private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor
private int m_angularMotorApply = 0; // application frame counter private int m_angularMotorApply = 0; // application frame counter
private float m_angularMotorVelocity = 0; // current angular motor velocity (ramps up and down) private float m_angularMotorVelocity = 0; // current angular motor velocity (ramps up and down)
private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate
private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate
private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate
private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body
*/ */
// Get what the body is doing, this includes 'external' influences // Get what the body is doing, this includes 'external' influences
d.Vector3 angularVelocity = d.BodyGetAngularVel(Body); d.Vector3 angularVelocity = d.BodyGetAngularVel(Body);
// Vector3 angularVelocity = Vector3.Zero; // Vector3 angularVelocity = Vector3.Zero;
if (m_angularMotorApply > 0) if (m_angularMotorApply > 0)
{ {
// ramp up to new value // ramp up to new value
// current velocity += error / ( time to get there / step interval ) // current velocity += error / (time to get there / step interval)
// requested speed - last motor speed // requested speed - last motor speed
m_angularMotorVelocity.X += (m_angularMotorDirection.X - m_angularMotorVelocity.X) / (m_angularMotorTimescale / pTimestep); m_angularMotorVelocity.X += (m_angularMotorDirection.X - m_angularMotorVelocity.X) / (m_angularMotorTimescale / pTimestep);
m_angularMotorVelocity.Y += (m_angularMotorDirection.Y - m_angularMotorVelocity.Y) / (m_angularMotorTimescale / pTimestep); m_angularMotorVelocity.Y += (m_angularMotorDirection.Y - m_angularMotorVelocity.Y) / (m_angularMotorTimescale / pTimestep);
m_angularMotorVelocity.Z += (m_angularMotorDirection.Z - m_angularMotorVelocity.Z) / (m_angularMotorTimescale / pTimestep); m_angularMotorVelocity.Z += (m_angularMotorDirection.Z - m_angularMotorVelocity.Z) / (m_angularMotorTimescale / pTimestep);
m_angularMotorApply--; // This is done so that if script request rate is less than phys frame rate the expected m_angularMotorApply--; // This is done so that if script request rate is less than phys frame rate the expected
// velocity may still be acheived. // velocity may still be acheived.
} }
else else
{ {
// no motor recently applied, keep the body velocity // no motor recently applied, keep the body velocity
/* m_angularMotorVelocity.X = angularVelocity.X; /* m_angularMotorVelocity.X = angularVelocity.X;
m_angularMotorVelocity.Y = angularVelocity.Y; m_angularMotorVelocity.Y = angularVelocity.Y;
m_angularMotorVelocity.Z = angularVelocity.Z; */ m_angularMotorVelocity.Z = angularVelocity.Z; */
// and decay the velocity
m_angularMotorVelocity -= m_angularMotorVelocity / (m_angularMotorDecayTimescale / pTimestep);
} // end motor section
// and decay the velocity
m_angularMotorVelocity -= m_angularMotorVelocity / (m_angularMotorDecayTimescale / pTimestep);
} // end motor section
// Vertical attractor section // Vertical attractor section
Vector3 vertattr = Vector3.Zero; Vector3 vertattr = Vector3.Zero;
if(m_verticalAttractionTimescale < 300) if (m_verticalAttractionTimescale < 300)
{
float VAservo = 0.2f / (m_verticalAttractionTimescale * pTimestep);
// get present body rotation
d.Quaternion rot = d.BodyGetQuaternion(Body);
Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W);
// make a vector pointing up
Vector3 verterr = Vector3.Zero;
verterr.Z = 1.0f;
// rotate it to Body Angle
verterr = verterr * rotq;
// verterr.X and .Y are the World error ammounts. They are 0 when there is no error (Vehicle Body is 'vertical'), and .Z will be 1.
// As the body leans to its side |.X| will increase to 1 and .Z fall to 0. As body inverts |.X| will fall and .Z will go
// negative. Similar for tilt and |.Y|. .X and .Y must be modulated to prevent a stable inverted body.
if (verterr.Z < 0.0f)
{
verterr.X = 2.0f - verterr.X;
verterr.Y = 2.0f - verterr.Y;
}
// Error is 0 (no error) to +/- 2 (max error)
// scale it by VAservo
verterr = verterr * VAservo;
//if(frcount == 0) Console.WriteLine("VAerr=" + verterr);
// As the body rotates around the X axis, then verterr.Y increases; Rotated around Y then .X increases, so
// Change Body angular velocity X based on Y, and Y based on X. Z is not changed.
vertattr.X = verterr.Y;
vertattr.Y = - verterr.X;
vertattr.Z = 0f;
// scaling appears better usingsquare-law
float bounce = 1.0f - (m_verticalAttractionEfficiency * m_verticalAttractionEfficiency);
vertattr.X += bounce * angularVelocity.X;
vertattr.Y += bounce * angularVelocity.Y;
} // else vertical attractor is off
// m_lastVertAttractor = vertattr;
// Bank section tba
// Deflection section tba
// Sum velocities
m_lastAngularVelocity = m_angularMotorVelocity + vertattr; // + bank + deflection
if (!m_lastAngularVelocity.ApproxEquals(Vector3.Zero, 0.01f))
{ {
if(!d.BodyIsEnabled (Body)) d.BodyEnable (Body); float VAservo = 0.2f / (m_verticalAttractionTimescale * pTimestep);
} // get present body rotation
else d.Quaternion rot = d.BodyGetQuaternion(Body);
{ Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W);
m_lastAngularVelocity = Vector3.Zero; // Reduce small value to zero. // make a vector pointing up
} Vector3 verterr = Vector3.Zero;
verterr.Z = 1.0f;
// rotate it to Body Angle
verterr = verterr * rotq;
// verterr.X and .Y are the World error ammounts. They are 0 when there is no error (Vehicle Body is 'vertical'), and .Z will be 1.
// As the body leans to its side |.X| will increase to 1 and .Z fall to 0. As body inverts |.X| will fall and .Z will go
// negative. Similar for tilt and |.Y|. .X and .Y must be modulated to prevent a stable inverted body.
if (verterr.Z < 0.0f)
{
verterr.X = 2.0f - verterr.X;
verterr.Y = 2.0f - verterr.Y;
}
// Error is 0 (no error) to +/- 2 (max error)
// scale it by VAservo
verterr = verterr * VAservo;
//if (frcount == 0) Console.WriteLine("VAerr=" + verterr);
// apply friction // As the body rotates around the X axis, then verterr.Y increases; Rotated around Y then .X increases, so
// Change Body angular velocity X based on Y, and Y based on X. Z is not changed.
vertattr.X = verterr.Y;
vertattr.Y = - verterr.X;
vertattr.Z = 0f;
// scaling appears better usingsquare-law
float bounce = 1.0f - (m_verticalAttractionEfficiency * m_verticalAttractionEfficiency);
vertattr.X += bounce * angularVelocity.X;
vertattr.Y += bounce * angularVelocity.Y;
} // else vertical attractor is off
// m_lastVertAttractor = vertattr;
// Bank section tba
// Deflection section tba
// Sum velocities
m_lastAngularVelocity = m_angularMotorVelocity + vertattr; // + bank + deflection
if (!m_lastAngularVelocity.ApproxEquals(Vector3.Zero, 0.01f))
{
if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body);
}
else
{
m_lastAngularVelocity = Vector3.Zero; // Reduce small value to zero.
}
// apply friction
Vector3 decayamount = Vector3.One / (m_angularFrictionTimescale / pTimestep); Vector3 decayamount = Vector3.One / (m_angularFrictionTimescale / pTimestep);
m_lastAngularVelocity -= m_lastAngularVelocity * decayamount; m_lastAngularVelocity -= m_lastAngularVelocity * decayamount;
// Apply to the body // Apply to the body
d.BodySetAngularVel (Body, m_lastAngularVelocity.X, m_lastAngularVelocity.Y, m_lastAngularVelocity.Z); d.BodySetAngularVel (Body, m_lastAngularVelocity.X, m_lastAngularVelocity.Y, m_lastAngularVelocity.Z);
} //end MoveAngular } //end MoveAngular
} }
} }

View File

@ -1,5 +1,7 @@
/* Copyright (c) Contributors, http://opensimulator.org/ /*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
@ -93,7 +95,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private float m_targetHoverHeight; private float m_targetHoverHeight;
private float m_groundHeight; private float m_groundHeight;
private float m_waterHeight; private float m_waterHeight;
private float m_buoyancy; //KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle. private float m_buoyancy; //KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle.
// private float m_tensor = 5f; // private float m_tensor = 5f;
private int body_autodisable_frames = 20; private int body_autodisable_frames = 20;
@ -294,7 +296,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_taintselected = value; m_taintselected = value;
m_isSelected = value; m_isSelected = value;
} }
if(m_isSelected) disableBodySoft(); if (m_isSelected) disableBodySoft();
} }
} }
@ -331,7 +333,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
d.BodyEnable(Body); d.BodyEnable(Body);
if (m_vehicle.Type != Vehicle.TYPE_NONE) if (m_vehicle.Type != Vehicle.TYPE_NONE)
m_vehicle.Enable(Body, _parent_scene); m_vehicle.Enable(Body, _parent_scene);
} }
m_disabled = false; m_disabled = false;
@ -376,7 +378,7 @@ namespace OpenSim.Region.Physics.OdePlugin
d.BodySetAutoDisableSteps(Body, body_autodisable_frames); d.BodySetAutoDisableSteps(Body, body_autodisable_frames);
// disconnect from world gravity so we can apply buoyancy // disconnect from world gravity so we can apply buoyancy
d.BodySetGravityMode (Body, false); d.BodySetGravityMode (Body, false);
m_interpenetrationcount = 0; m_interpenetrationcount = 0;
m_collisionscore = 0; m_collisionscore = 0;
@ -872,7 +874,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public void ProcessTaints(float timestep) public void ProcessTaints(float timestep)
{ {
//Console.WriteLine("ProcessTaints for " + m_primName ); //Console.WriteLine("ProcessTaints for " + m_primName);
if (m_taintadd) if (m_taintadd)
{ {
changeadd(timestep); changeadd(timestep);
@ -880,23 +882,23 @@ namespace OpenSim.Region.Physics.OdePlugin
if (prim_geom != IntPtr.Zero) if (prim_geom != IntPtr.Zero)
{ {
if (!_position.ApproxEquals(m_taintposition, 0f)) if (!_position.ApproxEquals(m_taintposition, 0f))
changemove(timestep); changemove(timestep);
if (m_taintrot != _orientation) if (m_taintrot != _orientation)
{ {
if(childPrim && IsPhysical) // For physical child prim... if (childPrim && IsPhysical) // For physical child prim...
{ {
rotate(timestep); rotate(timestep);
// KF: ODE will also rotate the parent prim! // KF: ODE will also rotate the parent prim!
// so rotate the root back to where it was // so rotate the root back to where it was
OdePrim parent = (OdePrim)_parent; OdePrim parent = (OdePrim)_parent;
parent.rotate(timestep); parent.rotate(timestep);
} }
else else
{ {
//Just rotate the prim //Just rotate the prim
rotate(timestep); rotate(timestep);
} }
} }
// //
@ -1562,241 +1564,241 @@ Console.WriteLine(" JointCreateFixed");
float fz = 0; float fz = 0;
if (IsPhysical && (Body != IntPtr.Zero) && !m_isSelected && !childPrim) // KF: Only move root prims. if (IsPhysical && (Body != IntPtr.Zero) && !m_isSelected && !childPrim) // KF: Only move root prims.
{ {
if (m_vehicle.Type != Vehicle.TYPE_NONE) if (m_vehicle.Type != Vehicle.TYPE_NONE)
{ {
// 'VEHICLES' are dealt with in ODEDynamics.cs // 'VEHICLES' are dealt with in ODEDynamics.cs
m_vehicle.Step(timestep, _parent_scene); m_vehicle.Step(timestep, _parent_scene);
} }
else else
{ {
//Console.WriteLine("Move " + m_primName); //Console.WriteLine("Move " + m_primName);
if(!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009 if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009
// NON-'VEHICLES' are dealt with here // NON-'VEHICLES' are dealt with here
if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f)) if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f))
{ {
d.Vector3 avel2 = d.BodyGetAngularVel(Body); d.Vector3 avel2 = d.BodyGetAngularVel(Body);
if (m_angularlock.X == 1) if (m_angularlock.X == 1)
avel2.X = 0; avel2.X = 0;
if (m_angularlock.Y == 1) if (m_angularlock.Y == 1)
avel2.Y = 0; avel2.Y = 0;
if (m_angularlock.Z == 1) if (m_angularlock.Z == 1)
avel2.Z = 0; avel2.Z = 0;
d.BodySetAngularVel(Body, avel2.X, avel2.Y, avel2.Z); d.BodySetAngularVel(Body, avel2.X, avel2.Y, avel2.Z);
} }
//float PID_P = 900.0f; //float PID_P = 900.0f;
float m_mass = CalculateMass(); float m_mass = CalculateMass();
// fz = 0f; // fz = 0f;
//m_log.Info(m_collisionFlags.ToString()); //m_log.Info(m_collisionFlags.ToString());
//KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle. //KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle.
// would come from SceneObjectPart.cs, public void SetBuoyancy(float fvalue) , PhysActor.Buoyancy = fvalue; ?? // would come from SceneObjectPart.cs, public void SetBuoyancy(float fvalue) , PhysActor.Buoyancy = fvalue; ??
// m_buoyancy: (unlimited value) <0=Falls fast; 0=1g; 1=0g; >1 = floats up // m_buoyancy: (unlimited value) <0=Falls fast; 0=1g; 1=0g; >1 = floats up
// gravityz multiplier = 1 - m_buoyancy // gravityz multiplier = 1 - m_buoyancy
fz = _parent_scene.gravityz * (1.0f - m_buoyancy) * m_mass; fz = _parent_scene.gravityz * (1.0f - m_buoyancy) * m_mass;
if (m_usePID) if (m_usePID)
{ {
//Console.WriteLine("PID " + m_primName); //Console.WriteLine("PID " + m_primName);
// KF - this is for object move? eg. llSetPos() ? // KF - this is for object move? eg. llSetPos() ?
//if (!d.BodyIsEnabled(Body)) //if (!d.BodyIsEnabled(Body))
//d.BodySetForce(Body, 0f, 0f, 0f); //d.BodySetForce(Body, 0f, 0f, 0f);
// If we're using the PID controller, then we have no gravity // If we're using the PID controller, then we have no gravity
//fz = (-1 * _parent_scene.gravityz) * m_mass; //KF: ?? Prims have no global gravity,so simply... //fz = (-1 * _parent_scene.gravityz) * m_mass; //KF: ?? Prims have no global gravity,so simply...
fz = 0f; fz = 0f;
// no lock; for now it's only called from within Simulate() // no lock; for now it's only called from within Simulate()
// If the PID Controller isn't active then we set our force // If the PID Controller isn't active then we set our force
// calculating base velocity to the current position // calculating base velocity to the current position
if ((m_PIDTau < 1) && (m_PIDTau != 0)) if ((m_PIDTau < 1) && (m_PIDTau != 0))
{ {
//PID_G = PID_G / m_PIDTau; //PID_G = PID_G / m_PIDTau;
m_PIDTau = 1; m_PIDTau = 1;
} }
if ((PID_G - m_PIDTau) <= 0) if ((PID_G - m_PIDTau) <= 0)
{ {
PID_G = m_PIDTau + 1; PID_G = m_PIDTau + 1;
} }
//PidStatus = true; //PidStatus = true;
// PhysicsVector vec = new PhysicsVector(); // PhysicsVector vec = new PhysicsVector();
d.Vector3 vel = d.BodyGetLinearVel(Body); d.Vector3 vel = d.BodyGetLinearVel(Body);
d.Vector3 pos = d.BodyGetPosition(Body); d.Vector3 pos = d.BodyGetPosition(Body);
_target_velocity = _target_velocity =
new Vector3( new Vector3(
(m_PIDTarget.X - pos.X) * ((PID_G - m_PIDTau) * timestep), (m_PIDTarget.X - pos.X) * ((PID_G - m_PIDTau) * timestep),
(m_PIDTarget.Y - pos.Y) * ((PID_G - m_PIDTau) * timestep), (m_PIDTarget.Y - pos.Y) * ((PID_G - m_PIDTau) * timestep),
(m_PIDTarget.Z - pos.Z) * ((PID_G - m_PIDTau) * timestep) (m_PIDTarget.Z - pos.Z) * ((PID_G - m_PIDTau) * timestep)
); );
// if velocity is zero, use position control; otherwise, velocity control // if velocity is zero, use position control; otherwise, velocity control
if (_target_velocity.ApproxEquals(Vector3.Zero,0.1f)) if (_target_velocity.ApproxEquals(Vector3.Zero,0.1f))
{ {
// keep track of where we stopped. No more slippin' & slidin' // keep track of where we stopped. No more slippin' & slidin'
// We only want to deactivate the PID Controller if we think we want to have our surrogate // We only want to deactivate the PID Controller if we think we want to have our surrogate
// react to the physics scene by moving it's position. // react to the physics scene by moving it's position.
// Avatar to Avatar collisions // Avatar to Avatar collisions
// Prim to avatar collisions // Prim to avatar collisions
//fx = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2); //fx = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2);
//fy = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y) * (PID_P * 2); //fy = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y) * (PID_P * 2);
//fz = fz + (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P; //fz = fz + (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P;
d.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z); d.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z);
d.BodySetLinearVel(Body, 0, 0, 0); d.BodySetLinearVel(Body, 0, 0, 0);
d.BodyAddForce(Body, 0, 0, fz); d.BodyAddForce(Body, 0, 0, fz);
return; return;
} }
else else
{ {
_zeroFlag = false; _zeroFlag = false;
// We're flying and colliding with something // We're flying and colliding with something
fx = ((_target_velocity.X) - vel.X) * (PID_D); fx = ((_target_velocity.X) - vel.X) * (PID_D);
fy = ((_target_velocity.Y) - vel.Y) * (PID_D); fy = ((_target_velocity.Y) - vel.Y) * (PID_D);
// vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P; // vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P;
fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass); fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass);
} }
} // end if (m_usePID) } // end if (m_usePID)
// Hover PID Controller needs to be mutually exlusive to MoveTo PID controller // Hover PID Controller needs to be mutually exlusive to MoveTo PID controller
if (m_useHoverPID && !m_usePID) if (m_useHoverPID && !m_usePID)
{ {
//Console.WriteLine("Hover " + m_primName); //Console.WriteLine("Hover " + m_primName);
// If we're using the PID controller, then we have no gravity // If we're using the PID controller, then we have no gravity
fz = (-1 * _parent_scene.gravityz) * m_mass; fz = (-1 * _parent_scene.gravityz) * m_mass;
// no lock; for now it's only called from within Simulate() // no lock; for now it's only called from within Simulate()
// If the PID Controller isn't active then we set our force // If the PID Controller isn't active then we set our force
// calculating base velocity to the current position // calculating base velocity to the current position
if ((m_PIDTau < 1)) if ((m_PIDTau < 1))
{ {
PID_G = PID_G / m_PIDTau; PID_G = PID_G / m_PIDTau;
} }
if ((PID_G - m_PIDTau) <= 0) if ((PID_G - m_PIDTau) <= 0)
{ {
PID_G = m_PIDTau + 1; PID_G = m_PIDTau + 1;
} }
// Where are we, and where are we headed? // Where are we, and where are we headed?
d.Vector3 pos = d.BodyGetPosition(Body); d.Vector3 pos = d.BodyGetPosition(Body);
d.Vector3 vel = d.BodyGetLinearVel(Body); d.Vector3 vel = d.BodyGetLinearVel(Body);
// Non-Vehicles have a limited set of Hover options. // Non-Vehicles have a limited set of Hover options.
// determine what our target height really is based on HoverType // determine what our target height really is based on HoverType
switch (m_PIDHoverType) switch (m_PIDHoverType)
{ {
case PIDHoverType.Ground: case PIDHoverType.Ground:
m_groundHeight = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y); m_groundHeight = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y);
m_targetHoverHeight = m_groundHeight + m_PIDHoverHeight; m_targetHoverHeight = m_groundHeight + m_PIDHoverHeight;
break; break;
case PIDHoverType.GroundAndWater: case PIDHoverType.GroundAndWater:
m_groundHeight = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y); m_groundHeight = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y);
m_waterHeight = _parent_scene.GetWaterLevel(); m_waterHeight = _parent_scene.GetWaterLevel();
if (m_groundHeight > m_waterHeight) if (m_groundHeight > m_waterHeight)
{ {
m_targetHoverHeight = m_groundHeight + m_PIDHoverHeight; m_targetHoverHeight = m_groundHeight + m_PIDHoverHeight;
} }
else else
{ {
m_targetHoverHeight = m_waterHeight + m_PIDHoverHeight; m_targetHoverHeight = m_waterHeight + m_PIDHoverHeight;
} }
break; break;
} // end switch (m_PIDHoverType) } // end switch (m_PIDHoverType)
_target_velocity = _target_velocity =
new Vector3(0.0f, 0.0f, new Vector3(0.0f, 0.0f,
(m_targetHoverHeight - pos.Z) * ((PID_G - m_PIDHoverTau) * timestep) (m_targetHoverHeight - pos.Z) * ((PID_G - m_PIDHoverTau) * timestep)
); );
// if velocity is zero, use position control; otherwise, velocity control // if velocity is zero, use position control; otherwise, velocity control
if (_target_velocity.ApproxEquals(Vector3.Zero, 0.1f)) if (_target_velocity.ApproxEquals(Vector3.Zero, 0.1f))
{ {
// keep track of where we stopped. No more slippin' & slidin' // keep track of where we stopped. No more slippin' & slidin'
// We only want to deactivate the PID Controller if we think we want to have our surrogate // We only want to deactivate the PID Controller if we think we want to have our surrogate
// react to the physics scene by moving it's position. // react to the physics scene by moving it's position.
// Avatar to Avatar collisions // Avatar to Avatar collisions
// Prim to avatar collisions // Prim to avatar collisions
d.BodySetPosition(Body, pos.X, pos.Y, m_targetHoverHeight); d.BodySetPosition(Body, pos.X, pos.Y, m_targetHoverHeight);
d.BodySetLinearVel(Body, vel.X, vel.Y, 0); d.BodySetLinearVel(Body, vel.X, vel.Y, 0);
d.BodyAddForce(Body, 0, 0, fz); d.BodyAddForce(Body, 0, 0, fz);
return; return;
} }
else else
{ {
_zeroFlag = false; _zeroFlag = false;
// We're flying and colliding with something // We're flying and colliding with something
fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass); fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass);
} }
} }
fx *= m_mass; fx *= m_mass;
fy *= m_mass; fy *= m_mass;
//fz *= m_mass; //fz *= m_mass;
fx += m_force.X; fx += m_force.X;
fy += m_force.Y; fy += m_force.Y;
fz += m_force.Z; fz += m_force.Z;
//m_log.Info("[OBJPID]: X:" + fx.ToString() + " Y:" + fy.ToString() + " Z:" + fz.ToString()); //m_log.Info("[OBJPID]: X:" + fx.ToString() + " Y:" + fy.ToString() + " Z:" + fz.ToString());
if (fx != 0 || fy != 0 || fz != 0) if (fx != 0 || fy != 0 || fz != 0)
{ {
//m_taintdisable = true; //m_taintdisable = true;
//base.RaiseOutOfBounds(Position); //base.RaiseOutOfBounds(Position);
//d.BodySetLinearVel(Body, fx, fy, 0f); //d.BodySetLinearVel(Body, fx, fy, 0f);
if (!d.BodyIsEnabled(Body)) if (!d.BodyIsEnabled(Body))
{ {
// A physical body at rest on a surface will auto-disable after a while, // A physical body at rest on a surface will auto-disable after a while,
// this appears to re-enable it incase the surface it is upon vanishes, // this appears to re-enable it incase the surface it is upon vanishes,
// and the body should fall again. // and the body should fall again.
d.BodySetLinearVel(Body, 0f, 0f, 0f); d.BodySetLinearVel(Body, 0f, 0f, 0f);
d.BodySetForce(Body, 0, 0, 0); d.BodySetForce(Body, 0, 0, 0);
enableBodySoft(); enableBodySoft();
} }
// 35x10 = 350n times the mass per second applied maximum. // 35x10 = 350n times the mass per second applied maximum.
float nmax = 35f * m_mass; float nmax = 35f * m_mass;
float nmin = -35f * m_mass; float nmin = -35f * m_mass;
if (fx > nmax) if (fx > nmax)
fx = nmax; fx = nmax;
if (fx < nmin) if (fx < nmin)
fx = nmin; fx = nmin;
if (fy > nmax) if (fy > nmax)
fy = nmax; fy = nmax;
if (fy < nmin) if (fy < nmin)
fy = nmin; fy = nmin;
d.BodyAddForce(Body, fx, fy, fz); d.BodyAddForce(Body, fx, fy, fz);
//Console.WriteLine("AddForce " + fx + "," + fy + "," + fz); //Console.WriteLine("AddForce " + fx + "," + fy + "," + fz);
} }
} }
} }
else else
{ // is not physical, or is not a body or is selected { // is not physical, or is not a body or is selected
// _zeroPosition = d.BodyGetPosition(Body); // _zeroPosition = d.BodyGetPosition(Body);
return; return;
//Console.WriteLine("Nothing " + m_primName); //Console.WriteLine("Nothing " + m_primName);
@ -1815,18 +1817,18 @@ Console.WriteLine(" JointCreateFixed");
myrot.W = _orientation.W; myrot.W = _orientation.W;
if (Body != IntPtr.Zero) if (Body != IntPtr.Zero)
{ {
// KF: If this is a root prim do BodySet // KF: If this is a root prim do BodySet
d.BodySetQuaternion(Body, ref myrot); d.BodySetQuaternion(Body, ref myrot);
if (m_isphysical) if (m_isphysical)
{ {
if (!m_angularlock.ApproxEquals(Vector3.One, 0f)) if (!m_angularlock.ApproxEquals(Vector3.One, 0f))
createAMotor(m_angularlock); createAMotor(m_angularlock);
} }
} }
else else
{ {
// daughter prim, do Geom set // daughter prim, do Geom set
d.GeomSetQuaternion(prim_geom, ref myrot); d.GeomSetQuaternion(prim_geom, ref myrot);
} }
resetCollisionAccounting(); resetCollisionAccounting();
@ -1890,7 +1892,7 @@ Console.WriteLine(" JointCreateFixed");
m_log.Error("[PHYSICS]: PrimGeom dead"); m_log.Error("[PHYSICS]: PrimGeom dead");
} }
} }
//Console.WriteLine("changePhysicsStatus for " + m_primName ); //Console.WriteLine("changePhysicsStatus for " + m_primName);
changeadd(2f); changeadd(2f);
} }
if (childPrim) if (childPrim)
@ -2454,7 +2456,7 @@ Console.WriteLine(" JointCreateFixed");
if (QuaternionIsFinite(value)) if (QuaternionIsFinite(value))
{ {
_orientation = value; _orientation = value;
} }
else else
m_log.Warn("[PHYSICS]: Got NaN quaternion Orientation from Scene in Object"); m_log.Warn("[PHYSICS]: Got NaN quaternion Orientation from Scene in Object");
@ -2675,7 +2677,7 @@ Console.WriteLine(" JointCreateFixed");
//outofBounds = true; //outofBounds = true;
} }
//float Adiff = 1.0f - Math.Abs(Quaternion.Dot(m_lastorientation, l_orientation)); //float Adiff = 1.0f - Math.Abs(Quaternion.Dot(m_lastorientation, l_orientation));
//Console.WriteLine("Adiff " + m_primName + " = " + Adiff); //Console.WriteLine("Adiff " + m_primName + " = " + Adiff);
if ((Math.Abs(m_lastposition.X - l_position.X) < 0.02) if ((Math.Abs(m_lastposition.X - l_position.X) < 0.02)
&& (Math.Abs(m_lastposition.Y - l_position.Y) < 0.02) && (Math.Abs(m_lastposition.Y - l_position.Y) < 0.02)

View File

@ -2603,12 +2603,12 @@ namespace OpenSim.Region.Physics.OdePlugin
lock (_taintedPrimLock) lock (_taintedPrimLock)
{ {
if (!(_taintedPrimH.Contains(taintedprim))) if (!(_taintedPrimH.Contains(taintedprim)))
{ {
//Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.m_primName); //Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.m_primName);
_taintedPrimH.Add(taintedprim); // HashSet for searching _taintedPrimH.Add(taintedprim); // HashSet for searching
_taintedPrimL.Add(taintedprim); // List for ordered readout _taintedPrimL.Add(taintedprim); // List for ordered readout
} }
} }
return; return;
} }
else if (prim is OdeCharacter) else if (prim is OdeCharacter)

View File

@ -2753,7 +2753,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
m_host.CollisionFilter.Clear(); m_host.CollisionFilter.Clear();
if(id != null) if (id != null)
{ {
m_host.CollisionFilter.Add(accept,id); m_host.CollisionFilter.Add(accept,id);
} }
@ -4240,7 +4240,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llPassCollisions(int pass) public void llPassCollisions(int pass)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if(pass == 0) if (pass == 0)
{ {
m_host.ParentGroup.PassCollision = false; m_host.ParentGroup.PassCollision = false;
} }
@ -7437,7 +7437,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// makes it more difficult to determine a child prim's actual inworld position). // makes it more difficult to determine a child prim's actual inworld position).
if (part.ParentID != 0) if (part.ParentID != 0)
v = ((v - llGetRootPosition()) * llGetRootRotation()) + llGetRootPosition(); v = ((v - llGetRootPosition()) * llGetRootRotation()) + llGetRootPosition();
res.Add( v ); res.Add(v);
break; break;
case (int)ScriptBaseClass.PRIM_SIZE: case (int)ScriptBaseClass.PRIM_SIZE:

View File

@ -1956,19 +1956,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// client's Statistics Bar (Ctrl-Shift-1) /// client's Statistics Bar (Ctrl-Shift-1)
/// </summary> /// </summary>
/// <returns>List of floats</returns> /// <returns>List of floats</returns>
public LSL_List osGetRegionStats() public LSL_List osGetRegionStats()
{ {
CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats");
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
LSL_List ret = new LSL_List(); LSL_List ret = new LSL_List();
float[] stats = World.SimulatorStats; float[] stats = World.SimulatorStats;
for (int i = 0; i < 21; i++) for (int i = 0; i < 21; i++)
{ {
ret.Add(new LSL_Float( stats[i] )); ret.Add(new LSL_Float(stats[i]));
} }
return ret; return ret;
} }
public int osGetSimulatorMemory() public int osGetSimulatorMemory()
{ {
@ -1984,81 +1984,81 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return (int)pws; return (int)pws;
} }
public void osSetSpeed(string UUID, float SpeedModifier) public void osSetSpeed(string UUID, float SpeedModifier)
{ {
CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
avatar.SpeedModifier = SpeedModifier; avatar.SpeedModifier = SpeedModifier;
} }
public void osKickAvatar(string FirstName,string SurName,string alert) public void osKickAvatar(string FirstName,string SurName,string alert)
{ {
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
{ {
foreach (ScenePresence presence in World.GetAvatars()) foreach (ScenePresence presence in World.GetAvatars())
{ {
if ((presence.Firstname == FirstName) && if ((presence.Firstname == FirstName) &&
presence.Lastname == SurName) presence.Lastname == SurName)
{ {
// kick client... // kick client...
if (alert != null) if (alert != null)
presence.ControllingClient.Kick(alert); presence.ControllingClient.Kick(alert);
// ...and close on our side // ...and close on our side
presence.Scene.IncomingCloseAgent(presence.UUID); presence.Scene.IncomingCloseAgent(presence.UUID);
} }
} }
} }
} }
public void osCauseDamage(string avatar, double damage) public void osCauseDamage(string avatar, double damage)
{ {
CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
UUID avatarId = new UUID(avatar); UUID avatarId = new UUID(avatar);
Vector3 pos = m_host.GetWorldPosition(); Vector3 pos = m_host.GetWorldPosition();
ScenePresence presence = World.GetScenePresence(avatarId); ScenePresence presence = World.GetScenePresence(avatarId);
if (presence != null) if (presence != null)
{ {
LandData land = World.GetLandData((float)pos.X, (float)pos.Y); LandData land = World.GetLandData((float)pos.X, (float)pos.Y);
if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage) if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage)
{ {
float health = presence.Health; float health = presence.Health;
health -= (float)damage; health -= (float)damage;
presence.setHealthWithUpdate(health); presence.setHealthWithUpdate(health);
if (health <= 0) if (health <= 0)
{ {
float healthliveagain = 100; float healthliveagain = 100;
presence.ControllingClient.SendAgentAlertMessage("You died!", true); presence.ControllingClient.SendAgentAlertMessage("You died!", true);
presence.setHealthWithUpdate(healthliveagain); presence.setHealthWithUpdate(healthliveagain);
presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient); presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient);
} }
} }
} }
} }
public void osCauseHealing(string avatar, double healing) public void osCauseHealing(string avatar, double healing)
{ {
CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
UUID avatarId = new UUID(avatar); UUID avatarId = new UUID(avatar);
ScenePresence presence = World.GetScenePresence(avatarId); ScenePresence presence = World.GetScenePresence(avatarId);
Vector3 pos = m_host.GetWorldPosition(); Vector3 pos = m_host.GetWorldPosition();
bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z)); bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z));
if (result) if (result)
{ {
if (presence != null) if (presence != null)
{ {
float health = presence.Health; float health = presence.Health;
health += (float)healing; health += (float)healing;
if (health >= 100) if (health >= 100)
{ {
health = 100; health = 100;
} }
presence.setHealthWithUpdate(health); presence.setHealthWithUpdate(health);
} }
} }
} }
} }
} }

View File

@ -162,7 +162,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
key osGetMapTexture(); key osGetMapTexture();
key osGetRegionMapTexture(string regionName); key osGetRegionMapTexture(string regionName);
LSL_List osGetRegionStats(); LSL_List osGetRegionStats();
int osGetSimulatorMemory(); int osGetSimulatorMemory();
void osKickAvatar(string FirstName,string SurName,string alert); void osKickAvatar(string FirstName,string SurName,string alert);

View File

@ -516,28 +516,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"; public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903";
public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"; public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361";
// Constants for osGetRegionStats // Constants for osGetRegionStats
public const int STATS_TIME_DILATION = 0; public const int STATS_TIME_DILATION = 0;
public const int STATS_SIM_FPS = 1; public const int STATS_SIM_FPS = 1;
public const int STATS_PHYSICS_FPS = 2; public const int STATS_PHYSICS_FPS = 2;
public const int STATS_AGENT_UPDATES = 3; public const int STATS_AGENT_UPDATES = 3;
public const int STATS_ROOT_AGENTS = 4; public const int STATS_ROOT_AGENTS = 4;
public const int STATS_CHILD_AGENTS = 5; public const int STATS_CHILD_AGENTS = 5;
public const int STATS_TOTAL_PRIMS = 6; public const int STATS_TOTAL_PRIMS = 6;
public const int STATS_ACTIVE_PRIMS = 7; public const int STATS_ACTIVE_PRIMS = 7;
public const int STATS_FRAME_MS = 8; public const int STATS_FRAME_MS = 8;
public const int STATS_NET_MS = 9; public const int STATS_NET_MS = 9;
public const int STATS_PHYSICS_MS = 10; public const int STATS_PHYSICS_MS = 10;
public const int STATS_IMAGE_MS = 11; public const int STATS_IMAGE_MS = 11;
public const int STATS_OTHER_MS = 12; public const int STATS_OTHER_MS = 12;
public const int STATS_IN_PACKETS_PER_SECOND = 13; public const int STATS_IN_PACKETS_PER_SECOND = 13;
public const int STATS_OUT_PACKETS_PER_SECOND = 14; public const int STATS_OUT_PACKETS_PER_SECOND = 14;
public const int STATS_UNACKED_BYTES = 15; public const int STATS_UNACKED_BYTES = 15;
public const int STATS_AGENT_MS = 16; public const int STATS_AGENT_MS = 16;
public const int STATS_PENDING_DOWNLOADS = 17; public const int STATS_PENDING_DOWNLOADS = 17;
public const int STATS_PENDING_UPLOADS = 18; public const int STATS_PENDING_UPLOADS = 18;
public const int STATS_ACTIVE_SCRIPTS = 19; public const int STATS_ACTIVE_SCRIPTS = 19;
public const int STATS_SCRIPT_LPS = 20; public const int STATS_SCRIPT_LPS = 20;
} }
} }

View File

@ -633,10 +633,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetRegionMapTexture(regionName); return m_OSSL_Functions.osGetRegionMapTexture(regionName);
} }
public LSL_List osGetRegionStats() public LSL_List osGetRegionStats()
{ {
return m_OSSL_Functions.osGetRegionStats(); return m_OSSL_Functions.osGetRegionStats();
} }
/// <summary> /// <summary>
/// Returns the amount of memory in use by the Simulator Daemon. /// Returns the amount of memory in use by the Simulator Daemon.
@ -649,7 +649,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
} }
public void osKickAvatar(string FirstName,string SurName,string alert) public void osKickAvatar(string FirstName,string SurName,string alert)
{ {
m_OSSL_Functions.osKickAvatar( FirstName, SurName, alert); m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
} }
public void osSetSpeed(string UUID, float SpeedModifier) public void osSetSpeed(string UUID, float SpeedModifier)
{ {

View File

@ -591,7 +591,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> linemap; Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> linemap;
lock(m_ScriptErrors) lock (m_ScriptErrors)
{ {
try try
{ {

View File

@ -289,24 +289,24 @@ namespace OpenSim.Tests.Common.Mock
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgentEvent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgentEvent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReportEvent;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveStateEvent;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUserEvent;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUserEvent;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntryEvent;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessageEvent;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
#pragma warning restore 67 #pragma warning restore 67