From 9904700dfdb7c6a111d9464eb23566fff73dc6b1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 12 Dec 2009 16:00:44 +0000 Subject: [PATCH 1/7] Another whitespace test commit --- OpenSim/Framework/Servers/VersionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index d348c903cd..714a592178 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + namespace OpenSim { public class VersionInfo From 30d64444a090148e5c07f27adc19ac2925533a19 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 12 Dec 2009 16:01:53 +0000 Subject: [PATCH 2/7] And reverse --- OpenSim/Framework/Servers/VersionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 714a592178..d348c903cd 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + namespace OpenSim { public class VersionInfo From 963cf25813ad2bd6dceaa39757391fbf94d6f09e Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 13 Dec 2009 03:04:16 +1100 Subject: [PATCH 3/7] * Implements OSSL function: osGetSimulatorMemory - returns the current amount of memory allocated to the simulator process (Moderate Threat Level). * Cleans redundant information out of the Simulator Version. Versions now look like: "OpenSimulator 0.6.9(dev) Unix/Mono" * [Minor] additional log info for MySQLInventoryData --- CONTRIBUTORS.txt | 346 +++++++++--------- OpenSim/Data/MySQL/MySQLInventoryData.cs | 3 + OpenSim/Framework/Util.cs | 20 + OpenSim/Region/Framework/Scenes/Scene.cs | 5 + .../Shared/Api/Implementation/OSSL_Api.cs | 13 + .../Shared/Api/Interface/IOSSL_Api.cs | 2 + .../Shared/Api/Runtime/OSSL_Stub.cs | 10 + 7 files changed, 226 insertions(+), 173 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 0d789289c4..08048f534f 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -1,173 +1,173 @@ -The following people have contributed to OpenSim (Thank you -for your effort!) - -Add your name in here if you have committed to OpenSim - -= Current OpenSim Developers (in very rough order of appearance) = -These folks represent the current core team for OpenSim, and are the -people that make the day to day of OpenSim happen. - -* MW (Tribal Media AB) -* Adam Frisby (DeepThink Pty Ltd) -* MingChen (DeepThink Pty Ltd) -* lbsa71 (Tribal Media AB) -* Sean Dague / sdague (IBM) -* Tedd -* justincc -* Teravus (w3z) -* Johan Berntsson (3Di) -* Ckrinke (Charles Krinke) -* chi11ken (Genkii) -* adjohn (Genkii) -* Dr Scofield aka Dirk Husemann (IBM Research - Zurich) -* dahlia -* mikem (3Di) -* Melanie Thielker -* Homer_Horwitz -* idb (Ian Brown) -* Diva (Crista Lopes, University of California, Irvine) -* nlin (3Di) -* Arthur Rodrigo S Valadares (IBM) - - -= Past Open Sim Developers = -These folks are alumns of the OpenSim core group, but are now -currently not active. Their great contributions helped get us to -where we are today. - -* Gareth -* Andy- -* MorphW -* CW -* Babblefrog -* Danx0r -* Dalien -* Darok -* Alondria - - -= Additional OpenSim Contributors = -These folks have contributed code patches to OpenSim to help make it -what it is today. - -* aduffy70 -* A_Biondi -* alex_carnell -* Alan Webb (IBM) -* BigFootAg -* BlueWall Slade -* brianw/Sir_Ahzz -* CharlieO -* ChrisDown -* Chris Yeoh (IBM) -* coyled -* Daedius -* Dong Jun Lan (IBM) -* DoranZemlja -* daTwitch -* devalnor-#708 -* dmiles (Daxtron Labs) -* dslake (Intel) -* FredoChaplin -* Gerhard -* Godfrey -* Grumly57 -* Ewe Loon -* Fly-Man -* Flyte Xevious -* Imaze Rhiano -* Intimidated -* Jeremy Bongio (IBM) -* jhurliman -* John R Sohn (XenReborn) -* jonc -* Junta Kohime -* Kayne -* Kevin Cozens -* kinoc (Daxtron Labs) -* Kitto Flora -* KittyLiu -* Kurt Taylor (IBM) -* lulurun -* M.Igarashi -* maimedleech -* Mic Bowman -* Michelle Argus -* Michael Cortez (The Flotsam Project, http://osflotsam.org/) -* Mike Osias (IBM) -* Mike Pitman (IBM) -* mikkopa/_someone - RealXtend -* Misterblue (Intel) -* Mircea Kitsune -* mpallari -* nornalbion -* Omar Vera Ustariz (IBM) -* openlifegrid.com -* otakup0pe -* ralphos -* RemedyTomm -* Revolution -* Richard Alimi (IBM) -* Rick Alther (IBM) -* Rob Smart (IBM) -* rtomita -* Ruud Lathorp -* SachaMagne -* Salahzar Stenvaag -* sempuki -* Snoopy -* Strawberry Fride -* tglion -* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud) -* tyre -* Vytek -* webmage (IBM) -* Xantor -* Y. Nitta -* YZh -* Zackary Geers aka Kunnis Basiat -* Zha Ewry - - -= LSL Devs = - -* Alondria -* CharlieO -* Tedd -* Melanie Thielker - - -= Testers = - -* Ai Austin -* CharlieO (LSL) -* Ckrinke -* openlifegrid.com - - -This software uses components from the following developers: -* Sleepycat Software (Berkeley DB) -* SQLite (Public Domain) -* XmlRpcCS (http://xmlrpccs.sf.net/) -* MySQL, Inc. (MySQL Connector/NET) -* NUnit (http://www.nunit.org) -* AGEIA Inc. (PhysX) -* Russel L. Smith (ODE) -* Prebuild (http://sourceforge.net/projects/dnpb/) -* LibOpenMetaverse (http://lib.openmetaverse.org/) -* DotNetOpenMail v0.5.8b (http://dotnetopenmail.sourceforge.net) -* Prototype JavaScript Framework ajax (http://www.prototypejs.org/) -* C5 GENERIC COLLECTION LIBRARY FOR C#/CLI -* Nini (http://nini.sourceforge.net/) -* log4net (http://logging.apache.org/log4net/) -* GlynnTucker.Cache (http://gtcache.sourceforge.net/) -* NDesk.Options 0.2.1 (http://www.ndesk.org/Options) - -Some plugins are based on Cable Beach -Cable Beach is Copyright (c) 2008 Intel Corporation -see http://forge.opensimulator.org/gf/project/assetserver/ - -In addition, we would like to thank: -* The Mono Project -* The NANT Developers -* Microsoft (.NET, MSSQL-Adapters) +The following people have contributed to OpenSim (Thank you +for your effort!) + +Add your name in here if you have committed to OpenSim + += Current OpenSim Developers (in very rough order of appearance) = +These folks represent the current core team for OpenSim, and are the +people that make the day to day of OpenSim happen. + +* MW (Tribal Media AB) +* Adam Frisby (DeepThink Pty Ltd) +* MingChen (DeepThink Pty Ltd) +* lbsa71 (Tribal Media AB) +* Sean Dague / sdague (IBM) +* Tedd +* justincc +* Teravus (w3z) +* Johan Berntsson (3Di) +* Ckrinke (Charles Krinke) +* chi11ken (Genkii) +* adjohn (Genkii) +* Dr Scofield aka Dirk Husemann (IBM Research - Zurich) +* dahlia +* mikem (3Di) +* Melanie Thielker +* Homer_Horwitz +* idb (Ian Brown) +* Diva (Crista Lopes, University of California, Irvine) +* nlin (3Di) +* Arthur Rodrigo S Valadares (IBM) + + += Past Open Sim Developers = +These folks are alumns of the OpenSim core group, but are now +currently not active. Their great contributions helped get us to +where we are today. + +* Gareth +* Andy- +* MorphW +* CW +* Babblefrog +* Danx0r +* Dalien +* Darok +* Alondria + + += Additional OpenSim Contributors = +These folks have contributed code patches to OpenSim to help make it +what it is today. + +* aduffy70 +* A_Biondi +* alex_carnell +* Alan Webb (IBM) +* BigFootAg +* BlueWall Slade +* brianw/Sir_Ahzz +* CharlieO +* ChrisDown +* Chris Yeoh (IBM) +* coyled +* Daedius +* Dong Jun Lan (IBM) +* DoranZemlja +* daTwitch +* devalnor-#708 +* dmiles (Daxtron Labs) +* dslake (Intel) +* FredoChaplin +* Gerhard +* Godfrey +* Grumly57 +* Ewe Loon +* Fly-Man +* Flyte Xevious +* Imaze Rhiano +* Intimidated +* Jeremy Bongio (IBM) +* jhurliman +* John R Sohn (XenReborn) +* jonc +* Junta Kohime +* Kayne +* Kevin Cozens +* kinoc (Daxtron Labs) +* Kitto Flora +* KittyLiu +* Kurt Taylor (IBM) +* lulurun +* M.Igarashi +* maimedleech +* Mic Bowman +* Michelle Argus +* Michael Cortez (The Flotsam Project, http://osflotsam.org/) +* Mike Osias (IBM) +* Mike Pitman (IBM) +* mikkopa/_someone - RealXtend +* Misterblue (Intel) +* Mircea Kitsune +* mpallari +* nornalbion +* Omar Vera Ustariz (IBM) +* openlifegrid.com +* otakup0pe +* ralphos +* RemedyTomm +* Revolution +* Richard Alimi (IBM) +* Rick Alther (IBM) +* Rob Smart (IBM) +* rtomita +* Ruud Lathorp +* SachaMagne +* Salahzar Stenvaag +* sempuki +* Snoopy +* Strawberry Fride +* tglion +* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud) +* tyre +* Vytek +* webmage (IBM) +* Xantor +* Y. Nitta +* YZh +* Zackary Geers aka Kunnis Basiat +* Zha Ewry + + += LSL Devs = + +* Alondria +* CharlieO +* Tedd +* Melanie Thielker + + += Testers = + +* Ai Austin +* CharlieO (LSL) +* Ckrinke +* openlifegrid.com + + +This software uses components from the following developers: +* Sleepycat Software (Berkeley DB) +* SQLite (Public Domain) +* XmlRpcCS (http://xmlrpccs.sf.net/) +* MySQL, Inc. (MySQL Connector/NET) +* NUnit (http://www.nunit.org) +* AGEIA Inc. (PhysX) +* Russel L. Smith (ODE) +* Prebuild (http://sourceforge.net/projects/dnpb/) +* LibOpenMetaverse (http://lib.openmetaverse.org/) +* DotNetOpenMail v0.5.8b (http://dotnetopenmail.sourceforge.net) +* Prototype JavaScript Framework ajax (http://www.prototypejs.org/) +* C5 GENERIC COLLECTION LIBRARY FOR C#/CLI +* Nini (http://nini.sourceforge.net/) +* log4net (http://logging.apache.org/log4net/) +* GlynnTucker.Cache (http://gtcache.sourceforge.net/) +* NDesk.Options 0.2.1 (http://www.ndesk.org/Options) + +Some plugins are based on Cable Beach +Cable Beach is Copyright (c) 2008 Intel Corporation +see http://forge.opensimulator.org/gf/project/assetserver/ + +In addition, we would like to thank: +* The Mono Project +* The NANT Developers +* Microsoft (.NET, MSSQL-Adapters) diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 0ea0cb7def..d560c5f1a4 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -91,6 +91,9 @@ namespace OpenSim.Data.MySQL rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true"; opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true"; + if(rollbackStore) + m_log.Warn("[MysqlInventory] Enabling rollback mode in: " + rollbackDir); + database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 111249747b..72150863f4 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1007,6 +1007,26 @@ namespace OpenSim.Framework return os; } + public static string GetRuntimeInformation() + { + string ru = String.Empty; + + if (Environment.OSVersion.Platform == PlatformID.Unix) + ru = "Unix/Mono"; + else + if (Environment.OSVersion.Platform == PlatformID.MacOSX) + ru = "OSX/Mono"; + else + { + if (Type.GetType("Mono.Runtime") != null) + ru = "Win/Mono"; + else + ru = "Win/.NET"; + } + + return ru; + } + /// /// Is the given string a UUID? /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a22fb5fc16..cc139729c0 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -574,10 +574,15 @@ namespace OpenSim.Region.Framework.Scenes StatsReporter.SetObjectCapacity(objectCapacity); + // Old + /* m_simulatorVersion = simulatorVersion + " (OS " + Util.GetOperatingSystemInformation() + ")" + " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString() + " PhysPrim:" + m_physicalPrim.ToString(); + */ + + m_simulatorVersion = simulatorVersion + " (" + Util.GetRuntimeInformation() + ")"; try { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 5501679744..e9e54aed75 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1970,5 +1970,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return ret; } + public int osGetSimulatorMemory() + { + CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); + m_host.AddScriptLPS(1); + long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; + + if (pws > Int32.MaxValue) + return Int32.MaxValue; + if (pws < 0) + return 0; + + return (int)pws; + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 0b0dc00507..580c354850 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -163,5 +163,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces key osGetMapTexture(); key osGetRegionMapTexture(string regionName); LSL_List osGetRegionStats(); + + int osGetSimulatorMemory(); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 519463e097..2876ad63f1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -637,5 +637,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_OSSL_Functions.osGetRegionStats(); } + + /// + /// Returns the amount of memory in use by the Simulator Daemon. + /// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware) + /// + /// + public LSL_Integer osGetSimulatorMemory() + { + return m_OSSL_Functions.osGetSimulatorMemory(); + } } } From 87e89efbf9727b294658f149c6494fd49608bc12 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 13 Dec 2009 03:49:22 +1100 Subject: [PATCH 4/7] * Mistaken ThreatLevel classification on osGetSimulatorMemory - should have been MODERATE. --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e9e54aed75..1b7db7c1e8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1972,7 +1972,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public int osGetSimulatorMemory() { - CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); + CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory"); m_host.AddScriptLPS(1); long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; From 4ef8dc7d96fa2d4efd992ff7d304b8894f004c4f Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Sun, 13 Dec 2009 02:08:28 -0500 Subject: [PATCH 5/7] * Add some glue that allows LocalPacketHandlers to decide if they want the packet to be processed asynchronously or not. * Make several packets not asynchronous (such as AgentUpdate). In theory, all fast returning packet handling methods should not be asynchronous. Ones that wait on an external resource or a long held lock, should be asynchronous. --- .../ClientStack/LindenUDP/LLClientView.cs | 136 ++++++++++++------ .../ClientStack/LindenUDP/LLUDPServer.cs | 2 +- 2 files changed, 90 insertions(+), 48 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index fba5090a14..9184c90a12 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -332,7 +332,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private AgentUpdateArgs lastarg; private bool m_IsActive = true; - protected Dictionary m_packetHandlers = new Dictionary(); + protected Dictionary m_packetHandlers = new Dictionary(); protected Dictionary m_genericPacketHandlers = new Dictionary(); //PauPaw:Local Generic Message handlers protected Scene m_scene; protected LLImageManager m_imageManager; @@ -539,13 +539,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP } public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler) + { + return AddLocalPacketHandler(packetType, handler, true); + } + + public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool async) { bool result = false; lock (m_packetHandlers) { if (!m_packetHandlers.ContainsKey(packetType)) { - m_packetHandlers.Add(packetType, handler); + m_packetHandlers.Add(packetType, new PacketProcessor() { method = handler, Async = async }); result = true; } } @@ -576,15 +581,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected virtual bool ProcessPacketMethod(Packet packet) { bool result = false; - PacketMethod method; - if (m_packetHandlers.TryGetValue(packet.Type, out method)) + PacketProcessor pprocessor; + if (m_packetHandlers.TryGetValue(packet.Type, out pprocessor)) { //there is a local handler for this packet type - result = method(this, packet); + if (pprocessor.Async) + { + object obj = new AsyncPacketProcess(this, pprocessor.method, packet); + Util.FireAndForget(ProcessSpecificPacketAsync,obj); + result = true; + } + else + { + result = pprocessor.method(this, packet); + } } else { //there is not a local handler so see if there is a Global handler + PacketMethod method = null; bool found; lock (PacketHandlers) { @@ -598,6 +613,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP return result; } + public void ProcessSpecificPacketAsync(object state) + { + AsyncPacketProcess packetObject = (AsyncPacketProcess)state; + packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack); + + } + #endregion Packet Handling # region Setup @@ -4340,26 +4362,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected virtual void RegisterLocalPacketHandlers() { AddLocalPacketHandler(PacketType.LogoutRequest, HandleLogout); - AddLocalPacketHandler(PacketType.AgentUpdate, HandleAgentUpdate); - AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect); - AddLocalPacketHandler(PacketType.AgentCachedTexture, HandleAgentTextureCached); - AddLocalPacketHandler(PacketType.MultipleObjectUpdate, HandleMultipleObjUpdate); - AddLocalPacketHandler(PacketType.MoneyTransferRequest, HandleMoneyTransferRequest); - AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest); - AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest); - AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest); + AddLocalPacketHandler(PacketType.AgentUpdate, HandleAgentUpdate, false); + AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect, false); + AddLocalPacketHandler(PacketType.AgentCachedTexture, HandleAgentTextureCached, false); + AddLocalPacketHandler(PacketType.MultipleObjectUpdate, HandleMultipleObjUpdate, false); + AddLocalPacketHandler(PacketType.MoneyTransferRequest, HandleMoneyTransferRequest, false); + AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest, false); + AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest, false); + AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest, false); AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage); AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest); AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate); AddLocalPacketHandler(PacketType.ScriptDialogReply, HandlerScriptDialogReply); - AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage); + AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage, false); AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship); AddLocalPacketHandler(PacketType.DeclineFriendship, HandlerDeclineFriendship); AddLocalPacketHandler(PacketType.TerminateFriendship, HandlerTerminateFrendship); AddLocalPacketHandler(PacketType.RezObject, HandlerRezObject); AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject); - AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand); + AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand, false); AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply); AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest); AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance); @@ -4370,9 +4392,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.ObjectAttach, HandleObjectAttach); AddLocalPacketHandler(PacketType.ObjectDetach, HandleObjectDetach); AddLocalPacketHandler(PacketType.ObjectDrop, HandleObjectDrop); - AddLocalPacketHandler(PacketType.SetAlwaysRun, HandleSetAlwaysRun); + AddLocalPacketHandler(PacketType.SetAlwaysRun, HandleSetAlwaysRun, false); AddLocalPacketHandler(PacketType.CompleteAgentMovement, HandleCompleteAgentMovement); - AddLocalPacketHandler(PacketType.AgentAnimation, HandleAgentAnimation); + AddLocalPacketHandler(PacketType.AgentAnimation, HandleAgentAnimation, false); AddLocalPacketHandler(PacketType.AgentRequestSit, HandleAgentRequestSit); AddLocalPacketHandler(PacketType.AgentSit, HandleAgentSit); AddLocalPacketHandler(PacketType.SoundTrigger, HandleSoundTrigger); @@ -4381,9 +4403,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.UserInfoRequest, HandleUserInfoRequest); AddLocalPacketHandler(PacketType.UpdateUserInfo, HandleUpdateUserInfo); AddLocalPacketHandler(PacketType.SetStartLocationRequest, HandleSetStartLocationRequest); - AddLocalPacketHandler(PacketType.AgentThrottle, HandleAgentThrottle); - AddLocalPacketHandler(PacketType.AgentPause, HandleAgentPause); - AddLocalPacketHandler(PacketType.AgentResume, HandleAgentResume); + AddLocalPacketHandler(PacketType.AgentThrottle, HandleAgentThrottle, false); + AddLocalPacketHandler(PacketType.AgentPause, HandleAgentPause, false); + AddLocalPacketHandler(PacketType.AgentResume, HandleAgentResume, false); AddLocalPacketHandler(PacketType.ForceScriptControlRelease, HandleForceScriptControlRelease); AddLocalPacketHandler(PacketType.ObjectLink, HandleObjectLink); AddLocalPacketHandler(PacketType.ObjectDelink, HandleObjectDelink); @@ -4399,22 +4421,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation); AddLocalPacketHandler(PacketType.ObjectFlagUpdate, HandleObjectFlagUpdate); AddLocalPacketHandler(PacketType.ObjectImage, HandleObjectImage); - AddLocalPacketHandler(PacketType.ObjectGrab, HandleObjectGrab); - AddLocalPacketHandler(PacketType.ObjectGrabUpdate, HandleObjectGrabUpdate); + AddLocalPacketHandler(PacketType.ObjectGrab, HandleObjectGrab, false); + AddLocalPacketHandler(PacketType.ObjectGrabUpdate, HandleObjectGrabUpdate, false); AddLocalPacketHandler(PacketType.ObjectDeGrab, HandleObjectDeGrab); - AddLocalPacketHandler(PacketType.ObjectSpinStart, HandleObjectSpinStart); - AddLocalPacketHandler(PacketType.ObjectSpinUpdate, HandleObjectSpinUpdate); - AddLocalPacketHandler(PacketType.ObjectSpinStop, HandleObjectSpinStop); - AddLocalPacketHandler(PacketType.ObjectDescription, HandleObjectDescription); - AddLocalPacketHandler(PacketType.ObjectName, HandleObjectName); - AddLocalPacketHandler(PacketType.ObjectPermissions, HandleObjectPermissions); - AddLocalPacketHandler(PacketType.Undo, HandleUndo); + AddLocalPacketHandler(PacketType.ObjectSpinStart, HandleObjectSpinStart, false); + AddLocalPacketHandler(PacketType.ObjectSpinUpdate, HandleObjectSpinUpdate, false); + AddLocalPacketHandler(PacketType.ObjectSpinStop, HandleObjectSpinStop, false); + AddLocalPacketHandler(PacketType.ObjectDescription, HandleObjectDescription, false); + AddLocalPacketHandler(PacketType.ObjectName, HandleObjectName, false); + AddLocalPacketHandler(PacketType.ObjectPermissions, HandleObjectPermissions, false); + AddLocalPacketHandler(PacketType.Undo, HandleUndo, false); AddLocalPacketHandler(PacketType.ObjectDuplicateOnRay, HandleObjectDuplicateOnRay); - AddLocalPacketHandler(PacketType.RequestObjectPropertiesFamily, HandleRequestObjectPropertiesFamily); + AddLocalPacketHandler(PacketType.RequestObjectPropertiesFamily, HandleRequestObjectPropertiesFamily, false); AddLocalPacketHandler(PacketType.ObjectIncludeInSearch, HandleObjectIncludeInSearch); - AddLocalPacketHandler(PacketType.ScriptAnswerYes, HandleScriptAnswerYes); - AddLocalPacketHandler(PacketType.ObjectClickAction, HandleObjectClickAction); - AddLocalPacketHandler(PacketType.ObjectMaterial, HandleObjectMaterial); + AddLocalPacketHandler(PacketType.ScriptAnswerYes, HandleScriptAnswerYes, false); + AddLocalPacketHandler(PacketType.ObjectClickAction, HandleObjectClickAction, false); + AddLocalPacketHandler(PacketType.ObjectMaterial, HandleObjectMaterial, false); AddLocalPacketHandler(PacketType.RequestImage, HandleRequestImage); AddLocalPacketHandler(PacketType.TransferRequest, HandleTransferRequest); AddLocalPacketHandler(PacketType.AssetUploadRequest, HandleAssetUploadRequest); @@ -4440,17 +4462,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.RemoveTaskInventory, HandleRemoveTaskInventory); AddLocalPacketHandler(PacketType.MoveTaskInventory, HandleMoveTaskInventory); AddLocalPacketHandler(PacketType.RezScript, HandleRezScript); - AddLocalPacketHandler(PacketType.MapLayerRequest, HandleMapLayerRequest); - AddLocalPacketHandler(PacketType.MapBlockRequest, HandleMapBlockRequest); - AddLocalPacketHandler(PacketType.MapNameRequest, HandleMapNameRequest); + AddLocalPacketHandler(PacketType.MapLayerRequest, HandleMapLayerRequest, false); + AddLocalPacketHandler(PacketType.MapBlockRequest, HandleMapBlockRequest, false); + AddLocalPacketHandler(PacketType.MapNameRequest, HandleMapNameRequest, false); AddLocalPacketHandler(PacketType.TeleportLandmarkRequest, HandleTeleportLandmarkRequest); AddLocalPacketHandler(PacketType.TeleportLocationRequest, HandleTeleportLocationRequest); - AddLocalPacketHandler(PacketType.UUIDNameRequest, HandleUUIDNameRequest); + AddLocalPacketHandler(PacketType.UUIDNameRequest, HandleUUIDNameRequest, false); AddLocalPacketHandler(PacketType.RegionHandleRequest, HandleRegionHandleRequest); - AddLocalPacketHandler(PacketType.ParcelInfoRequest, HandleParcelInfoRequest); - AddLocalPacketHandler(PacketType.ParcelAccessListRequest, HandleParcelAccessListRequest); - AddLocalPacketHandler(PacketType.ParcelAccessListUpdate, HandleParcelAccessListUpdate); - AddLocalPacketHandler(PacketType.ParcelPropertiesRequest, HandleParcelPropertiesRequest); + AddLocalPacketHandler(PacketType.ParcelInfoRequest, HandleParcelInfoRequest, false); + AddLocalPacketHandler(PacketType.ParcelAccessListRequest, HandleParcelAccessListRequest, false); + AddLocalPacketHandler(PacketType.ParcelAccessListUpdate, HandleParcelAccessListUpdate, false); + AddLocalPacketHandler(PacketType.ParcelPropertiesRequest, HandleParcelPropertiesRequest, false); AddLocalPacketHandler(PacketType.ParcelDivide, HandleParcelDivide); AddLocalPacketHandler(PacketType.ParcelJoin, HandleParcelJoin); AddLocalPacketHandler(PacketType.ParcelPropertiesUpdate, HandleParcelPropertiesUpdate); @@ -4464,7 +4486,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.LandStatRequest, HandleLandStatRequest); AddLocalPacketHandler(PacketType.ParcelDwellRequest, HandleParcelDwellRequest); AddLocalPacketHandler(PacketType.EstateOwnerMessage, HandleEstateOwnerMessage); - AddLocalPacketHandler(PacketType.RequestRegionInfo, HandleRequestRegionInfo); + AddLocalPacketHandler(PacketType.RequestRegionInfo, HandleRequestRegionInfo, false); AddLocalPacketHandler(PacketType.EstateCovenantRequest, HandleEstateCovenantRequest); AddLocalPacketHandler(PacketType.RequestGodlikePowers, HandleRequestGodlikePowers); AddLocalPacketHandler(PacketType.GodKickUser, HandleGodKickUser); @@ -4479,13 +4501,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.ActivateGestures, HandleActivateGestures); AddLocalPacketHandler(PacketType.DeactivateGestures, HandleDeactivateGestures); AddLocalPacketHandler(PacketType.ObjectOwner, HandleObjectOwner); - AddLocalPacketHandler(PacketType.AgentFOV, HandleAgentFOV); + AddLocalPacketHandler(PacketType.AgentFOV, HandleAgentFOV, false); AddLocalPacketHandler(PacketType.ViewerStats, HandleViewerStats); - AddLocalPacketHandler(PacketType.MapItemRequest, HandleMapItemRequest); - AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort); - AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest); + AddLocalPacketHandler(PacketType.MapItemRequest, HandleMapItemRequest, false); + AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false); + AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false); AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode); - AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth); + AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false); AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents); AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery); AddLocalPacketHandler(PacketType.DirFindQuery, HandleDirFindQuery); @@ -15757,6 +15779,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion } + + public struct PacketProcessor + { + public PacketMethod method; + public bool Async; + } + public class AsyncPacketProcess + { + public bool result = false; + public readonly LLClientView ClientView = null; + public readonly Packet Pack = null; + public readonly PacketMethod Method = null; + public AsyncPacketProcess(LLClientView pClientview, PacketMethod pMethod, Packet pPack) + { + ClientView = pClientview; + Method = pMethod; + Pack = pPack; + } + } + #endregion public static OSD BuildEvent(string eventName, OSD eventBody) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 338f2bb8d2..3c4fa72363 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -943,7 +943,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } if (packetInbox.Dequeue(100, ref incomingPacket)) - Util.FireAndForget(ProcessInPacket, incomingPacket); + ProcessInPacket(incomingPacket);//, incomingPacket); Util.FireAndForget(ProcessInPacket, incomingPacket); } catch (Exception ex) { From f04645724956061bc1349ded24f984c6d12dd958 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Sun, 13 Dec 2009 04:02:18 -0500 Subject: [PATCH 6/7] Tweaking the ModifyLand packet to be async. Advice from Adam --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 9184c90a12..4780701095 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -4381,7 +4381,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.TerminateFriendship, HandlerTerminateFrendship); AddLocalPacketHandler(PacketType.RezObject, HandlerRezObject); AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject); - AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand, false); + AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand); AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply); AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest); AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance); From c426549f53cb08ab2d55770cc498faa6f94bf66e Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 14 Dec 2009 00:31:15 +0000 Subject: [PATCH 7/7] Add an option to exit an instance rather than restarting a region within it --- OpenSim/Region/Framework/Scenes/Scene.cs | 13 ++++++++++++- bin/OpenSim.ini.example | 10 +++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a22fb5fc16..4241b20134 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -902,7 +902,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); m_restartTimer.Start(); m_dialogModule.SendNotificationToUsersInRegion( - UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes"); + UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0))); } } @@ -932,6 +932,16 @@ namespace OpenSim.Region.Framework.Scenes // This causes the region to restart immediatley. public void RestartNow() { + IConfig startupConfig = m_config.Configs["Startup"]; + if (startupConfig != null) + { + if (startupConfig.GetBoolean("InworldRestartShutsDown", false)) + { + MainConsole.Instance.RunCommand("shutdown"); + return; + } + } + if (PhysicsScene != null) { PhysicsScene.Dispose(); @@ -939,6 +949,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.Error("[REGION]: Closing"); Close(); + m_log.Error("[REGION]: Firing Region Restart Message"); base.Restart(0); } diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 4351b3f57b..1cf96b0d1b 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -107,7 +107,15 @@ ; Combine all contiguous regions into one large region ; Order your regions from South to North, West to East in your regions.ini and then set this to true ; Warning! Don't use this with regions that have existing content!, This will likely break them - CombineContiguousRegions=false + CombineContiguousRegions = false + + ; If you have only one region in an instance, or to avoid the many bugs + ; that you can trigger in modules by restarting a region, set this to + ; true to make the entire instance exit instead of restarting the region. + ; This is meant to be used on systems where some external system like + ; Monit will restart any instance that exits, thereby making the shutdown + ; into a restart. + ;InworldRestartShutsDown = false ; ## ; ## STORAGE