aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenSim.Framework/Types
diff options
context:
space:
mode:
authorMW2007-05-26 13:40:19 +0000
committerMW2007-05-26 13:40:19 +0000
commit3436961bb5c01d659d09be134368f4f69460cef9 (patch)
tree3753ba4d7818df2a6bce0bbe863ff033cdfd568a /Common/OpenSim.Framework/Types
downloadopensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.zip
opensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.tar.gz
opensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.tar.bz2
opensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.tar.xz
Start of rewrite 5279!
Diffstat (limited to 'Common/OpenSim.Framework/Types')
-rw-r--r--Common/OpenSim.Framework/Types/AgentCiruitData.cs22
-rw-r--r--Common/OpenSim.Framework/Types/AssetBase.cs22
-rw-r--r--Common/OpenSim.Framework/Types/AssetLandmark.cs34
-rw-r--r--Common/OpenSim.Framework/Types/AssetStorage.cs23
-rw-r--r--Common/OpenSim.Framework/Types/Login.cs24
-rw-r--r--Common/OpenSim.Framework/Types/NeighbourInfo.cs19
-rw-r--r--Common/OpenSim.Framework/Types/OSVector3.cs18
-rw-r--r--Common/OpenSim.Framework/Types/PrimData.cs173
8 files changed, 335 insertions, 0 deletions
diff --git a/Common/OpenSim.Framework/Types/AgentCiruitData.cs b/Common/OpenSim.Framework/Types/AgentCiruitData.cs
new file mode 100644
index 0000000..7314586
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/AgentCiruitData.cs
@@ -0,0 +1,22 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class AgentCircuitData
9 {
10 public AgentCircuitData() { }
11 public LLUUID AgentID;
12 public LLUUID SessionID;
13 public LLUUID SecureSessionID;
14 public LLVector3 startpos;
15 public string firstname;
16 public string lastname;
17 public uint circuitcode;
18 public bool child;
19 public LLUUID InventoryFolder;
20 public LLUUID BaseFolder;
21 }
22}
diff --git a/Common/OpenSim.Framework/Types/AssetBase.cs b/Common/OpenSim.Framework/Types/AssetBase.cs
new file mode 100644
index 0000000..f6104f8
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/AssetBase.cs
@@ -0,0 +1,22 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class AssetBase
9 {
10 public byte[] Data;
11 public LLUUID FullID;
12 public sbyte Type;
13 public sbyte InvType;
14 public string Name;
15 public string Description;
16
17 public AssetBase()
18 {
19
20 }
21 }
22}
diff --git a/Common/OpenSim.Framework/Types/AssetLandmark.cs b/Common/OpenSim.Framework/Types/AssetLandmark.cs
new file mode 100644
index 0000000..9d1a326
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/AssetLandmark.cs
@@ -0,0 +1,34 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class AssetLandmark : AssetBase
9 {
10 public int Version;
11 public LLVector3 Position;
12 public LLUUID RegionID;
13
14 public AssetLandmark(AssetBase a)
15 {
16 this.Data = a.Data;
17 this.FullID = a.FullID;
18 this.Type = a.Type;
19 this.InvType = a.InvType;
20 this.Name = a.Name;
21 this.Description = a.Description;
22 InternData();
23 }
24
25 private void InternData()
26 {
27 string temp = System.Text.Encoding.UTF8.GetString(Data).Trim();
28 string[] parts = temp.Split('\n');
29 int.TryParse(parts[0].Substring(17, 1), out Version);
30 LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID);
31 LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position);
32 }
33 }
34}
diff --git a/Common/OpenSim.Framework/Types/AssetStorage.cs b/Common/OpenSim.Framework/Types/AssetStorage.cs
new file mode 100644
index 0000000..5b5b3b2
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/AssetStorage.cs
@@ -0,0 +1,23 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class AssetStorage
9 {
10
11 public AssetStorage() {
12 }
13
14 public AssetStorage(LLUUID assetUUID) {
15 UUID=assetUUID;
16 }
17
18 public byte[] Data;
19 public sbyte Type;
20 public string Name;
21 public LLUUID UUID;
22 }
23}
diff --git a/Common/OpenSim.Framework/Types/Login.cs b/Common/OpenSim.Framework/Types/Login.cs
new file mode 100644
index 0000000..71f9de3
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/Login.cs
@@ -0,0 +1,24 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class Login
9 {
10 public string First = "Test";
11 public string Last = "User";
12 public LLUUID Agent;
13 public LLUUID Session;
14 public LLUUID SecureSession = LLUUID.Zero;
15 public LLUUID InventoryFolder;
16 public LLUUID BaseFolder;
17 public uint CircuitCode;
18
19 public Login()
20 {
21
22 }
23 }
24}
diff --git a/Common/OpenSim.Framework/Types/NeighbourInfo.cs b/Common/OpenSim.Framework/Types/NeighbourInfo.cs
new file mode 100644
index 0000000..58b6cb1
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/NeighbourInfo.cs
@@ -0,0 +1,19 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework.Types
6{
7 public class NeighbourInfo
8 {
9 public NeighbourInfo()
10 {
11 }
12
13 public ulong regionhandle;
14 public uint RegionLocX;
15 public uint RegionLocY;
16 public string sim_ip;
17 public uint sim_port;
18 }
19}
diff --git a/Common/OpenSim.Framework/Types/OSVector3.cs b/Common/OpenSim.Framework/Types/OSVector3.cs
new file mode 100644
index 0000000..8fb840b
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/OSVector3.cs
@@ -0,0 +1,18 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework.Types
6{
7 public class OSVector3
8 {
9 public float X;
10 public float Y;
11 public float Z;
12
13 public OSVector3()
14 {
15
16 }
17 }
18}
diff --git a/Common/OpenSim.Framework/Types/PrimData.cs b/Common/OpenSim.Framework/Types/PrimData.cs
new file mode 100644
index 0000000..68e2a22
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/PrimData.cs
@@ -0,0 +1,173 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class PrimData
9 {
10 private const uint FULL_MASK_PERMISSIONS = 2147483647;
11
12 public LLUUID OwnerID;
13 public byte PCode;
14 public ushort PathBegin;
15 public ushort PathEnd;
16 public byte PathScaleX;
17 public byte PathScaleY;
18 public byte PathShearX;
19 public byte PathShearY;
20 public sbyte PathSkew;
21 public ushort ProfileBegin;
22 public ushort ProfileEnd;
23 public LLVector3 Scale;
24 public byte PathCurve;
25 public byte ProfileCurve;
26 public uint ParentID = 0;
27 public ushort ProfileHollow;
28 public sbyte PathRadiusOffset;
29 public byte PathRevolutions;
30 public sbyte PathTaperX;
31 public sbyte PathTaperY;
32 public sbyte PathTwist;
33 public sbyte PathTwistBegin;
34 public byte[] Texture;
35
36
37 public Int32 CreationDate;
38 public uint OwnerMask = FULL_MASK_PERMISSIONS;
39 public uint NextOwnerMask = FULL_MASK_PERMISSIONS;
40 public uint GroupMask = FULL_MASK_PERMISSIONS;
41 public uint EveryoneMask = FULL_MASK_PERMISSIONS;
42 public uint BaseMask = FULL_MASK_PERMISSIONS;
43
44 //following only used during prim storage
45 public LLVector3 Position;
46 public LLQuaternion Rotation = new LLQuaternion(0,1,0,0);
47 public uint LocalID;
48 public LLUUID FullID;
49
50 public PrimData()
51 {
52
53 }
54
55 public PrimData(byte[] data)
56 {
57 int i =0;
58
59 this.OwnerID = new LLUUID(data, i); i += 16;
60 this.PCode = data[i++];
61 this.PathBegin = (ushort)(data[i++] + (data[i++] << 8));
62 this.PathEnd = (ushort)(data[i++] + (data[i++] << 8));
63 this.PathScaleX = data[i++];
64 this.PathScaleY = data[i++];
65 this.PathShearX = data[i++];
66 this.PathShearY = data[i++];
67 this.PathSkew = (sbyte)data[i++];
68 this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8));
69 this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8));
70 this.Scale = new LLVector3(data, i); i += 12;
71 this.PathCurve = data[i++];
72 this.ProfileCurve = data[i++];
73 this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
74 this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8));
75 this.PathRadiusOffset = (sbyte)data[i++];
76 this.PathRevolutions = data[i++];
77 this.PathTaperX = (sbyte)data[i++];
78 this.PathTaperY =(sbyte) data[i++];
79 this.PathTwist = (sbyte) data[i++];
80 this.PathTwistBegin = (sbyte) data[i++];
81 ushort length = (ushort)(data[i++] + (data[i++] << 8));
82 this.Texture = new byte[length];
83 Array.Copy(data, i, Texture, 0, length); i += length;
84 this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
85 this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
86 this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
87 this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
88 this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
89 this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
90 this.Position = new LLVector3(data, i); i += 12;
91 this.Rotation = new LLQuaternion(data,i, true); i += 12;
92 this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
93 this.FullID = new LLUUID(data, i); i += 16;
94
95 }
96
97 public byte[] ToBytes()
98 {
99 int i = 0;
100 byte[] bytes = new byte[126 + Texture.Length];
101 Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
102 bytes[i++] = this.PCode;
103 bytes[i++] = (byte)(this.PathBegin % 256);
104 bytes[i++] = (byte)((this.PathBegin >> 8) % 256);
105 bytes[i++] = (byte)(this.PathEnd % 256);
106 bytes[i++] = (byte)((this.PathEnd >> 8) % 256);
107 bytes[i++] = this.PathScaleX;
108 bytes[i++] = this.PathScaleY;
109 bytes[i++] = this.PathShearX;
110 bytes[i++] = this.PathShearY;
111 bytes[i++] = (byte)this.PathSkew;
112 bytes[i++] = (byte)(this.ProfileBegin % 256);
113 bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256);
114 bytes[i++] = (byte)(this.ProfileEnd % 256);
115 bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256);
116 Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12;
117 bytes[i++] = this.PathCurve;
118 bytes[i++] = this.ProfileCurve;
119 bytes[i++] = (byte)(ParentID % 256);
120 bytes[i++] = (byte)((ParentID >> 8) % 256);
121 bytes[i++] = (byte)((ParentID >> 16) % 256);
122 bytes[i++] = (byte)((ParentID >> 24) % 256);
123 bytes[i++] = (byte)(this.ProfileHollow %256);
124 bytes[i++] = (byte)((this.ProfileHollow >> 8)% 256);
125 bytes[i++] = ((byte)this.PathRadiusOffset);
126 bytes[i++] = this.PathRevolutions;
127 bytes[i++] = ((byte) this.PathTaperX);
128 bytes[i++] = ((byte) this.PathTaperY);
129 bytes[i++] = ((byte) this.PathTwist);
130 bytes[i++] = ((byte) this.PathTwistBegin);
131 bytes[i++] = (byte)(Texture.Length % 256);
132 bytes[i++] = (byte)((Texture.Length >> 8) % 256);
133 Array.Copy(Texture, 0, bytes, i, Texture.Length); i += Texture.Length;
134 bytes[i++] = (byte)(this.CreationDate % 256);
135 bytes[i++] = (byte)((this.CreationDate >> 8) % 256);
136 bytes[i++] = (byte)((this.CreationDate >> 16) % 256);
137 bytes[i++] = (byte)((this.CreationDate >> 24) % 256);
138 bytes[i++] = (byte)(this.OwnerMask % 256);
139 bytes[i++] = (byte)((this.OwnerMask >> 8) % 256);
140 bytes[i++] = (byte)((this.OwnerMask >> 16) % 256);
141 bytes[i++] = (byte)((this.OwnerMask >> 24) % 256);
142 bytes[i++] = (byte)(this.NextOwnerMask % 256);
143 bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256);
144 bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256);
145 bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256);
146 bytes[i++] = (byte)(this.GroupMask % 256);
147 bytes[i++] = (byte)((this.GroupMask >> 8) % 256);
148 bytes[i++] = (byte)((this.GroupMask >> 16) % 256);
149 bytes[i++] = (byte)((this.GroupMask >> 24) % 256);
150 bytes[i++] = (byte)(this.EveryoneMask % 256);
151 bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256);
152 bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256);
153 bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256);
154 bytes[i++] = (byte)(this.BaseMask % 256);
155 bytes[i++] = (byte)((this.BaseMask >> 8) % 256);
156 bytes[i++] = (byte)((this.BaseMask >> 16) % 256);
157 bytes[i++] = (byte)((this.BaseMask >> 24) % 256);
158 Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12;
159 if (this.Rotation == new LLQuaternion(0,0,0,0))
160 {
161 this.Rotation = new LLQuaternion(0, 1, 0, 0);
162 }
163 Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12;
164 bytes[i++] = (byte)(this.LocalID % 256);
165 bytes[i++] = (byte)((this.LocalID >> 8) % 256);
166 bytes[i++] = (byte)((this.LocalID >> 16) % 256);
167 bytes[i++] = (byte)((this.LocalID >> 24) % 256);
168 Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16;
169
170 return bytes;
171 }
172 }
173}