aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorgareth2007-03-22 10:11:15 +0000
committergareth2007-03-22 10:11:15 +0000
commit7daa3955bc3a1918e40962851f9e8d38597a245e (patch)
treebee3e1372a7eed0c1b220a8a49f7bee7d29a6b91 /src
parentLoad XML for neighbourinfo from grid (diff)
downloadopensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.zip
opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.gz
opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.bz2
opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.xz
brought zircon branch into trunk
Diffstat (limited to '')
-rw-r--r--OpenSim.Framework.Console/MainConsole.cs (renamed from src/VersionInfo.cs.template)29
-rw-r--r--OpenSim.Framework/HeightMapGenHills.cs (renamed from src/HeightMapGenHills.cs)2
-rw-r--r--OpenSim.Framework/IAssetServer.cs (renamed from src/GridInterfaces/IAssetServer.cs)80
-rw-r--r--OpenSim.Framework/IConfig.cs (renamed from src/Config.cs)81
-rw-r--r--OpenSim.Framework/IGridServer.cs (renamed from src/GridInterfaces/ILocalStorage.cs)100
-rw-r--r--OpenSim.Framework/LoginService.cs (renamed from src/OpenSim.Framework/LoginService.cs)5
-rw-r--r--OpenSim.Framework/Properties/AssemblyInfo.cs (renamed from src/Properties/AssemblyInfo.cs)10
-rw-r--r--OpenSim.GridInterfaces/Local/LocalGridServer.cs (renamed from src/LocalServers/LocalGridServers/LocalGrid.cs)135
-rw-r--r--OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs (renamed from src/physics/plugins/PhysXplugin.cs)52
-rw-r--r--OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs (renamed from src/physics/RealPhysX/RealPhysXplugin/AssemblyInfo.cs)0
-rw-r--r--OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs (renamed from src/physics/RealPhysX/RealPhysXplugin/RealPhysX.cs)69
-rw-r--r--OpenSim.RegionServer/SimConsole.cs (renamed from src/OpenSimConsole.cs)22
-rw-r--r--OpenSim.RegionServer/VersionInfo.cs (renamed from src/VersionInfo.cs)12
-rw-r--r--OpenSim.RegionServer/types/Mesh.cs (renamed from src/types/Mesh.cs)0
-rw-r--r--OpenSim.RegionServer/types/Triangle.cs (renamed from src/types/Triangle.cs)0
-rw-r--r--OpenSim.RegionServer/world/Entity.cs (renamed from src/world/Entity.cs)2
-rw-r--r--OpenSim.RegionServer/world/ScriptEngine.cs (renamed from src/world/ScriptEngine.cs)0
-rw-r--r--OpenSim.RegionServer/world/SurfacePatch.cs (renamed from src/world/SurfacePatch.cs)0
-rw-r--r--OpenSim.RegionServer/world/World.cs (renamed from src/world/World.cs)47
-rw-r--r--OpenSim.RegionServer/world/scripting/IScript.cs (renamed from src/world/scripting/IScript.cs)0
-rw-r--r--OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs (renamed from src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs)29
-rw-r--r--src/AssemblyInfo.cs21
-rw-r--r--src/Assets/AssetCache.cs436
-rw-r--r--src/CAPS/SimHttp.cs165
-rw-r--r--src/Config/SimConfig/AssemblyInfo.cs21
-rw-r--r--src/Config/SimConfig/Db4SimConfig.cs177
-rw-r--r--src/Config/SimConfig/SimConfig.csproj52
-rw-r--r--src/Config/default.build53
-rw-r--r--src/GridInterfaces/AssemblyInfo.cs21
-rw-r--r--src/GridInterfaces/GridInterfaces.csproj40
-rw-r--r--src/GridInterfaces/IGridServer.cs145
-rw-r--r--src/GridInterfaces/default.build50
-rw-r--r--src/GridServers/LoginServer.cs350
-rw-r--r--src/LocalServers/LocalGridServers/AssemblyInfo.cs21
-rw-r--r--src/LocalServers/LocalGridServers/LocalGridServers.csproj48
-rw-r--r--src/LocalServers/default.build51
-rw-r--r--src/LocalStorage/Db4LocalStorage/AssemblyInfo.cs21
-rw-r--r--src/LocalStorage/Db4LocalStorage/Db4LocalStorage.csproj52
-rw-r--r--src/LocalStorage/default.build53
-rw-r--r--src/Main.cs338
-rw-r--r--src/OpenSim.Framework/AssemblyInfo.cs21
-rw-r--r--src/OpenSim.Framework/OpenSim.Framework.csproj49
-rw-r--r--src/OpenSim.Framework/Properties/AssemblyInfo.cs35
-rw-r--r--src/OpenSim.Framework/default.build50
-rw-r--r--src/OpenSimClient.cs471
-rw-r--r--src/RemoteServers/RemoteGridServers/AssemblyInfo.cs21
-rw-r--r--src/RemoteServers/RemoteGridServers/RemoteGrid.cs279
-rw-r--r--src/RemoteServers/RemoteGridServers/RemoteGridServers.csproj48
-rw-r--r--src/RemoteServers/default.build51
-rw-r--r--src/Second-server.csproj110
-rw-r--r--src/ServerConsole/ServerConsole/AssemblyInfo.cs21
-rw-r--r--src/ServerConsole/ServerConsole/ServerConsole.cs87
-rw-r--r--src/ServerConsole/ServerConsole/ServerConsole.csproj34
-rw-r--r--src/ServerConsole/default.build48
-rw-r--r--src/Util.cs99
-rw-r--r--src/opensim.sln80
-rw-r--r--src/physics/AssemblyInfo.cs21
-rw-r--r--src/physics/PhysicsManager.cs285
-rw-r--r--src/physics/PhysicsManager.csproj40
-rw-r--r--src/physics/RealPhysX/RealPhysXplugin/RealPhysXplugin.csproj46
-rw-r--r--src/physics/default.build49
-rw-r--r--src/physics/plugins/AssemblyInfo.cs21
-rw-r--r--src/physics/plugins/BasicPhysicsplugin.csproj51
-rw-r--r--src/physics/plugins/default.build51
-rw-r--r--src/world/Avatar.cs487
-rw-r--r--src/world/Primitive.cs429
66 files changed, 342 insertions, 5432 deletions
diff --git a/src/VersionInfo.cs.template b/OpenSim.Framework.Console/MainConsole.cs
index e4e1b95..02c4ae8 100644
--- a/src/VersionInfo.cs.template
+++ b/OpenSim.Framework.Console/MainConsole.cs
@@ -1,5 +1,5 @@
1/* 1/*
2Copyright (c) OpenSim project, http://osgrid.org/ 2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3* 3*
4* Redistribution and use in source and binary forms, with or without 4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met: 5* modification, are permitted provided that the following conditions are met:
@@ -22,16 +22,27 @@ Copyright (c) OpenSim project, http://osgrid.org/
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
25*/ 26*/
26
27using System; 27using System;
28 28
29namespace OpenSim 29namespace OpenSim.Framework.Console
30{ 30{
31 /// <summary> 31 public class MainConsole {
32 /// </summary> 32
33 public class VersionInfo 33 private static ConsoleBase instance;
34 { 34
35 public static string Version = "@@VERSION"; 35 public static ConsoleBase Instance
36 } 36 {
37 get
38 {
39 return instance;
40 }
41 set
42 {
43 instance = value;
44 }
45 }
46 }
47
37} 48}
diff --git a/src/HeightMapGenHills.cs b/OpenSim.Framework/HeightMapGenHills.cs
index e7589af..6a729da 100644
--- a/src/HeightMapGenHills.cs
+++ b/OpenSim.Framework/HeightMapGenHills.cs
@@ -27,7 +27,7 @@
27 27
28using System; 28using System;
29 29
30namespace OpenSim 30namespace OpenSim.Framework.Terrain
31{ 31{
32 public class HeightmapGenHills 32 public class HeightmapGenHills
33 { 33 {
diff --git a/src/GridInterfaces/IAssetServer.cs b/OpenSim.Framework/IAssetServer.cs
index 6050a6c..a0de548 100644
--- a/src/GridInterfaces/IAssetServer.cs
+++ b/OpenSim.Framework/IAssetServer.cs
@@ -30,53 +30,39 @@ using System.Net.Sockets;
30using System.IO; 30using System.IO;
31using System.Threading; 31using System.Threading;
32using libsecondlife; 32using libsecondlife;
33using OpenSim.Framework.Assets;
33 34
34 35namespace OpenSim.Framework.Interfaces
35namespace OpenSim.GridServers
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// Description of IAssetServer. 38 /// Description of IAssetServer.
39 /// </summary> 39 /// </summary>
40 40
41 public interface IAssetServer 41 public interface IAssetServer
42 { 42 {
43 void SetReceiver(IAssetReceiver receiver); 43 void SetReceiver(IAssetReceiver receiver);
44 void RequestAsset(LLUUID assetID, bool isTexture); 44 void RequestAsset(LLUUID assetID, bool isTexture);
45 void UpdateAsset(AssetBase asset); 45 void UpdateAsset(AssetBase asset);
46 void UploadNewAsset(AssetBase asset); 46 void UploadNewAsset(AssetBase asset);
47 void SetServerInfo(string ServerUrl, string ServerKey); 47 void SetServerInfo(string ServerUrl, string ServerKey);
48 } 48 void Close();
49 49 }
50 // could change to delegate? 50
51 public interface IAssetReceiver 51 // could change to delegate?
52 { 52 public interface IAssetReceiver
53 void AssetReceived(AssetBase asset, bool IsTexture); 53 {
54 void AssetNotFound(AssetBase asset); 54 void AssetReceived(AssetBase asset, bool IsTexture);
55 } 55 void AssetNotFound(AssetBase asset);
56 56 }
57 public struct ARequest 57
58 { 58 public interface IAssetPlugin
59 public LLUUID AssetID; 59 {
60 public bool IsTexture; 60 IAssetServer GetAssetServer();
61 } 61 }
62 62
63 public class AssetBase 63 public struct ARequest
64 { 64 {
65 public byte[] Data; 65 public LLUUID AssetID;
66 public LLUUID FullID; 66 public bool IsTexture;
67 public sbyte Type; 67 }
68 public sbyte InvType;
69 public string Name;
70 public string Description;
71
72 public AssetBase()
73 {
74
75 }
76 }
77
78 public interface IAssetPlugin
79 {
80 IAssetServer GetAssetServer();
81 }
82} 68}
diff --git a/src/Config.cs b/OpenSim.Framework/IConfig.cs
index 1c0a6cc..ca7f645 100644
--- a/src/Config.cs
+++ b/OpenSim.Framework/IConfig.cs
@@ -31,49 +31,48 @@ using System;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.IO; 32using System.IO;
33using libsecondlife; 33using libsecondlife;
34using OpenSim.world; 34//using OpenSim.world;
35 35
36namespace OpenSim 36namespace OpenSim.Framework.Interfaces
37{ 37{
38 /// <summary> 38 /// <summary>
39 /// This class handles connection to the underlying database used for configuration of the region. 39 /// This class handles connection to the underlying database used for configuration of the region.
40 /// Region content is also stored by this class. The main entry point is InitConfig() which attempts to locate 40 /// Region content is also stored by this class. The main entry point is InitConfig() which attempts to locate
41 /// opensim.yap in the current working directory. If opensim.yap can not be found, default settings are loaded from 41 /// opensim.yap in the current working directory. If opensim.yap can not be found, default settings are loaded from
42 /// what is hardcoded here and then saved into opensim.yap for future startups. 42 /// what is hardcoded here and then saved into opensim.yap for future startups.
43 /// </summary> 43 /// </summary>
44 44
45 45
46 public abstract class SimConfig 46 public abstract class SimConfig
47 { 47 {
48 public string RegionName; 48 public string RegionName;
49 49
50 public uint RegionLocX; 50 public uint RegionLocX;
51 public uint RegionLocY; 51 public uint RegionLocY;
52 public ulong RegionHandle; 52 public ulong RegionHandle;
53 53
54 public int IPListenPort; 54 public int IPListenPort;
55 public string IPListenAddr; 55 public string IPListenAddr;
56 56
57 public string AssetURL; 57 public string AssetURL;
58 public string AssetSendKey; 58 public string AssetSendKey;
59 59
60 public string GridURL; 60 public string GridURL;
61 public string GridSendKey; 61 public string GridSendKey;
62 public string GridRecvKey; 62 public string GridRecvKey;
63 public string UserURL; 63 public string UserURL;
64 public string UserSendKey; 64 public string UserSendKey;
65 public string UserRecvKey; 65 public string UserRecvKey;
66
67 public abstract void InitConfig(bool sandboxMode);
68 public abstract void LoadFromGrid();
69 public abstract float[] LoadWorld();
70 public abstract void SaveMap(float[] heightmap);
71
72 }
66 73
67 74 public interface ISimConfig
68 public abstract void InitConfig(); 75 {
69 public abstract void LoadFromGrid(); 76 SimConfig GetConfigObject();
70 public abstract World LoadWorld(); 77 }
71 public abstract void SaveMap();
72
73 }
74
75 public interface ISimConfig
76 {
77 SimConfig GetConfigObject();
78 }
79} 78}
diff --git a/src/GridInterfaces/ILocalStorage.cs b/OpenSim.Framework/IGridServer.cs
index 6b7ded6..026dfab 100644
--- a/src/GridInterfaces/ILocalStorage.cs
+++ b/OpenSim.Framework/IGridServer.cs
@@ -25,62 +25,54 @@
25* 25*
26*/ 26*/
27 27
28
28using System; 29using System;
30using System.Collections.Generic;
31using System.Net;
32using System.Net.Sockets;
33using System.IO;
29using libsecondlife; 34using libsecondlife;
35using OpenSim;
30 36
31namespace GridInterfaces 37namespace OpenSim.Framework.Interfaces
32{ 38{
33 /// <summary> 39 /// <summary>
34 /// ILocalStorage. Really hacked together right now needs cleaning up 40 /// Handles connection to Grid Servers.
35 /// </summary> 41 /// also Sim to Sim connections?
36 public interface ILocalStorage 42 /// </summary>
37 { 43
38 void StorePrim(PrimData prim); 44 public interface IGridServer
39 void RemovePrim(LLUUID primID); 45 {
40 void LoadPrimitives(ILocalStorageReceiver receiver); 46 UUIDBlock RequestUUIDBlock();
41 void ShutDown(); 47 NeighbourInfo[] RequestNeighbours(); //should return a array of neighbouring regions
42 } 48 AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
43 49 bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
44 public interface ILocalStorageReceiver 50 string GetName();
45 { 51 bool RequestConnection();
46 void PrimFromStorage(PrimData prim); 52 void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
47 } 53 void Close();
48 54 }
49 55
50 public class PrimData 56 public struct UUIDBlock
51 { 57 {
52 public LLUUID OwnerID; 58 public LLUUID BlockStart;
53 public byte PCode; 59 public LLUUID BlockEnd;
54 public byte PathBegin; 60 }
55 public byte PathEnd; 61
56 public byte PathScaleX; 62 public class AuthenticateResponse
57 public byte PathScaleY; 63 {
58 public byte PathShearX; 64 public bool Authorised;
59 public byte PathShearY; 65 public Login LoginInfo;
60 public sbyte PathSkew; 66
61 public byte ProfileBegin; 67 public AuthenticateResponse()
62 public byte ProfileEnd; 68 {
63 public LLVector3 Scale; 69
64 public byte PathCurve; 70 }
65 public byte ProfileCurve; 71
66 public uint ParentID=0; 72 }
67 public byte ProfileHollow; 73
68 public sbyte PathRadiusOffset; 74 public interface IGridPlugin
69 public byte PathRevolutions; 75 {
70 public sbyte PathTaperX; 76 IGridServer GetGridServer();
71 public sbyte PathTaperY; 77 }
72 public sbyte PathTwist;
73 public sbyte PathTwistBegin;
74
75 //following only used during prim storage
76 public LLVector3 Position;
77 public LLQuaternion Rotation;
78 public uint LocalID;
79 public LLUUID FullID;
80
81 public PrimData()
82 {
83
84 }
85 }
86} 78}
diff --git a/src/OpenSim.Framework/LoginService.cs b/OpenSim.Framework/LoginService.cs
index 85fe761..eba0281 100644
--- a/src/OpenSim.Framework/LoginService.cs
+++ b/OpenSim.Framework/LoginService.cs
@@ -3,13 +3,12 @@ using System.Collections;
3using System.Collections.Generic; 3using System.Collections.Generic;
4using System.Text; 4using System.Text;
5using Nwc.XmlRpc; 5using Nwc.XmlRpc;
6using OpenSim.GridServers;
7using libsecondlife; 6using libsecondlife;
8 7
9namespace OpenSim.Framework 8namespace OpenSim.Framework.Grid
10{ 9{
11 public abstract class LoginService 10 public abstract class LoginService
12 { 11 {
13 12
14 } 13 }
15} 14} \ No newline at end of file
diff --git a/src/Properties/AssemblyInfo.cs b/OpenSim.Framework/Properties/AssemblyInfo.cs
index 90fc127..86f5cdb 100644
--- a/src/Properties/AssemblyInfo.cs
+++ b/OpenSim.Framework/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
5// General Information about an assembly is controlled through the following 5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information 6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly. 7// associated with an assembly.
8[assembly: AssemblyTitle("opensim")] 8[assembly: AssemblyTitle("OpenSim.FrameWork")]
9[assembly: AssemblyDescription("")] 9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")] 10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("Playahead AB")] 11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("opensim")] 12[assembly: AssemblyProduct("OpenSim.FrameWork")]
13[assembly: AssemblyCopyright("Copyright © Playahead AB 2007")] 13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")] 14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")] 15[assembly: AssemblyCulture("")]
16 16
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
20[assembly: ComVisible(false)] 20[assembly: ComVisible(false)]
21 21
22// The following GUID is for the ID of the typelib if this project is exposed to COM 22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("1d09756b-a461-4302-b6fe-15c455317909")] 23[assembly: Guid("a08e20c7-f191-4137-b1f0-9291408fa521")]
24 24
25// Version information for an assembly consists of the following four values: 25// Version information for an assembly consists of the following four values:
26// 26//
diff --git a/src/LocalServers/LocalGridServers/LocalGrid.cs b/OpenSim.GridInterfaces/Local/LocalGridServer.cs
index bd377d3..d70e989 100644
--- a/src/LocalServers/LocalGridServers/LocalGrid.cs
+++ b/OpenSim.GridInterfaces/Local/LocalGridServer.cs
@@ -27,10 +27,14 @@
27using System; 27using System;
28using System.Collections.Generic; 28using System.Collections.Generic;
29using System.Threading; 29using System.Threading;
30using OpenSim.GridServers; 30using System.IO;
31using OpenSim.Framework.Interfaces;
32using OpenSim.Framework.Assets;
31using libsecondlife; 33using libsecondlife;
34using Db4objects.Db4o;
35using Db4objects.Db4o.Query;
32 36
33namespace LocalGridServers 37namespace OpenSim.GridInterfaces.Local
34{ 38{
35 /// <summary> 39 /// <summary>
36 /// 40 ///
@@ -49,86 +53,26 @@ namespace LocalGridServers
49 } 53 }
50 } 54 }
51 55
52 public class LocalAssetPlugin : IAssetPlugin
53 {
54 public LocalAssetPlugin()
55 {
56
57 }
58
59 public IAssetServer GetAssetServer()
60 {
61 return(new LocalAssetServer());
62 }
63 }
64
65 public class LocalAssetServer : IAssetServer
66 {
67 private IAssetReceiver _receiver;
68 private BlockingQueue<ARequest> _assetRequests;
69
70 public LocalAssetServer()
71 {
72 this._assetRequests = new BlockingQueue<ARequest>();
73 ServerConsole.MainConsole.Instance.WriteLine("Local Asset Server class created");
74 }
75
76 public void SetReceiver(IAssetReceiver receiver)
77 {
78 this._receiver = receiver;
79 }
80
81 public void RequestAsset(LLUUID assetID, bool isTexture)
82 {
83 ARequest req = new ARequest();
84 req.AssetID = assetID;
85 req.IsTexture = isTexture;
86 //this._assetRequests.Enqueue(req);
87 }
88
89 public void UpdateAsset(AssetBase asset)
90 {
91
92 }
93
94 public void UploadNewAsset(AssetBase asset)
95 {
96
97 }
98
99 public void SetServerInfo(string ServerUrl, string SendKey)
100 {
101
102 }
103
104 private void RunRequests()
105 {
106 while(true)
107 {
108 Thread.Sleep(1000);
109 }
110 }
111 }
112
113 public class LocalGridServer : LocalGridBase 56 public class LocalGridServer : LocalGridBase
114 { 57 {
115 public List<Login> Sessions = new List<Login>(); 58 public List<Login> Sessions = new List<Login>();
116 59
117 public LocalGridServer() 60 public LocalGridServer()
118 { 61 {
119 Sessions = new List<Login>(); 62 Sessions = new List<Login>();
120 ServerConsole.MainConsole.Instance.WriteLine("Local Grid Server class created"); 63 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Local Grid Server class created");
121 }
122
123 public override string GetName()
124 {
125 return "Local";
126 } 64 }
127 65
128 public override bool RequestConnection() 66 public override bool RequestConnection()
129 { 67 {
130 return true; 68 return true;
131 } 69 }
70
71 public override string GetName()
72 {
73 return "Local";
74 }
75
132 public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode) 76 public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
133 { 77 {
134 //we are running local 78 //we are running local
@@ -159,17 +103,22 @@ namespace LocalGridServers
159 UUIDBlock uuidBlock = new UUIDBlock(); 103 UUIDBlock uuidBlock = new UUIDBlock();
160 return(uuidBlock); 104 return(uuidBlock);
161 } 105 }
162 106
163 public override neighbourinfo[] RequestNeighbours(ulong regionhandle) 107 public override NeighbourInfo[] RequestNeighbours()
164 { 108 {
165 return new neighbourinfo[8]; 109 return null;
166 } 110 }
167 111
168 public override void SetServerInfo(string GridServerUrl, string GridSendKey, string GridRecvKey, string UserServerUrl, string UserSendKey, string UserRecvKey) 112 public override void SetServerInfo(string ServerUrl, string SendKey, string RecvKey)
169 { 113 {
170 114
171 } 115 }
172 116
117 public override void Close()
118 {
119
120 }
121
173 /// <summary> 122 /// <summary>
174 /// used by the local login server to inform us of new sessions 123 /// used by the local login server to inform us of new sessions
175 /// </summary> 124 /// </summary>
@@ -182,30 +131,26 @@ namespace LocalGridServers
182 } 131 }
183 } 132 }
184 } 133 }
185
186 public class BlockingQueue< T > {
187 private Queue< T > _queue = new Queue< T >();
188 private object _queueSync = new object();
189 134
190 public void Enqueue(T value) 135 public class AssetUUIDQuery : Predicate
136 {
137 private LLUUID _findID;
138
139 public AssetUUIDQuery(LLUUID find)
191 { 140 {
192 lock(_queueSync) 141 _findID = find;
193 {
194 _queue.Enqueue(value);
195 Monitor.Pulse(_queueSync);
196 }
197 } 142 }
198 143 public bool Match(AssetStorage asset)
199 public T Dequeue()
200 { 144 {
201 lock(_queueSync) 145 return (asset.UUID == _findID);
202 {
203 if( _queue.Count < 1)
204 Monitor.Wait(_queueSync);
205
206 return _queue.Dequeue();
207 }
208 } 146 }
209 } 147 }
210 148
149 public class AssetStorage
150 {
151 public byte[] Data;
152 public sbyte Type;
153 public string Name;
154 public LLUUID UUID;
155 }
211} 156}
diff --git a/src/physics/plugins/PhysXplugin.cs b/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
index 8c09dc8..deff803 100644
--- a/src/physics/plugins/PhysXplugin.cs
+++ b/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
@@ -26,18 +26,18 @@
26*/ 26*/
27using System; 27using System;
28using System.Collections.Generic; 28using System.Collections.Generic;
29using PhysicsSystem; 29using OpenSim.Physics.Manager;
30 30
31namespace PhysXplugin 31namespace OpenSim.Physics.BasicPhysicsPlugin
32{ 32{
33 /// <summary> 33 /// <summary>
34 /// Will be the PhysX plugin but for now will be a very basic physics engine 34 /// Will be the PhysX plugin but for now will be a very basic physics engine
35 /// </summary> 35 /// </summary>
36 public class PhysXPlugin : IPhysicsPlugin 36 public class BasicPhysicsPlugin : IPhysicsPlugin
37 { 37 {
38 private PhysXScene _mScene; 38 private BasicScene _mScene;
39 39
40 public PhysXPlugin() 40 public BasicPhysicsPlugin()
41 { 41 {
42 42
43 } 43 }
@@ -51,14 +51,14 @@ namespace PhysXplugin
51 { 51 {
52 if(_mScene == null) 52 if(_mScene == null)
53 { 53 {
54 _mScene = new PhysXScene(); 54 _mScene = new BasicScene();
55 } 55 }
56 return(_mScene); 56 return(_mScene);
57 } 57 }
58 58
59 public string GetName() 59 public string GetName()
60 { 60 {
61 return("PhysX"); 61 return("basicphysics");
62 } 62 }
63 63
64 public void Dispose() 64 public void Dispose()
@@ -67,19 +67,19 @@ namespace PhysXplugin
67 } 67 }
68 } 68 }
69 69
70 public class PhysXScene :PhysicsScene 70 public class BasicScene :PhysicsScene
71 { 71 {
72 private List<PhysXActor> _actors = new List<PhysXActor>(); 72 private List<BasicActor> _actors = new List<BasicActor>();
73 private float[] _heightMap; 73 private float[] _heightMap;
74 74
75 public PhysXScene() 75 public BasicScene()
76 { 76 {
77 77
78 } 78 }
79 79
80 public override PhysicsActor AddAvatar(PhysicsVector position) 80 public override PhysicsActor AddAvatar(PhysicsVector position)
81 { 81 {
82 PhysXActor act = new PhysXActor(); 82 BasicActor act = new BasicActor();
83 act.Position = position; 83 act.Position = position;
84 _actors.Add(act); 84 _actors.Add(act);
85 return act; 85 return act;
@@ -92,7 +92,7 @@ namespace PhysXplugin
92 92
93 public override void Simulate(float timeStep) 93 public override void Simulate(float timeStep)
94 { 94 {
95 foreach (PhysXActor actor in _actors) 95 foreach (BasicActor actor in _actors)
96 { 96 {
97 actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep); 97 actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep);
98 actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep); 98 actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep);
@@ -151,13 +151,13 @@ namespace PhysXplugin
151 } 151 }
152 } 152 }
153 153
154 public class PhysXActor : PhysicsActor 154 public class BasicActor : PhysicsActor
155 { 155 {
156 private PhysicsVector _position; 156 private PhysicsVector _position;
157 private PhysicsVector _velocity; 157 private PhysicsVector _velocity;
158 private PhysicsVector _acceleration; 158 private PhysicsVector _acceleration;
159 private bool flying; 159 private bool flying;
160 public PhysXActor() 160 public BasicActor()
161 { 161 {
162 _velocity = new PhysicsVector(); 162 _velocity = new PhysicsVector();
163 _position = new PhysicsVector(); 163 _position = new PhysicsVector();
@@ -200,6 +200,18 @@ namespace PhysXplugin
200 } 200 }
201 } 201 }
202 202
203 public override Axiom.MathLib.Quaternion Orientation
204 {
205 get
206 {
207 return Axiom.MathLib.Quaternion.Identity;
208 }
209 set
210 {
211
212 }
213 }
214
203 public override PhysicsVector Acceleration 215 public override PhysicsVector Acceleration
204 { 216 {
205 get 217 get
@@ -208,6 +220,18 @@ namespace PhysXplugin
208 } 220 }
209 221
210 } 222 }
223
224 public override bool Kinematic
225 {
226 get
227 {
228 return true;
229 }
230 set
231 {
232
233 }
234 }
211 public void SetAcceleration (PhysicsVector accel) 235 public void SetAcceleration (PhysicsVector accel)
212 { 236 {
213 this._acceleration = accel; 237 this._acceleration = accel;
diff --git a/src/physics/RealPhysX/RealPhysXplugin/AssemblyInfo.cs b/OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs
index 913aae7..913aae7 100644
--- a/src/physics/RealPhysX/RealPhysXplugin/AssemblyInfo.cs
+++ b/OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs
diff --git a/src/physics/RealPhysX/RealPhysXplugin/RealPhysX.cs b/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs
index 9576a40..043c2f1 100644
--- a/src/physics/RealPhysX/RealPhysXplugin/RealPhysX.cs
+++ b/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs
@@ -52,10 +52,10 @@
52*/ 52*/
53using System; 53using System;
54using System.Collections.Generic; 54using System.Collections.Generic;
55using PhysicsSystem; 55using OpenSim.Physics.Manager;
56using PhysXWrapper; 56using PhysXWrapper;
57 57
58namespace PhysXplugin 58namespace OpenSim.Physics.PhysXPlugin
59{ 59{
60 /// <summary> 60 /// <summary>
61 /// Will be the PhysX plugin but for now will be a very basic physics engine 61 /// Will be the PhysX plugin but for now will be a very basic physics engine
@@ -105,6 +105,7 @@ namespace PhysXplugin
105 public PhysXScene() 105 public PhysXScene()
106 { 106 {
107 mySdk = NxPhysicsSDK.CreateSDK(); 107 mySdk = NxPhysicsSDK.CreateSDK();
108 Console.WriteLine("Sdk created - now creating scene");
108 scene = mySdk.CreateScene(); 109 scene = mySdk.CreateScene();
109 110
110 } 111 }
@@ -179,6 +180,7 @@ namespace PhysXplugin
179 private PhysicsVector _acceleration; 180 private PhysicsVector _acceleration;
180 private NxCharacter _character; 181 private NxCharacter _character;
181 private bool flying; 182 private bool flying;
183 private float gravityAccel;
182 184
183 public PhysXCharacter(NxCharacter character) 185 public PhysXCharacter(NxCharacter character)
184 { 186 {
@@ -224,6 +226,30 @@ namespace PhysXplugin
224 } 226 }
225 } 227 }
226 228
229 public override bool Kinematic
230 {
231 get
232 {
233 return false;
234 }
235 set
236 {
237
238 }
239 }
240
241 public override Axiom.MathLib.Quaternion Orientation
242 {
243 get
244 {
245 return Axiom.MathLib.Quaternion.Identity;
246 }
247 set
248 {
249
250 }
251 }
252
227 public override PhysicsVector Acceleration 253 public override PhysicsVector Acceleration
228 { 254 {
229 get 255 get
@@ -258,9 +284,14 @@ namespace PhysXplugin
258 } 284 }
259 else 285 else
260 { 286 {
261 vec.Z = (-9.8f + this._velocity.Z) * timeStep; 287 gravityAccel+= -9.8f;
288 vec.Z = (gravityAccel + this._velocity.Z) * timeStep;
289 }
290 int res = this._character.Move(vec);
291 if(res == 1)
292 {
293 gravityAccel = 0;
262 } 294 }
263 this._character.Move(vec);
264 } 295 }
265 296
266 public void UpdatePosition() 297 public void UpdatePosition()
@@ -332,6 +363,36 @@ namespace PhysXplugin
332 } 363 }
333 } 364 }
334 365
366 public override bool Kinematic
367 {
368 get
369 {
370 return this._prim.Kinematic;
371 }
372 set
373 {
374 this._prim.Kinematic = value;
375 }
376 }
377
378 public override Axiom.MathLib.Quaternion Orientation
379 {
380 get
381 {
382 Axiom.MathLib.Quaternion res = new Axiom.MathLib.Quaternion();
383 PhysXWrapper.Quaternion quat = this._prim.GetOrientation();
384 res.w = quat.W;
385 res.x = quat.X;
386 res.y = quat.Y;
387 res.z = quat.Z;
388 return res;
389 }
390 set
391 {
392
393 }
394 }
395
335 public override PhysicsVector Acceleration 396 public override PhysicsVector Acceleration
336 { 397 {
337 get 398 get
diff --git a/src/OpenSimConsole.cs b/OpenSim.RegionServer/SimConsole.cs
index cf8b648..d6d5e44 100644
--- a/src/OpenSimConsole.cs
+++ b/OpenSim.RegionServer/SimConsole.cs
@@ -33,14 +33,14 @@ using System.IO;
33using System.Net; 33using System.Net;
34using libsecondlife; 34using libsecondlife;
35using libsecondlife.Packets; 35using libsecondlife.Packets;
36using ServerConsole; 36using OpenSim.Framework.Console;
37 37
38namespace OpenSim 38namespace OpenSim
39{ 39{
40 /// <summary> 40 /// <summary>
41 /// Description of ServerConsole. 41 /// Description of ServerConsole.
42 /// </summary> 42 /// </summary>
43 public class MServerConsole : ConsoleBase 43 public class SimConsole : ConsoleBase
44 { 44 {
45 45
46 private ConsoleType ConsType; 46 private ConsoleType ConsType;
@@ -57,7 +57,7 @@ namespace OpenSim
57 // TCP - the port to bind to 57 // TCP - the port to bind to
58 // Local - param ignored 58 // Local - param ignored
59 // SimChat - the chat channel to accept commands from 59 // SimChat - the chat channel to accept commands from
60 public MServerConsole(ConsoleType constype, string sparam, int iparam) { 60 public SimConsole(ConsoleType constype, string sparam, int iparam) {
61 ConsType = constype; 61 ConsType = constype;
62 switch(constype) { 62 switch(constype) {
63 case ConsoleType.Local: 63 case ConsoleType.Local:
@@ -156,11 +156,11 @@ namespace OpenSim
156 break; 156 break;
157 157
158 case "regenerate": 158 case "regenerate":
159 OpenSim_Main.local_world.RegenerateTerrain(); 159 OpenSimRoot.Instance.LocalWorld.RegenerateTerrain();
160 break; 160 break;
161 161
162 case "shutdown": 162 case "shutdown":
163 OpenSim_Main.Shutdown(); 163 OpenSimRoot.Instance.Shutdown();
164 break; 164 break;
165 } 165 }
166 return null; 166 return null;
@@ -170,16 +170,16 @@ namespace OpenSim
170 public override void ShowCommands(string ShowWhat) { 170 public override void ShowCommands(string ShowWhat) {
171 switch(ShowWhat) { 171 switch(ShowWhat) {
172 case "uptime": 172 case "uptime":
173 this.WriteLine("OpenSim has been running since " + OpenSim_Main.sim.startuptime.ToString()); 173 this.WriteLine("OpenSim has been running since " + OpenSimRoot.Instance.startuptime.ToString());
174 this.WriteLine("That is " + (DateTime.Now-OpenSim_Main.sim.startuptime).ToString()); 174 this.WriteLine("That is " + (DateTime.Now-OpenSimRoot.Instance.startuptime).ToString());
175 break; 175 break;
176 case "users": 176 case "users":
177 OpenSim.world.Avatar TempAv; 177 OpenSim.world.Avatar TempAv;
178 this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}","Firstname", "Lastname","Agent ID", "Session ID", "Circuit", "IP")); 178 this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}","Firstname", "Lastname","Agent ID", "Session ID", "Circuit", "IP"));
179 foreach (libsecondlife.LLUUID UUID in OpenSim_Main.local_world.Entities.Keys) { 179 foreach (libsecondlife.LLUUID UUID in OpenSimRoot.Instance.LocalWorld.Entities.Keys) {
180 if(OpenSim_Main.local_world.Entities[UUID].ToString()== "OpenSim.world.Avatar") 180 if(OpenSimRoot.Instance.LocalWorld.Entities[UUID].ToString()== "OpenSim.world.Avatar")
181 { 181 {
182 TempAv=(OpenSim.world.Avatar)OpenSim_Main.local_world.Entities[UUID]; 182 TempAv=(OpenSim.world.Avatar)OpenSimRoot.Instance.LocalWorld.Entities[UUID];
183 this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}",TempAv.firstname, TempAv.lastname,UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString())); 183 this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}",TempAv.firstname, TempAv.lastname,UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()));
184 } 184 }
185 } 185 }
@@ -190,7 +190,7 @@ namespace OpenSim
190 // Displays a prompt to the user and then runs the command they entered 190 // Displays a prompt to the user and then runs the command they entered
191 public override void MainConsolePrompt() { 191 public override void MainConsolePrompt() {
192 string[] tempstrarray; 192 string[] tempstrarray;
193 string tempstr = this.CmdPrompt("OpenSim-" + OpenSim_Main.cfg.RegionHandle.ToString() + " # "); 193 string tempstr = this.CmdPrompt("OpenSim-" + OpenSimRoot.Instance.Cfg.RegionHandle.ToString() + " # ");
194 tempstrarray = tempstr.Split(' '); 194 tempstrarray = tempstr.Split(' ');
195 string cmd=tempstrarray[0]; 195 string cmd=tempstrarray[0];
196 Array.Reverse(tempstrarray); 196 Array.Reverse(tempstrarray);
diff --git a/src/VersionInfo.cs b/OpenSim.RegionServer/VersionInfo.cs
index 5cfd136..39767df 100644
--- a/src/VersionInfo.cs
+++ b/OpenSim.RegionServer/VersionInfo.cs
@@ -28,10 +28,10 @@ using System;
28 28
29namespace OpenSim 29namespace OpenSim
30{ 30{
31 /// <summary> 31 /// <summary>
32 /// </summary> 32 /// </summary>
33 public class VersionInfo 33 public class VersionInfo
34 { 34 {
35 public static string Version = "0.1, Build 1174381410, Revision 240M"; 35 public static string Version = "0.1, Build 1173843165, Revision 193:206M";
36 } 36 }
37} 37}
diff --git a/src/types/Mesh.cs b/OpenSim.RegionServer/types/Mesh.cs
index 3e00c91..3e00c91 100644
--- a/src/types/Mesh.cs
+++ b/OpenSim.RegionServer/types/Mesh.cs
diff --git a/src/types/Triangle.cs b/OpenSim.RegionServer/types/Triangle.cs
index 8dfea6e..8dfea6e 100644
--- a/src/types/Triangle.cs
+++ b/OpenSim.RegionServer/types/Triangle.cs
diff --git a/src/world/Entity.cs b/OpenSim.RegionServer/world/Entity.cs
index ee4b2e4..780f3a0 100644
--- a/src/world/Entity.cs
+++ b/OpenSim.RegionServer/world/Entity.cs
@@ -20,7 +20,7 @@ namespace OpenSim.world
20 public Entity() 20 public Entity()
21 { 21 {
22 uuid = new libsecondlife.LLUUID(); 22 uuid = new libsecondlife.LLUUID();
23 localid = 8880000 + (OpenSim_Main.local_world._localNumber++); // FIXME - race condition! 23 localid = 0;
24 position = new LLVector3(); 24 position = new LLVector3();
25 velocity = new LLVector3(); 25 velocity = new LLVector3();
26 rotation = new Quaternion(); 26 rotation = new Quaternion();
diff --git a/src/world/ScriptEngine.cs b/OpenSim.RegionServer/world/ScriptEngine.cs
index f20a08e..f20a08e 100644
--- a/src/world/ScriptEngine.cs
+++ b/OpenSim.RegionServer/world/ScriptEngine.cs
diff --git a/src/world/SurfacePatch.cs b/OpenSim.RegionServer/world/SurfacePatch.cs
index 71e4116..71e4116 100644
--- a/src/world/SurfacePatch.cs
+++ b/OpenSim.RegionServer/world/SurfacePatch.cs
diff --git a/src/world/World.cs b/OpenSim.RegionServer/world/World.cs
index e1c84bc..ba99233 100644
--- a/src/world/World.cs
+++ b/OpenSim.RegionServer/world/World.cs
@@ -5,8 +5,10 @@ using System.Collections.Generic;
5using System.Text; 5using System.Text;
6using System.Reflection; 6using System.Reflection;
7using System.IO; 7using System.IO;
8using PhysicsSystem; 8using OpenSim.Physics.Manager;
9using GridInterfaces; 9using OpenSim.Framework.Interfaces;
10using OpenSim.Framework.Assets;
11using OpenSim.Framework.Terrain;
10 12
11namespace OpenSim.world 13namespace OpenSim.world
12{ 14{
@@ -26,10 +28,10 @@ namespace OpenSim.world
26 28
27 public World() 29 public World()
28 { 30 {
29 ServerConsole.MainConsole.Instance.WriteLine("World.cs - creating new entitities instance"); 31 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating new entitities instance");
30 Entities = new Dictionary<libsecondlife.LLUUID, Entity>(); 32 Entities = new Dictionary<libsecondlife.LLUUID, Entity>();
31 33
32 ServerConsole.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); 34 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap");
33 TerrainManager = new TerrainManager(new SecondLife()); 35 TerrainManager = new TerrainManager(new SecondLife());
34 Avatar.SetupTemplate("avatar-template.dat"); 36 Avatar.SetupTemplate("avatar-template.dat");
35 // ServerConsole.MainConsole.Instance.WriteLine("World.cs - Creating script engine instance"); 37 // ServerConsole.MainConsole.Instance.WriteLine("World.cs - Creating script engine instance");
@@ -71,7 +73,7 @@ namespace OpenSim.world
71 73
72 //backup world data 74 //backup world data
73 this.storageCount++; 75 this.storageCount++;
74 if(storageCount> 300) //set to how often you want to backup 76 if(storageCount> 1200) //set to how often you want to backup
75 { 77 {
76 this.Backup(); 78 this.Backup();
77 storageCount =0; 79 storageCount =0;
@@ -112,15 +114,15 @@ namespace OpenSim.world
112 HeightmapGenHills hills = new HeightmapGenHills(); 114 HeightmapGenHills hills = new HeightmapGenHills();
113 this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); 115 this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
114 this.phyScene.SetTerrain(this.LandMap); 116 this.phyScene.SetTerrain(this.LandMap);
115 OpenSim_Main.cfg.SaveMap(); 117 OpenSimRoot.Instance.Cfg.SaveMap(this.LandMap);
116 118
117 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) { 119 foreach(SimClient client in OpenSimRoot.Instance.ClientThreads.Values) {
118 this.SendLayerData(client); 120 this.SendLayerData(client);
119 } 121 }
120 } 122 }
121 public void LoadPrimsFromStorage() 123 public void LoadPrimsFromStorage()
122 { 124 {
123 ServerConsole.MainConsole.Instance.WriteLine("World.cs: LoadPrimsFromStorage() - Loading primitives"); 125 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: LoadPrimsFromStorage() - Loading primitives");
124 this.localStorage.LoadPrimitives(this); 126 this.localStorage.LoadPrimitives(this);
125 } 127 }
126 128
@@ -130,7 +132,7 @@ namespace OpenSim.world
130 { 132 {
131 _primCount = prim.LocalID + 1; 133 _primCount = prim.LocalID + 1;
132 } 134 }
133 ServerConsole.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId "+ prim.LocalID+ " ) from storage"); 135 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId "+ prim.LocalID+ " ) from storage");
134 Primitive nPrim = new Primitive(); 136 Primitive nPrim = new Primitive();
135 nPrim.CreateFromStorage(prim); 137 nPrim.CreateFromStorage(prim);
136 this.Entities.Add(nPrim.uuid, nPrim); 138 this.Entities.Add(nPrim.uuid, nPrim);
@@ -141,7 +143,7 @@ namespace OpenSim.world
141 this.localStorage.ShutDown(); 143 this.localStorage.ShutDown();
142 } 144 }
143 145
144 public void SendLayerData(OpenSimClient RemoteClient) { 146 public void SendLayerData(SimClient RemoteClient) {
145 int[] patches = new int[4]; 147 int[] patches = new int[4];
146 148
147 for (int y = 0; y < 16; y++) 149 for (int y = 0; y < 16; y++)
@@ -159,7 +161,7 @@ namespace OpenSim.world
159 } 161 }
160 } 162 }
161 163
162 public void GetInitialPrims(OpenSimClient RemoteClient) 164 public void GetInitialPrims(SimClient RemoteClient)
163 { 165 {
164 foreach (libsecondlife.LLUUID UUID in Entities.Keys) 166 foreach (libsecondlife.LLUUID UUID in Entities.Keys)
165 { 167 {
@@ -170,33 +172,36 @@ namespace OpenSim.world
170 } 172 }
171 } 173 }
172 174
173 public void AddViewerAgent(OpenSimClient AgentClient) { 175 public void AddViewerAgent(SimClient AgentClient) {
174 ServerConsole.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); 176 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
175 Avatar NewAvatar = new Avatar(AgentClient); 177 Avatar NewAvatar = new Avatar(AgentClient);
176 ServerConsole.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); 178 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world");
177 ServerConsole.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); 179 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake ");
178 NewAvatar.SendRegionHandshake(this); 180 NewAvatar.SendRegionHandshake(this);
179 PhysicsVector pVec = new PhysicsVector(NewAvatar.position.X, NewAvatar.position.Y, NewAvatar.position.Z); 181 PhysicsVector pVec = new PhysicsVector(NewAvatar.position.X, NewAvatar.position.Y, NewAvatar.position.Z);
180 NewAvatar.PhysActor = this.phyScene.AddAvatar(pVec); 182 NewAvatar.PhysActor = this.phyScene.AddAvatar(pVec);
181 this.Entities.Add(AgentClient.AgentID, NewAvatar); 183 this.Entities.Add(AgentClient.AgentID, NewAvatar);
182 } 184 }
183 185
184 public void AddNewPrim(ObjectAddPacket addPacket, OpenSimClient AgentClient) 186 public void AddNewPrim(ObjectAddPacket addPacket, SimClient AgentClient)
185 { 187 {
186 ServerConsole.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim"); 188 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim");
187 Primitive prim = new Primitive(); 189 Primitive prim = new Primitive();
188 prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount); 190 prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount);
189 PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z); 191 PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z);
190 PhysicsVector pSize = new PhysicsVector( 0.25f, 0.25f, 0.25f); 192 PhysicsVector pSize = new PhysicsVector( 0.255f, 0.255f, 0.255f);
191 //prim.PhysActor = this.phyScene.AddPrim(pVec, pSize ); 193 if(OpenSim.world.Avatar.PhysicsEngineFlying)
194 {
195 prim.PhysActor = this.phyScene.AddPrim(pVec, pSize );
196 }
192 //prim.PhysicsEnabled = true; 197 //prim.PhysicsEnabled = true;
193 this.Entities.Add(prim.uuid, prim); 198 this.Entities.Add(prim.uuid, prim);
194 this._primCount++; 199 this._primCount++;
195 } 200 }
196 201
197 public bool Backup() { 202 public bool Backup() {
198 /* TODO: Save the current world entities state. */ 203
199 ServerConsole.MainConsole.Instance.WriteLine("World.cs: Backup() - Backing up Primitives"); 204 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: Backup() - Backing up Primitives");
200 foreach (libsecondlife.LLUUID UUID in Entities.Keys) 205 foreach (libsecondlife.LLUUID UUID in Entities.Keys)
201 { 206 {
202 Entities[UUID].BackUp(); 207 Entities[UUID].BackUp();
diff --git a/src/world/scripting/IScript.cs b/OpenSim.RegionServer/world/scripting/IScript.cs
index 550594d..550594d 100644
--- a/src/world/scripting/IScript.cs
+++ b/OpenSim.RegionServer/world/scripting/IScript.cs
diff --git a/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs b/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs
index bb9825c..93ed9cc 100644
--- a/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs
+++ b/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs
@@ -29,9 +29,10 @@ using System.Collections.Generic;
29using Db4objects.Db4o; 29using Db4objects.Db4o;
30using Db4objects.Db4o.Query; 30using Db4objects.Db4o.Query;
31using libsecondlife; 31using libsecondlife;
32using GridInterfaces; 32using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Assets;
33 34
34namespace Db4LocalStorage 35namespace OpenSim.Storage.LocalStorageDb4o
35{ 36{
36 /// <summary> 37 /// <summary>
37 /// 38 ///
@@ -45,13 +46,13 @@ namespace Db4LocalStorage
45 try 46 try
46 { 47 {
47 db = Db4oFactory.OpenFile("localworld.yap"); 48 db = Db4oFactory.OpenFile("localworld.yap");
48 ServerConsole.MainConsole.Instance.WriteLine("Db4LocalStorage creation"); 49 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage creation");
49 } 50 }
50 catch(Exception e) 51 catch(Exception e)
51 { 52 {
52 db.Close(); 53 db.Close();
53 ServerConsole.MainConsole.Instance.WriteLine("Db4LocalStorage :Constructor - Exception occured"); 54 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage :Constructor - Exception occured");
54 ServerConsole.MainConsole.Instance.WriteLine(e.ToString()); 55 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.ToString());
55 } 56 }
56 } 57 }
57 58
@@ -84,6 +85,7 @@ namespace Db4LocalStorage
84 found.ProfileHollow = prim.ProfileHollow; 85 found.ProfileHollow = prim.ProfileHollow;
85 found.Position = prim.Position; 86 found.Position = prim.Position;
86 found.Rotation = prim.Rotation; 87 found.Rotation = prim.Rotation;
88 found.Texture = prim.Texture;
87 db.Set(found); 89 db.Set(found);
88 db.Commit(); 90 db.Commit();
89 } 91 }
@@ -109,7 +111,7 @@ namespace Db4LocalStorage
109 public void LoadPrimitives(ILocalStorageReceiver receiver) 111 public void LoadPrimitives(ILocalStorageReceiver receiver)
110 { 112 {
111 IObjectSet result = db.Get(typeof(PrimData)); 113 IObjectSet result = db.Get(typeof(PrimData));
112 ServerConsole.MainConsole.Instance.WriteLine("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count); 114 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count);
113 foreach (PrimData prim in result) { 115 foreach (PrimData prim in result) {
114 receiver.PrimFromStorage(prim); 116 receiver.PrimFromStorage(prim);
115 } 117 }
@@ -121,19 +123,4 @@ namespace Db4LocalStorage
121 db.Close(); 123 db.Close();
122 } 124 }
123 } 125 }
124
125 public class UUIDQuery : Predicate
126 {
127 private LLUUID _findID;
128
129 public UUIDQuery(LLUUID find)
130 {
131 _findID = find;
132 }
133 public bool Match(PrimData prim)
134 {
135 return (prim.FullID == _findID);
136 }
137 }
138
139} 126}
diff --git a/src/AssemblyInfo.cs b/src/AssemblyInfo.cs
deleted file mode 100644
index b88eb75..0000000
--- a/src/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5//------------------------------------------------------------------------------
6// <auto-generated>
7// This code was generated by a tool.
8// Runtime Version:2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </auto-generated>
13//------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.0.0.1")]
18[assembly: AssemblyTitleAttribute("opensim")]
19[assembly: AssemblyDescriptionAttribute("The C# implementation of the simulator portion of OGS")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/Assets/AssetCache.cs b/src/Assets/AssetCache.cs
deleted file mode 100644
index d35b482..0000000
--- a/src/Assets/AssetCache.cs
+++ /dev/null
@@ -1,436 +0,0 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using System;
29using System.Collections.Generic;
30using System.Threading;
31using libsecondlife;
32using libsecondlife.Packets;
33using OpenSim;
34using OpenSim.GridServers;
35
36namespace OpenSim.Assets
37{
38 /// <summary>
39 /// Manages local cache of assets and their sending to viewers.
40 /// </summary>
41 public class AssetCache : IAssetReceiver
42 {
43 public Dictionary<libsecondlife.LLUUID, AssetInfo> Assets;
44 public Dictionary<libsecondlife.LLUUID, TextureImage> Textures;
45
46 public List<AssetRequest> AssetRequests = new List<AssetRequest>(); //assets ready to be sent to viewers
47 public List<AssetRequest> TextureRequests = new List<AssetRequest>(); //textures ready to be sent
48
49 public Dictionary<LLUUID, AssetRequest> RequestedAssets = new Dictionary<LLUUID, AssetRequest>(); //Assets requested from the asset server
50 public Dictionary<LLUUID, AssetRequest> RequestedTextures = new Dictionary<LLUUID, AssetRequest>(); //Textures requested from the asset server
51
52 private IAssetServer _assetServer;
53 private Thread _assetCacheThread;
54
55 /// <summary>
56 ///
57 /// </summary>
58 public AssetCache( IAssetServer assetServer)
59 {
60 _assetServer = assetServer;
61 _assetServer.SetReceiver(this);
62 Assets = new Dictionary<libsecondlife.LLUUID, AssetInfo> ();
63 Textures = new Dictionary<libsecondlife.LLUUID, TextureImage> ();
64 this._assetCacheThread = new Thread( new ThreadStart(RunAssetManager));
65 this._assetCacheThread.IsBackground = true;
66 this._assetCacheThread.Start();
67 }
68
69 /// <summary>
70 ///
71 /// </summary>
72 private void RunAssetManager()
73 {
74 this.ProcessAssetQueue();
75 this.ProcessTextureQueue();
76 Thread.Sleep(100);
77 }
78
79 /// <summary>
80 ///
81 /// </summary>
82 private void ProcessTextureQueue()
83 {
84 if(this.TextureRequests.Count == 0)
85 {
86 //no requests waiting
87 return;
88 }
89 int num;
90
91 if(this.TextureRequests.Count < 5)
92 {
93 //lower than 5 so do all of them
94 num = this.TextureRequests.Count;
95 }
96 else
97 {
98 num=5;
99 }
100 AssetRequest req;
101 for(int i = 0; i < num; i++)
102 {
103 req=(AssetRequest)this.TextureRequests[i];
104
105 if(req.PacketCounter == 0)
106 {
107 //first time for this request so send imagedata packet
108 if(req.NumPackets == 1)
109 {
110 //only one packet so send whole file
111 ImageDataPacket im = new ImageDataPacket();
112 im.ImageID.Packets = 1;
113 im.ImageID.ID = req.ImageInfo.FullID;
114 im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
115 im.ImageData.Data = req.ImageInfo.Data;
116 im.ImageID.Codec = 2;
117 req.RequestUser.OutPacket(im);
118 req.PacketCounter++;
119 //req.ImageInfo.l= time;
120 //System.Console.WriteLine("sent texture: "+req.image_info.FullID);
121 }
122 else
123 {
124 //more than one packet so split file up
125 ImageDataPacket im = new ImageDataPacket();
126 im.ImageID.Packets = (ushort)req.NumPackets;
127 im.ImageID.ID = req.ImageInfo.FullID;
128 im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
129 im.ImageData.Data = new byte[600];
130 Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600);
131 im.ImageID.Codec = 2;
132 req.RequestUser.OutPacket(im);
133 req.PacketCounter++;
134 //req.ImageInfo.last_used = time;
135 //System.Console.WriteLine("sent first packet of texture:
136 }
137 }
138 else
139 {
140 //send imagepacket
141 //more than one packet so split file up
142 ImagePacketPacket im = new ImagePacketPacket();
143 im.ImageID.Packet = (ushort)req.PacketCounter;
144 im.ImageID.ID = req.ImageInfo.FullID;
145 int size = req.ImageInfo.Data.Length - 600 - 1000*(req.PacketCounter - 1);
146 if(size > 1000) size = 1000;
147 im.ImageData.Data = new byte[size];
148 Array.Copy(req.ImageInfo.Data, 600 + 1000*(req.PacketCounter - 1), im.ImageData.Data, 0, size);
149 req.RequestUser.OutPacket(im);
150 req.PacketCounter++;
151 //req.ImageInfo.last_used = time;
152 //System.Console.WriteLine("sent a packet of texture: "+req.image_info.FullID);
153 }
154 }
155
156 //remove requests that have been completed
157 int count = 0;
158 for(int i = 0; i < num; i++)
159 {
160 req=(AssetRequest)this.TextureRequests[count];
161 if(req.PacketCounter == req.NumPackets)
162 {
163 this.TextureRequests.Remove(req);
164 }
165 else
166 {
167 count++;
168 }
169 }
170
171 }
172 public void AssetReceived(AssetBase asset, bool IsTexture)
173 {
174 //check if it is a texture or not
175 //then add to the correct cache list
176 //then check for waiting requests for this asset/texture (in the Requested lists)
177 //and move those requests into the Requests list.
178 if(IsTexture)
179 {
180 TextureImage image = new TextureImage(asset);
181 this.Textures.Add(image.FullID, image);
182 if(this.RequestedTextures.ContainsKey(image.FullID))
183 {
184 AssetRequest req = this.RequestedTextures[image.FullID];
185 req.ImageInfo = image;
186 this.RequestedTextures.Remove(image.FullID);
187 this.TextureRequests.Add(req);
188 }
189 }
190 else
191 {
192 AssetInfo assetInf = new AssetInfo(asset);
193 this.Assets.Add(assetInf.FullID, assetInf);
194 if(this.RequestedAssets.ContainsKey(assetInf.FullID))
195 {
196 AssetRequest req = this.RequestedAssets[assetInf.FullID];
197 req.AssetInf = assetInf;
198 this.RequestedAssets.Remove(assetInf.FullID);
199 this.AssetRequests.Add(req);
200 }
201 }
202 }
203
204 public void AssetNotFound(AssetBase asset)
205 {
206 //the asset server had no knowledge of requested asset
207
208 }
209
210 #region Assets
211 /// <summary>
212 ///
213 /// </summary>
214 /// <param name="userInfo"></param>
215 /// <param name="transferRequest"></param>
216 public void AddAssetRequest(OpenSimClient userInfo, TransferRequestPacket transferRequest)
217 {
218 LLUUID requestID = new LLUUID(transferRequest.TransferInfo.Params, 0);
219 //check to see if asset is in local cache, if not we need to request it from asset server.
220 if(!this.Assets.ContainsKey(requestID))
221 {
222 //not found asset
223 // so request from asset server
224 AssetRequest request = new AssetRequest();
225 request.RequestUser = userInfo;
226 request.RequestAssetID = requestID;
227 request.TransferRequestID = transferRequest.TransferInfo.TransferID;
228 this.RequestedAssets.Add(requestID,request);
229 this._assetServer.RequestAsset(requestID, false);
230 return;
231 }
232 //it is in our cache
233 AssetInfo asset = this.Assets[requestID];
234
235 //work out how many packets it should be sent in
236 // and add to the AssetRequests list
237 AssetRequest req = new AssetRequest();
238 req.RequestUser = userInfo;
239 req.RequestAssetID = requestID;
240 req.TransferRequestID = transferRequest.TransferInfo.TransferID;
241 req.AssetInf = asset;
242
243 if(asset.Data.LongLength>600)
244 {
245 //over 600 bytes so split up file
246 req.NumPackets = 1 + (int)(asset.Data.Length-600+999)/1000;
247 }
248 else
249 {
250 req.NumPackets = 1;
251 }
252
253 this.AssetRequests.Add(req);
254 }
255
256 /// <summary>
257 ///
258 /// </summary>
259 private void ProcessAssetQueue()
260 {
261 if(this.AssetRequests.Count == 0)
262 {
263 //no requests waiting
264 return;
265 }
266 int num;
267
268 if(this.AssetRequests.Count < 5)
269 {
270 //lower than 5 so do all of them
271 num = this.AssetRequests.Count;
272 }
273 else
274 {
275 num=5;
276 }
277 AssetRequest req;
278 for(int i = 0; i < num; i++)
279 {
280 req=(AssetRequest)this.AssetRequests[i];
281
282 TransferInfoPacket Transfer = new TransferInfoPacket();
283 Transfer.TransferInfo.ChannelType = 2;
284 Transfer.TransferInfo.Status = 0;
285 Transfer.TransferInfo.TargetType = 0;
286 Transfer.TransferInfo.Params = req.RequestAssetID.GetBytes();
287 Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length;
288 Transfer.TransferInfo.TransferID = req.TransferRequestID;
289 req.RequestUser.OutPacket(Transfer);
290
291 if(req.NumPackets == 1)
292 {
293 TransferPacketPacket TransferPacket = new TransferPacketPacket();
294 TransferPacket.TransferData.Packet = 0;
295 TransferPacket.TransferData.ChannelType = 2;
296 TransferPacket.TransferData.TransferID=req.TransferRequestID;
297 TransferPacket.TransferData.Data = req.AssetInf.Data;
298 TransferPacket.TransferData.Status = 1;
299 req.RequestUser.OutPacket(TransferPacket);
300 }
301 else
302 {
303 //more than one packet so split file up , for now it can't be bigger than 2000 bytes
304 TransferPacketPacket TransferPacket = new TransferPacketPacket();
305 TransferPacket.TransferData.Packet = 0;
306 TransferPacket.TransferData.ChannelType = 2;
307 TransferPacket.TransferData.TransferID=req.TransferRequestID;
308 byte[] chunk = new byte[1000];
309 Array.Copy(req.AssetInf.Data,chunk,1000);
310 TransferPacket.TransferData.Data = chunk;
311 TransferPacket.TransferData.Status = 0;
312 req.RequestUser.OutPacket(TransferPacket);
313
314 TransferPacket = new TransferPacketPacket();
315 TransferPacket.TransferData.Packet = 1;
316 TransferPacket.TransferData.ChannelType = 2;
317 TransferPacket.TransferData.TransferID = req.TransferRequestID;
318 byte[] chunk1 = new byte[(req.AssetInf.Data.Length-1000)];
319 Array.Copy(req.AssetInf.Data, 1000, chunk1, 0, chunk1.Length);
320 TransferPacket.TransferData.Data = chunk1;
321 TransferPacket.TransferData.Status = 1;
322 req.RequestUser.OutPacket(TransferPacket);
323 }
324
325 }
326
327 //remove requests that have been completed
328 for(int i = 0; i < num; i++)
329 {
330 this.AssetRequests.RemoveAt(0);
331 }
332
333 }
334
335 #endregion
336
337 #region Textures
338 /// <summary>
339 ///
340 /// </summary>
341 /// <param name="userInfo"></param>
342 /// <param name="imageID"></param>
343 public void AddTextureRequest(OpenSimClient userInfo, LLUUID imageID)
344 {
345 //check to see if texture is in local cache, if not request from asset server
346 if(!this.Textures.ContainsKey(imageID))
347 {
348 //not is cache so request from asset server
349 AssetRequest request = new AssetRequest();
350 request.RequestUser = userInfo;
351 request.RequestAssetID = imageID;
352 request.IsTextureRequest = true;
353 this.RequestedTextures.Add(imageID, request);
354 this._assetServer.RequestAsset(imageID, true);
355 return;
356 }
357 TextureImage imag = this.Textures[imageID];
358 AssetRequest req = new AssetRequest();
359 req.RequestUser = userInfo;
360 req.RequestAssetID = imageID;
361 req.IsTextureRequest = true;
362 req.ImageInfo = imag;
363
364 if(imag.Data.LongLength>600)
365 {
366 //over 600 bytes so split up file
367 req.NumPackets = 1 + (int)(imag.Data.Length-600+999)/1000;
368 }
369 else
370 {
371 req.NumPackets = 1;
372 }
373
374 this.TextureRequests.Add(req);
375 }
376 #endregion
377
378 }
379
380 public class AssetRequest
381 {
382 public OpenSimClient RequestUser;
383 public LLUUID RequestAssetID;
384 public AssetInfo AssetInf;
385 public TextureImage ImageInfo;
386 public LLUUID TransferRequestID;
387 public long DataPointer = 0;
388 public int NumPackets = 0;
389 public int PacketCounter = 0;
390 public bool IsTextureRequest;
391 //public bool AssetInCache;
392 //public int TimeRequested;
393
394 public AssetRequest()
395 {
396
397 }
398 }
399
400 public class AssetInfo : AssetBase
401 {
402 public AssetInfo()
403 {
404
405 }
406
407 public AssetInfo(AssetBase aBase)
408 {
409 Data= aBase.Data;
410 FullID = aBase.FullID;
411 Type = aBase.Type;
412 InvType = aBase.InvType;
413 Name= aBase.Name;
414 Description = aBase.Description;
415 }
416 }
417
418 public class TextureImage : AssetBase
419 {
420 public TextureImage()
421 {
422
423 }
424
425 public TextureImage(AssetBase aBase)
426 {
427 Data= aBase.Data;
428 FullID = aBase.FullID;
429 Type = aBase.Type;
430 InvType = aBase.InvType;
431 Name= aBase.Name;
432 Description = aBase.Description;
433 }
434 }
435
436}
diff --git a/src/CAPS/SimHttp.cs b/src/CAPS/SimHttp.cs
deleted file mode 100644
index c0373de..0000000
--- a/src/CAPS/SimHttp.cs
+++ /dev/null
@@ -1,165 +0,0 @@
1/*
2Copyright (c) OpenSimCAPS project, http://osgrid.org/
3
4
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.Text;
32using Nwc.XmlRpc;
33using System.Threading;
34using System.Text.RegularExpressions;
35using System.Net;
36using System.IO;
37using System.Collections;
38using System.Collections.Generic;
39using libsecondlife;
40using ServerConsole;
41using OpenSim.GridServers;
42
43namespace OpenSim
44{
45 // Dummy HTTP server, does nothing useful for now
46
47 public class SimCAPSHTTPServer {
48 public Thread HTTPD;
49 public HttpListener Listener;
50
51 public SimCAPSHTTPServer() {
52 ServerConsole.MainConsole.Instance.WriteLine("Starting up HTTP Server");
53 HTTPD = new Thread(new ThreadStart(StartHTTP));
54 HTTPD.Start();
55 }
56
57 public void StartHTTP() {
58 try
59 {
60 ServerConsole.MainConsole.Instance.WriteLine("SimHttp.cs:StartHTTP() - Spawned main thread OK");
61 Listener = new HttpListener();
62
63 Listener.Prefixes.Add("http://+:" + OpenSim_Main.cfg.IPListenPort + "/");
64 Listener.Start();
65
66 HttpListenerContext context;
67 while(true) {
68 context = Listener.GetContext();
69 ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context);
70 }
71 }
72 catch (Exception e)
73 {
74 ServerConsole.MainConsole.Instance.WriteLine(e.Message);
75 }
76 }
77
78 static string ParseXMLRPC(string requestBody) {
79 try
80 {
81 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
82
83 Hashtable requestData = (Hashtable)request.Params[0];
84 switch(request.MethodName) {
85 case "expect_user":
86 GridServers.agentcircuitdata agent_data = new GridServers.agentcircuitdata();
87 agent_data.SessionID = new LLUUID((string)requestData["session_id"]);
88 agent_data.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
89 agent_data.firstname = (string)requestData["firstname"];
90 agent_data.lastname = (string)requestData["lastname"];
91 agent_data.AgentID = new LLUUID((string)requestData["agent_id"]);
92 agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
93 if (OpenSim_Main.gridServers.GridServer.GetName() == "Remote")
94 {
95 ((RemoteGridBase) OpenSim_Main.gridServers.GridServer).agentcircuits.Add((uint)agent_data.circuitcode,agent_data);
96 }
97 return "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>";
98 break;
99 }
100 }
101 catch(Exception e)
102 {
103 Console.WriteLine(e.ToString());
104 }
105 return "";
106 }
107
108 static string ParseREST(string requestBody, string requestURL) {
109 return "";
110 }
111
112 static string ParseLLSDXML(string requestBody) {
113 // dummy function for now - IMPLEMENT ME!
114 return "";
115 }
116
117 static void HandleRequest(Object stateinfo) {
118 HttpListenerContext context=(HttpListenerContext)stateinfo;
119
120 HttpListenerRequest request = context.Request;
121 HttpListenerResponse response = context.Response;
122
123 response.KeepAlive=false;
124 response.SendChunked=false;
125
126 System.IO.Stream body = request.InputStream;
127 System.Text.Encoding encoding = System.Text.Encoding.UTF8;
128 System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding);
129
130 string requestBody = reader.ReadToEnd();
131 body.Close();
132 reader.Close();
133
134 string responseString="";
135 switch(request.ContentType) {
136 case "text/xml":
137 // must be XML-RPC, so pass to the XML-RPC parser
138
139 responseString=ParseXMLRPC(requestBody);
140 response.AddHeader("Content-type","text/xml");
141 break;
142
143 case "application/xml":
144 // probably LLSD we hope, otherwise it should be ignored by the parser
145 responseString=ParseLLSDXML(requestBody);
146 response.AddHeader("Content-type","application/xml");
147 break;
148
149 case null:
150 // must be REST or invalid crap, so pass to the REST parser
151 responseString=ParseREST(request.Url.OriginalString,requestBody);
152 break;
153 }
154
155 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
156 System.IO.Stream output = response.OutputStream;
157 response.SendChunked=false;
158 response.ContentLength64=buffer.Length;
159 output.Write(buffer,0,buffer.Length);
160 output.Close();
161 }
162 }
163
164
165}
diff --git a/src/Config/SimConfig/AssemblyInfo.cs b/src/Config/SimConfig/AssemblyInfo.cs
deleted file mode 100644
index 7fabd63..0000000
--- a/src/Config/SimConfig/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5// ------------------------------------------------------------------------------
6// <autogenerated>
7// This code was generated by a tool.
8// Mono Runtime Version: 2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </autogenerated>
13// ------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.1.0.240")]
18[assembly: AssemblyTitleAttribute("opensim-simconfig")]
19[assembly: AssemblyDescriptionAttribute("The default configuration handler")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/Config/SimConfig/Db4SimConfig.cs b/src/Config/SimConfig/Db4SimConfig.cs
deleted file mode 100644
index 1b696fe..0000000
--- a/src/Config/SimConfig/Db4SimConfig.cs
+++ /dev/null
@@ -1,177 +0,0 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections.Generic;
29using OpenSim;
30using OpenSim.world;
31using Db4objects.Db4o;
32
33namespace Db40SimConfig
34{
35 public class Db40ConfigPlugin: ISimConfig
36 {
37 public SimConfig GetConfigObject()
38 {
39 ServerConsole.MainConsole.Instance.WriteLine("Loading Db40Config dll");
40 return ( new DbSimConfig());
41 }
42 }
43
44 public class DbSimConfig :SimConfig
45 {
46 private IObjectContainer db;
47
48 public void LoadDefaults() {
49 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings");
50
51 this.RegionName=ServerConsole.MainConsole.Instance.CmdPrompt("Name [OpenSim test]: ","OpenSim test");
52 this.RegionLocX=(uint)Convert.ToInt32(ServerConsole.MainConsole.Instance.CmdPrompt("Grid Location X [997]: ","997"));
53 this.RegionLocY=(uint)Convert.ToInt32(ServerConsole.MainConsole.Instance.CmdPrompt("Grid Location Y [996]: ","996"));
54 this.IPListenPort=Convert.ToInt32(ServerConsole.MainConsole.Instance.CmdPrompt("UDP port for client connections [9000]: ","9000"));
55 this.IPListenAddr=ServerConsole.MainConsole.Instance.CmdPrompt("IP Address to listen on for client connections [127.0.0.1]: ","127.0.0.1");
56
57 if(!OpenSim_Main.sim.sandbox)
58 {
59 this.AssetURL=ServerConsole.MainConsole.Instance.CmdPrompt("Asset server URL: ");
60 this.AssetSendKey=ServerConsole.MainConsole.Instance.CmdPrompt("Asset server key: ");
61 this.GridURL=ServerConsole.MainConsole.Instance.CmdPrompt("Grid server URL: ");
62 this.GridSendKey=ServerConsole.MainConsole.Instance.CmdPrompt("Key to send to grid server: ");
63 this.GridRecvKey=ServerConsole.MainConsole.Instance.CmdPrompt("Key to expect from grid server: ");
64 this.UserURL=ServerConsole.MainConsole.Instance.CmdPrompt("User server URL: ");
65 this.UserSendKey=ServerConsole.MainConsole.Instance.CmdPrompt("Key to send to user server: ");
66 this.UserRecvKey=ServerConsole.MainConsole.Instance.CmdPrompt("Key to expect from user server: ");
67 }
68 this.RegionHandle = Util.UIntsToLong((RegionLocX*256), (RegionLocY*256));
69 }
70
71 public override void InitConfig() {
72 try {
73 db = Db4oFactory.OpenFile("opensim.yap");
74 IObjectSet result = db.Get(typeof(DbSimConfig));
75 if(result.Count==1) {
76 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:InitConfig() - Found a SimConfig object in the local database, loading");
77 foreach (DbSimConfig cfg in result) {
78 this.RegionName = cfg.RegionName;
79 this.RegionLocX = cfg.RegionLocX;
80 this.RegionLocY = cfg.RegionLocY;
81 this.RegionHandle = Util.UIntsToLong((RegionLocX*256), (RegionLocY*256));
82 this.IPListenPort = cfg.IPListenPort;
83 this.IPListenAddr = cfg.IPListenAddr;
84 this.AssetURL = cfg.AssetURL;
85 this.AssetSendKey = cfg.AssetSendKey;
86 this.GridURL = cfg.GridURL;
87 this.GridSendKey = cfg.GridSendKey;
88 }
89 } else {
90 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults");
91 LoadDefaults();
92 ServerConsole.MainConsole.Instance.WriteLine("Writing out default settings to local database");
93 db.Set(this);
94 }
95 } catch(Exception e) {
96 db.Close();
97 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:InitConfig() - Exception occured");
98 ServerConsole.MainConsole.Instance.WriteLine(e.ToString());
99 }
100
101 ServerConsole.MainConsole.Instance.WriteLine("Sim settings loaded:");
102 ServerConsole.MainConsole.Instance.WriteLine("Name: " + this.RegionName);
103 ServerConsole.MainConsole.Instance.WriteLine("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]");
104 ServerConsole.MainConsole.Instance.WriteLine("Region Handle: " + this.RegionHandle.ToString());
105 ServerConsole.MainConsole.Instance.WriteLine("Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort);
106 ServerConsole.MainConsole.Instance.WriteLine("Sandbox Mode? " + OpenSim_Main.sim.sandbox.ToString());
107 ServerConsole.MainConsole.Instance.WriteLine("Asset URL: " + this.AssetURL);
108 ServerConsole.MainConsole.Instance.WriteLine("Asset key: " + this.AssetSendKey);
109 ServerConsole.MainConsole.Instance.WriteLine("Grid URL: " + this.GridURL);
110 ServerConsole.MainConsole.Instance.WriteLine("Grid key: " + this.GridSendKey);
111 }
112
113 public override World LoadWorld()
114 {
115 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Loading world....");
116 World blank = new World();
117 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Looking for a heightmap in local DB");
118 IObjectSet world_result = db.Get(typeof(MapStorage));
119 if(world_result.Count>0) {
120 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Found a heightmap in local database, loading");
121 MapStorage map=(MapStorage)world_result.Next();
122 blank.LandMap = map.Map;
123 } else {
124 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - No heightmap found, generating new one");
125 HeightmapGenHills hills = new HeightmapGenHills();
126 blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
127 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Saving heightmap to local database");
128 MapStorage map= new MapStorage();
129 map.Map = blank.LandMap;
130 db.Set(map);
131 db.Commit();
132 }
133 return blank;
134 }
135
136 public override void SaveMap()
137 {
138 IObjectSet world_result = db.Get(typeof(MapStorage));
139 if(world_result.Count>0) {
140 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - updating saved copy of heightmap in local database");
141 MapStorage map=(MapStorage)world_result.Next();
142 db.Delete(map);
143 }
144 MapStorage map1= new MapStorage();
145 map1.Map = OpenSim_Main.local_world.LandMap;
146 db.Set(map1);
147 db.Commit();
148 }
149
150 public override void LoadFromGrid() {
151 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadFromGrid() - dummy function, DOING ABSOLUTELY NOTHING AT ALL!!!");
152 // TODO: Make this crap work
153 /* WebRequest GridLogin = WebRequest.Create(this.GridURL + "regions/" + this.RegionHandle.ToString() + "/login");
154 WebResponse GridResponse = GridLogin.GetResponse();
155 byte[] idata = new byte[(int)GridResponse.ContentLength];
156 BinaryReader br = new BinaryReader(GridResponse.GetResponseStream());
157
158 br.Close();
159 GridResponse.Close();
160 */
161 }
162
163 public void Shutdown() {
164 db.Close();
165 }
166 }
167
168 public class MapStorage
169 {
170 public float[] Map;
171
172 public MapStorage()
173 {
174
175 }
176 }
177}
diff --git a/src/Config/SimConfig/SimConfig.csproj b/src/Config/SimConfig/SimConfig.csproj
deleted file mode 100644
index 43e9499..0000000
--- a/src/Config/SimConfig/SimConfig.csproj
+++ /dev/null
@@ -1,52 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <OutputType>Library</OutputType>
4 <RootNamespace>SimConfig</RootNamespace>
5 <AssemblyName>SimConfig</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 <ProjectGuid>{B063760D-DB8D-4F64-B6FE-335FAD1E650A}</ProjectGuid>
9 </PropertyGroup>
10 <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
11 <OutputPath>..\..\..\bin\</OutputPath>
12 <Optimize>False</Optimize>
13 <DefineConstants>DEBUG;TRACE</DefineConstants>
14 <DebugSymbols>True</DebugSymbols>
15 <DebugType>Full</DebugType>
16 <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
17 </PropertyGroup>
18 <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
19 <OutputPath>..\..\..\bin\</OutputPath>
20 <Optimize>True</Optimize>
21 <DefineConstants>TRACE</DefineConstants>
22 <DebugSymbols>False</DebugSymbols>
23 <DebugType>None</DebugType>
24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
25 </PropertyGroup>
26 <ItemGroup>
27 <Reference Include="System" />
28 <Reference Include="System.Xml" />
29 <Reference Include="Db4objects.Db4o">
30 <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
31 <SpecificVersion>False</SpecificVersion>
32 </Reference>
33 </ItemGroup>
34 <ItemGroup>
35 <Compile Include="Db4SimConfig.cs" />
36 </ItemGroup>
37 <ItemGroup>
38 <ProjectReference Include="..\..\ServerConsole\ServerConsole\ServerConsole.csproj">
39 <Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
40 <Name>ServerConsole</Name>
41 </ProjectReference>
42 <ProjectReference Include="..\..\Second-server.csproj">
43 <Project>{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}</Project>
44 <Name>Second-server</Name>
45 </ProjectReference>
46 <ProjectReference Include="..\..\GridInterfaces\GridInterfaces.csproj">
47 <Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
48 <Name>GridInterfaces</Name>
49 </ProjectReference>
50 </ItemGroup>
51 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
52</Project> \ No newline at end of file
diff --git a/src/Config/default.build b/src/Config/default.build
deleted file mode 100644
index 9e13ca6..0000000
--- a/src/Config/default.build
+++ /dev/null
@@ -1,53 +0,0 @@
1<?xml version="1.0"?>
2 <project name="OpenSim" default="build" basedir=".">
3 <description>nant buildfile for OpenSim</description>
4 <property name="debug" value="true" overwrite="false" />
5 <target name="clean" description="remove all generated files">
6 <delete file="../bin/SimConfig.dll" failonerror="false" />
7 </target>
8
9 <target name="svnupdate" description="updates to latest SVN">
10 <exec program="svn">
11 <arg value="update" />
12 </exec>
13 </target>
14
15 <target name="upgrade" description="updates from SVN and then builds" depends="clean,svnupdate,build">
16
17 </target>
18
19 <target name="build" description="compiles the source code">
20
21 <loadfile file="../../VERSION" property="svnver"/>
22 <asminfo output="SimConfig/AssemblyInfo.cs" language="CSharp">
23 <imports>
24 <import namespace="System" />
25 <import namespace="System.Reflection" />
26 <import namespace="System.Runtime.InteropServices" />
27 </imports>
28 <attributes>
29 <attribute type="ComVisibleAttribute" value="false" />
30 <attribute type="CLSCompliantAttribute" value="false" />
31 <attribute type="AssemblyVersionAttribute" value="${svnver}" />
32 <attribute type="AssemblyTitleAttribute" value="opensim-simconfig" />
33 <attribute type="AssemblyDescriptionAttribute" value="The default configuration handler" />
34 <attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
35 </attributes>
36 </asminfo>
37
38 <csc target="library" output="../../bin/SimConfig.dll" debug="${debug}" verbose="true" warninglevel="4">
39 <references basedir="../../bin/" failonempty="true">
40 <include name="System.dll" />
41 <include name="System.Data.dll" />
42 <include name="System.Xml.dll" />
43 <include name="ServerConsole.dll" />
44 <include name="GridInterfaces.dll" />
45 <include name="OpenSim.exe" />
46 <include name="Db4objects.Db4o.dll" />
47 </references>
48 <sources basedir="SimConfig/">
49 <include name="*.cs" />
50 </sources>
51 </csc>
52 </target>
53</project>
diff --git a/src/GridInterfaces/AssemblyInfo.cs b/src/GridInterfaces/AssemblyInfo.cs
deleted file mode 100644
index 32f1380..0000000
--- a/src/GridInterfaces/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5// ------------------------------------------------------------------------------
6// <autogenerated>
7// This code was generated by a tool.
8// Mono Runtime Version: 2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </autogenerated>
13// ------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.1.0.240")]
18[assembly: AssemblyTitleAttribute("opensim-gridinterfaces")]
19[assembly: AssemblyDescriptionAttribute("Definitions for OGS interface")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/GridInterfaces/GridInterfaces.csproj b/src/GridInterfaces/GridInterfaces.csproj
deleted file mode 100644
index 197994f..0000000
--- a/src/GridInterfaces/GridInterfaces.csproj
+++ /dev/null
@@ -1,40 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <OutputType>Library</OutputType>
4 <RootNamespace>GridInterfaces</RootNamespace>
5 <AssemblyName>GridInterfaces</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 <ProjectGuid>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</ProjectGuid>
9 </PropertyGroup>
10 <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
11 <OutputPath>bin\Debug\</OutputPath>
12 <Optimize>False</Optimize>
13 <DefineConstants>DEBUG;TRACE</DefineConstants>
14 <DebugSymbols>True</DebugSymbols>
15 <DebugType>Full</DebugType>
16 <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
17 </PropertyGroup>
18 <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
19 <OutputPath>bin\Release\</OutputPath>
20 <Optimize>True</Optimize>
21 <DefineConstants>TRACE</DefineConstants>
22 <DebugSymbols>False</DebugSymbols>
23 <DebugType>None</DebugType>
24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
25 </PropertyGroup>
26 <ItemGroup>
27 <Reference Include="System" />
28 <Reference Include="System.Xml" />
29 <Reference Include="libsecondlife">
30 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
31 <SpecificVersion>False</SpecificVersion>
32 </Reference>
33 </ItemGroup>
34 <ItemGroup>
35 <Compile Include="IAssetServer.cs" />
36 <Compile Include="IGridServer.cs" />
37 <Compile Include="ILocalStorage.cs" />
38 </ItemGroup>
39 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
40</Project> \ No newline at end of file
diff --git a/src/GridInterfaces/IGridServer.cs b/src/GridInterfaces/IGridServer.cs
deleted file mode 100644
index dcb8ef2..0000000
--- a/src/GridInterfaces/IGridServer.cs
+++ /dev/null
@@ -1,145 +0,0 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28
29using System;
30using System.Collections.Generic;
31using System.Net;
32using System.Net.Sockets;
33using System.IO;
34using libsecondlife;
35using OpenSim;
36
37namespace OpenSim.GridServers
38{
39 /// <summary>
40 /// Handles connection to Grid Servers.
41 /// also Sim to Sim connections?
42 /// </summary>
43
44
45
46
47 public interface IGridServer
48 {
49 UUIDBlock RequestUUIDBlock();
50 neighbourinfo[] RequestNeighbours(ulong regionhandle); //should return a array of neighbouring regions
51 AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
52 bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
53 string GetName();
54 bool RequestConnection();
55 void SetServerInfo(string GridServerUrl, string GridSendKey, string GridRecvKey, string UserServerUrl, string UserSendKey, string UserRecvKey);
56 }
57
58 public abstract class RemoteGridBase : IGridServer
59 {
60 public abstract Dictionary<uint, agentcircuitdata> agentcircuits {
61 get;
62 set;
63 }
64
65 public abstract UUIDBlock RequestUUIDBlock();
66 public abstract neighbourinfo[] RequestNeighbours(ulong regionhandle);
67 public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
68 public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
69 public abstract string GetName();
70 public abstract bool RequestConnection();
71 public abstract void SetServerInfo(string GridServerUrl, string GridSendKey, string GridRecvKey, string UserServerUrl, string UserSendKey, string UserRecvKey);
72 }
73
74 public abstract class LocalGridBase : IGridServer
75 {
76 public abstract UUIDBlock RequestUUIDBlock();
77 public abstract neighbourinfo[] RequestNeighbours(ulong regionhandle);
78 public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
79 public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
80 public abstract string GetName();
81 public abstract bool RequestConnection();
82 public abstract void SetServerInfo(string GridServerUrl, string GridSendKey, string GridRecvKey, string UserServerUrl, string UserSendKey, string UserRecvKey);
83 public abstract void AddNewSession(Login session);
84 }
85
86 public struct UUIDBlock
87 {
88 public LLUUID BlockStart;
89 public LLUUID BlockEnd;
90 }
91
92 public class AuthenticateResponse
93 {
94 public bool Authorised;
95 public Login LoginInfo;
96
97 public AuthenticateResponse()
98 {
99
100 }
101
102 }
103
104 public class Login
105 {
106 public string First = "Test";
107 public string Last = "User";
108 public LLUUID Agent;
109 public LLUUID Session;
110 public LLUUID InventoryFolder;
111 public LLUUID BaseFolder;
112 public Login()
113 {
114
115 }
116 }
117
118 public interface IGridPlugin
119 {
120 IGridServer GetGridServer();
121 }
122
123 public class agentcircuitdata
124 {
125 public agentcircuitdata() { }
126 public LLUUID AgentID;
127 public LLUUID SessionID;
128 public LLUUID SecureSessionID;
129 public string firstname;
130 public string lastname;
131 public uint circuitcode;
132 public bool child_agent;
133 }
134
135 public class neighbourinfo
136 {
137 public neighbourinfo() { }
138 public ulong regionhandle;
139 public uint RegionLocX;
140 public uint RegionLocY;
141 public string sim_ip;
142 public uint sim_port;
143 }
144
145}
diff --git a/src/GridInterfaces/default.build b/src/GridInterfaces/default.build
deleted file mode 100644
index dd02448..0000000
--- a/src/GridInterfaces/default.build
+++ /dev/null
@@ -1,50 +0,0 @@
1<?xml version="1.0"?>
2 <project name="OpenSim" default="build" basedir=".">
3 <description>nant buildfile for OpenSim</description>
4 <property name="debug" value="true" overwrite="false" />
5 <target name="clean" description="remove all generated files">
6 <delete file="../../bin/GridInterfaces.dll" failonerror="false" />
7 </target>
8
9 <target name="svnupdate" description="updates to latest SVN">
10 <exec program="svn">
11 <arg value="update" />
12 </exec>
13 </target>
14
15 <target name="upgrade" description="updates from SVN and then builds" depends="clean,svnupdate,build">
16
17 </target>
18
19 <target name="build" description="compiles the source code">
20
21 <loadfile file="../../VERSION" property="svnver"/>
22 <asminfo output="AssemblyInfo.cs" language="CSharp">
23 <imports>
24 <import namespace="System" />
25 <import namespace="System.Reflection" />
26 <import namespace="System.Runtime.InteropServices" />
27 </imports>
28 <attributes>
29 <attribute type="ComVisibleAttribute" value="false" />
30 <attribute type="CLSCompliantAttribute" value="false" />
31 <attribute type="AssemblyVersionAttribute" value="${svnver}" />
32 <attribute type="AssemblyTitleAttribute" value="opensim-gridinterfaces" />
33 <attribute type="AssemblyDescriptionAttribute" value="Definitions for OGS interface" />
34 <attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
35 </attributes>
36 </asminfo>
37
38 <csc target="library" output="../../bin/GridInterfaces.dll" debug="${debug}" verbose="true" warninglevel="4">
39 <references basedir="../../bin" failonempty="true">
40 <include name="System.dll" />
41 <include name="System.Xml.dll" />
42 <include name="OpenSim.Framework.dll" />
43 <include name="libsecondlife.dll" />
44 </references>
45 <sources basedir="./">
46 <include name="*.cs" />
47 </sources>
48 </csc>
49 </target>
50</project>
diff --git a/src/GridServers/LoginServer.cs b/src/GridServers/LoginServer.cs
deleted file mode 100644
index dbf211d..0000000
--- a/src/GridServers/LoginServer.cs
+++ /dev/null
@@ -1,350 +0,0 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using Nwc.XmlRpc;
29using System;
30using System.IO;
31using System.Net;
32using System.Net.Sockets;
33using System.Text;
34using System.Text.RegularExpressions;
35using System.Threading;
36using System.Collections;
37using System.Security.Cryptography;
38using System.Xml;
39using libsecondlife;
40using OpenSim;
41using OpenSim.Framework;
42
43namespace OpenSim.GridServers
44{
45
46 /// <summary>
47 /// When running in local (default) mode , handles client logins.
48 /// </summary>
49 public class LoginServer : LoginService
50 {
51 public LoginServer(IGridServer gridServer)
52 {
53 _gridServer = gridServer;
54 }
55
56 private IGridServer _gridServer;
57 private ushort _loginPort = 8080;
58 public IPAddress clientAddress = IPAddress.Loopback;
59 public IPAddress remoteAddress = IPAddress.Any;
60 private Socket loginServer;
61 private int NumClients;
62 private string _defaultResponse;
63
64 private string _mpasswd;
65 private bool _needPasswd=false;
66
67 // InitializeLogin: initialize the login
68 private void InitializeLogin() {
69 loginServer = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
70 loginServer.Bind(new IPEndPoint(remoteAddress, _loginPort));
71 loginServer.Listen(1);
72
73 this._needPasswd=false;
74 //read in default response string
75 StreamReader SR;
76 string lines;
77 SR=File.OpenText("new-login.dat");
78
79 //lines=SR.ReadLine();
80
81 while(!SR.EndOfStream)
82 {
83 lines = SR.ReadLine();
84 _defaultResponse += lines;
85 //lines = SR.ReadLine();
86 }
87 SR.Close();
88 this._mpasswd = EncodePassword("testpass");
89 }
90
91 public void Startup()
92 {
93 this.InitializeLogin();
94 Thread runLoginProxy = new Thread(new ThreadStart(RunLogin));
95 runLoginProxy.IsBackground = true;
96 runLoginProxy.Start();
97 }
98
99 private void RunLogin()
100 {
101 Console.WriteLine("Starting Login Server");
102 try
103 {
104 for (;;)
105 {
106 Socket client = loginServer.Accept();
107 IPEndPoint clientEndPoint = (IPEndPoint)client.RemoteEndPoint;
108
109
110 NetworkStream networkStream = new NetworkStream(client);
111 StreamReader networkReader = new StreamReader(networkStream);
112 StreamWriter networkWriter = new StreamWriter(networkStream);
113
114 try
115 {
116 LoginRequest(networkReader, networkWriter);
117 }
118 catch (Exception e)
119 {
120 Console.WriteLine(e.Message);
121 }
122
123 networkWriter.Close();
124 networkReader.Close();
125 networkStream.Close();
126
127 client.Close();
128
129 // send any packets queued for injection
130
131 }
132 }
133 catch (Exception e)
134 {
135 Console.WriteLine(e.Message);
136 Console.WriteLine(e.StackTrace);
137 }
138 }
139
140 // ProxyLogin: proxy a login request
141 private void LoginRequest(StreamReader reader, StreamWriter writer)
142 {
143 lock(this)
144 {
145 string line;
146 int contentLength = 0;
147 // read HTTP header
148 do
149 {
150 // read one line of the header
151 line = reader.ReadLine();
152
153 // check for premature EOF
154 if (line == null)
155 throw new Exception("EOF in client HTTP header");
156
157 // look for Content-Length
158 Match match = (new Regex(@"Content-Length: (\d+)$")).Match(line);
159 if (match.Success)
160 contentLength = Convert.ToInt32(match.Groups[1].Captures[0].ToString());
161 } while (line != "");
162
163 // read the HTTP body into a buffer
164 char[] content = new char[contentLength];
165 reader.Read(content, 0, contentLength);
166
167 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(new String(content));
168 if(request.MethodName == "login_to_simulator")
169 {
170 XmlRpcResponse response = ProcessRequest(request);
171
172 // forward the XML-RPC response to the client
173 writer.WriteLine("HTTP/1.0 200 OK");
174 writer.WriteLine("Content-type: text/xml");
175 writer.WriteLine();
176
177 XmlTextWriter responseWriter = new XmlTextWriter(writer);
178 XmlRpcResponseSerializer.Singleton.Serialize(responseWriter, response);
179 responseWriter.Close();
180 }
181 else
182 {
183 writer.WriteLine("HTTP/1.0 403 Authentication Forbidden");
184 writer.WriteLine();
185 }
186 }
187 }
188
189 private XmlRpcResponse ProcessRequest(XmlRpcRequest request)
190 {
191 XmlRpcResponse response = (XmlRpcResponse)(new XmlRpcResponseDeserializer()).Deserialize(this._defaultResponse);
192
193 Hashtable responseData = (Hashtable)response.Value;
194 Hashtable requestData = (Hashtable)request.Params[0];
195
196 string first;
197 string last;
198 string passwd;
199 LLUUID Agent;
200 LLUUID Session;
201
202 //get login name
203 if(requestData.Contains("first"))
204 {
205 first = (string)requestData["first"];
206 }
207 else
208 {
209 first = "test";
210 }
211
212 if(requestData.Contains("last"))
213 {
214 last = (string)requestData["last"];
215 }
216 else
217 {
218 last = "User"+NumClients.ToString();
219 }
220
221 if(requestData.Contains("passwd"))
222 {
223 passwd = (string)requestData["passwd"];
224 }
225 else
226 {
227 passwd = "notfound";
228 }
229
230 if( !Authenticate(first, last, passwd))
231 {
232 responseData["reason"] = "key";
233 responseData["message"] = "You have entered an invalid name/password combination. Check Caps/lock.";
234 responseData["login"] = "false";
235 }
236 else
237 {
238 NumClients++;
239
240 //create a agent and session LLUUID
241 Agent = GetAgentId( first, last );
242 Session = LLUUID.Random();
243
244 //create some login info
245 Hashtable LoginFlagsHash = new Hashtable();
246 LoginFlagsHash["daylight_savings"]="N";
247 LoginFlagsHash["stipend_since_login"]="N";
248 LoginFlagsHash["gendered"]="Y";
249 LoginFlagsHash["ever_logged_in"]="Y";
250 ArrayList LoginFlags=new ArrayList();
251 LoginFlags.Add(LoginFlagsHash);
252
253 Hashtable GlobalT = new Hashtable();
254 GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271";
255 GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
256 GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
257 ArrayList GlobalTextures = new ArrayList();
258 GlobalTextures.Add(GlobalT);
259
260 responseData["sim_port"] = OpenSim_Main.cfg.IPListenPort;
261 responseData["sim_ip"] = OpenSim_Main.cfg.IPListenAddr;
262 responseData["agent_id"] = Agent.ToStringHyphenated();
263 responseData["session_id"] = Session.ToStringHyphenated();
264 responseData["seconds_since_epoch"]=(Int32)(DateTime.UtcNow - new DateTime(1970,1,1)).TotalSeconds;
265 responseData["login-flags"]=LoginFlags;
266 responseData["global-textures"]=GlobalTextures;
267
268 //inventory
269 ArrayList InventoryList = (ArrayList) responseData["inventory-skeleton"];
270 Hashtable Inventory1 = (Hashtable)InventoryList[0];
271 Hashtable Inventory2 = (Hashtable)InventoryList[1];
272 LLUUID BaseFolderID = LLUUID.Random();
273 LLUUID InventoryFolderID = LLUUID.Random();
274 Inventory2["name"] = "Base";
275 Inventory2["folder_id"] = BaseFolderID.ToStringHyphenated();
276 Inventory2["type_default"] =6;
277 Inventory1["folder_id"] = InventoryFolderID.ToStringHyphenated();
278
279 ArrayList InventoryRoot = (ArrayList) responseData["inventory-root"];
280 Hashtable Inventoryroot = (Hashtable)InventoryRoot[0];
281 Inventoryroot["folder_id"] = InventoryFolderID.ToStringHyphenated();
282
283 CustomiseLoginResponse( responseData, first, last );
284
285 Login _login = new Login();
286 //copy data to login object
287 _login.First = first;
288 _login.Last = last;
289 _login.Agent = Agent;
290 _login.Session = Session;
291 _login.BaseFolder = BaseFolderID;
292 _login.InventoryFolder = InventoryFolderID;
293
294 //working on local computer if so lets add to the gridserver's list of sessions?
295 if(OpenSim_Main.gridServers.GridServer.GetName() == "Local")
296 {
297 ((LocalGridBase)this._gridServer).AddNewSession(_login);
298 }
299 }
300 return response;
301 }
302
303 protected virtual void CustomiseLoginResponse( Hashtable responseData, string first, string last )
304 {
305 }
306
307 protected virtual LLUUID GetAgentId(string firstName, string lastName)
308 {
309 return LLUUID.Random();
310 }
311
312 protected virtual bool Authenticate(string first, string last, string passwd)
313 {
314 if(this._needPasswd)
315 {
316 //every user needs the password to login
317 string encodedPass = passwd.Remove(0,3); //remove $1$
318 if(encodedPass == this._mpasswd)
319 {
320 return true;
321 }
322 else
323 {
324 return false;
325 }
326 }
327 else
328 {
329 //do not need password to login
330 return true;
331 }
332 }
333
334 private static string EncodePassword(string passwd)
335 {
336 Byte[] originalBytes;
337 Byte[] encodedBytes;
338 MD5 md5;
339
340 md5 = new MD5CryptoServiceProvider();
341 originalBytes = ASCIIEncoding.Default.GetBytes(passwd);
342 encodedBytes = md5.ComputeHash(originalBytes);
343
344 return Regex.Replace(BitConverter.ToString(encodedBytes), "-", "").ToLower();
345 }
346
347 }
348
349
350}
diff --git a/src/LocalServers/LocalGridServers/AssemblyInfo.cs b/src/LocalServers/LocalGridServers/AssemblyInfo.cs
deleted file mode 100644
index 4b17ba2..0000000
--- a/src/LocalServers/LocalGridServers/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5// ------------------------------------------------------------------------------
6// <autogenerated>
7// This code was generated by a tool.
8// Mono Runtime Version: 2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </autogenerated>
13// ------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.1.0.240")]
18[assembly: AssemblyTitleAttribute("opensim-localservers")]
19[assembly: AssemblyDescriptionAttribute("local grid servers")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/LocalServers/LocalGridServers/LocalGridServers.csproj b/src/LocalServers/LocalGridServers/LocalGridServers.csproj
deleted file mode 100644
index 7a5ce3d..0000000
--- a/src/LocalServers/LocalGridServers/LocalGridServers.csproj
+++ /dev/null
@@ -1,48 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <OutputType>Library</OutputType>
4 <RootNamespace>LocalGridServers</RootNamespace>
5 <AssemblyName>LocalGridServers</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 <ProjectGuid>{D7F0395B-FADC-4936-80A0-D95AACE92F62}</ProjectGuid>
9 </PropertyGroup>
10 <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
11 <OutputPath>bin\Debug\</OutputPath>
12 <Optimize>False</Optimize>
13 <DefineConstants>DEBUG;TRACE</DefineConstants>
14 <DebugSymbols>True</DebugSymbols>
15 <DebugType>Full</DebugType>
16 <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
17 </PropertyGroup>
18 <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
19 <OutputPath>bin\Release\</OutputPath>
20 <Optimize>True</Optimize>
21 <DefineConstants>TRACE</DefineConstants>
22 <DebugSymbols>False</DebugSymbols>
23 <DebugType>None</DebugType>
24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
25 </PropertyGroup>
26 <ItemGroup>
27 <Reference Include="System" />
28 <Reference Include="System.Xml" />
29 <Reference Include="libsecondlife">
30 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
31 <SpecificVersion>False</SpecificVersion>
32 </Reference>
33 </ItemGroup>
34 <ItemGroup>
35 <Compile Include="LocalGrid.cs" />
36 </ItemGroup>
37 <ItemGroup>
38 <ProjectReference Include="..\..\ServerConsole\ServerConsole\ServerConsole.csproj">
39 <Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
40 <Name>ServerConsole</Name>
41 </ProjectReference>
42 <ProjectReference Include="..\..\GridInterfaces\GridInterfaces.csproj">
43 <Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
44 <Name>GridInterfaces</Name>
45 </ProjectReference>
46 </ItemGroup>
47 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
48</Project> \ No newline at end of file
diff --git a/src/LocalServers/default.build b/src/LocalServers/default.build
deleted file mode 100644
index 14c52cd..0000000
--- a/src/LocalServers/default.build
+++ /dev/null
@@ -1,51 +0,0 @@
1<?xml version="1.0"?>
2 <project name="OpenSim" default="build" basedir=".">
3 <description>nant buildfile for OpenSim</description>
4 <property name="debug" value="true" overwrite="false" />
5 <target name="clean" description="remove all generated files">
6 <delete file="../../bin/LocalGridServers.dll" failonerror="false" />
7 </target>
8
9 <target name="svnupdate" description="updates to latest SVN">
10 <exec program="svn">
11 <arg value="update" />
12 </exec>
13 </target>
14
15 <target name="upgrade" description="updates from SVN and then builds" depends="clean,svnupdate,build">
16
17 </target>
18
19 <target name="build" description="compiles the source code">
20
21 <loadfile file="../../VERSION" property="svnver"/>
22 <asminfo output="LocalGridServers/AssemblyInfo.cs" language="CSharp">
23 <imports>
24 <import namespace="System" />
25 <import namespace="System.Reflection" />
26 <import namespace="System.Runtime.InteropServices" />
27 </imports>
28 <attributes>
29 <attribute type="ComVisibleAttribute" value="false" />
30 <attribute type="CLSCompliantAttribute" value="false" />
31 <attribute type="AssemblyVersionAttribute" value="${svnver}" />
32 <attribute type="AssemblyTitleAttribute" value="opensim-localservers" />
33 <attribute type="AssemblyDescriptionAttribute" value="local grid servers" />
34 <attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
35 </attributes>
36 </asminfo>
37
38 <csc target="library" output="../../bin/LocalGridServers.dll" debug="${debug}" verbose="true" warninglevel="4">
39 <references basedir="../../bin" failonempty="true">
40 <include name="System.dll" />
41 <include name="System.Xml.dll" />
42 <include name="libsecondlife.dll" />
43 <include name="GridInterfaces.dll" />
44 <include name="ServerConsole.dll" />
45 </references>
46 <sources basedir="LocalGridServers/">
47 <include name="*.cs" />
48 </sources>
49 </csc>
50 </target>
51</project>
diff --git a/src/LocalStorage/Db4LocalStorage/AssemblyInfo.cs b/src/LocalStorage/Db4LocalStorage/AssemblyInfo.cs
deleted file mode 100644
index 0c5ff75..0000000
--- a/src/LocalStorage/Db4LocalStorage/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5// ------------------------------------------------------------------------------
6// <autogenerated>
7// This code was generated by a tool.
8// Mono Runtime Version: 2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </autogenerated>
13// ------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.1.0.240")]
18[assembly: AssemblyTitleAttribute("opensim-localstorage")]
19[assembly: AssemblyDescriptionAttribute("The local storage handler")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.csproj b/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.csproj
deleted file mode 100644
index c00771c..0000000
--- a/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.csproj
+++ /dev/null
@@ -1,52 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <OutputType>Library</OutputType>
4 <RootNamespace>Db4LocalStorage</RootNamespace>
5 <AssemblyName>Db4LocalStorage</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 <ProjectGuid>{74784F23-B0FD-484C-82C1-96C0215733DC}</ProjectGuid>
9 </PropertyGroup>
10 <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
11 <OutputPath>bin\Debug\</OutputPath>
12 <Optimize>False</Optimize>
13 <DefineConstants>DEBUG;TRACE</DefineConstants>
14 <DebugSymbols>True</DebugSymbols>
15 <DebugType>Full</DebugType>
16 <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
17 </PropertyGroup>
18 <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
19 <OutputPath>bin\Release\</OutputPath>
20 <Optimize>True</Optimize>
21 <DefineConstants>TRACE</DefineConstants>
22 <DebugSymbols>False</DebugSymbols>
23 <DebugType>None</DebugType>
24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
25 </PropertyGroup>
26 <ItemGroup>
27 <Reference Include="System" />
28 <Reference Include="System.Xml" />
29 <Reference Include="libsecondlife">
30 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
31 <SpecificVersion>False</SpecificVersion>
32 </Reference>
33 <Reference Include="Db4objects.Db4o">
34 <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
35 <SpecificVersion>False</SpecificVersion>
36 </Reference>
37 </ItemGroup>
38 <ItemGroup>
39 <Compile Include="Db4LocalStorage.cs" />
40 </ItemGroup>
41 <ItemGroup>
42 <ProjectReference Include="..\..\ServerConsole\ServerConsole\ServerConsole.csproj">
43 <Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
44 <Name>ServerConsole</Name>
45 </ProjectReference>
46 <ProjectReference Include="..\..\GridInterfaces\GridInterfaces.csproj">
47 <Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
48 <Name>GridInterfaces</Name>
49 </ProjectReference>
50 </ItemGroup>
51 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
52</Project> \ No newline at end of file
diff --git a/src/LocalStorage/default.build b/src/LocalStorage/default.build
deleted file mode 100644
index 5ed183e..0000000
--- a/src/LocalStorage/default.build
+++ /dev/null
@@ -1,53 +0,0 @@
1<?xml version="1.0"?>
2 <project name="OpenSim" default="build" basedir=".">
3 <description>nant buildfile for OpenSim</description>
4 <property name="debug" value="true" overwrite="false" />
5 <target name="clean" description="remove all generated files">
6 <delete file="../bin/Db4LocalStorage.dll" failonerror="false" />
7 </target>
8
9 <target name="svnupdate" description="updates to latest SVN">
10 <exec program="svn">
11 <arg value="update" />
12 </exec>
13 </target>
14
15 <target name="upgrade" description="updates from SVN and then builds" depends="clean,svnupdate,build">
16
17 </target>
18
19 <target name="build" description="compiles the source code">
20
21 <loadfile file="../../VERSION" property="svnver"/>
22 <asminfo output="Db4LocalStorage/AssemblyInfo.cs" language="CSharp">
23 <imports>
24 <import namespace="System" />
25 <import namespace="System.Reflection" />
26 <import namespace="System.Runtime.InteropServices" />
27 </imports>
28 <attributes>
29 <attribute type="ComVisibleAttribute" value="false" />
30 <attribute type="CLSCompliantAttribute" value="false" />
31 <attribute type="AssemblyVersionAttribute" value="${svnver}" />
32 <attribute type="AssemblyTitleAttribute" value="opensim-localstorage" />
33 <attribute type="AssemblyDescriptionAttribute" value="The local storage handler" />
34 <attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
35 </attributes>
36 </asminfo>
37
38 <csc target="library" output="../../bin/Db4LocalStorage.dll" debug="${debug}" verbose="true" warninglevel="4">
39 <references basedir="../../bin/" failonempty="true">
40 <include name="System.dll" />
41 <include name="System.Data.dll" />
42 <include name="System.Xml.dll" />
43 <include name="libsecondlife.dll" />
44 <include name="GridInterfaces.dll" />
45 <include name="ServerConsole.dll" />
46 <include name="Db4objects.Db4o.dll" />
47 </references>
48 <sources basedir="Db4LocalStorage/">
49 <include name="*.cs" />
50 </sources>
51 </csc>
52 </target>
53</project>
diff --git a/src/Main.cs b/src/Main.cs
deleted file mode 100644
index a738d03..0000000
--- a/src/Main.cs
+++ /dev/null
@@ -1,338 +0,0 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3
4
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.Text;
32using System.IO;
33using System.Threading;
34using System.Net;
35using System.Net.Sockets;
36using System.Timers;
37using System.Reflection;
38using System.Collections;
39using System.Collections.Generic;
40using libsecondlife;
41using libsecondlife.Packets;
42using OpenSim.world;
43using OpenSim.GridServers;
44using OpenSim.Assets;
45using ServerConsole;
46using PhysicsSystem;
47
48namespace OpenSim
49{
50 /// <summary>
51 /// Description of MainForm.
52 /// </summary>
53 public class OpenSim_Main
54 {
55 public static OpenSim_Main sim;
56 public static SimConfig cfg;
57 public static World local_world;
58 public static Grid gridServers;
59 public static SimCAPSHTTPServer http_server;
60
61 public static Socket Server;
62 private static IPEndPoint ServerIncoming;
63 private static byte[] RecvBuffer = new byte[4096];
64 private byte[] ZeroBuffer = new byte[8192];
65 private static IPEndPoint ipeSender;
66 private static EndPoint epSender;
67 private static AsyncCallback ReceivedData;
68
69 public AssetCache assetCache;
70 public DateTime startuptime;
71 public Dictionary<EndPoint, OpenSimClient> ClientThreads = new Dictionary<EndPoint, OpenSimClient>();
72 private PhysicsManager physManager;
73 private System.Timers.Timer timer1 = new System.Timers.Timer();
74 private string ConfigDll = "SimConfig.dll";
75 private string _physicsEngine = "PhysX";
76 public bool sandbox = false;
77 public bool loginserver = false;
78
79 [STAThread]
80 public static void Main( string[] args )
81 {
82 Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
83 Console.WriteLine("Starting...\n");
84 ServerConsole.MainConsole.Instance = new MServerConsole(ServerConsole.ConsoleBase.ConsoleType.Local,"",0);
85
86 sim = new OpenSim_Main();
87
88 sim.sandbox = false;
89 sim.loginserver = false;
90 sim._physicsEngine = "PhysX";
91
92 for (int i = 0; i < args.Length; i++)
93 {
94 if(args[i] == "-sandbox")
95 {
96 sim.sandbox = true;
97 }
98
99 if(args[i] == "-loginserver")
100 {
101 sim.loginserver = true;
102 }
103 if(args[i] == "-realphysx")
104 {
105 sim._physicsEngine = "RealPhysX";
106 OpenSim.world.Avatar.PhysicsEngineFlying = true;
107 }
108 }
109
110 OpenSim_Main.gridServers = new Grid();
111 if(sim.sandbox)
112 {
113 OpenSim_Main.gridServers.AssetDll = "LocalGridServers.dll";
114 OpenSim_Main.gridServers.GridDll = "LocalGridServers.dll";
115 OpenSim_Main.gridServers.LoadPlugins();
116 ServerConsole.MainConsole.Instance.WriteLine("Starting in Sandbox mode");
117 }
118 else
119 {
120 OpenSim_Main.gridServers.AssetDll = "RemoteGridServers.dll";
121 OpenSim_Main.gridServers.GridDll = "RemoteGridServers.dll";
122 OpenSim_Main.gridServers.LoadPlugins();
123 ServerConsole.MainConsole.Instance.WriteLine("Starting in Grid mode");
124 }
125
126 if(sim.loginserver && sim.sandbox)
127 {
128 LoginServer loginServer = new LoginServer(OpenSim_Main.gridServers.GridServer);
129 loginServer.Startup();
130 }
131 sim.assetCache = new AssetCache(OpenSim_Main.gridServers.AssetServer);
132
133 sim.Startup();
134
135 while(true) {
136 ServerConsole.MainConsole.Instance.MainConsolePrompt();
137 }
138 }
139
140 private OpenSim_Main() {
141 }
142
143 private void Startup() {
144 startuptime=DateTime.Now;
145
146 // We check our local database first, then the grid for config options
147 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Loading configuration");
148 cfg = this.LoadConfigDll(this.ConfigDll);
149 cfg.InitConfig();
150 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Contacting gridserver");
151 cfg.LoadFromGrid();
152
153 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - We are " + cfg.RegionName + " at " + cfg.RegionLocX.ToString() + "," + cfg.RegionLocY.ToString());
154 ServerConsole.MainConsole.Instance.WriteLine("Initialising world");
155 local_world = cfg.LoadWorld();
156
157 this.physManager = new PhysicsSystem.PhysicsManager();
158 this.physManager.LoadPlugins();
159 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Starting up messaging system");
160 local_world.PhysScene = this.physManager.GetPhysicsScene(this._physicsEngine); //should be reading from the config file what physics engine to use
161 local_world.PhysScene.SetTerrain(local_world.LandMap);
162
163 OpenSim_Main.gridServers.AssetServer.SetServerInfo(OpenSim_Main.cfg.AssetURL, OpenSim_Main.cfg.AssetSendKey);
164 OpenSim_Main.gridServers.GridServer.SetServerInfo(OpenSim_Main.cfg.GridURL, OpenSim_Main.cfg.GridSendKey, OpenSim_Main.cfg.GridRecvKey, OpenSim_Main.cfg.UserURL, OpenSim_Main.cfg.UserSendKey, OpenSim_Main.cfg.UserRecvKey);
165
166 local_world.LoadStorageDLL("Db4LocalStorage.dll"); //all these dll names shouldn't be hard coded.
167 local_world.LoadPrimsFromStorage();
168
169 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Starting CAPS HTTP server");
170 http_server = new SimCAPSHTTPServer();
171
172 timer1.Enabled = true;
173 timer1.Interval = 100;
174 timer1.Elapsed += new ElapsedEventHandler(this.Timer1Tick);
175
176 MainServerListener();
177
178 }
179
180 private SimConfig LoadConfigDll(string dllName)
181 {
182 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
183 SimConfig config = null;
184
185 foreach (Type pluginType in pluginAssembly.GetTypes())
186 {
187 if (pluginType.IsPublic)
188 {
189 if (!pluginType.IsAbstract)
190 {
191 Type typeInterface = pluginType.GetInterface("ISimConfig", true);
192
193 if (typeInterface != null)
194 {
195 ISimConfig plug = (ISimConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
196 config = plug.GetConfigObject();
197 break;
198 }
199
200 typeInterface = null;
201 }
202 }
203 }
204 pluginAssembly = null;
205 return config;
206 }
207
208 private void OnReceivedData(IAsyncResult result) {
209 ipeSender = new IPEndPoint(IPAddress.Any, 0);
210 epSender = (EndPoint)ipeSender;
211 Packet packet = null;
212 int numBytes = Server.EndReceiveFrom(result, ref epSender);
213 int packetEnd = numBytes - 1;
214 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
215
216 // This is either a new client or a packet to send to an old one
217 if(ClientThreads.ContainsKey(epSender)) {
218 ClientThreads[epSender].InPacket(packet);
219 } else if( packet.Type == PacketType.UseCircuitCode ) { // new client
220 OpenSimClient newuser = new OpenSimClient(epSender,(UseCircuitCodePacket)packet);
221 ClientThreads.Add(epSender, newuser);
222 } else { // invalid client
223 Console.Error.WriteLine("Main.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString());
224 }
225 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
226 }
227
228 private void MainServerListener() {
229 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:MainServerListener() - New thread started");
230 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:MainServerListener() - Opening UDP socket on " + cfg.IPListenAddr + ":" + cfg.IPListenPort);
231
232 ServerIncoming = new IPEndPoint(IPAddress.Any, cfg.IPListenPort);
233 Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
234 Server.Bind(ServerIncoming);
235
236 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:MainServerListener() - UDP socket bound, getting ready to listen");
237
238 ipeSender = new IPEndPoint(IPAddress.Any, 0);
239 epSender = (EndPoint) ipeSender;
240 ReceivedData = new AsyncCallback(this.OnReceivedData);
241 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
242
243 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:MainServerListener() - Listening...");
244
245 }
246
247 public static void Shutdown() {
248 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Closing all threads");
249 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Killing listener thread");
250 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Killing clients");
251 // IMPLEMENT THIS
252 ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Closing console and terminating");
253 OpenSim_Main.local_world.Close();
254 ServerConsole.MainConsole.Instance.Close();
255 Environment.Exit(0);
256 }
257
258 void Timer1Tick( object sender, System.EventArgs e )
259 {
260
261 local_world.Update();
262 }
263 }
264
265 public class Grid
266 {
267 public IAssetServer AssetServer;
268 public IGridServer GridServer;
269 public string AssetDll = "";
270 public string GridDll = "";
271
272 public Grid()
273 {
274 }
275
276 public void LoadPlugins()
277 {
278 this.AssetServer = this.LoadAssetDll(this.AssetDll);
279 this.GridServer = this.LoadGridDll(this.GridDll);
280 }
281
282 private IAssetServer LoadAssetDll(string dllName)
283 {
284 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
285 IAssetServer server = null;
286
287 foreach (Type pluginType in pluginAssembly.GetTypes())
288 {
289 if (pluginType.IsPublic)
290 {
291 if (!pluginType.IsAbstract)
292 {
293 Type typeInterface = pluginType.GetInterface("IAssetPlugin", true);
294
295 if (typeInterface != null)
296 {
297 IAssetPlugin plug = (IAssetPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
298 server = plug.GetAssetServer();
299 break;
300 }
301
302 typeInterface = null;
303 }
304 }
305 }
306 pluginAssembly = null;
307 return server;
308 }
309
310 private IGridServer LoadGridDll(string dllName)
311 {
312 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
313 IGridServer server = null;
314
315 foreach (Type pluginType in pluginAssembly.GetTypes())
316 {
317 if (pluginType.IsPublic)
318 {
319 if (!pluginType.IsAbstract)
320 {
321 Type typeInterface = pluginType.GetInterface("IGridPlugin", true);
322
323 if (typeInterface != null)
324 {
325 IGridPlugin plug = (IGridPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
326 server = plug.GetGridServer();
327 break;
328 }
329
330 typeInterface = null;
331 }
332 }
333 }
334 pluginAssembly = null;
335 return server;
336 }
337 }
338}
diff --git a/src/OpenSim.Framework/AssemblyInfo.cs b/src/OpenSim.Framework/AssemblyInfo.cs
deleted file mode 100644
index 32f1380..0000000
--- a/src/OpenSim.Framework/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5// ------------------------------------------------------------------------------
6// <autogenerated>
7// This code was generated by a tool.
8// Mono Runtime Version: 2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </autogenerated>
13// ------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.1.0.240")]
18[assembly: AssemblyTitleAttribute("opensim-gridinterfaces")]
19[assembly: AssemblyDescriptionAttribute("Definitions for OGS interface")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/OpenSim.Framework/OpenSim.Framework.csproj b/src/OpenSim.Framework/OpenSim.Framework.csproj
deleted file mode 100644
index ec586c3..0000000
--- a/src/OpenSim.Framework/OpenSim.Framework.csproj
+++ /dev/null
@@ -1,49 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ProductVersion>8.0.50727</ProductVersion>
6 <SchemaVersion>2.0</SchemaVersion>
7 <ProjectGuid>{407CE85B-628C-4788-9DBC-49BCEFC3A84F}</ProjectGuid>
8 <OutputType>Library</OutputType>
9 <AppDesignerFolder>Properties</AppDesignerFolder>
10 <RootNamespace>OpenSim.Framework</RootNamespace>
11 <AssemblyName>OpenGrid.Framework</AssemblyName>
12 </PropertyGroup>
13 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
14 <DebugSymbols>true</DebugSymbols>
15 <DebugType>full</DebugType>
16 <Optimize>false</Optimize>
17 <OutputPath>bin\Debug\</OutputPath>
18 <DefineConstants>DEBUG;TRACE</DefineConstants>
19 <ErrorReport>prompt</ErrorReport>
20 <WarningLevel>4</WarningLevel>
21 </PropertyGroup>
22 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
23 <DebugType>pdbonly</DebugType>
24 <Optimize>true</Optimize>
25 <OutputPath>bin\Release\</OutputPath>
26 <DefineConstants>TRACE</DefineConstants>
27 <ErrorReport>prompt</ErrorReport>
28 <WarningLevel>4</WarningLevel>
29 </PropertyGroup>
30 <ItemGroup>
31 <Reference Include="libsecondlife, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
32 <SpecificVersion>False</SpecificVersion>
33 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
34 </Reference>
35 <Reference Include="System" />
36 <Reference Include="System.Data" />
37 <Reference Include="System.Xml" />
38 </ItemGroup>
39 <ItemGroup>
40 <Compile Include="LoginService.cs" />
41 </ItemGroup>
42 <ItemGroup>
43 <ProjectReference Include="..\GridInterfaces\GridInterfaces.csproj">
44 <Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
45 <Name>GridInterfaces</Name>
46 </ProjectReference>
47 </ItemGroup>
48 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
49</Project> \ No newline at end of file
diff --git a/src/OpenSim.Framework/Properties/AssemblyInfo.cs b/src/OpenSim.Framework/Properties/AssemblyInfo.cs
deleted file mode 100644
index 72e55b9..0000000
--- a/src/OpenSim.Framework/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenGrid.Framework")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("Playahead AB")]
12[assembly: AssemblyProduct("OpenGrid.Framework")]
13[assembly: AssemblyCopyright("Copyright © Playahead AB 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("67d2b810-0969-4550-ab2b-d2f5ac191191")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/OpenSim.Framework/default.build b/src/OpenSim.Framework/default.build
deleted file mode 100644
index 57dfee8..0000000
--- a/src/OpenSim.Framework/default.build
+++ /dev/null
@@ -1,50 +0,0 @@
1<?xml version="1.0"?>
2 <project name="OpenSim.Framework" default="build" basedir=".">
3 <description>nant buildfile for OpenSim.Framework</description>
4 <property name="debug" value="true" overwrite="false" />
5 <target name="clean" description="remove all generated files">
6 <delete file="../../bin/OpenSim.Framework.dll" failonerror="false" />
7 </target>
8
9 <target name="svnupdate" description="updates to latest SVN">
10 <exec program="svn">
11 <arg value="update" />
12 </exec>
13 </target>
14
15 <target name="upgrade" description="updates from SVN and then builds" depends="clean,svnupdate,build">
16
17 </target>
18
19 <target name="build" description="compiles the source code">
20
21 <loadfile file="../../VERSION" property="svnver"/>
22 <asminfo output="AssemblyInfo.cs" language="CSharp">
23 <imports>
24 <import namespace="System" />
25 <import namespace="System.Reflection" />
26 <import namespace="System.Runtime.InteropServices" />
27 </imports>
28 <attributes>
29 <attribute type="ComVisibleAttribute" value="false" />
30 <attribute type="CLSCompliantAttribute" value="false" />
31 <attribute type="AssemblyVersionAttribute" value="${svnver}" />
32 <attribute type="AssemblyTitleAttribute" value="opensim-gridinterfaces" />
33 <attribute type="AssemblyDescriptionAttribute" value="Definitions for OGS interface" />
34 <attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
35 </attributes>
36 </asminfo>
37
38 <csc target="library" output="../../bin/OpenSim.Framework.dll" debug="${debug}" verbose="true" warninglevel="4">
39 <references basedir="../../bin" failonempty="true">
40 <include name="System.dll" />
41 <include name="System.Xml.dll" />
42 <include name="libsecondlife.dll" />
43 <include name="GridInterfaces.dll" />
44 </references>
45 <sources basedir="./">
46 <include name="*.cs" />
47 </sources>
48 </csc>
49 </target>
50</project>
diff --git a/src/OpenSimClient.cs b/src/OpenSimClient.cs
deleted file mode 100644
index dd698e4..0000000
--- a/src/OpenSimClient.cs
+++ /dev/null
@@ -1,471 +0,0 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*/
26
27using System;
28using System.Collections;
29using System.Collections.Generic;
30using libsecondlife;
31using libsecondlife.Packets;
32using System.Net;
33using System.Net.Sockets;
34using System.IO;
35using System.Threading;
36using System.Timers;
37using OpenSim.GridServers;
38using OpenSim.world;
39
40namespace OpenSim
41{
42 /// <summary>
43 /// Handles new client connections
44 /// Constructor takes a single Packet and authenticates everything
45 /// </summary>
46 public class OpenSimClient {
47
48 public LLUUID AgentID;
49 public LLUUID SessionID;
50 public uint CircuitCode;
51 public world.Avatar ClientAvatar;
52 private UseCircuitCodePacket cirpack;
53 private Thread ClientThread;
54 public EndPoint userEP;
55 private BlockingQueue<QueItem> PacketQueue;
56 private Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>();
57 private Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>();
58 private System.Timers.Timer AckTimer;
59 private uint Sequence = 0;
60 private object SequenceLock = new object();
61 private const int MAX_APPENDED_ACKS = 10;
62 private const int RESEND_TIMEOUT = 4000;
63 private const int MAX_SEQUENCE = 0xFFFFFF;
64
65 public void ack_pack(Packet Pack) {
66 //libsecondlife.Packets.PacketAckPacket ack_it = new PacketAckPacket();
67 //ack_it.Packets = new PacketAckPacket.PacketsBlock[1];
68 //ack_it.Packets[0] = new PacketAckPacket.PacketsBlock();
69 //ack_it.Packets[0].ID = Pack.Header.ID;
70 //ack_it.Header.Reliable = false;
71
72 //OutPacket(ack_it);
73
74 if (Pack.Header.Reliable) {
75 lock (PendingAcks) {
76 uint sequence = (uint)Pack.Header.Sequence;
77 if (!PendingAcks.ContainsKey(sequence)) { PendingAcks[sequence] = sequence; }
78 }
79 }
80 }
81
82 public void ProcessInPacket(Packet Pack) {
83 ack_pack(Pack);
84 switch(Pack.Type) {
85 case PacketType.CompleteAgentMovement:
86 ClientAvatar.CompleteMovement(OpenSim_Main.local_world);
87 ClientAvatar.SendInitialPosition();
88 break;
89 case PacketType.RegionHandshakeReply:
90 OpenSim_Main.local_world.SendLayerData(this);
91 break;
92 case PacketType.AgentWearablesRequest:
93 ClientAvatar.SendInitialAppearance();
94 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
95 if(client.AgentID != this.AgentID)
96 {
97 ObjectUpdatePacket objupdate = client.ClientAvatar.CreateUpdatePacket();
98 this.OutPacket(objupdate);
99 client.ClientAvatar.SendAppearanceToOtherAgent(this);
100 }
101 }
102 OpenSim_Main.local_world.GetInitialPrims(this);
103 break;
104 case PacketType.ObjectAdd:
105 OpenSim_Main.local_world.AddNewPrim((ObjectAddPacket)Pack, this);
106 break;
107 case PacketType.ObjectLink:
108 ServerConsole.MainConsole.Instance.WriteLine(Pack.ToString());
109 break;
110 case PacketType.ObjectScale:
111 ServerConsole.MainConsole.Instance.WriteLine(Pack.ToString());
112 break;
113 case PacketType.ObjectShape:
114 ObjectShapePacket shape = (ObjectShapePacket)Pack;
115 for(int i =0; i <shape.ObjectData.Length; i++)
116 {
117 foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
118 {
119 if(ent.localid == shape.ObjectData[i].ObjectLocalID)
120 {
121 ((OpenSim.world.Primitive)ent).UpdateShape(shape.ObjectData[i]);
122 }
123 }
124 }
125 break;
126 case PacketType.MultipleObjectUpdate :
127 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)Pack;
128
129 for( int i = 0; i < multipleupdate.ObjectData.Length; i++ )
130 {
131 if( multipleupdate.ObjectData[ i ].Type == 9 ) //change position
132 {
133 libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[ i ].Data, 0 );
134 foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
135 {
136 if(ent.localid == multipleupdate.ObjectData[ i ].ObjectLocalID)
137 {
138 ((OpenSim.world.Primitive)ent).UpdatePosition( pos);
139
140 }
141 }
142
143 //should update stored position of the prim
144 }
145 else if(multipleupdate.ObjectData[i].Type == 10 )//rotation
146 {
147 libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
148 foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
149 {
150 if(ent.localid == multipleupdate.ObjectData[ i ].ObjectLocalID)
151 {
152 ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.W);
153 ((OpenSim.world.Primitive)ent).UpdateFlag = true;
154 }
155 }
156 }
157 else if(multipleupdate.ObjectData[i].Type == 13 )//scale
158 {
159
160 libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[ i ].Data, 12 );
161 foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
162 {
163 if(ent.localid == multipleupdate.ObjectData[ i ].ObjectLocalID)
164 {
165 ((OpenSim.world.Primitive)ent).Scale = scale;
166 }
167 }
168 }
169 }
170 break;
171 case PacketType.TransferRequest:
172 //Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request");
173 TransferRequestPacket transfer = (TransferRequestPacket)Pack;
174 OpenSim_Main.sim.assetCache.AddAssetRequest(this, transfer);
175 break;
176 case PacketType.AgentUpdate:
177 ClientAvatar.HandleUpdate((AgentUpdatePacket)Pack);
178 break;
179 case PacketType.LogoutRequest:
180 ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got a logout request");
181 //tell all clients to kill our object
182 KillObjectPacket kill = new KillObjectPacket();
183 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
184 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
185 kill.ObjectData[0].ID = this.ClientAvatar.localid;
186 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
187 client.OutPacket(kill);
188 }
189 OpenSim_Main.gridServers.GridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
190 lock(OpenSim_Main.local_world.Entities) {
191 OpenSim_Main.local_world.Entities.Remove(this.AgentID);
192 }
193 //need to do other cleaning up here too
194 OpenSim_Main.sim.ClientThreads.Remove(this.userEP);
195 this.ClientThread.Abort();
196 break;
197 case PacketType.ChatFromViewer:
198 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
199 if(Helpers.FieldToString(inchatpack.ChatData.Message)=="") break;
200
201 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
202 libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
203 reply.ChatData.Audible = 1;
204 reply.ChatData.Message = inchatpack.ChatData.Message;
205 reply.ChatData.ChatType = 1;
206 reply.ChatData.SourceType = 1;
207 reply.ChatData.Position = this.ClientAvatar.position;
208 reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0");
209 reply.ChatData.OwnerID = this.AgentID;
210 reply.ChatData.SourceID = this.AgentID;
211 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
212 client.OutPacket(reply);
213 }
214 break;
215 }
216 }
217
218 private void ResendUnacked()
219 {
220 int now = Environment.TickCount;
221
222 lock (NeedAck)
223 {
224 foreach (Packet packet in NeedAck.Values)
225 {
226 if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent))
227 {
228 ServerConsole.MainConsole.Instance.WriteLine("Resending " + packet.Type.ToString() + " packet, " +
229 (now - packet.TickCount) + "ms have passed");
230
231 packet.Header.Resent = true;
232 OutPacket(packet);
233 }
234 }
235 }
236 }
237
238 private void SendAcks()
239 {
240 lock (PendingAcks)
241 {
242 if (PendingAcks.Count > 0)
243 {
244 if (PendingAcks.Count > 250)
245 {
246 // FIXME: Handle the odd case where we have too many pending ACKs queued up
247 ServerConsole.MainConsole.Instance.WriteLine("Too many ACKs queued up!");
248 return;
249 }
250
251 ServerConsole.MainConsole.Instance.WriteLine("Sending PacketAck");
252
253
254 int i = 0;
255 PacketAckPacket acks = new PacketAckPacket();
256 acks.Packets = new PacketAckPacket.PacketsBlock[PendingAcks.Count];
257
258 foreach (uint ack in PendingAcks.Values)
259 {
260 acks.Packets[i] = new PacketAckPacket.PacketsBlock();
261 acks.Packets[i].ID = ack;
262 i++;
263 }
264
265 acks.Header.Reliable = false;
266 OutPacket(acks);
267
268 PendingAcks.Clear();
269 }
270 }
271 }
272
273 private void AckTimer_Elapsed(object sender, ElapsedEventArgs ea)
274 {
275 SendAcks();
276 ResendUnacked();
277 }
278
279 public void ProcessOutPacket(Packet Pack) {
280
281 // Keep track of when this packet was sent out
282 Pack.TickCount = Environment.TickCount;
283
284 if (!Pack.Header.Resent)
285 {
286 // Set the sequence number
287 lock (SequenceLock)
288 {
289 if (Sequence >= MAX_SEQUENCE)
290 Sequence = 1;
291 else
292 Sequence++;
293 Pack.Header.Sequence = Sequence;
294 }
295
296 if (Pack.Header.Reliable) //DIRTY HACK
297 {
298 lock (NeedAck)
299 {
300 if (!NeedAck.ContainsKey(Pack.Header.Sequence))
301 {
302 NeedAck.Add(Pack.Header.Sequence, Pack);
303 }
304 else
305 {
306 // Client.Log("Attempted to add a duplicate sequence number (" +
307 // packet.Header.Sequence + ") to the NeedAck dictionary for packet type " +
308 // packet.Type.ToString(), Helpers.LogLevel.Warning);
309 }
310 }
311
312 // Don't append ACKs to resent packets, in case that's what was causing the
313 // delivery to fail
314 if (!Pack.Header.Resent)
315 {
316 // Append any ACKs that need to be sent out to this packet
317 lock (PendingAcks)
318 {
319 if (PendingAcks.Count > 0 && PendingAcks.Count < MAX_APPENDED_ACKS &&
320 Pack.Type != PacketType.PacketAck &&
321 Pack.Type != PacketType.LogoutRequest)
322 {
323 Pack.Header.AckList = new uint[PendingAcks.Count];
324 int i = 0;
325
326 foreach (uint ack in PendingAcks.Values)
327 {
328 Pack.Header.AckList[i] = ack;
329 i++;
330 }
331
332 PendingAcks.Clear();
333 Pack.Header.AppendedAcks = true;
334 }
335 }
336 }
337 }
338 }
339
340 //ServerConsole.MainConsole.Instance.WriteLine("OUT: \n" + Pack.ToString());
341
342 byte[] ZeroOutBuffer = new byte[4096];
343 byte[] sendbuffer;
344 sendbuffer = Pack.ToBytes();
345
346 try {
347 if (Pack.Header.Zerocoded) {
348 int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
349 OpenSim_Main.Server.SendTo(ZeroOutBuffer, packetsize, SocketFlags.None,userEP);
350 } else {
351 OpenSim_Main.Server.SendTo(sendbuffer, sendbuffer.Length, SocketFlags.None,userEP);
352 }
353 } catch (Exception) {
354 ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread");
355 ClientThread.Abort();
356 }
357
358 }
359
360 public void InPacket(Packet NewPack) {
361 // Handle appended ACKs
362 if (NewPack.Header.AppendedAcks)
363 {
364 lock (NeedAck)
365 {
366 foreach (uint ack in NewPack.Header.AckList)
367 {
368 NeedAck.Remove(ack);
369 }
370 }
371 }
372
373 // Handle PacketAck packets
374 if (NewPack.Type == PacketType.PacketAck)
375 {
376 PacketAckPacket ackPacket = (PacketAckPacket)NewPack;
377
378 lock (NeedAck)
379 {
380 foreach (PacketAckPacket.PacketsBlock block in ackPacket.Packets)
381 {
382 NeedAck.Remove(block.ID);
383 }
384 }
385 } else if( ( NewPack.Type == PacketType.StartPingCheck ) ) {
386 //reply to pingcheck
387 libsecondlife.Packets.StartPingCheckPacket startPing = (libsecondlife.Packets.StartPingCheckPacket)NewPack;
388 libsecondlife.Packets.CompletePingCheckPacket endPing = new CompletePingCheckPacket();
389 endPing.PingID.PingID = startPing.PingID.PingID;
390 OutPacket(endPing);
391 }
392 else
393 {
394 QueItem item = new QueItem();
395 item.Packet = NewPack;
396 item.Incoming = true;
397 this.PacketQueue.Enqueue(item);
398 }
399
400 }
401
402 public void OutPacket(Packet NewPack) {
403 QueItem item = new QueItem();
404 item.Packet = NewPack;
405 item.Incoming = false;
406 this.PacketQueue.Enqueue(item);
407 }
408
409 public OpenSimClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack) {
410 ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs - Started up new client thread to handle incoming request");
411 cirpack = initialcirpack;
412 userEP = remoteEP;
413 PacketQueue = new BlockingQueue<QueItem>();
414 AckTimer = new System.Timers.Timer(500);
415 AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed);
416 AckTimer.Start();
417
418 ClientThread = new Thread(new ThreadStart(AuthUser));
419 ClientThread.IsBackground = true;
420 ClientThread.Start();
421 }
422
423 private void ClientLoop() {
424 ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ClientLoop() - Entered loop");
425 while(true) {
426 QueItem nextPacket = PacketQueue.Dequeue();
427 if(nextPacket.Incoming)
428 {
429 //is a incoming packet
430 ProcessInPacket(nextPacket.Packet);
431 }
432 else
433 {
434 //is a out going packet
435 ProcessOutPacket(nextPacket.Packet);
436 }
437 }
438 }
439
440 private void InitNewClient() {
441 ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
442 OpenSim_Main.local_world.AddViewerAgent(this);
443 world.Entity tempent=OpenSim_Main.local_world.Entities[this.AgentID];
444 this.ClientAvatar=(world.Avatar)tempent;
445 }
446
447 private void AuthUser()
448 {
449 AuthenticateResponse sessionInfo = OpenSim_Main.gridServers.GridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
450 if(!sessionInfo.Authorised)
451 {
452 //session/circuit not authorised
453 ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString());
454 ClientThread.Abort();
455 }
456 else
457 {
458 ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString());
459 //session is authorised
460 this.AgentID=cirpack.CircuitCode.ID;
461 this.SessionID=cirpack.CircuitCode.SessionID;
462 this.CircuitCode=cirpack.CircuitCode.Code;
463 InitNewClient();
464 this.ClientAvatar.firstname = sessionInfo.LoginInfo.First;
465 this.ClientAvatar.lastname = sessionInfo.LoginInfo.Last;
466 ClientLoop();
467 }
468 }
469 }
470
471}
diff --git a/src/RemoteServers/RemoteGridServers/AssemblyInfo.cs b/src/RemoteServers/RemoteGridServers/AssemblyInfo.cs
deleted file mode 100644
index 7d3f314..0000000
--- a/src/RemoteServers/RemoteGridServers/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5// ------------------------------------------------------------------------------
6// <autogenerated>
7// This code was generated by a tool.
8// Mono Runtime Version: 2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </autogenerated>
13// ------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.1.0.240")]
18[assembly: AssemblyTitleAttribute("opensim-remoteservers")]
19[assembly: AssemblyDescriptionAttribute("Connects to remote OGS installation")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/RemoteServers/RemoteGridServers/RemoteGrid.cs b/src/RemoteServers/RemoteGridServers/RemoteGrid.cs
deleted file mode 100644
index adb3d0f..0000000
--- a/src/RemoteServers/RemoteGridServers/RemoteGrid.cs
+++ /dev/null
@@ -1,279 +0,0 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections;
29using System.Collections.Generic;
30using System.Threading;
31using System.Net;
32using System.Net.Sockets;
33using System.IO;
34using System.Xml;
35using libsecondlife;
36using OpenSim.GridServers;
37
38namespace RemoteGridServers
39{
40 /// <summary>
41 ///
42 /// </summary>
43 ///
44
45 public class RemoteGridPlugin : IGridPlugin
46 {
47 public RemoteGridPlugin()
48 {
49
50 }
51
52 public IGridServer GetGridServer()
53 {
54 return(new RemoteGridServer());
55 }
56 }
57
58 public class RemoteAssetPlugin : IAssetPlugin
59 {
60 public RemoteAssetPlugin()
61 {
62
63 }
64
65 public IAssetServer GetAssetServer()
66 {
67 return(new RemoteAssetServer());
68 }
69 }
70 public class RemoteGridServer : RemoteGridBase
71 {
72 private string GridServerUrl;
73 private string GridSendKey;
74 private string GridRecvKey;
75 private string UserServerUrl;
76 private string UserSendKey;
77 private string UserRecvKey;
78
79 private Dictionary<uint, agentcircuitdata> AgentCircuits = new Dictionary<uint, agentcircuitdata>();
80
81 public override Dictionary<uint, agentcircuitdata> agentcircuits {
82 get {return AgentCircuits;}
83 set {AgentCircuits=value;}
84 }
85
86 public RemoteGridServer()
87 {
88 ServerConsole.MainConsole.Instance.WriteLine("Remote Grid Server class created");
89 }
90
91 public override bool RequestConnection()
92 {
93 return true;
94 }
95
96 public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
97 {
98 agentcircuitdata validcircuit=this.AgentCircuits[circuitcode];
99 AuthenticateResponse user = new AuthenticateResponse();
100 if((sessionID==validcircuit.SessionID) && (agentID==validcircuit.AgentID))
101 {
102 // YAY! Valid login
103 user.Authorised = true;
104 user.LoginInfo = new Login();
105 user.LoginInfo.Agent = agentID;
106 user.LoginInfo.Session = sessionID;
107 user.LoginInfo.First = validcircuit.firstname;
108 user.LoginInfo.Last = validcircuit.lastname;
109 }
110 else
111 {
112 // Invalid
113 user.Authorised = false;
114 }
115
116 return(user);
117 }
118
119 public override bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
120 {
121 WebRequest DeleteSession = WebRequest.Create(UserServerUrl + "/usersessions/" + sessionID.ToString());
122 DeleteSession.Method="DELETE";
123 DeleteSession.ContentType="text/plaintext";
124 DeleteSession.ContentLength=0;
125
126 StreamWriter stOut = new StreamWriter (DeleteSession.GetRequestStream(), System.Text.Encoding.ASCII);
127 stOut.Write("");
128 stOut.Close();
129
130 StreamReader stIn = new StreamReader(DeleteSession.GetResponse().GetResponseStream());
131 string GridResponse = stIn.ReadToEnd();
132 stIn.Close();
133 return(true);
134 }
135
136 public override UUIDBlock RequestUUIDBlock()
137 {
138 UUIDBlock uuidBlock = new UUIDBlock();
139 return(uuidBlock);
140 }
141
142 public override neighbourinfo[] RequestNeighbours(ulong regionhandle)
143 {
144 ArrayList neighbourlist = new ArrayList();
145
146 WebRequest FindNeighbours = WebRequest.Create(GridServerUrl + "/regions/" + regionhandle.ToString() + "/neighbours");
147 FindNeighbours.ContentType="text/plaintext";
148 FindNeighbours.ContentLength=0;
149
150 StreamWriter stOut = new StreamWriter (FindNeighbours.GetRequestStream(), System.Text.Encoding.ASCII);
151 stOut.Write("");
152 stOut.Close();
153
154
155 XmlDocument GridRespXml = new XmlDocument();
156 GridRespXml.Load(FindNeighbours.GetResponse().GetResponseStream());
157
158
159 XmlNode NeighboursRoot = GridRespXml.FirstChild;
160 if(NeighboursRoot.Name != "neighbours") {
161 return new neighbourinfo[0];
162 }
163
164 FindNeighbours.GetResponse().GetResponseStream().Close();
165
166 return new neighbourinfo[0];
167 }
168
169 public override void SetServerInfo(string UserServerUrl, string UserSendKey, string UserRecvKey, string GridServerUrl, string GridSendKey, string GridRecvKey)
170 {
171 this.UserServerUrl = UserServerUrl;
172 this.UserSendKey = UserSendKey;
173 this.UserRecvKey = UserRecvKey;
174 this.GridServerUrl = GridServerUrl;
175 this.GridSendKey = GridSendKey;
176 this.GridRecvKey = GridRecvKey;
177 }
178
179 public override string GetName()
180 {
181 return "Remote";
182 }
183 }
184
185
186 public class RemoteAssetServer : IAssetServer
187 {
188 private IAssetReceiver _receiver;
189 private BlockingQueue<ARequest> _assetRequests;
190 private Thread _remoteAssetServerThread;
191 private string AssetServerUrl;
192 private string AssetSendKey;
193
194 public RemoteAssetServer()
195 {
196 this._assetRequests = new BlockingQueue<ARequest>();
197 this._remoteAssetServerThread = new Thread(new ThreadStart(RunRequests));
198 this._remoteAssetServerThread.IsBackground = true;
199 this._remoteAssetServerThread.Start();
200 ServerConsole.MainConsole.Instance.WriteLine("Remote Asset Server class created");
201 }
202
203 public void SetReceiver(IAssetReceiver receiver)
204 {
205 this._receiver = receiver;
206 }
207
208 public void RequestAsset(LLUUID assetID, bool isTexture)
209 {
210 ARequest req = new ARequest();
211 req.AssetID = assetID;
212 req.IsTexture = isTexture;
213 this._assetRequests.Enqueue(req);
214 }
215
216 public void UpdateAsset(AssetBase asset)
217 {
218
219 }
220
221 public void UploadNewAsset(AssetBase asset)
222 {
223
224 }
225
226 public void SetServerInfo(string ServerUrl, string ServerKey)
227 {
228 this.AssetServerUrl = ServerUrl;
229 this.AssetSendKey = ServerKey;
230 }
231
232 private void RunRequests()
233 {
234 while(true)
235 {
236 //we need to add support for the asset server not knowing about a requested asset
237 ARequest req = this._assetRequests.Dequeue();
238 LLUUID assetID = req.AssetID;
239 ServerConsole.MainConsole.Instance.WriteLine(" RemoteAssetServer- Got a AssetServer request, processing it");
240 WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "getasset/" + AssetSendKey + "/" + assetID + "/data");
241 WebResponse AssetResponse = AssetLoad.GetResponse();
242 byte[] idata = new byte[(int)AssetResponse.ContentLength];
243 BinaryReader br = new BinaryReader(AssetResponse.GetResponseStream());
244 idata = br.ReadBytes((int)AssetResponse.ContentLength);
245 br.Close();
246
247 AssetBase asset = new AssetBase();
248 asset.FullID = assetID;
249 asset.Data = idata;
250 _receiver.AssetReceived(asset, req.IsTexture );
251 }
252 }
253 }
254
255 public class BlockingQueue< T > {
256 private Queue< T > _queue = new Queue< T >();
257 private object _queueSync = new object();
258
259 public void Enqueue(T value)
260 {
261 lock(_queueSync)
262 {
263 _queue.Enqueue(value);
264 Monitor.Pulse(_queueSync);
265 }
266 }
267
268 public T Dequeue()
269 {
270 lock(_queueSync)
271 {
272 if( _queue.Count < 1)
273 Monitor.Wait(_queueSync);
274
275 return _queue.Dequeue();
276 }
277 }
278 }
279}
diff --git a/src/RemoteServers/RemoteGridServers/RemoteGridServers.csproj b/src/RemoteServers/RemoteGridServers/RemoteGridServers.csproj
deleted file mode 100644
index f1c5649..0000000
--- a/src/RemoteServers/RemoteGridServers/RemoteGridServers.csproj
+++ /dev/null
@@ -1,48 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <OutputType>Library</OutputType>
4 <RootNamespace>RemoteGridServers</RootNamespace>
5 <AssemblyName>RemoteGridServers</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 <ProjectGuid>{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}</ProjectGuid>
9 </PropertyGroup>
10 <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
11 <OutputPath>bin\Debug\</OutputPath>
12 <Optimize>False</Optimize>
13 <DefineConstants>DEBUG;TRACE</DefineConstants>
14 <DebugSymbols>True</DebugSymbols>
15 <DebugType>Full</DebugType>
16 <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
17 </PropertyGroup>
18 <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
19 <OutputPath>bin\Release\</OutputPath>
20 <Optimize>True</Optimize>
21 <DefineConstants>TRACE</DefineConstants>
22 <DebugSymbols>False</DebugSymbols>
23 <DebugType>None</DebugType>
24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
25 </PropertyGroup>
26 <ItemGroup>
27 <Reference Include="System" />
28 <Reference Include="System.Xml" />
29 <Reference Include="libsecondlife">
30 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
31 <SpecificVersion>False</SpecificVersion>
32 </Reference>
33 </ItemGroup>
34 <ItemGroup>
35 <Compile Include="RemoteGrid.cs" />
36 </ItemGroup>
37 <ItemGroup>
38 <ProjectReference Include="..\..\ServerConsole\ServerConsole\ServerConsole.csproj">
39 <Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
40 <Name>ServerConsole</Name>
41 </ProjectReference>
42 <ProjectReference Include="..\..\GridInterfaces\GridInterfaces.csproj">
43 <Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
44 <Name>GridInterfaces</Name>
45 </ProjectReference>
46 </ItemGroup>
47 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
48</Project> \ No newline at end of file
diff --git a/src/RemoteServers/default.build b/src/RemoteServers/default.build
deleted file mode 100644
index f8e6977..0000000
--- a/src/RemoteServers/default.build
+++ /dev/null
@@ -1,51 +0,0 @@
1<?xml version="1.0"?>
2 <project name="OpenSim" default="build" basedir=".">
3 <description>nant buildfile for OpenSim</description>
4 <property name="debug" value="true" overwrite="false" />
5 <target name="clean" description="remove all generated files">
6 <delete file="../../bin/RemoteGridServers.dll" failonerror="false" />
7 </target>
8
9 <target name="svnupdate" description="updates to latest SVN">
10 <exec program="svn">
11 <arg value="update" />
12 </exec>
13 </target>
14
15 <target name="upgrade" description="updates from SVN and then builds" depends="clean,svnupdate,build">
16
17 </target>
18
19 <target name="build" description="compiles the source code">
20
21 <loadfile file="../../VERSION" property="svnver"/>
22 <asminfo output="RemoteGridServers/AssemblyInfo.cs" language="CSharp">
23 <imports>
24 <import namespace="System" />
25 <import namespace="System.Reflection" />
26 <import namespace="System.Runtime.InteropServices" />
27 </imports>
28 <attributes>
29 <attribute type="ComVisibleAttribute" value="false" />
30 <attribute type="CLSCompliantAttribute" value="false" />
31 <attribute type="AssemblyVersionAttribute" value="${svnver}" />
32 <attribute type="AssemblyTitleAttribute" value="opensim-remoteservers" />
33 <attribute type="AssemblyDescriptionAttribute" value="Connects to remote OGS installation" />
34 <attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
35 </attributes>
36 </asminfo>
37
38 <csc target="library" output="../../bin/RemoteGridServers.dll" debug="${debug}" verbose="true" warninglevel="4">
39 <references basedir="../../bin" failonempty="true">
40 <include name="System.dll" />
41 <include name="System.Xml.dll" />
42 <include name="libsecondlife.dll" />
43 <include name="GridInterfaces.dll" />
44 <include name="ServerConsole.dll" />
45 </references>
46 <sources basedir="RemoteGridServers/">
47 <include name="*.cs" />
48 </sources>
49 </csc>
50 </target>
51</project>
diff --git a/src/Second-server.csproj b/src/Second-server.csproj
deleted file mode 100644
index 7c0d17c..0000000
--- a/src/Second-server.csproj
+++ /dev/null
@@ -1,110 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <OutputType>Exe</OutputType>
4 <RootNamespace>OpenSim</RootNamespace>
5 <AssemblyName>OpenSim</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 <ProjectGuid>{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}</ProjectGuid>
9 <StartupObject>OpenSim.OpenSim_Main</StartupObject>
10 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
11 <NoStdLib>False</NoStdLib>
12 <WarningLevel>4</WarningLevel>
13 <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
14 </PropertyGroup>
15 <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
16 <OutputPath>bin\</OutputPath>
17 <Optimize>False</Optimize>
18 <DefineConstants>DEBUG;TRACE</DefineConstants>
19 <DebugSymbols>true</DebugSymbols>
20 <DebugType>Full</DebugType>
21 <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
22 </PropertyGroup>
23 <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
24 <OutputPath>..\bin\</OutputPath>
25 <Optimize>True</Optimize>
26 <DefineConstants>TRACE</DefineConstants>
27 <DebugSymbols>False</DebugSymbols>
28 <DebugType>None</DebugType>
29 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
30 </PropertyGroup>
31 <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
32 <RegisterForComInterop>False</RegisterForComInterop>
33 <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
34 <BaseAddress>4194304</BaseAddress>
35 <PlatformTarget>AnyCPU</PlatformTarget>
36 <FileAlignment>4096</FileAlignment>
37 </PropertyGroup>
38 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
39 <OutputPath>..\bin\</OutputPath>
40 </PropertyGroup>
41 <ItemGroup>
42 <Reference Include="System" />
43 <Reference Include="System.Data" />
44 <Reference Include="System.Xml" />
45 <Reference Include="libsecondlife">
46 <HintPath>..\bin\libsecondlife.dll</HintPath>
47 <SpecificVersion>False</SpecificVersion>
48 </Reference>
49 <Reference Include="Axiom.MathLib">
50 <HintPath>..\bin\Axiom.MathLib.dll</HintPath>
51 <SpecificVersion>False</SpecificVersion>
52 </Reference>
53 <Reference Include="log4net">
54 <HintPath>..\bin\log4net.dll</HintPath>
55 <SpecificVersion>False</SpecificVersion>
56 </Reference>
57 </ItemGroup>
58 <ItemGroup>
59 <Compile Include="Config.cs" />
60 <Compile Include="Main.cs" />
61 <Compile Include="OpenSimClient.cs" />
62 <Compile Include="types\Mesh.cs" />
63 <Compile Include="types\Triangle.cs" />
64 <Compile Include="Util.cs" />
65 <Compile Include="world\Avatar.cs" />
66 <Compile Include="world\Entity.cs" />
67 <Compile Include="world\Primitive.cs" />
68 <Compile Include="world\ScriptEngine.cs" />
69 <Compile Include="world\scripting\IScript.cs" />
70 <Compile Include="world\SurfacePatch.cs" />
71 <Compile Include="world\World.cs" />
72 <Compile Include="GridServers\LoginServer.cs" />
73 <Compile Include="Assets\AssetCache.cs" />
74 <Compile Include="OpenSimConsole.cs" />
75 <Compile Include="HeightMapGenHills.cs" />
76 <Compile Include="VersionInfo.cs" />
77 <Compile Include="CAPS\SimHttp.cs" />
78 </ItemGroup>
79 <ItemGroup>
80 <ProjectReference Include="GridInterfaces\GridInterfaces.csproj">
81 <Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
82 <Name>GridInterfaces</Name>
83 </ProjectReference>
84 <ProjectReference Include="LocalServers\LocalGridServers\LocalGridServers.csproj">
85 <Project>{D7F0395B-FADC-4936-80A0-D95AACE92F62}</Project>
86 <Name>LocalGridServers</Name>
87 </ProjectReference>
88 <ProjectReference Include="LocalStorage\Db4LocalStorage\Db4LocalStorage.csproj">
89 <Project>{74784F23-B0FD-484C-82C1-96C0215733DC}</Project>
90 <Name>Db4LocalStorage</Name>
91 </ProjectReference>
92 <ProjectReference Include="OpenSim.Framework\OpenSim.Framework.csproj">
93 <Project>{407CE85B-628C-4788-9DBC-49BCEFC3A84F}</Project>
94 <Name>OpenSim.Framework</Name>
95 </ProjectReference>
96 <ProjectReference Include="physics\PhysicsManager.csproj">
97 <Project>{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}</Project>
98 <Name>PhysicsManager</Name>
99 </ProjectReference>
100 <ProjectReference Include="RemoteServers\RemoteGridServers\RemoteGridServers.csproj">
101 <Project>{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}</Project>
102 <Name>RemoteGridServers</Name>
103 </ProjectReference>
104 <ProjectReference Include="ServerConsole\ServerConsole\ServerConsole.csproj">
105 <Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
106 <Name>ServerConsole</Name>
107 </ProjectReference>
108 </ItemGroup>
109 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
110</Project> \ No newline at end of file
diff --git a/src/ServerConsole/ServerConsole/AssemblyInfo.cs b/src/ServerConsole/ServerConsole/AssemblyInfo.cs
deleted file mode 100644
index e6b64d6..0000000
--- a/src/ServerConsole/ServerConsole/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5// ------------------------------------------------------------------------------
6// <autogenerated>
7// This code was generated by a tool.
8// Mono Runtime Version: 2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </autogenerated>
13// ------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.1.0.240")]
18[assembly: AssemblyTitleAttribute("opensim-serverconsole")]
19[assembly: AssemblyDescriptionAttribute("The default server console")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/ServerConsole/ServerConsole/ServerConsole.cs b/src/ServerConsole/ServerConsole/ServerConsole.cs
deleted file mode 100644
index 27d97e5..0000000
--- a/src/ServerConsole/ServerConsole/ServerConsole.cs
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28
29namespace ServerConsole
30{
31 public class MainConsole {
32
33 private static ConsoleBase instance;
34
35 public static ConsoleBase Instance
36 {
37 get
38 {
39 return instance;
40 }
41 set
42 {
43 instance = value;
44 }
45 }
46 }
47
48 public abstract class ConsoleBase
49 {
50
51 public enum ConsoleType {
52 Local, // Use stdio
53 TCP, // Use TCP/telnet
54 SimChat // Use in-world chat (for gods)
55 }
56
57 public abstract void Close();
58
59 public abstract void Write(string format, params object[] args);
60
61 public abstract void WriteLine(string format, params object[] args);
62
63 public abstract string ReadLine();
64
65 public abstract int Read() ;
66
67 // Displays a command prompt and waits for the user to enter a string, then returns that string
68 public abstract string CmdPrompt(string prompt) ;
69
70 // Displays a command prompt and returns a default value if the user simply presses enter
71 public abstract string CmdPrompt(string prompt, string defaultresponse);
72
73 // Displays a command prompt and returns a default value, user may only enter 1 of 2 options
74 public abstract string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB) ;
75
76 // Runs a command with a number of parameters
77 public abstract Object RunCmd(string Cmd, string[] cmdparams) ;
78
79 // Shows data about something
80 public abstract void ShowCommands(string ShowWhat) ;
81
82 // Displays a prompt to the user and then runs the command they entered
83 public abstract void MainConsolePrompt() ;
84
85 public abstract void SetStatus( string status );
86 }
87}
diff --git a/src/ServerConsole/ServerConsole/ServerConsole.csproj b/src/ServerConsole/ServerConsole/ServerConsole.csproj
deleted file mode 100644
index d1094de..0000000
--- a/src/ServerConsole/ServerConsole/ServerConsole.csproj
+++ /dev/null
@@ -1,34 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <OutputType>Library</OutputType>
4 <RootNamespace>ServerConsole</RootNamespace>
5 <AssemblyName>ServerConsole</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 <ProjectGuid>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</ProjectGuid>
9 </PropertyGroup>
10 <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
11 <OutputPath>bin\Debug\</OutputPath>
12 <Optimize>False</Optimize>
13 <DefineConstants>DEBUG;TRACE</DefineConstants>
14 <DebugSymbols>True</DebugSymbols>
15 <DebugType>Full</DebugType>
16 <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
17 </PropertyGroup>
18 <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
19 <OutputPath>bin\Release\</OutputPath>
20 <Optimize>True</Optimize>
21 <DefineConstants>TRACE</DefineConstants>
22 <DebugSymbols>False</DebugSymbols>
23 <DebugType>None</DebugType>
24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
25 </PropertyGroup>
26 <ItemGroup>
27 <Reference Include="System" />
28 <Reference Include="System.Xml" />
29 </ItemGroup>
30 <ItemGroup>
31 <Compile Include="ServerConsole.cs" />
32 </ItemGroup>
33 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
34</Project> \ No newline at end of file
diff --git a/src/ServerConsole/default.build b/src/ServerConsole/default.build
deleted file mode 100644
index 0de930a..0000000
--- a/src/ServerConsole/default.build
+++ /dev/null
@@ -1,48 +0,0 @@
1<?xml version="1.0"?>
2 <project name="OpenSim" default="build" basedir=".">
3 <description>nant buildfile for OpenSim</description>
4 <property name="debug" value="true" overwrite="false" />
5 <target name="clean" description="remove all generated files">
6 <delete file="../../bin/ServerConsole.dll" failonerror="false" />
7 </target>
8
9 <target name="svnupdate" description="updates to latest SVN">
10 <exec program="svn">
11 <arg value="update" />
12 </exec>
13 </target>
14
15 <target name="upgrade" description="updates from SVN and then builds" depends="clean,svnupdate,build">
16
17 </target>
18
19 <target name="build" description="compiles the source code">
20
21 <loadfile file="../../VERSION" property="svnver"/>
22 <asminfo output="ServerConsole/AssemblyInfo.cs" language="CSharp">
23 <imports>
24 <import namespace="System" />
25 <import namespace="System.Reflection" />
26 <import namespace="System.Runtime.InteropServices" />
27 </imports>
28 <attributes>
29 <attribute type="ComVisibleAttribute" value="false" />
30 <attribute type="CLSCompliantAttribute" value="false" />
31 <attribute type="AssemblyVersionAttribute" value="${svnver}" />
32 <attribute type="AssemblyTitleAttribute" value="opensim-serverconsole" />
33 <attribute type="AssemblyDescriptionAttribute" value="The default server console" />
34 <attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
35 </attributes>
36 </asminfo>
37
38 <csc target="library" output="../../bin/ServerConsole.dll" debug="${debug}" verbose="true" warninglevel="4">
39 <references>
40 <include name="System.dll" />
41 <include name="System.Xml.dll" />
42 </references>
43 <sources basedir="ServerConsole/">
44 <include name="*.cs" />
45 </sources>
46 </csc>
47 </target>
48</project>
diff --git a/src/Util.cs b/src/Util.cs
deleted file mode 100644
index 477390e..0000000
--- a/src/Util.cs
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3
4* Copyright (c) <year>, <copyright holder>
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.Collections.Generic;
32using System.Threading;
33using libsecondlife;
34using libsecondlife.Packets;
35
36namespace OpenSim
37{
38 /// <summary>
39 /// </summary>
40 ///
41 public class Util
42 {
43 public static ulong UIntsToLong(uint X, uint Y)
44 {
45 return Helpers.UIntsToLong(X,Y);
46 }
47 public Util()
48 {
49
50 }
51 }
52
53 public class QueItem {
54 public QueItem()
55 {
56 }
57
58 public Packet Packet;
59 public bool Incoming;
60 }
61
62 /* this is in IGridServer.cs, so there should be no reason for it to be here as well
63 public class agentcircuitdata
64 {
65 public agentcircuitdata() { }
66 public LLUUID AgentID;
67 public LLUUID SessionID;
68 public LLUUID SecureSessionID;
69 public string firstname;
70 public string lastname;
71 public uint circuitcode;
72 }
73 */
74
75 public class BlockingQueue< T > {
76 private Queue< T > _queue = new Queue< T >();
77 private object _queueSync = new object();
78
79 public void Enqueue(T value)
80 {
81 lock(_queueSync)
82 {
83 _queue.Enqueue(value);
84 Monitor.Pulse(_queueSync);
85 }
86 }
87
88 public T Dequeue()
89 {
90 lock(_queueSync)
91 {
92 if( _queue.Count < 1)
93 Monitor.Wait(_queueSync);
94
95 return _queue.Dequeue();
96 }
97 }
98 }
99}
diff --git a/src/opensim.sln b/src/opensim.sln
deleted file mode 100644
index c4be551..0000000
--- a/src/opensim.sln
+++ /dev/null
@@ -1,80 +0,0 @@
1
2Microsoft Visual Studio Solution File, Format Version 9.00
3# Visual Studio 2005
4Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Second-server", "Second-server.csproj", "{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}"
5EndProject
6Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GridInterfaces", "GridInterfaces\GridInterfaces.csproj", "{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}"
7EndProject
8Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhysicsManager", "physics\PhysicsManager.csproj", "{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}"
9EndProject
10Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerConsole", "ServerConsole\ServerConsole\ServerConsole.csproj", "{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}"
11EndProject
12Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalGridServers", "LocalServers\LocalGridServers\LocalGridServers.csproj", "{D7F0395B-FADC-4936-80A0-D95AACE92F62}"
13EndProject
14Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoteGridServers", "RemoteServers\RemoteGridServers\RemoteGridServers.csproj", "{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}"
15EndProject
16Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimConfig", "Config\SimConfig\SimConfig.csproj", "{B063760D-DB8D-4F64-B6FE-335FAD1E650A}"
17EndProject
18Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Db4LocalStorage", "LocalStorage\Db4LocalStorage\Db4LocalStorage.csproj", "{74784F23-B0FD-484C-82C1-96C0215733DC}"
19EndProject
20Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicPhysicsplugin", "physics\plugins\BasicPhysicsplugin.csproj", "{52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}"
21EndProject
22Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealPhysXplugin", "physics\RealPhysX\RealPhysXplugin\RealPhysXplugin.csproj", "{56C1D214-F389-4228-921A-0A3A0712C159}"
23EndProject
24Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework", "OpenSim.Framework\OpenSim.Framework.csproj", "{407CE85B-628C-4788-9DBC-49BCEFC3A84F}"
25EndProject
26Global
27 GlobalSection(SolutionConfigurationPlatforms) = preSolution
28 Debug|Any CPU = Debug|Any CPU
29 Release|Any CPU = Release|Any CPU
30 EndGlobalSection
31 GlobalSection(ProjectConfigurationPlatforms) = postSolution
32 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.Build.0 = Release|Any CPU
36 {5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 {5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 {5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 {5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Release|Any CPU.Build.0 = Release|Any CPU
40 {3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41 {3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
42 {3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 {3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Release|Any CPU.Build.0 = Release|Any CPU
44 {C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 {C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 {C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 {C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Release|Any CPU.Build.0 = Release|Any CPU
48 {D7F0395B-FADC-4936-80A0-D95AACE92F62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49 {D7F0395B-FADC-4936-80A0-D95AACE92F62}.Debug|Any CPU.Build.0 = Debug|Any CPU
50 {D7F0395B-FADC-4936-80A0-D95AACE92F62}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 {D7F0395B-FADC-4936-80A0-D95AACE92F62}.Release|Any CPU.Build.0 = Release|Any CPU
52 {CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53 {CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
54 {CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
55 {CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Release|Any CPU.Build.0 = Release|Any CPU
56 {B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57 {B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Debug|Any CPU.Build.0 = Debug|Any CPU
58 {B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Release|Any CPU.ActiveCfg = Release|Any CPU
59 {B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Release|Any CPU.Build.0 = Release|Any CPU
60 {74784F23-B0FD-484C-82C1-96C0215733DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61 {74784F23-B0FD-484C-82C1-96C0215733DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
62 {74784F23-B0FD-484C-82C1-96C0215733DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
63 {74784F23-B0FD-484C-82C1-96C0215733DC}.Release|Any CPU.Build.0 = Release|Any CPU
64 {52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
65 {52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
66 {52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
67 {52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}.Release|Any CPU.Build.0 = Release|Any CPU
68 {56C1D214-F389-4228-921A-0A3A0712C159}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69 {56C1D214-F389-4228-921A-0A3A0712C159}.Debug|Any CPU.Build.0 = Debug|Any CPU
70 {56C1D214-F389-4228-921A-0A3A0712C159}.Release|Any CPU.ActiveCfg = Release|Any CPU
71 {56C1D214-F389-4228-921A-0A3A0712C159}.Release|Any CPU.Build.0 = Release|Any CPU
72 {407CE85B-628C-4788-9DBC-49BCEFC3A84F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
73 {407CE85B-628C-4788-9DBC-49BCEFC3A84F}.Debug|Any CPU.Build.0 = Debug|Any CPU
74 {407CE85B-628C-4788-9DBC-49BCEFC3A84F}.Release|Any CPU.ActiveCfg = Release|Any CPU
75 {407CE85B-628C-4788-9DBC-49BCEFC3A84F}.Release|Any CPU.Build.0 = Release|Any CPU
76 EndGlobalSection
77 GlobalSection(SolutionProperties) = preSolution
78 HideSolutionNode = FALSE
79 EndGlobalSection
80EndGlobal
diff --git a/src/physics/AssemblyInfo.cs b/src/physics/AssemblyInfo.cs
deleted file mode 100644
index c6a4efa..0000000
--- a/src/physics/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5// ------------------------------------------------------------------------------
6// <autogenerated>
7// This code was generated by a tool.
8// Mono Runtime Version: 2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </autogenerated>
13// ------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.1.0.240")]
18[assembly: AssemblyTitleAttribute("opensim-physicsmanager")]
19[assembly: AssemblyDescriptionAttribute("Handles physics plugins")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/physics/PhysicsManager.cs b/src/physics/PhysicsManager.cs
deleted file mode 100644
index 1fee628..0000000
--- a/src/physics/PhysicsManager.cs
+++ /dev/null
@@ -1,285 +0,0 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections.Generic;
29using System.Collections;
30using System.IO;
31using System.Reflection;
32
33namespace PhysicsSystem
34{
35 /// <summary>
36 /// Description of MyClass.
37 /// </summary>
38 public class PhysicsManager
39 {
40 private Dictionary<string, IPhysicsPlugin> _plugins=new Dictionary<string, IPhysicsPlugin>();
41
42 public PhysicsManager()
43 {
44
45 }
46
47 public PhysicsScene GetPhysicsScene(string engineName)
48 {
49 if( String.IsNullOrEmpty( engineName ) )
50 {
51 return new NullPhysicsScene();
52 }
53
54 if(_plugins.ContainsKey(engineName))
55 {
56 ServerConsole.MainConsole.Instance.WriteLine("creating "+engineName);
57 return _plugins[engineName].GetScene();
58 }
59 else
60 {
61 string error = String.Format("couldn't find physicsEngine: {0}", engineName);
62 ServerConsole.MainConsole.Instance.WriteLine( error );
63 throw new ArgumentException( error );
64 }
65 }
66
67 public void LoadPlugins()
68 {
69 string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory ,"Physics");
70 string[] pluginFiles = Directory.GetFiles(path, "*.dll");
71
72
73 for(int i= 0; i<pluginFiles.Length; i++)
74 {
75 this.AddPlugin(pluginFiles[i]);
76 }
77 }
78
79 private void AddPlugin(string FileName)
80 {
81 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
82
83 foreach (Type pluginType in pluginAssembly.GetTypes())
84 {
85 if (pluginType.IsPublic)
86 {
87 if (!pluginType.IsAbstract)
88 {
89 Type typeInterface = pluginType.GetInterface("IPhysicsPlugin", true);
90
91 if (typeInterface != null)
92 {
93 IPhysicsPlugin plug = (IPhysicsPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
94 plug.Init();
95 this._plugins.Add(plug.GetName(),plug);
96
97 }
98
99 typeInterface = null;
100 }
101 }
102 }
103
104 pluginAssembly = null;
105 }
106 }
107 public interface IPhysicsPlugin
108 {
109 bool Init();
110 PhysicsScene GetScene();
111 string GetName();
112 void Dispose();
113 }
114
115 public abstract class PhysicsScene
116 {
117 public static PhysicsScene Null
118 {
119 get
120 {
121 return new NullPhysicsScene();
122 }
123 }
124
125 public abstract PhysicsActor AddAvatar(PhysicsVector position);
126
127 public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size);
128
129 public abstract void Simulate(float timeStep);
130
131 public abstract void GetResults();
132
133 public abstract void SetTerrain(float[] heightMap);
134
135 public abstract bool IsThreaded
136 {
137 get;
138 }
139 }
140
141 public class NullPhysicsScene : PhysicsScene
142 {
143 private static int m_workIndicator;
144
145 public override PhysicsActor AddAvatar(PhysicsVector position)
146 {
147 ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : AddAvatar({0})", position );
148 return PhysicsActor.Null;
149 }
150
151 public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
152 {
153 ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : AddPrim({0},{1})", position, size );
154 return PhysicsActor.Null;
155 }
156
157 public override void Simulate(float timeStep)
158 {
159 m_workIndicator = ( m_workIndicator + 1 ) % 10;
160
161 ServerConsole.MainConsole.Instance.SetStatus( m_workIndicator.ToString() );
162 }
163
164 public override void GetResults()
165 {
166 ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : GetResults()" );
167 }
168
169 public override void SetTerrain(float[] heightMap)
170 {
171 ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : SetTerrain({0} items)", heightMap.Length );
172 }
173
174 public override bool IsThreaded
175 {
176 get { return false; }
177 }
178 }
179
180 public abstract class PhysicsActor
181 {
182 public static readonly PhysicsActor Null = new NullPhysicsActor();
183
184 public abstract PhysicsVector Position
185 {
186 get;
187 set;
188 }
189
190 public abstract PhysicsVector Velocity
191 {
192 get;
193 set;
194 }
195
196 public abstract PhysicsVector Acceleration
197 {
198 get;
199 }
200 public abstract bool Flying
201 {
202 get;
203 set;
204 }
205
206 public abstract void AddForce(PhysicsVector force);
207
208 public abstract void SetMomentum(PhysicsVector momentum);
209 }
210
211 public class NullPhysicsActor : PhysicsActor
212 {
213 public override PhysicsVector Position
214 {
215 get
216 {
217 return PhysicsVector.Zero;
218 }
219 set
220 {
221 return;
222 }
223 }
224
225 public override PhysicsVector Velocity
226 {
227 get
228 {
229 return PhysicsVector.Zero;
230 }
231 set
232 {
233 return;
234 }
235 }
236
237 public override PhysicsVector Acceleration
238 {
239 get { return PhysicsVector.Zero; }
240 }
241
242 public override bool Flying
243 {
244 get
245 {
246 return false;
247 }
248 set
249 {
250 return;
251 }
252 }
253
254 public override void AddForce(PhysicsVector force)
255 {
256 return;
257 }
258
259 public override void SetMomentum(PhysicsVector momentum)
260 {
261 return;
262 }
263 }
264
265 public class PhysicsVector
266 {
267 public float X;
268 public float Y;
269 public float Z;
270
271 public PhysicsVector()
272 {
273
274 }
275
276 public PhysicsVector(float x, float y, float z)
277 {
278 X = x;
279 Y = y;
280 Z = z;
281 }
282
283 public static readonly PhysicsVector Zero = new PhysicsVector(0f, 0f, 0f);
284 }
285}
diff --git a/src/physics/PhysicsManager.csproj b/src/physics/PhysicsManager.csproj
deleted file mode 100644
index 3eadfe7..0000000
--- a/src/physics/PhysicsManager.csproj
+++ /dev/null
@@ -1,40 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <OutputType>Library</OutputType>
4 <RootNamespace>PhysicsManager</RootNamespace>
5 <AssemblyName>PhysicsManager</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 <ProjectGuid>{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}</ProjectGuid>
9 </PropertyGroup>
10 <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
11 <OutputPath>bin\Debug\</OutputPath>
12 <Optimize>False</Optimize>
13 <DefineConstants>DEBUG;TRACE</DefineConstants>
14 <DebugSymbols>True</DebugSymbols>
15 <DebugType>Full</DebugType>
16 <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
17 </PropertyGroup>
18 <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
19 <OutputPath>bin\Release\</OutputPath>
20 <Optimize>True</Optimize>
21 <DefineConstants>TRACE</DefineConstants>
22 <DebugSymbols>False</DebugSymbols>
23 <DebugType>None</DebugType>
24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
25 </PropertyGroup>
26 <ItemGroup>
27 <Reference Include="System" />
28 <Reference Include="System.Xml" />
29 </ItemGroup>
30 <ItemGroup>
31 <Compile Include="PhysicsManager.cs" />
32 </ItemGroup>
33 <ItemGroup>
34 <ProjectReference Include="..\ServerConsole\ServerConsole\ServerConsole.csproj">
35 <Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
36 <Name>ServerConsole</Name>
37 </ProjectReference>
38 </ItemGroup>
39 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
40</Project> \ No newline at end of file
diff --git a/src/physics/RealPhysX/RealPhysXplugin/RealPhysXplugin.csproj b/src/physics/RealPhysX/RealPhysXplugin/RealPhysXplugin.csproj
deleted file mode 100644
index 554df5e..0000000
--- a/src/physics/RealPhysX/RealPhysXplugin/RealPhysXplugin.csproj
+++ /dev/null
@@ -1,46 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <OutputType>Library</OutputType>
4 <RootNamespace>RealPhysXplugin</RootNamespace>
5 <AssemblyName>RealPhysXplugin</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 <ProjectGuid>{56C1D214-F389-4228-921A-0A3A0712C159}</ProjectGuid>
9 </PropertyGroup>
10 <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
11 <OutputPath>..\..\..\..\bin\Physics\</OutputPath>
12 <Optimize>False</Optimize>
13 <DefineConstants>DEBUG;TRACE</DefineConstants>
14 <DebugSymbols>True</DebugSymbols>
15 <DebugType>Full</DebugType>
16 <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
17 </PropertyGroup>
18 <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
19 <OutputPath>..\..\..\..\bin\Physics\</OutputPath>
20 <Optimize>True</Optimize>
21 <DefineConstants>TRACE</DefineConstants>
22 <DebugSymbols>False</DebugSymbols>
23 <DebugType>None</DebugType>
24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
25 </PropertyGroup>
26 <ItemGroup>
27 <Reference Include="System" />
28 <Reference Include="System.Xml" />
29 <Reference Include="PhysX_Wrapper_Dotnet">
30 <HintPath>..\..\..\..\bin\PhysX_Wrapper_Dotnet.dll</HintPath>
31 <SpecificVersion>False</SpecificVersion>
32 <Private>False</Private>
33 </Reference>
34 </ItemGroup>
35 <ItemGroup>
36 <Compile Include="RealPhysX.cs" />
37 </ItemGroup>
38 <ItemGroup>
39 <ProjectReference Include="..\..\PhysicsManager.csproj">
40 <Project>{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}</Project>
41 <Name>PhysicsManager</Name>
42 <Private>False</Private>
43 </ProjectReference>
44 </ItemGroup>
45 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
46</Project> \ No newline at end of file
diff --git a/src/physics/default.build b/src/physics/default.build
deleted file mode 100644
index 01d2415..0000000
--- a/src/physics/default.build
+++ /dev/null
@@ -1,49 +0,0 @@
1<?xml version="1.0"?>
2 <project name="OpenSim" default="build" basedir=".">
3 <description>nant buildfile for OpenSim</description>
4 <property name="debug" value="true" overwrite="false" />
5 <target name="clean" description="remove all generated files">
6 <delete file="../../bin/PhysicsManager.dll" failonerror="false" />
7 </target>
8
9 <target name="svnupdate" description="updates to latest SVN">
10 <exec program="svn">
11 <arg value="update" />
12 </exec>
13 </target>
14
15 <target name="upgrade" description="updates from SVN and then builds" depends="clean,svnupdate,build">
16
17 </target>
18
19 <target name="build" description="compiles the source code">
20
21 <loadfile file="../../VERSION" property="svnver"/>
22 <asminfo output="AssemblyInfo.cs" language="CSharp">
23 <imports>
24 <import namespace="System" />
25 <import namespace="System.Reflection" />
26 <import namespace="System.Runtime.InteropServices" />
27 </imports>
28 <attributes>
29 <attribute type="ComVisibleAttribute" value="false" />
30 <attribute type="CLSCompliantAttribute" value="false" />
31 <attribute type="AssemblyVersionAttribute" value="${svnver}" />
32 <attribute type="AssemblyTitleAttribute" value="opensim-physicsmanager" />
33 <attribute type="AssemblyDescriptionAttribute" value="Handles physics plugins" />
34 <attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
35 </attributes>
36 </asminfo>
37
38 <csc target="library" output="../../bin/PhysicsManager.dll" debug="${debug}" verbose="true" warninglevel="4">
39 <references basedir="../../bin" failonempty="true">
40 <include name="System.dll" />
41 <include name="System.Xml.dll" />
42 <include name="ServerConsole.dll" />
43 </references>
44 <sources basedir="./">
45 <include name="*.cs" />
46 </sources>
47 </csc>
48 </target>
49</project>
diff --git a/src/physics/plugins/AssemblyInfo.cs b/src/physics/plugins/AssemblyInfo.cs
deleted file mode 100644
index 4cd5558..0000000
--- a/src/physics/plugins/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5// ------------------------------------------------------------------------------
6// <autogenerated>
7// This code was generated by a tool.
8// Mono Runtime Version: 2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </autogenerated>
13// ------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.1.0.240")]
18[assembly: AssemblyTitleAttribute("opensim-physicsmanager-physx")]
19[assembly: AssemblyDescriptionAttribute("PhysX plugin for OpenSim")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/physics/plugins/BasicPhysicsplugin.csproj b/src/physics/plugins/BasicPhysicsplugin.csproj
deleted file mode 100644
index b3f47d3..0000000
--- a/src/physics/plugins/BasicPhysicsplugin.csproj
+++ /dev/null
@@ -1,51 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ProductVersion>8.0.50727</ProductVersion>
6 <SchemaVersion>2.0</SchemaVersion>
7 <ProjectGuid>{52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}</ProjectGuid>
8 <OutputType>Library</OutputType>
9 <AppDesignerFolder>Properties</AppDesignerFolder>
10 <RootNamespace>BasicPhysicsplugin</RootNamespace>
11 <AssemblyName>BasicPhysicsplugin</AssemblyName>
12 </PropertyGroup>
13 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
14 <DebugSymbols>true</DebugSymbols>
15 <DebugType>full</DebugType>
16 <Optimize>false</Optimize>
17 <OutputPath>..\..\..\bin\Physics\</OutputPath>
18 <DefineConstants>DEBUG;TRACE</DefineConstants>
19 <ErrorReport>prompt</ErrorReport>
20 <WarningLevel>4</WarningLevel>
21 </PropertyGroup>
22 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
23 <DebugType>pdbonly</DebugType>
24 <Optimize>true</Optimize>
25 <OutputPath>..\..\..\bin\Physics\</OutputPath>
26 <DefineConstants>TRACE</DefineConstants>
27 <ErrorReport>prompt</ErrorReport>
28 <WarningLevel>4</WarningLevel>
29 </PropertyGroup>
30 <ItemGroup>
31 <Reference Include="Axiom.MathLib, Version=0.7.0.25497, Culture=neutral">
32 <SpecificVersion>False</SpecificVersion>
33 <HintPath>..\..\..\bin\Axiom.MathLib.dll</HintPath>
34 <Private>False</Private>
35 </Reference>
36 <Reference Include="System" />
37 <Reference Include="System.Data" />
38 <Reference Include="System.Xml" />
39 </ItemGroup>
40 <ItemGroup>
41 <Compile Include="PhysXplugin.cs" />
42 </ItemGroup>
43 <ItemGroup>
44 <ProjectReference Include="..\PhysicsManager.csproj">
45 <Project>{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}</Project>
46 <Name>PhysicsManager</Name>
47 <Private>False</Private>
48 </ProjectReference>
49 </ItemGroup>
50 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
51</Project> \ No newline at end of file
diff --git a/src/physics/plugins/default.build b/src/physics/plugins/default.build
deleted file mode 100644
index 66056a5..0000000
--- a/src/physics/plugins/default.build
+++ /dev/null
@@ -1,51 +0,0 @@
1<?xml version="1.0"?>
2 <project name="OpenSim" default="build" basedir=".">
3 <description>nant buildfile for OpenSim</description>
4 <property name="debug" value="true" overwrite="false" />
5 <target name="clean" description="remove all generated files">
6 <delete file="../../../bin/Physics/PhysXplugin.dll" failonerror="false" />
7 </target>
8
9 <target name="svnupdate" description="updates to latest SVN">
10 <exec program="svn">
11 <arg value="update" />
12 </exec>
13 </target>
14
15 <target name="upgrade" description="updates from SVN and then builds" depends="clean,svnupdate,build">
16
17 </target>
18
19 <target name="build" description="compiles the source code">
20
21 <loadfile file="../../../VERSION" property="svnver"/>
22 <asminfo output="AssemblyInfo.cs" language="CSharp">
23 <imports>
24 <import namespace="System" />
25 <import namespace="System.Reflection" />
26 <import namespace="System.Runtime.InteropServices" />
27 </imports>
28 <attributes>
29 <attribute type="ComVisibleAttribute" value="false" />
30 <attribute type="CLSCompliantAttribute" value="false" />
31 <attribute type="AssemblyVersionAttribute" value="${svnver}" />
32 <attribute type="AssemblyTitleAttribute" value="opensim-physicsmanager-physx" />
33 <attribute type="AssemblyDescriptionAttribute" value="PhysX plugin for OpenSim" />
34 <attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
35 </attributes>
36 </asminfo>
37
38 <mkdir dir="../../../bin/Physics"/>
39
40 <csc target="library" output="../../../bin/Physics/PhysXplugin.dll" debug="${debug}" verbose="true" warninglevel="4">
41 <references basedir="../../../bin" failonempty="true">
42 <include name="System.dll" />
43 <include name="System.Xml.dll" />
44 <include name="PhysicsManager.dll" />
45 </references>
46 <sources basedir="./">
47 <include name="*.cs" />
48 </sources>
49 </csc>
50 </target>
51</project>
diff --git a/src/world/Avatar.cs b/src/world/Avatar.cs
deleted file mode 100644
index facfeee..0000000
--- a/src/world/Avatar.cs
+++ /dev/null
@@ -1,487 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Text;
5using libsecondlife;
6using libsecondlife.Packets;
7using PhysicsSystem;
8using Axiom.MathLib;
9
10namespace OpenSim.world
11{
12 public class Avatar : Entity
13 {
14 public static bool PhysicsEngineFlying;
15 public string firstname;
16 public string lastname;
17 public OpenSimClient ControllingClient;
18 private PhysicsActor _physActor;
19 private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate;
20 private bool updateflag;
21 private byte movementflag;
22 private List<NewForce> forcesList = new List<NewForce>();
23 private short _updateCount;
24 private Axiom.MathLib.Quaternion bodyRot;
25
26 public Avatar(OpenSimClient TheClient) {
27 ServerConsole.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)");
28 ControllingClient=TheClient;
29 position = new LLVector3(100.0f,100.0f,30.0f);
30 position.Z = OpenSim_Main.local_world.LandMap[(int)position.Y * 256 + (int)position.X]+1;
31 }
32
33 public PhysicsActor PhysActor
34 {
35 set
36 {
37 this._physActor = value;
38 }
39 }
40 public override void addForces()
41 {
42 lock(this.forcesList)
43 {
44 if(this.forcesList.Count>0)
45 {
46 for(int i=0 ; i < this.forcesList.Count; i++)
47 {
48 NewForce force = this.forcesList[i];
49 PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z);
50 this._physActor.Velocity = phyVector;
51 this.updateflag = true;
52 this.velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this
53 // but as we are setting the velocity (rather than using real forces) at the moment it is okay.
54 }
55 for(int i=0 ; i < this.forcesList.Count; i++)
56 {
57 this.forcesList.RemoveAt(0);
58 }
59 }
60 }
61 }
62
63 public override void update()
64 {
65
66 if(this.updateflag)
67 {
68 //need to send movement info
69 //so create the improvedterseobjectupdate packet
70 //use CreateTerseBlock()
71 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
72 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
73 terse.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle; // FIXME
74 terse.RegionData.TimeDilation = 64096;
75 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
76 terse.ObjectData[0] = terseBlock;
77 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
78 client.OutPacket(terse);
79 }
80
81 updateflag =false;
82 //this._updateCount = 0;
83 }
84 else
85 {
86 //if((movementflag & 1) !=0)
87 //{
88 _updateCount++;
89 if(( (!PhysicsEngineFlying) && (_updateCount>3)) || (_updateCount>0))
90 {
91 //It has been a while since last update was sent so lets send one.
92 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
93 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
94 terse.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle; // FIXME
95 terse.RegionData.TimeDilation = 64096;
96 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
97 terse.ObjectData[0] = terseBlock;
98 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
99 client.OutPacket(terse);
100 }
101 _updateCount = 0;
102 }
103 //}
104 }
105 }
106
107 public static void SetupTemplate(string name)
108 {
109 int i = 0;
110 FileInfo fInfo = new FileInfo(name);
111 long numBytes = fInfo.Length;
112 FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read);
113 BinaryReader br = new BinaryReader(fStream);
114 byte [] data1 = br.ReadBytes((int)numBytes);
115 br.Close();
116 fStream.Close();
117
118 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
119
120 System.Text.Encoding enc = System.Text.Encoding.ASCII;
121 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
122 pos.X = 100f;
123 objdata.ID = 8880000;
124 objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0");
125 libsecondlife.LLVector3 pos2 = new LLVector3(100f,100f,23f);
126 //objdata.FullID=user.AgentID;
127 byte[] pb = pos.GetBytes();
128 Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length);
129
130 Avatar.AvatarTemplate = objdata;
131 }
132
133 public void CompleteMovement(World RegionInfo) {
134 ServerConsole.MainConsole.Instance.WriteLine("Avatar.cs:CompleteMovement() - Constructing AgentMovementComplete packet");
135 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
136 mov.AgentData.SessionID = this.ControllingClient.SessionID;
137 mov.AgentData.AgentID = this.ControllingClient.AgentID;
138 mov.Data.RegionHandle = OpenSim_Main.cfg.RegionHandle;
139 // TODO - dynamicalise this stuff
140 mov.Data.Timestamp = 1172750370;
141 mov.Data.Position = new LLVector3(100f, 100f, 23f);
142 mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0);
143
144 ControllingClient.OutPacket(mov);
145 }
146
147 public void SendInitialPosition() {
148
149 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
150 //send a objectupdate packet with information about the clients avatar
151 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
152 objupdate.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle;
153 objupdate.RegionData.TimeDilation = 64096;
154 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
155
156 objupdate.ObjectData[0] = AvatarTemplate;
157 //give this avatar object a local id and assign the user a name
158 objupdate.ObjectData[0].ID = this.localid;
159 objupdate.ObjectData[0].FullID = ControllingClient.AgentID;
160 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0");
161
162 libsecondlife.LLVector3 pos2 = new LLVector3((float)this.position.X, (float)this.position.Y, (float)this.position.Z);
163
164 byte[] pb = pos2.GetBytes();
165
166 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
167 OpenSim_Main.local_world._localNumber++;
168
169 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values)
170 {
171 client.OutPacket(objupdate);
172 if(client.AgentID != ControllingClient.AgentID)
173 {
174 SendAppearanceToOtherAgent(client);
175 }
176 }
177 //this.ControllingClient.OutPacket(objupdate);
178 }
179
180 public void SendInitialAppearance() {
181 AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket();
182 aw.AgentData.AgentID = this.ControllingClient.AgentID;
183 aw.AgentData.SerialNum = 0;
184 aw.AgentData.SessionID = ControllingClient.SessionID;
185
186 aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13];
187 AgentWearablesUpdatePacket.WearableDataBlock awb = new AgentWearablesUpdatePacket.WearableDataBlock();
188 awb.WearableType = (byte)0;
189 awb.AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
190 awb.ItemID = LLUUID.Random();
191 aw.WearableData[0] = awb;
192
193 for(int i=1; i<13; i++)
194 {
195 awb = new AgentWearablesUpdatePacket.WearableDataBlock();
196 awb.WearableType = (byte)i;
197 awb.AssetID = new LLUUID("00000000-0000-0000-0000-000000000000");
198 awb.ItemID = new LLUUID("00000000-0000-0000-0000-000000000000");
199 aw.WearableData[i] = awb;
200 }
201
202 ControllingClient.OutPacket(aw);
203 }
204
205 public ObjectUpdatePacket CreateUpdatePacket()
206 {
207 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
208 //send a objectupdate packet with information about the clients avatar
209 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
210 objupdate.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle;
211 objupdate.RegionData.TimeDilation = 64096;
212 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
213
214 objupdate.ObjectData[0] = AvatarTemplate;
215 //give this avatar object a local id and assign the user a name
216 objupdate.ObjectData[0].ID = this.localid;
217 objupdate.ObjectData[0].FullID = ControllingClient.AgentID;
218 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0");
219
220 libsecondlife.LLVector3 pos2 = new LLVector3((float)this._physActor.Position.X, (float)this._physActor.Position.Y, (float)this._physActor.Position.Z);
221
222 byte[] pb = pos2.GetBytes();
223
224 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
225 return objupdate;
226 }
227
228 public void SendAppearanceToOtherAgent(OpenSimClient userInfo)
229 {
230 AvatarAppearancePacket avp = new AvatarAppearancePacket();
231
232
233 avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218];
234 //avp.ObjectData.TextureEntry=this.avatar_template.TextureEntry;// br.ReadBytes((int)numBytes);
235
236 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-0000-000000000005"));
237 avp.ObjectData.TextureEntry = ntex.ToBytes();
238
239 AvatarAppearancePacket.VisualParamBlock avblock = null;
240 for(int i = 0; i < 218; i++)
241 {
242 avblock = new AvatarAppearancePacket.VisualParamBlock();
243 avblock.ParamValue = (byte)100;
244 avp.VisualParam[i] = avblock;
245 }
246
247 avp.Sender.IsTrial = false;
248 avp.Sender.ID = ControllingClient.AgentID;
249 userInfo.OutPacket(avp);
250
251 }
252
253 public void HandleUpdate(AgentUpdatePacket pack) {
254 if(((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_FLY) !=0)
255 {
256 this._physActor.Flying = true;
257 }
258 else
259 {
260 this._physActor.Flying = false;
261 }
262 if(((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_POS) !=0) {
263 Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z);
264 if(((movementflag & 1) ==0) || (q!= this.bodyRot))
265 {
266 //we should add a new force to the list
267 // but for now we will deal with velocities
268 NewForce newVelocity = new NewForce();
269 Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0);
270 Axiom.MathLib.Vector3 direc = q * v3;
271 direc.Normalize();
272
273 //work out velocity for sim physics system
274 direc = direc * ((0.03f) * 128f);
275 if(this._physActor.Flying)
276 direc *=2;
277
278 newVelocity.X = direc.x;
279 newVelocity.Y = direc.y;
280 newVelocity.Z = direc.z;
281 this.forcesList.Add(newVelocity);
282 movementflag = 1;
283 this.bodyRot = q;
284 }
285 }
286 else if((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_UP_POS) !=0) &&(PhysicsEngineFlying)) {
287 if(((movementflag & 2) ==0) && this._physActor.Flying)
288 {
289 //we should add a new force to the list
290 // but for now we will deal with velocities
291 NewForce newVelocity = new NewForce();
292 Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(0, 0, 1);
293 Axiom.MathLib.Vector3 direc = v3;
294 direc.Normalize();
295
296 //work out velocity for sim physics system
297 direc = direc * ((0.03f) * 128f *2);
298 newVelocity.X = direc.x;
299 newVelocity.Y = direc.y;
300 newVelocity.Z = direc.z;
301 this.forcesList.Add(newVelocity);
302 movementflag = 2;
303 }
304 }
305 else if((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_UP_NEG) !=0) && (PhysicsEngineFlying)) {
306 if(((movementflag & 4) ==0) && this._physActor.Flying)
307 {
308 //we should add a new force to the list
309 // but for now we will deal with velocities
310 NewForce newVelocity = new NewForce();
311 Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(0, 0, -1);
312 //Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z);
313 Axiom.MathLib.Vector3 direc = v3;
314 direc.Normalize();
315
316 //work out velocity for sim physics system
317 direc = direc * ((0.03f) * 128f *2);
318 newVelocity.X = direc.x;
319 newVelocity.Y = direc.y;
320 newVelocity.Z = direc.z;
321 this.forcesList.Add(newVelocity);
322 movementflag = 4;
323 }
324 }
325 else if(((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_NEG) !=0) {
326 Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z);
327 if(((movementflag & 8) ==0) || (q!= this.bodyRot))
328 {
329 //we should add a new force to the list
330 // but for now we will deal with velocities
331 NewForce newVelocity = new NewForce();
332 Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(-1, 0, 0);
333 Axiom.MathLib.Vector3 direc = q * v3;
334 direc.Normalize();
335
336 //work out velocity for sim physics system
337 direc = direc * ((0.03f) * 128f);
338 if(this._physActor.Flying)
339 direc *=2;
340
341 newVelocity.X = direc.x;
342 newVelocity.Y = direc.y;
343 newVelocity.Z = direc.z;
344 this.forcesList.Add(newVelocity);
345 movementflag = 8;
346 this.bodyRot = q;
347 }
348 }
349 else
350 {
351 if((movementflag) !=0)
352 {
353 NewForce newVelocity = new NewForce();
354 newVelocity.X = 0;
355 newVelocity.Y = 0;
356 newVelocity.Z = 0;
357 this.forcesList.Add(newVelocity);
358 movementflag = 0;
359 }
360 }
361 }
362
363 //should be moved somewhere else
364 public void SendRegionHandshake(World RegionInfo) {
365 ServerConsole.MainConsole.Instance.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
366 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
367 RegionHandshakePacket handshake = new RegionHandshakePacket();
368
369 ServerConsole.MainConsole.Instance.WriteLine("Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details");
370 handshake.RegionInfo.BillableFactor = 0;
371 handshake.RegionInfo.IsEstateManager = false;
372 handshake.RegionInfo.TerrainHeightRange00 = 60;
373 handshake.RegionInfo.TerrainHeightRange01 = 60;
374 handshake.RegionInfo.TerrainHeightRange10 = 60;
375 handshake.RegionInfo.TerrainHeightRange11 = 60;
376 handshake.RegionInfo.TerrainStartHeight00 = 10;
377 handshake.RegionInfo.TerrainStartHeight01 = 10;
378 handshake.RegionInfo.TerrainStartHeight10 = 10;
379 handshake.RegionInfo.TerrainStartHeight11 = 10;
380 handshake.RegionInfo.SimAccess = 13;
381 handshake.RegionInfo.WaterHeight = 20;
382 handshake.RegionInfo.RegionFlags = 72458694;
383 handshake.RegionInfo.SimName = _enc.GetBytes(OpenSim_Main.cfg.RegionName + "\0");
384 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
385 handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975");
386 handshake.RegionInfo.TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3");
387 handshake.RegionInfo.TerrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f");
388 handshake.RegionInfo.TerrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2");
389 handshake.RegionInfo.TerrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000");
390 handshake.RegionInfo.TerrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000");
391 handshake.RegionInfo.TerrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000");
392 handshake.RegionInfo.TerrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000");
393 handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37");
394
395 ServerConsole.MainConsole.Instance.WriteLine("Avatar.cs:SendRegionHandshake() - Sending RegionHandshake packet");
396 this.ControllingClient.OutPacket(handshake);
397 }
398
399 public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock()
400 {
401 byte[] bytes = new byte[60];
402 int i=0;
403 ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
404
405 dat.TextureEntry = AvatarTemplate.TextureEntry;
406 libsecondlife.LLVector3 pos2 = new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z);
407
408 uint ID = this.localid;
409
410 bytes[i++] = (byte)(ID % 256);
411 bytes[i++] = (byte)((ID >> 8) % 256);
412 bytes[i++] = (byte)((ID >> 16) % 256);
413 bytes[i++] = (byte)((ID >> 24) % 256);
414 bytes[i++] = 0;
415 bytes[i++] = 1;
416 i += 14;
417 bytes[i++] = 128;
418 bytes[i++] = 63;
419
420 byte[] pb = pos2.GetBytes();
421 Array.Copy(pb, 0, bytes, i, pb.Length);
422 i += 12;
423 ushort InternVelocityX;
424 ushort InternVelocityY;
425 ushort InternVelocityZ;
426
427 Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(this._physActor.Velocity.X, this._physActor.Velocity.Y, this._physActor.Velocity.Z);
428 internDirec = internDirec /128.0f;
429 internDirec.x += 1;
430 internDirec.y += 1;
431 internDirec.z += 1;
432
433 InternVelocityX = (ushort)(32768 * internDirec.x);
434 InternVelocityY = (ushort)(32768 * internDirec.y);
435 InternVelocityZ = (ushort)(32768 * internDirec.z);
436
437 ushort ac = 32767;
438 bytes[i++] = (byte)(InternVelocityX % 256);
439 bytes[i++] = (byte)((InternVelocityX >> 8) % 256);
440 bytes[i++] = (byte)(InternVelocityY % 256);
441 bytes[i++] = (byte)((InternVelocityY>> 8) % 256);
442 bytes[i++] = (byte)(InternVelocityZ % 256);
443 bytes[i++] = (byte)((InternVelocityZ >> 8) % 256);
444
445 //accel
446 bytes[i++] = (byte)(ac % 256);
447 bytes[i++] = (byte)((ac >> 8) % 256);
448 bytes[i++] = (byte)(ac % 256);
449 bytes[i++] = (byte)((ac >> 8) % 256);
450 bytes[i++] = (byte)(ac % 256);
451 bytes[i++] = (byte)((ac >> 8) % 256);
452
453 //rot
454 bytes[i++] = (byte)(ac % 256);
455 bytes[i++] = (byte)((ac >> 8) % 256);
456 bytes[i++] = (byte)(ac % 256);
457 bytes[i++] = (byte)((ac >> 8) % 256);
458 bytes[i++] = (byte)(ac % 256);
459 bytes[i++] = (byte)((ac >> 8) % 256);
460 bytes[i++] = (byte)(ac % 256);
461 bytes[i++] = (byte)((ac >> 8) % 256);
462
463 //rotation vel
464 bytes[i++] = (byte)(ac % 256);
465 bytes[i++] = (byte)((ac >> 8) % 256);
466 bytes[i++] = (byte)(ac % 256);
467 bytes[i++] = (byte)((ac >> 8) % 256);
468 bytes[i++] = (byte)(ac % 256);
469 bytes[i++] = (byte)((ac >> 8) % 256);
470
471 dat.Data=bytes;
472 return(dat);
473 }
474 }
475
476 public class NewForce
477 {
478 public float X;
479 public float Y;
480 public float Z;
481
482 public NewForce()
483 {
484
485 }
486 }
487}
diff --git a/src/world/Primitive.cs b/src/world/Primitive.cs
deleted file mode 100644
index 6be33ef..0000000
--- a/src/world/Primitive.cs
+++ /dev/null
@@ -1,429 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.types;
5using libsecondlife;
6using libsecondlife.Packets;
7using GridInterfaces;
8using PhysicsSystem;
9
10namespace OpenSim.world
11{
12 public class Primitive : Entity
13 {
14 protected float mesh_cutbegin;
15 protected float mesh_cutend;
16 protected PrimData primData;
17 protected bool newPrimFlag;
18 protected bool updateFlag;
19 protected bool dirtyFlag;
20 private ObjectUpdatePacket OurPacket;
21 private PhysicsActor _physActor;
22 private bool physicsEnabled;
23
24 public bool PhysicsEnabled
25 {
26 get
27 {
28 return physicsEnabled;
29 }
30 set
31 {
32 physicsEnabled = value;
33 }
34 }
35 public bool UpdateFlag
36 {
37 get
38 {
39 return updateFlag;
40 }
41 set
42 {
43 updateFlag = value;
44 }
45 }
46 public LLVector3 Scale
47 {
48 set
49 {
50 this.primData.Scale = value;
51 this.dirtyFlag = true;
52 }
53 get
54 {
55 return this.primData.Scale;
56 }
57 }
58 public PhysicsActor PhysActor
59 {
60 set
61 {
62 this._physActor = value;
63 }
64 }
65
66 public Primitive()
67 {
68 mesh_cutbegin = 0.0f;
69 mesh_cutend = 1.0f;
70 }
71
72 public override Mesh getMesh()
73 {
74 Mesh mesh = new Mesh();
75 Triangle tri = new Triangle(
76 new Axiom.MathLib.Vector3(0.0f, 1.0f, 1.0f),
77 new Axiom.MathLib.Vector3(1.0f, 0.0f, 1.0f),
78 new Axiom.MathLib.Vector3(1.0f, 1.0f, 0.0f));
79
80 mesh.AddTri(tri);
81 mesh += base.getMesh();
82
83 return mesh;
84 }
85
86 public void UpdatePosition( LLVector3 pos)
87 {
88 this.position = pos;
89 if(this._physActor != null && this.physicsEnabled)
90 {
91 this._physActor.Position = new PhysicsVector(pos.X, pos.Y, pos.Z);
92 }
93 this.updateFlag = true;
94 }
95
96 public override void update()
97 {
98 if(this.newPrimFlag)
99 {
100 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
101 client.OutPacket(OurPacket);
102 }
103 this.newPrimFlag = false;
104 }
105 else if(this.updateFlag)
106 {
107 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
108 terse.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle; // FIXME
109 terse.RegionData.TimeDilation = 64096;
110 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
111 terse.ObjectData[0] = this.CreateImprovedBlock();
112 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
113 client.OutPacket(terse);
114 }
115 this.updateFlag = false;
116 }
117 else if(this.dirtyFlag)
118 {
119 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
120 UpdateClient(client);
121 }
122 this.dirtyFlag = false;
123 }
124 else
125 {
126 if(this._physActor != null && this.physicsEnabled)
127 {
128 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
129 terse.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle; // FIXME
130 terse.RegionData.TimeDilation = 64096;
131 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
132 terse.ObjectData[0] = this.CreateImprovedBlock();
133 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
134 client.OutPacket(terse);
135 }
136 }
137 }
138 }
139
140 public void UpdateClient(OpenSimClient RemoteClient)
141 {
142
143 LLVector3 lPos;
144 if( this._physActor != null && this.physicsEnabled)
145 {
146 PhysicsVector pPos = this._physActor.Position;
147 lPos = new LLVector3( pPos.X, pPos.Y, pPos.Z);
148 }
149 else
150 {
151 lPos = this.position;
152 }
153 byte[] pb = lPos.GetBytes();
154 Array.Copy(pb, 0, OurPacket.ObjectData[0].ObjectData, 0, pb.Length);
155
156 // OurPacket should be update with the follwing in updateShape() rather than having to do it here
157 OurPacket.ObjectData[0].OwnerID = this.primData.OwnerID;
158 OurPacket.ObjectData[0].PCode = this.primData.PCode;
159 OurPacket.ObjectData[0].PathBegin = this.primData.PathBegin;
160 OurPacket.ObjectData[0].PathEnd = this.primData.PathEnd;
161 OurPacket.ObjectData[0].PathScaleX = this.primData.PathScaleX;
162 OurPacket.ObjectData[0].PathScaleY = this.primData.PathScaleY;
163 OurPacket.ObjectData[0].PathShearX = this.primData.PathShearX;
164 OurPacket.ObjectData[0].PathShearY = this.primData.PathShearY;
165 OurPacket.ObjectData[0].PathSkew = this.primData.PathSkew;
166 OurPacket.ObjectData[0].ProfileBegin = this.primData.ProfileBegin;
167 OurPacket.ObjectData[0].ProfileEnd = this.primData.ProfileEnd;
168 OurPacket.ObjectData[0].Scale = this.primData.Scale;
169 OurPacket.ObjectData[0].PathCurve = this.primData.PathCurve;
170 OurPacket.ObjectData[0].ProfileCurve = this.primData.ProfileCurve;
171 OurPacket.ObjectData[0].ParentID = 0;
172 OurPacket.ObjectData[0].ProfileHollow = this.primData.ProfileHollow;
173 //finish off copying rest of shape data
174 OurPacket.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset;
175 OurPacket.ObjectData[0].PathRevolutions = this.primData.PathRevolutions;
176 OurPacket.ObjectData[0].PathTaperX = this.primData.PathTaperX;
177 OurPacket.ObjectData[0].PathTaperY = this.primData.PathTaperY;
178 OurPacket.ObjectData[0].PathTwist = this.primData.PathTwist;
179 OurPacket.ObjectData[0].PathTwistBegin= this.primData.PathTwistBegin;
180
181 RemoteClient.OutPacket(OurPacket);
182 }
183
184 public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket)
185 {
186 this.primData.PathBegin = addPacket.PathBegin;
187 this.primData.PathEnd = addPacket.PathEnd;
188 this.primData.PathScaleX = addPacket.PathScaleX;
189 this.primData.PathScaleY = addPacket.PathScaleY;
190 this.primData.PathShearX = addPacket.PathShearX;
191 this.primData.PathShearY = addPacket.PathShearY;
192 this.primData.PathSkew = addPacket.PathSkew;
193 this.primData.ProfileBegin = addPacket.ProfileBegin;
194 this.primData.ProfileEnd = addPacket.ProfileEnd;
195 this.primData.PathCurve = addPacket.PathCurve;
196 this.primData.ProfileCurve = addPacket.ProfileCurve;
197 this.primData.ProfileHollow = addPacket.ProfileHollow;
198 this.primData.PathRadiusOffset = addPacket.PathRadiusOffset;
199 this.primData.PathRevolutions = addPacket.PathRevolutions;
200 this.primData.PathTaperX = addPacket.PathTaperX;
201 this.primData.PathTaperY = addPacket.PathTaperY;
202 this.primData.PathTwist = addPacket.PathTwist;
203 this.primData.PathTwistBegin =addPacket.PathTwistBegin;
204 this.dirtyFlag = true;
205 }
206
207 public void CreateFromPacket( ObjectAddPacket addPacket, LLUUID agentID, uint localID)
208 {
209 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
210 objupdate.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle;
211 objupdate.RegionData.TimeDilation = 64096;
212
213 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
214 PrimData PData = new PrimData();
215 this.primData = PData;
216 objupdate.ObjectData[0] = new ObjectUpdatePacket.ObjectDataBlock();
217 objupdate.ObjectData[0].PSBlock = new byte[0];
218 objupdate.ObjectData[0].ExtraParams = new byte[1];
219 objupdate.ObjectData[0].MediaURL = new byte[0];
220 objupdate.ObjectData[0].NameValue = new byte[0];
221 objupdate.ObjectData[0].Text = new byte[0];
222 objupdate.ObjectData[0].TextColor = new byte[4];
223 objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0,0,0);
224 objupdate.ObjectData[0].JointPivot = new LLVector3(0,0,0);
225 objupdate.ObjectData[0].Material = 3;
226 objupdate.ObjectData[0].UpdateFlags=32+65536+131072+256+4+8+2048+524288+268435456;
227 objupdate.ObjectData[0].TextureAnim = new byte[0];
228 objupdate.ObjectData[0].Sound = LLUUID.Zero;
229 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
230 objupdate.ObjectData[0].TextureEntry = ntex.ToBytes();
231 objupdate.ObjectData[0].State = 0;
232 objupdate.ObjectData[0].Data = new byte[0];
233 PData.OwnerID = objupdate.ObjectData[0].OwnerID = agentID;
234 PData.PCode = objupdate.ObjectData[0].PCode = addPacket.ObjectData.PCode;
235 PData.PathBegin = objupdate.ObjectData[0].PathBegin = addPacket.ObjectData.PathBegin;
236 PData.PathEnd = objupdate.ObjectData[0].PathEnd = addPacket.ObjectData.PathEnd;
237 PData.PathScaleX = objupdate.ObjectData[0].PathScaleX = addPacket.ObjectData.PathScaleX;
238 PData.PathScaleY = objupdate.ObjectData[0].PathScaleY = addPacket.ObjectData.PathScaleY;
239 PData.PathShearX = objupdate.ObjectData[0].PathShearX = addPacket.ObjectData.PathShearX;
240 PData.PathShearY = objupdate.ObjectData[0].PathShearY = addPacket.ObjectData.PathShearY;
241 PData.PathSkew = objupdate.ObjectData[0].PathSkew = addPacket.ObjectData.PathSkew;
242 PData.ProfileBegin = objupdate.ObjectData[0].ProfileBegin = addPacket.ObjectData.ProfileBegin;
243 PData.ProfileEnd = objupdate.ObjectData[0].ProfileEnd = addPacket.ObjectData.ProfileEnd;
244 PData.Scale = objupdate.ObjectData[0].Scale = addPacket.ObjectData.Scale;
245 PData.PathCurve = objupdate.ObjectData[0].PathCurve = addPacket.ObjectData.PathCurve;
246 PData.ProfileCurve = objupdate.ObjectData[0].ProfileCurve = addPacket.ObjectData.ProfileCurve;
247 PData.ParentID = objupdate.ObjectData[0].ParentID = 0;
248 PData.ProfileHollow = objupdate.ObjectData[0].ProfileHollow = addPacket.ObjectData.ProfileHollow;
249
250 PData.PathRadiusOffset = objupdate.ObjectData[0].PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset;
251 PData.PathRevolutions = objupdate.ObjectData[0].PathRevolutions = addPacket.ObjectData.PathRevolutions;
252 PData.PathTaperX = objupdate.ObjectData[0].PathTaperX = addPacket.ObjectData.PathTaperX;
253 PData.PathTaperY = objupdate.ObjectData[0].PathTaperY = addPacket.ObjectData.PathTaperY;
254 PData.PathTwist = objupdate.ObjectData[0].PathTwist = addPacket.ObjectData.PathTwist;
255 PData.PathTwistBegin = objupdate.ObjectData[0].PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
256
257 //finish off copying rest of shape data
258
259 objupdate.ObjectData[0].ID = (uint)(localID);
260 objupdate.ObjectData[0].FullID = new LLUUID("edba7151-5857-acc5-b30b-f01efef" + (localID- 702000).ToString("00000"));
261 objupdate.ObjectData[0].ObjectData = new byte[60];
262 objupdate.ObjectData[0].ObjectData[46] = 128;
263 objupdate.ObjectData[0].ObjectData[47] = 63;
264 LLVector3 pos1= addPacket.ObjectData.RayEnd;
265 //update position
266 byte[] pb = pos1.GetBytes();
267 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 0, pb.Length);
268
269 this.newPrimFlag = true;
270 this.uuid = objupdate.ObjectData[0].FullID;
271 this.localid = objupdate.ObjectData[0].ID;
272 this.position = pos1;
273 this.OurPacket = objupdate;
274 }
275
276 public void CreateFromStorage(PrimData store)
277 {
278 //need to clean this up as it shares a lot of code with CreateFromPacket()
279 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
280 objupdate.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle;
281 objupdate.RegionData.TimeDilation = 64096;
282 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
283
284 this.primData = store;
285 objupdate.ObjectData[0] = new ObjectUpdatePacket.ObjectDataBlock();
286 objupdate.ObjectData[0].PSBlock = new byte[0];
287 objupdate.ObjectData[0].ExtraParams = new byte[1];
288 objupdate.ObjectData[0].MediaURL = new byte[0];
289 objupdate.ObjectData[0].NameValue = new byte[0];
290 objupdate.ObjectData[0].Text = new byte[0];
291 objupdate.ObjectData[0].TextColor = new byte[4];
292 objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0,0,0);
293 objupdate.ObjectData[0].JointPivot = new LLVector3(0,0,0);
294 objupdate.ObjectData[0].Material = 3;
295 objupdate.ObjectData[0].UpdateFlags=32+65536+131072+256+4+8+2048+524288+268435456;
296 objupdate.ObjectData[0].TextureAnim = new byte[0];
297 objupdate.ObjectData[0].Sound = LLUUID.Zero;
298 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
299 objupdate.ObjectData[0].TextureEntry = ntex.ToBytes();
300 objupdate.ObjectData[0].State = 0;
301 objupdate.ObjectData[0].Data = new byte[0];
302 objupdate.ObjectData[0].OwnerID = this.primData.OwnerID;
303 objupdate.ObjectData[0].PCode = this.primData.PCode;
304 objupdate.ObjectData[0].PathBegin = this.primData.PathBegin;
305 objupdate.ObjectData[0].PathEnd = this.primData.PathEnd;
306 objupdate.ObjectData[0].PathScaleX = this.primData.PathScaleX;
307 objupdate.ObjectData[0].PathScaleY = this.primData.PathScaleY;
308 objupdate.ObjectData[0].PathShearX = this.primData.PathShearX;
309 objupdate.ObjectData[0].PathShearY = this.primData.PathShearY;
310 objupdate.ObjectData[0].PathSkew = this.primData.PathSkew;
311 objupdate.ObjectData[0].ProfileBegin = this.primData.ProfileBegin;
312 objupdate.ObjectData[0].ProfileEnd = this.primData.ProfileEnd;
313 objupdate.ObjectData[0].Scale = this.primData.Scale;
314 objupdate.ObjectData[0].PathCurve = this.primData.PathCurve;
315 objupdate.ObjectData[0].ProfileCurve = this.primData.ProfileCurve;
316 objupdate.ObjectData[0].ParentID = 0;
317 objupdate.ObjectData[0].ProfileHollow = this.primData.ProfileHollow;
318 //finish off copying rest of shape data
319 objupdate.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset;
320 objupdate.ObjectData[0].PathRevolutions = this.primData.PathRevolutions;
321 objupdate.ObjectData[0].PathTaperX = this.primData.PathTaperX;
322 objupdate.ObjectData[0].PathTaperY = this.primData.PathTaperY;
323 objupdate.ObjectData[0].PathTwist = this.primData.PathTwist;
324 objupdate.ObjectData[0].PathTwistBegin= this.primData.PathTwistBegin;
325
326 objupdate.ObjectData[0].ID = (uint)store.LocalID;
327 objupdate.ObjectData[0].FullID = store.FullID;
328
329 objupdate.ObjectData[0].ObjectData = new byte[60];
330 objupdate.ObjectData[0].ObjectData[46] = 128;
331 objupdate.ObjectData[0].ObjectData[47] = 63;
332 LLVector3 pos1= store.Position;
333 //update position
334 byte[] pb = pos1.GetBytes();
335 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 0, pb.Length);
336
337 this.uuid = objupdate.ObjectData[0].FullID;
338 this.localid = objupdate.ObjectData[0].ID;
339 this.position = pos1;
340 this.OurPacket = objupdate;
341
342 }
343 public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateImprovedBlock()
344 {
345 uint ID = this.localid;
346 byte[] bytes = new byte[60];
347
348 int i = 0;
349 ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
350 dat.TextureEntry = this.OurPacket.ObjectData[0].TextureEntry;
351
352 bytes[i++] = (byte)(ID % 256);
353 bytes[i++] = (byte)((ID >> 8) % 256);
354 bytes[i++] = (byte)((ID >> 16) % 256);
355 bytes[i++] = (byte)((ID >> 24) % 256);
356 bytes[i++]= 0;
357 bytes[i++]= 0;
358
359 LLVector3 lPos;
360 if( this._physActor != null && this.physicsEnabled)
361 {
362 PhysicsVector pPos = this._physActor.Position;
363 lPos = new LLVector3( pPos.X, pPos.Y, pPos.Z);
364 }
365 else
366 {
367 lPos = this.position;
368 }
369 byte[] pb = lPos.GetBytes();
370 Array.Copy(pb, 0, bytes, i, pb.Length);
371 i += 12;
372 ushort ac = 32767;
373
374 //vel
375 bytes[i++] = (byte)(ac % 256);
376 bytes[i++] = (byte)((ac >> 8) % 256);
377 bytes[i++] = (byte)(ac % 256);
378 bytes[i++] = (byte)((ac >> 8) % 256);
379 bytes[i++] = (byte)(ac % 256);
380 bytes[i++] = (byte)((ac >> 8) % 256);
381
382 //accel
383 bytes[i++] = (byte)(ac % 256);
384 bytes[i++] = (byte)((ac >> 8) % 256);
385 bytes[i++] = (byte)(ac % 256);
386 bytes[i++] = (byte)((ac >> 8) % 256);
387 bytes[i++] = (byte)(ac % 256);
388 bytes[i++] = (byte)((ac >> 8) % 256);
389
390 ushort rw, rx,ry,rz;
391 rw = (ushort)(32768 * (this.rotation.w+1));
392 rx = (ushort)(32768 * (this.rotation.x+1));
393 ry = (ushort)(32768 * (this.rotation.y+1));
394 rz = (ushort)(32768 * (this.rotation.z+1));
395
396 //rot
397 bytes[i++] = (byte)(rx % 256);
398 bytes[i++] = (byte)((rx >> 8) % 256);
399 bytes[i++] = (byte)(ry % 256);
400 bytes[i++] = (byte)((ry >> 8) % 256);
401 bytes[i++] = (byte)(rz % 256);
402 bytes[i++] = (byte)((rz >> 8) % 256);
403 bytes[i++] = (byte)(rw % 256);
404 bytes[i++] = (byte)((rw >> 8) % 256);
405
406 //rotation vel
407 bytes[i++] = (byte)(ac % 256);
408 bytes[i++] = (byte)((ac >> 8) % 256);
409 bytes[i++] = (byte)(ac % 256);
410 bytes[i++] = (byte)((ac >> 8) % 256);
411 bytes[i++] = (byte)(ac % 256);
412 bytes[i++] = (byte)((ac >> 8) % 256);
413
414 dat.Data=bytes;
415 return dat;
416 }
417
418 public override void BackUp()
419 {
420
421 this.primData.FullID = this.uuid;
422 this.primData.LocalID = this.localid;
423 this.primData.Position = this.position;
424 this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z , this.rotation.w);
425 OpenSim_Main.local_world.localStorage.StorePrim(this.primData);
426 }
427 }
428
429}