diff options
author | Dr Scofield | 2009-02-10 13:10:57 +0000 |
---|---|---|
committer | Dr Scofield | 2009-02-10 13:10:57 +0000 |
commit | 180be7de07014aa33bc6066f12a0819b731c1c9d (patch) | |
tree | 3aa13af3cda4b808fa9453655875327699b61311 /OpenSim/Region/Modules | |
parent | Stopgap measure: To use gridlaunch, or GUI, start opensim with (diff) | |
download | opensim-SC_OLD-180be7de07014aa33bc6066f12a0819b731c1c9d.zip opensim-SC_OLD-180be7de07014aa33bc6066f12a0819b731c1c9d.tar.gz opensim-SC_OLD-180be7de07014aa33bc6066f12a0819b731c1c9d.tar.bz2 opensim-SC_OLD-180be7de07014aa33bc6066f12a0819b731c1c9d.tar.xz |
this is step 2 of 2 of the OpenSim.Region.Environment refactor.
NOTHING has been deleted or moved off to forge at this point. what
has happened is that OpenSim.Region.Environment.Modules has been split
in two:
- OpenSim.Region.CoreModules: all those modules that are either
directly or indirectly referenced from other OpenSim packages, or
that provide functionality that the OpenSim developer community
considers core functionality:
CoreModules/Agent/AssetTransaction
CoreModules/Agent/Capabilities
CoreModules/Agent/TextureDownload
CoreModules/Agent/TextureSender
CoreModules/Agent/TextureSender/Tests
CoreModules/Agent/Xfer
CoreModules/Avatar/AvatarFactory
CoreModules/Avatar/Chat/ChatModule
CoreModules/Avatar/Combat
CoreModules/Avatar/Currency/SampleMoney
CoreModules/Avatar/Dialog
CoreModules/Avatar/Friends
CoreModules/Avatar/Gestures
CoreModules/Avatar/Groups
CoreModules/Avatar/InstantMessage
CoreModules/Avatar/Inventory
CoreModules/Avatar/Inventory/Archiver
CoreModules/Avatar/Inventory/Transfer
CoreModules/Avatar/Lure
CoreModules/Avatar/ObjectCaps
CoreModules/Avatar/Profiles
CoreModules/Communications/Local
CoreModules/Communications/REST
CoreModules/Framework/EventQueue
CoreModules/Framework/InterfaceCommander
CoreModules/Hypergrid
CoreModules/InterGrid
CoreModules/Scripting/DynamicTexture
CoreModules/Scripting/EMailModules
CoreModules/Scripting/HttpRequest
CoreModules/Scripting/LoadImageURL
CoreModules/Scripting/VectorRender
CoreModules/Scripting/WorldComm
CoreModules/Scripting/XMLRPC
CoreModules/World/Archiver
CoreModules/World/Archiver/Tests
CoreModules/World/Estate
CoreModules/World/Land
CoreModules/World/Permissions
CoreModules/World/Serialiser
CoreModules/World/Sound
CoreModules/World/Sun
CoreModules/World/Terrain
CoreModules/World/Terrain/DefaultEffects
CoreModules/World/Terrain/DefaultEffects/bin
CoreModules/World/Terrain/DefaultEffects/bin/Debug
CoreModules/World/Terrain/Effects
CoreModules/World/Terrain/FileLoaders
CoreModules/World/Terrain/FloodBrushes
CoreModules/World/Terrain/PaintBrushes
CoreModules/World/Terrain/Tests
CoreModules/World/Vegetation
CoreModules/World/Wind
CoreModules/World/WorldMap
- OpenSim.Region.OptionalModules: all those modules that are not core
modules:
OptionalModules/Avatar/Chat/IRC-stuff
OptionalModules/Avatar/Concierge
OptionalModules/Avatar/Voice/AsterixVoice
OptionalModules/Avatar/Voice/SIPVoice
OptionalModules/ContentManagementSystem
OptionalModules/Grid/Interregion
OptionalModules/Python
OptionalModules/SvnSerialiser
OptionalModules/World/NPC
OptionalModules/World/TreePopulator
Diffstat (limited to 'OpenSim/Region/Modules')
6 files changed, 0 insertions, 747 deletions
diff --git a/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs b/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs deleted file mode 100644 index 63e574a..0000000 --- a/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System.Reflection; | ||
29 | using System.Runtime.CompilerServices; | ||
30 | using System.Runtime.InteropServices; | ||
31 | |||
32 | // General information about an assembly is controlled through the following | ||
33 | // set of attributes. Change these attribute values to modify the information | ||
34 | // associated with an assembly. | ||
35 | [assembly: AssemblyTitle("Python")] | ||
36 | [assembly: AssemblyDescription("")] | ||
37 | [assembly: AssemblyConfiguration("")] | ||
38 | [assembly: AssemblyCompany("")] | ||
39 | [assembly: AssemblyProduct("Python")] | ||
40 | [assembly: AssemblyCopyright("Copyright (c) 2008")] | ||
41 | [assembly: AssemblyTrademark("")] | ||
42 | [assembly: AssemblyCulture("")] | ||
43 | |||
44 | // Setting ComVisible to false makes the types in this assembly not visible | ||
45 | // to COM components. If you need to access a type in this assembly from | ||
46 | // COM, set the ComVisible attribute to true on that type. | ||
47 | [assembly: ComVisible(false)] | ||
48 | |||
49 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
50 | [assembly: Guid("5bd55f67-385d-4a43-893a-b5d2ea43f07d")] | ||
51 | |||
52 | // Version information for an assembly consists of the following four values: | ||
53 | // | ||
54 | // Major Version | ||
55 | // Minor Version | ||
56 | // Build Number | ||
57 | // Revision | ||
58 | // | ||
59 | // You can specify all the values or you can default the Build and Revision Numbers | ||
60 | // by using the '*' as shown below: | ||
61 | // [assembly: AssemblyVersion("1.0.*")] | ||
62 | [assembly: AssemblyVersion("1.0.0.0")] | ||
63 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Region/Modules/Python/PythonAPI/Console.cs b/OpenSim/Region/Modules/Python/PythonAPI/Console.cs deleted file mode 100644 index 215a9ad..0000000 --- a/OpenSim/Region/Modules/Python/PythonAPI/Console.cs +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Reflection; | ||
30 | using log4net; | ||
31 | |||
32 | namespace OpenSim.Region.Modules.Python.PythonAPI | ||
33 | { | ||
34 | class Console | ||
35 | { | ||
36 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
37 | |||
38 | public void WriteLine(string txt) | ||
39 | { | ||
40 | m_log.Info(txt); | ||
41 | } | ||
42 | |||
43 | public void WriteLine(string txt, params Object[] e) | ||
44 | { | ||
45 | m_log.Info(String.Format(txt, e)); | ||
46 | } | ||
47 | } | ||
48 | } | ||
diff --git a/OpenSim/Region/Modules/Python/PythonModule.cs b/OpenSim/Region/Modules/Python/PythonModule.cs deleted file mode 100644 index 5dedac2..0000000 --- a/OpenSim/Region/Modules/Python/PythonModule.cs +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using System.Security.Policy; | ||
32 | using System.Text; | ||
33 | using IronPython.Hosting; | ||
34 | using log4net; | ||
35 | using Nini.Config; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
37 | using OpenSim.Region.Framework.Scenes; | ||
38 | |||
39 | namespace OpenSim.Region.Modules.Python | ||
40 | { | ||
41 | class PythonModule : IRegionModule | ||
42 | { | ||
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
44 | private PythonEngine m_python; | ||
45 | |||
46 | public void Initialise(Scene scene, IConfigSource source) | ||
47 | { | ||
48 | } | ||
49 | |||
50 | public void PostInitialise() | ||
51 | { | ||
52 | m_log.Info("[PYTHON] Initialising IronPython engine."); | ||
53 | m_python = new PythonEngine(); | ||
54 | m_python.AddToPath(System.Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + "Python"); | ||
55 | } | ||
56 | |||
57 | public void Close() | ||
58 | { | ||
59 | } | ||
60 | |||
61 | public string Name | ||
62 | { | ||
63 | get { return "PythonModule"; } | ||
64 | } | ||
65 | |||
66 | public bool IsSharedModule | ||
67 | { | ||
68 | get { return true; } | ||
69 | } | ||
70 | } | ||
71 | } | ||
diff --git a/OpenSim/Region/Modules/SvnSerialiser/Properties/AssemblyInfo.cs b/OpenSim/Region/Modules/SvnSerialiser/Properties/AssemblyInfo.cs deleted file mode 100644 index 165fcea..0000000 --- a/OpenSim/Region/Modules/SvnSerialiser/Properties/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System.Reflection; | ||
29 | using System.Runtime.InteropServices; | ||
30 | |||
31 | // General information about an assembly is controlled through the following | ||
32 | // set of attributes. Change these attribute values to modify the information | ||
33 | // associated with an assembly. | ||
34 | [assembly: AssemblyTitle("SvnSerialiser")] | ||
35 | [assembly: AssemblyDescription("")] | ||
36 | [assembly: AssemblyConfiguration("")] | ||
37 | [assembly: AssemblyCompany("")] | ||
38 | [assembly: AssemblyProduct("SvnSerialiser")] | ||
39 | [assembly: AssemblyCopyright("Copyright (c) 2008")] | ||
40 | [assembly: AssemblyTrademark("")] | ||
41 | [assembly: AssemblyCulture("")] | ||
42 | |||
43 | // Setting ComVisible to false makes the types in this assembly not visible | ||
44 | // to COM components. If you need to access a type in this assembly from | ||
45 | // COM, set the ComVisible attribute to true on that type. | ||
46 | [assembly: ComVisible(false)] | ||
47 | |||
48 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
49 | [assembly: Guid("c0893655-0c18-4dd7-8b5b-5f58ab1ec6c7")] | ||
50 | |||
51 | // Version information for an assembly consists of the following four values: | ||
52 | // | ||
53 | // Major Version | ||
54 | // Minor Version | ||
55 | // Build Number | ||
56 | // Revision | ||
57 | // | ||
58 | // You can specify all the values or you can default the Build and Revision Numbers | ||
59 | // by using the '*' as shown below: | ||
60 | // [assembly: AssemblyVersion("1.0.*")] | ||
61 | [assembly: AssemblyVersion("1.0.0.0")] | ||
62 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs deleted file mode 100644 index 6e3b620..0000000 --- a/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs +++ /dev/null | |||
@@ -1,396 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.IO; | ||
31 | using System.Reflection; | ||
32 | using System.Timers; | ||
33 | using log4net; | ||
34 | using Nini.Config; | ||
35 | using OpenSim.Region.Framework.Interfaces; | ||
36 | using OpenSim.Region.Environment.Modules.World.Serialiser; | ||
37 | using OpenSim.Region.Environment.Modules.World.Terrain; | ||
38 | using OpenSim.Region.Framework.Scenes; | ||
39 | using PumaCode.SvnDotNet.AprSharp; | ||
40 | using PumaCode.SvnDotNet.SubversionSharp; | ||
41 | using Slash=System.IO.Path; | ||
42 | |||
43 | namespace OpenSim.Region.Modules.SvnSerialiser | ||
44 | { | ||
45 | public class SvnBackupModule : IRegionModule | ||
46 | { | ||
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
48 | private readonly List<Scene> m_scenes = new List<Scene>(); | ||
49 | private readonly Timer m_timer = new Timer(); | ||
50 | |||
51 | private bool m_enabled = false; | ||
52 | private bool m_installBackupOnLoad = false; | ||
53 | private IRegionSerialiserModule m_serialiser; | ||
54 | private bool m_svnAutoSave = false; | ||
55 | private SvnClient m_svnClient; | ||
56 | private string m_svndir = "SVNmodule" + Slash.DirectorySeparatorChar + "repo"; | ||
57 | private string m_svnpass = "password"; | ||
58 | |||
59 | private TimeSpan m_svnperiod = new TimeSpan(0, 0, 15, 0, 0); | ||
60 | private string m_svnurl = "svn://insert.Your.svn/here/"; | ||
61 | private string m_svnuser = "username"; | ||
62 | |||
63 | #region SvnModule Core | ||
64 | |||
65 | /// <summary> | ||
66 | /// Exports a specified scene to the SVN repo directory, then commits. | ||
67 | /// </summary> | ||
68 | /// <param name="scene">The scene to export</param> | ||
69 | public void SaveRegion(Scene scene) | ||
70 | { | ||
71 | List<string> svnfilenames = CreateAndAddExport(scene); | ||
72 | |||
73 | m_svnClient.Commit3(svnfilenames, true, false); | ||
74 | m_log.Info("[SVNBACKUP]: Region backup successful (" + scene.RegionInfo.RegionName + ")."); | ||
75 | } | ||
76 | |||
77 | /// <summary> | ||
78 | /// Saves all registered scenes to the SVN repo, then commits. | ||
79 | /// </summary> | ||
80 | public void SaveAllRegions() | ||
81 | { | ||
82 | List<string> svnfilenames = new List<string>(); | ||
83 | List<string> regions = new List<string>(); | ||
84 | |||
85 | foreach (Scene scene in m_scenes) | ||
86 | { | ||
87 | svnfilenames.AddRange(CreateAndAddExport(scene)); | ||
88 | regions.Add("'" + scene.RegionInfo.RegionName + "' "); | ||
89 | } | ||
90 | |||
91 | m_svnClient.Commit3(svnfilenames, true, false); | ||
92 | m_log.Info("[SVNBACKUP]: Server backup successful (" + String.Concat(regions.ToArray()) + ")."); | ||
93 | } | ||
94 | |||
95 | private List<string> CreateAndAddExport(Scene scene) | ||
96 | { | ||
97 | m_log.Info("[SVNBACKUP]: Saving a region to SVN with name " + scene.RegionInfo.RegionName); | ||
98 | |||
99 | List<string> filenames = m_serialiser.SerialiseRegion(scene, m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID + Slash.DirectorySeparatorChar); | ||
100 | |||
101 | try | ||
102 | { | ||
103 | m_svnClient.Add3(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID, true, false, false); | ||
104 | } | ||
105 | catch (SvnException) | ||
106 | { | ||
107 | } | ||
108 | |||
109 | List<string> svnfilenames = new List<string>(); | ||
110 | foreach (string filename in filenames) | ||
111 | svnfilenames.Add(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID + Slash.DirectorySeparatorChar + filename); | ||
112 | svnfilenames.Add(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID); | ||
113 | |||
114 | return svnfilenames; | ||
115 | } | ||
116 | |||
117 | public void LoadRegion(Scene scene) | ||
118 | { | ||
119 | IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>(); | ||
120 | if (serialiser != null) | ||
121 | { | ||
122 | serialiser.LoadPrimsFromXml2( | ||
123 | scene, | ||
124 | m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID | ||
125 | + Slash.DirectorySeparatorChar + "objects.xml"); | ||
126 | |||
127 | scene.RequestModuleInterface<ITerrainModule>().LoadFromFile( | ||
128 | m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID | ||
129 | + Slash.DirectorySeparatorChar + "heightmap.r32"); | ||
130 | |||
131 | m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ")."); | ||
132 | } | ||
133 | else | ||
134 | { | ||
135 | m_log.ErrorFormat( | ||
136 | "[SVNBACKUP]: Region load of {0} failed - no serialisation module available", | ||
137 | scene.RegionInfo.RegionName); | ||
138 | } | ||
139 | } | ||
140 | |||
141 | private void CheckoutSvn() | ||
142 | { | ||
143 | m_svnClient.Checkout2(m_svnurl, m_svndir, Svn.Revision.Head, Svn.Revision.Head, true, false); | ||
144 | } | ||
145 | |||
146 | private void CheckoutSvn(SvnRevision revision) | ||
147 | { | ||
148 | m_svnClient.Checkout2(m_svnurl, m_svndir, revision, revision, true, false); | ||
149 | } | ||
150 | |||
151 | // private void CheckoutSvnPartial(string subdir) | ||
152 | // { | ||
153 | // if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir)) | ||
154 | // Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir); | ||
155 | |||
156 | // m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, Svn.Revision.Head, Svn.Revision.Head, true, false); | ||
157 | // } | ||
158 | |||
159 | // private void CheckoutSvnPartial(string subdir, SvnRevision revision) | ||
160 | // { | ||
161 | // if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir)) | ||
162 | // Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir); | ||
163 | |||
164 | // m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, revision, revision, true, false); | ||
165 | // } | ||
166 | |||
167 | #endregion | ||
168 | |||
169 | #region SvnDotNet Callbacks | ||
170 | |||
171 | private SvnError SimpleAuth(out SvnAuthCredSimple svnCredentials, IntPtr baton, | ||
172 | AprString realm, AprString username, bool maySave, AprPool pool) | ||
173 | { | ||
174 | svnCredentials = SvnAuthCredSimple.Alloc(pool); | ||
175 | svnCredentials.Username = new AprString(m_svnuser, pool); | ||
176 | svnCredentials.Password = new AprString(m_svnpass, pool); | ||
177 | svnCredentials.MaySave = false; | ||
178 | return SvnError.NoError; | ||
179 | } | ||
180 | |||
181 | private SvnError GetCommitLogCallback(out AprString logMessage, out SvnPath tmpFile, AprArray commitItems, IntPtr baton, AprPool pool) | ||
182 | { | ||
183 | if (!commitItems.IsNull) | ||
184 | { | ||
185 | foreach (SvnClientCommitItem2 item in commitItems) | ||
186 | { | ||
187 | m_log.Debug("[SVNBACKUP]: ... " + Path.GetFileName(item.Path.ToString()) + " (" + item.Kind.ToString() + ") r" + item.Revision.ToString()); | ||
188 | } | ||
189 | } | ||
190 | |||
191 | string msg = "Region Backup (" + System.Environment.MachineName + " at " + DateTime.UtcNow + " UTC)"; | ||
192 | |||
193 | m_log.Debug("[SVNBACKUP]: Saved with message: " + msg); | ||
194 | |||
195 | logMessage = new AprString(msg, pool); | ||
196 | tmpFile = new SvnPath(pool); | ||
197 | |||
198 | return (SvnError.NoError); | ||
199 | } | ||
200 | |||
201 | #endregion | ||
202 | |||
203 | #region IRegionModule Members | ||
204 | |||
205 | public void Initialise(Scene scene, IConfigSource source) | ||
206 | { | ||
207 | try | ||
208 | { | ||
209 | if (!source.Configs["SVN"].GetBoolean("Enabled", false)) | ||
210 | return; | ||
211 | |||
212 | m_enabled = true; | ||
213 | |||
214 | m_svndir = source.Configs["SVN"].GetString("Directory", m_svndir); | ||
215 | m_svnurl = source.Configs["SVN"].GetString("URL", m_svnurl); | ||
216 | m_svnuser = source.Configs["SVN"].GetString("Username", m_svnuser); | ||
217 | m_svnpass = source.Configs["SVN"].GetString("Password", m_svnpass); | ||
218 | m_installBackupOnLoad = source.Configs["SVN"].GetBoolean("ImportOnStartup", m_installBackupOnLoad); | ||
219 | m_svnAutoSave = source.Configs["SVN"].GetBoolean("Autosave", m_svnAutoSave); | ||
220 | m_svnperiod = new TimeSpan(0, source.Configs["SVN"].GetInt("AutosavePeriod", (int) m_svnperiod.TotalMinutes), 0); | ||
221 | } | ||
222 | catch (Exception) | ||
223 | { | ||
224 | } | ||
225 | |||
226 | lock (m_scenes) | ||
227 | { | ||
228 | m_scenes.Add(scene); | ||
229 | } | ||
230 | //Only register it once, to prevent command being executed x*region times | ||
231 | if (m_scenes.Count == 1) | ||
232 | { | ||
233 | scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; | ||
234 | } | ||
235 | } | ||
236 | |||
237 | public void PostInitialise() | ||
238 | { | ||
239 | if (m_enabled == false) | ||
240 | return; | ||
241 | |||
242 | if (m_svnAutoSave) | ||
243 | { | ||
244 | m_timer.Interval = m_svnperiod.TotalMilliseconds; | ||
245 | m_timer.Elapsed += m_timer_Elapsed; | ||
246 | m_timer.AutoReset = true; | ||
247 | m_timer.Start(); | ||
248 | } | ||
249 | |||
250 | m_log.Info("[SVNBACKUP]: Connecting to SVN server " + m_svnurl + " ..."); | ||
251 | SetupSvnProvider(); | ||
252 | |||
253 | m_log.Info("[SVNBACKUP]: Creating repository in " + m_svndir + "."); | ||
254 | CreateSvnDirectory(); | ||
255 | CheckoutSvn(); | ||
256 | SetupSerialiser(); | ||
257 | |||
258 | if (m_installBackupOnLoad) | ||
259 | { | ||
260 | m_log.Info("[SVNBACKUP]: Importing latest SVN revision to scenes..."); | ||
261 | foreach (Scene scene in m_scenes) | ||
262 | { | ||
263 | LoadRegion(scene); | ||
264 | } | ||
265 | } | ||
266 | } | ||
267 | |||
268 | public void Close() | ||
269 | { | ||
270 | } | ||
271 | |||
272 | public string Name | ||
273 | { | ||
274 | get { return "SvnBackupModule"; } | ||
275 | } | ||
276 | |||
277 | public bool IsSharedModule | ||
278 | { | ||
279 | get { return true; } | ||
280 | } | ||
281 | |||
282 | #endregion | ||
283 | |||
284 | private void EventManager_OnPluginConsole(string[] args) | ||
285 | { | ||
286 | if (args[0] == "svn" && args[1] == "save") | ||
287 | { | ||
288 | SaveAllRegions(); | ||
289 | } | ||
290 | if (args.Length == 2) | ||
291 | { | ||
292 | if (args[0] == "svn" && args[1] == "load") | ||
293 | { | ||
294 | LoadAllScenes(); | ||
295 | } | ||
296 | } | ||
297 | if (args.Length == 3) | ||
298 | { | ||
299 | if (args[0] == "svn" && args[1] == "load") | ||
300 | { | ||
301 | LoadAllScenes(Int32.Parse(args[2])); | ||
302 | } | ||
303 | } | ||
304 | if (args.Length == 3) | ||
305 | { | ||
306 | if (args[0] == "svn" && args[1] == "load-region") | ||
307 | { | ||
308 | LoadScene(args[2]); | ||
309 | } | ||
310 | } | ||
311 | if (args.Length == 4) | ||
312 | { | ||
313 | if (args[0] == "svn" && args[1] == "load-region") | ||
314 | { | ||
315 | LoadScene(args[2], Int32.Parse(args[3])); | ||
316 | } | ||
317 | } | ||
318 | } | ||
319 | |||
320 | public void LoadScene(string name) | ||
321 | { | ||
322 | CheckoutSvn(); | ||
323 | |||
324 | foreach (Scene scene in m_scenes) | ||
325 | { | ||
326 | if (scene.RegionInfo.RegionName.ToLower().Equals(name.ToLower())) | ||
327 | { | ||
328 | LoadRegion(scene); | ||
329 | return; | ||
330 | } | ||
331 | } | ||
332 | m_log.Warn("[SVNBACKUP]: No region loaded - unable to find matching name."); | ||
333 | } | ||
334 | |||
335 | public void LoadScene(string name, int revision) | ||
336 | { | ||
337 | CheckoutSvn(new SvnRevision(revision)); | ||
338 | |||
339 | foreach (Scene scene in m_scenes) | ||
340 | { | ||
341 | if (scene.RegionInfo.RegionName.ToLower().Equals(name.ToLower())) | ||
342 | { | ||
343 | LoadRegion(scene); | ||
344 | return; | ||
345 | } | ||
346 | } | ||
347 | m_log.Warn("[SVNBACKUP]: No region loaded - unable to find matching name."); | ||
348 | } | ||
349 | |||
350 | public void LoadAllScenes() | ||
351 | { | ||
352 | CheckoutSvn(); | ||
353 | |||
354 | foreach (Scene scene in m_scenes) | ||
355 | { | ||
356 | LoadRegion(scene); | ||
357 | } | ||
358 | } | ||
359 | |||
360 | public void LoadAllScenes(int revision) | ||
361 | { | ||
362 | CheckoutSvn(new SvnRevision(revision)); | ||
363 | |||
364 | foreach (Scene scene in m_scenes) | ||
365 | { | ||
366 | LoadRegion(scene); | ||
367 | } | ||
368 | } | ||
369 | |||
370 | private void m_timer_Elapsed(object sender, ElapsedEventArgs e) | ||
371 | { | ||
372 | SaveAllRegions(); | ||
373 | } | ||
374 | |||
375 | private void SetupSerialiser() | ||
376 | { | ||
377 | if (m_scenes.Count > 0) | ||
378 | m_serialiser = m_scenes[0].RequestModuleInterface<IRegionSerialiserModule>(); | ||
379 | } | ||
380 | |||
381 | private void SetupSvnProvider() | ||
382 | { | ||
383 | m_svnClient = new SvnClient(); | ||
384 | m_svnClient.AddUsernameProvider(); | ||
385 | m_svnClient.AddPromptProvider(new SvnAuthProviderObject.SimplePrompt(SimpleAuth), IntPtr.Zero, 2); | ||
386 | m_svnClient.OpenAuth(); | ||
387 | m_svnClient.Context.LogMsgFunc2 = new SvnDelegate(new SvnClient.GetCommitLog2(GetCommitLogCallback)); | ||
388 | } | ||
389 | |||
390 | private void CreateSvnDirectory() | ||
391 | { | ||
392 | if (!Directory.Exists(m_svndir)) | ||
393 | Directory.CreateDirectory(m_svndir); | ||
394 | } | ||
395 | } | ||
396 | } | ||
diff --git a/OpenSim/Region/Modules/Terrain/Extensions/DefaultEffects/Effects/ChannelDigger.cs b/OpenSim/Region/Modules/Terrain/Extensions/DefaultEffects/Effects/ChannelDigger.cs deleted file mode 100644 index 8dd7478..0000000 --- a/OpenSim/Region/Modules/Terrain/Extensions/DefaultEffects/Effects/ChannelDigger.cs +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using OpenSim.Region.Framework.Interfaces; | ||
30 | using OpenSim.Region.Environment.Modules.World.Terrain; | ||
31 | using OpenSim.Region.Environment.Modules.World.Terrain.FloodBrushes; | ||
32 | |||
33 | namespace OpenSim.Region.Modules.Terrain.Extensions.DefaultEffects.Effects | ||
34 | { | ||
35 | public class ChannelDigger : ITerrainEffect | ||
36 | { | ||
37 | private readonly int num_h = 4; | ||
38 | private readonly int num_w = 4; | ||
39 | |||
40 | private readonly ITerrainFloodEffect raiseFunction = new RaiseArea(); | ||
41 | private readonly ITerrainFloodEffect smoothFunction = new SmoothArea(); | ||
42 | |||
43 | #region ITerrainEffect Members | ||
44 | |||
45 | public void RunEffect(ITerrainChannel map) | ||
46 | { | ||
47 | FillMap(map, 15); | ||
48 | BuildTiles(map, 7); | ||
49 | SmoothMap(map, 3); | ||
50 | } | ||
51 | |||
52 | #endregion | ||
53 | |||
54 | private void SmoothMap(ITerrainChannel map, int rounds) | ||
55 | { | ||
56 | Boolean[,] bitmap = new bool[map.Width,map.Height]; | ||
57 | for (int x = 0; x < map.Width; x++) | ||
58 | { | ||
59 | for (int y = 0; y < map.Height; y++) | ||
60 | { | ||
61 | bitmap[x, y] = true; | ||
62 | } | ||
63 | } | ||
64 | |||
65 | for (int i = 0; i < rounds; i++) | ||
66 | { | ||
67 | smoothFunction.FloodEffect(map, bitmap, 1.0); | ||
68 | } | ||
69 | } | ||
70 | |||
71 | private void FillMap(ITerrainChannel map, double val) | ||
72 | { | ||
73 | for (int x = 0; x < map.Width; x++) | ||
74 | for (int y = 0; y < map.Height; y++) | ||
75 | map[x, y] = val; | ||
76 | } | ||
77 | |||
78 | private void BuildTiles(ITerrainChannel map, double height) | ||
79 | { | ||
80 | int channelWidth = (int) Math.Floor((map.Width / num_w) * 0.8); | ||
81 | int channelHeight = (int) Math.Floor((map.Height / num_h) * 0.8); | ||
82 | int channelXOffset = (map.Width / num_w) - channelWidth; | ||
83 | int channelYOffset = (map.Height / num_h) - channelHeight; | ||
84 | |||
85 | for (int x = 0; x < num_w; x++) | ||
86 | { | ||
87 | for (int y = 0; y < num_h; y++) | ||
88 | { | ||
89 | int xoff = ((channelXOffset + channelWidth) * x) + (channelXOffset / 2); | ||
90 | int yoff = ((channelYOffset + channelHeight) * y) + (channelYOffset / 2); | ||
91 | |||
92 | Boolean[,] bitmap = new bool[map.Width,map.Height]; | ||
93 | |||
94 | for (int dx = 0; dx < channelWidth; dx++) | ||
95 | { | ||
96 | for (int dy = 0; dy < channelHeight; dy++) | ||
97 | { | ||
98 | bitmap[dx + xoff, dy + yoff] = true; | ||
99 | } | ||
100 | } | ||
101 | |||
102 | raiseFunction.FloodEffect(map, bitmap, height); | ||
103 | } | ||
104 | } | ||
105 | } | ||
106 | } | ||
107 | } | ||