diff options
-rw-r--r-- | OpenSim/Framework/General/Interfaces/IClientAPI.cs | 3 | ||||
-rw-r--r-- | OpenSim/Framework/General/NullClientAPI.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.API.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup.cs | 244 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart.cs | 258 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Primitive.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 54 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 3 |
10 files changed, 100 insertions, 508 deletions
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index abde0ab..808a857 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -190,6 +190,7 @@ namespace OpenSim.Framework.Interfaces | |||
190 | void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item); | 190 | void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item); |
191 | void SendNameReply(LLUUID profileId, string firstname, string lastname); | 191 | void SendNameReply(LLUUID profileId, string firstname, string lastname); |
192 | 192 | ||
193 | 193 | void SendAlertMessage(string message); | |
194 | void SendAgentAlertMessage(string message, bool modal); | ||
194 | } | 195 | } |
195 | } | 196 | } |
diff --git a/OpenSim/Framework/General/NullClientAPI.cs b/OpenSim/Framework/General/NullClientAPI.cs index f753d05..cfba228 100644 --- a/OpenSim/Framework/General/NullClientAPI.cs +++ b/OpenSim/Framework/General/NullClientAPI.cs | |||
@@ -125,5 +125,8 @@ namespace OpenSim.Framework | |||
125 | public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items){} | 125 | public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items){} |
126 | public virtual void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item){} | 126 | public virtual void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item){} |
127 | public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname){} | 127 | public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname){} |
128 | } | 128 | |
129 | public void SendAlertMessage(string message) { } | ||
130 | public void SendAgentAlertMessage(string message, bool modal) { } | ||
131 | } | ||
129 | } | 132 | } |
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 81523e0..8a1e0f1 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -361,6 +361,13 @@ namespace OpenSim | |||
361 | } | 361 | } |
362 | break; | 362 | break; |
363 | 363 | ||
364 | case "alert": | ||
365 | for (int i = 0; i < m_localWorld.Count; i++) | ||
366 | { | ||
367 | ((Scene)m_localWorld[i]).HandleAlertCommand(cmdparams); | ||
368 | } | ||
369 | break; | ||
370 | |||
364 | case "quit": | 371 | case "quit": |
365 | case "shutdown": | 372 | case "shutdown": |
366 | Shutdown(); | 373 | Shutdown(); |
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 81fa58b..8a5e631 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -36,6 +36,7 @@ using OpenSim.Framework.Console; | |||
36 | using OpenSim.Framework.Interfaces; | 36 | using OpenSim.Framework.Interfaces; |
37 | using OpenSim.Framework.Types; | 37 | using OpenSim.Framework.Types; |
38 | using OpenSim.Framework.Data; | 38 | using OpenSim.Framework.Data; |
39 | using OpenSim.Framework.Utilities; | ||
39 | 40 | ||
40 | namespace OpenSim.Region.ClientStack | 41 | namespace OpenSim.Region.ClientStack |
41 | { | 42 | { |
@@ -576,6 +577,31 @@ namespace OpenSim.Region.ClientStack | |||
576 | this.OutPacket(inventoryReply); | 577 | this.OutPacket(inventoryReply); |
577 | } | 578 | } |
578 | 579 | ||
580 | /// <summary> | ||
581 | /// | ||
582 | /// </summary> | ||
583 | /// <param name="message"></param> | ||
584 | public void SendAlertMessage(string message) | ||
585 | { | ||
586 | AlertMessagePacket alertPack = new AlertMessagePacket(); | ||
587 | alertPack.AlertData.Message = Helpers.StringToField(message); | ||
588 | OutPacket(alertPack); | ||
589 | } | ||
590 | |||
591 | /// <summary> | ||
592 | /// | ||
593 | /// </summary> | ||
594 | /// <param name="message"></param> | ||
595 | /// <param name="modal"></param> | ||
596 | public void SendAgentAlertMessage(string message, bool modal) | ||
597 | { | ||
598 | AgentAlertMessagePacket alertPack = new AgentAlertMessagePacket(); | ||
599 | alertPack.AgentData.AgentID = this.AgentID; | ||
600 | alertPack.AlertData.Message = Helpers.StringToField(message); | ||
601 | alertPack.AlertData.Modal = modal; | ||
602 | OutPacket(alertPack); | ||
603 | } | ||
604 | |||
579 | #region Appearance/ Wearables Methods | 605 | #region Appearance/ Wearables Methods |
580 | 606 | ||
581 | /// <summary> | 607 | /// <summary> |
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup.cs deleted file mode 100644 index 93fbe74..0000000 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup.cs +++ /dev/null | |||
@@ -1,244 +0,0 @@ | |||
1 | using System.Collections.Generic; | ||
2 | using System.Text; | ||
3 | using Axiom.Math; | ||
4 | using libsecondlife; | ||
5 | using libsecondlife.Packets; | ||
6 | using OpenSim.Framework.Interfaces; | ||
7 | using OpenSim.Framework.Types; | ||
8 | using OpenSim.Physics.Manager; | ||
9 | |||
10 | namespace OpenSim.Region.Environment.Scenes | ||
11 | { | ||
12 | public delegate void PrimCountTaintedDelegate(); | ||
13 | |||
14 | public class AllNewSceneObjectGroup : EntityBase | ||
15 | { | ||
16 | private Encoding enc = Encoding.ASCII; | ||
17 | |||
18 | protected AllNewSceneObjectPart m_rootPart; | ||
19 | protected Dictionary<LLUUID, AllNewSceneObjectPart> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart>(); | ||
20 | |||
21 | public event PrimCountTaintedDelegate OnPrimCountTainted; | ||
22 | |||
23 | /// <summary> | ||
24 | /// | ||
25 | /// </summary> | ||
26 | public int primCount | ||
27 | { | ||
28 | get | ||
29 | { | ||
30 | return 1; | ||
31 | } | ||
32 | } | ||
33 | |||
34 | /// <summary> | ||
35 | /// | ||
36 | /// </summary> | ||
37 | public LLVector3 GroupCentrePoint | ||
38 | { | ||
39 | get | ||
40 | { | ||
41 | return new LLVector3(0, 0, 0); | ||
42 | } | ||
43 | } | ||
44 | |||
45 | /// <summary> | ||
46 | /// | ||
47 | /// </summary> | ||
48 | public AllNewSceneObjectGroup() | ||
49 | { | ||
50 | |||
51 | } | ||
52 | |||
53 | /// <summary> | ||
54 | /// | ||
55 | /// </summary> | ||
56 | public void FlagGroupForFullUpdate() | ||
57 | { | ||
58 | |||
59 | } | ||
60 | |||
61 | /// <summary> | ||
62 | /// | ||
63 | /// </summary> | ||
64 | public void FlagGroupForTerseUpdate() | ||
65 | { | ||
66 | |||
67 | } | ||
68 | |||
69 | /// <summary> | ||
70 | /// | ||
71 | /// </summary> | ||
72 | /// <param name="objectGroup"></param> | ||
73 | public void LinkToGroup(AllNewSceneObjectGroup objectGroup) | ||
74 | { | ||
75 | |||
76 | } | ||
77 | |||
78 | /// <summary> | ||
79 | /// | ||
80 | /// </summary> | ||
81 | /// <param name="primID"></param> | ||
82 | /// <returns></returns> | ||
83 | public AllNewSceneObjectPart HasChildPrim(LLUUID primID) | ||
84 | { | ||
85 | AllNewSceneObjectPart childPart = null; | ||
86 | if (this.m_parts.ContainsKey(primID)) | ||
87 | { | ||
88 | childPart = this.m_parts[primID]; | ||
89 | } | ||
90 | return childPart; | ||
91 | } | ||
92 | |||
93 | /// <summary> | ||
94 | /// | ||
95 | /// </summary> | ||
96 | /// <param name="localID"></param> | ||
97 | /// <returns></returns> | ||
98 | public AllNewSceneObjectPart HasChildPrim(uint localID) | ||
99 | { | ||
100 | foreach (AllNewSceneObjectPart part in this.m_parts.Values) | ||
101 | { | ||
102 | if (part.m_localID == localID) | ||
103 | { | ||
104 | return part; | ||
105 | } | ||
106 | } | ||
107 | return null; | ||
108 | } | ||
109 | |||
110 | public void TriggerTainted() | ||
111 | { | ||
112 | if (OnPrimCountTainted != null) | ||
113 | { | ||
114 | this.OnPrimCountTainted(); | ||
115 | } | ||
116 | } | ||
117 | |||
118 | /// <summary> | ||
119 | /// | ||
120 | /// </summary> | ||
121 | /// <param name="offset"></param> | ||
122 | /// <param name="pos"></param> | ||
123 | /// <param name="remoteClient"></param> | ||
124 | public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) | ||
125 | { | ||
126 | this.Pos = pos; | ||
127 | } | ||
128 | |||
129 | /// <summary> | ||
130 | /// | ||
131 | /// </summary> | ||
132 | /// <param name="client"></param> | ||
133 | public void GetProperites(IClientAPI client) | ||
134 | { | ||
135 | ObjectPropertiesPacket proper = new ObjectPropertiesPacket(); | ||
136 | proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; | ||
137 | proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); | ||
138 | proper.ObjectData[0].ItemID = LLUUID.Zero; | ||
139 | proper.ObjectData[0].CreationDate = (ulong)this.m_rootPart.CreationDate; | ||
140 | proper.ObjectData[0].CreatorID = this.m_rootPart.CreatorID; | ||
141 | proper.ObjectData[0].FolderID = LLUUID.Zero; | ||
142 | proper.ObjectData[0].FromTaskID = LLUUID.Zero; | ||
143 | proper.ObjectData[0].GroupID = LLUUID.Zero; | ||
144 | proper.ObjectData[0].InventorySerial = 0; | ||
145 | proper.ObjectData[0].LastOwnerID = this.m_rootPart.LastOwnerID; | ||
146 | proper.ObjectData[0].ObjectID = this.m_uuid; | ||
147 | proper.ObjectData[0].OwnerID = this.m_rootPart.OwnerID; | ||
148 | proper.ObjectData[0].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0"); | ||
149 | proper.ObjectData[0].TextureID = new byte[0]; | ||
150 | proper.ObjectData[0].SitName = enc.GetBytes(this.m_rootPart.SitName + "\0"); | ||
151 | proper.ObjectData[0].Name = enc.GetBytes(this.m_rootPart.Name + "\0"); | ||
152 | proper.ObjectData[0].Description = enc.GetBytes(this.m_rootPart.Description + "\0"); | ||
153 | proper.ObjectData[0].OwnerMask = this.m_rootPart.OwnerMask; | ||
154 | proper.ObjectData[0].NextOwnerMask = this.m_rootPart.NextOwnerMask; | ||
155 | proper.ObjectData[0].GroupMask = this.m_rootPart.GroupMask; | ||
156 | proper.ObjectData[0].EveryoneMask = this.m_rootPart.EveryoneMask; | ||
157 | proper.ObjectData[0].BaseMask = this.m_rootPart.BaseMask; | ||
158 | |||
159 | client.OutPacket(proper); | ||
160 | } | ||
161 | |||
162 | /// <summary> | ||
163 | /// | ||
164 | /// </summary> | ||
165 | /// <param name="part"></param> | ||
166 | private void SetPartAsRoot(AllNewSceneObjectPart part) | ||
167 | { | ||
168 | this.m_rootPart = part; | ||
169 | this.m_uuid = part.uuid; | ||
170 | this.m_localId = part.m_localID; | ||
171 | part.ParentID = 0; | ||
172 | part.UpdateHandler = delegate(ref LLVector3 pos, UpdateType direction, AllNewSceneObjectPart objectPart) | ||
173 | { | ||
174 | switch (direction) | ||
175 | { | ||
176 | case UpdateType.GroupPositionEdit: | ||
177 | this.m_pos = new LLVector3(pos.X, pos.Y, pos.Z); | ||
178 | pos.X = 0; | ||
179 | pos.Y = 0; | ||
180 | pos.Z = 0; | ||
181 | break; | ||
182 | |||
183 | case UpdateType.SinglePositionEdit: | ||
184 | LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); | ||
185 | LLVector3 oldPos = new LLVector3(this.Pos.X + objectPart.OffsetPosition.X, this.Pos.Y + objectPart.OffsetPosition.Y, this.Pos.Z + objectPart.OffsetPosition.Z); | ||
186 | LLVector3 diff = oldPos - newPos; | ||
187 | Axiom.Math.Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z); | ||
188 | Axiom.Math.Quaternion partRotation = new Quaternion(objectPart.RotationOffset.W, objectPart.RotationOffset.X, objectPart.RotationOffset.Y, objectPart.RotationOffset.Z); | ||
189 | axDiff = partRotation.Inverse() * axDiff; | ||
190 | diff.X = axDiff.x; | ||
191 | diff.Y = axDiff.y; | ||
192 | diff.Z = axDiff.z; | ||
193 | |||
194 | foreach (AllNewSceneObjectPart obPart in this.m_parts.Values) | ||
195 | { | ||
196 | if (obPart.uuid == objectPart.uuid) | ||
197 | { | ||
198 | obPart.OffsetPosition = obPart.OffsetPosition + diff; | ||
199 | } | ||
200 | } | ||
201 | this.Pos = newPos; | ||
202 | pos.X = newPos.X; | ||
203 | pos.Y = newPos.Y; | ||
204 | pos.Z = newPos.Z; | ||
205 | break; | ||
206 | |||
207 | case UpdateType.ResizeOffset: | ||
208 | this.Pos += pos; | ||
209 | LLVector3 offset = new LLVector3(-pos.X, -pos.Y, -pos.Z); | ||
210 | foreach (AllNewSceneObjectPart obPart2 in this.m_parts.Values) | ||
211 | { | ||
212 | if (obPart2.uuid == objectPart.uuid) | ||
213 | { | ||
214 | obPart2.OffsetPosition = obPart2.OffsetPosition + offset; | ||
215 | } | ||
216 | } | ||
217 | pos.X = 0; | ||
218 | pos.Y = 0; | ||
219 | pos.Z = 0; | ||
220 | break; | ||
221 | |||
222 | case UpdateType.SingleRotationEdit: | ||
223 | break; | ||
224 | } | ||
225 | |||
226 | |||
227 | return pos; | ||
228 | }; | ||
229 | } | ||
230 | |||
231 | /// <summary> | ||
232 | /// | ||
233 | /// </summary> | ||
234 | /// <param name="part"></param> | ||
235 | private void SetPartAsNonRoot(AllNewSceneObjectPart part) | ||
236 | { | ||
237 | part.ParentID = this.m_rootPart.m_localID; | ||
238 | part.UpdateHandler = delegate(ref LLVector3 pos, UpdateType direction, AllNewSceneObjectPart objectPart) | ||
239 | { | ||
240 | return pos; | ||
241 | }; | ||
242 | } | ||
243 | } | ||
244 | } | ||
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs index 5d3a406..4f48217 100644 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs +++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs | |||
@@ -225,7 +225,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
225 | #region Roation | 225 | #region Roation |
226 | public void UpdateGroupRotation(LLQuaternion rot) | 226 | public void UpdateGroupRotation(LLQuaternion rot) |
227 | { | 227 | { |
228 | this.m_rootPart.RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W); | 228 | this.m_rootPart.UpdateRotation(rot); |
229 | } | 229 | } |
230 | 230 | ||
231 | /// <summary> | 231 | /// <summary> |
@@ -233,9 +233,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
233 | /// </summary> | 233 | /// </summary> |
234 | /// <param name="pos"></param> | 234 | /// <param name="pos"></param> |
235 | /// <param name="rot"></param> | 235 | /// <param name="rot"></param> |
236 | public void UpdateGroupMouseRotation(LLVector3 pos, LLQuaternion rot) | 236 | public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot) |
237 | { | 237 | { |
238 | this.m_rootPart.RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W); | 238 | this.m_rootPart.UpdateRotation(rot); |
239 | this.m_pos = pos; | 239 | this.m_pos = pos; |
240 | } | 240 | } |
241 | 241 | ||
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart.cs deleted file mode 100644 index 4b05e31..0000000 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart.cs +++ /dev/null | |||
@@ -1,258 +0,0 @@ | |||
1 | using System.Collections.Generic; | ||
2 | using System.Text; | ||
3 | using System; | ||
4 | using Axiom.Math; | ||
5 | using libsecondlife; | ||
6 | using libsecondlife.Packets; | ||
7 | using OpenSim.Framework.Interfaces; | ||
8 | using OpenSim.Framework.Types; | ||
9 | |||
10 | namespace OpenSim.Region.Environment.Scenes | ||
11 | { | ||
12 | public enum UpdateType | ||
13 | { | ||
14 | OutGoingOffset, | ||
15 | GroupPositionEdit, | ||
16 | SinglePositionEdit, | ||
17 | ResizeOffset, | ||
18 | SingleRotationEdit | ||
19 | } | ||
20 | |||
21 | public delegate LLVector3 HandleUpdate(ref LLVector3 pos, UpdateType updateType, AllNewSceneObjectPart objectPart); | ||
22 | |||
23 | public class AllNewSceneObjectPart | ||
24 | { | ||
25 | private const uint FULL_MASK_PERMISSIONS = 2147483647; | ||
26 | |||
27 | private ulong m_regionHandle; | ||
28 | private uint m_flags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456 + 128; // HOUSEKEEPING : Do we really need this? | ||
29 | //private Dictionary<LLUUID, InventoryItem> inventoryItems; | ||
30 | |||
31 | public string SitName = ""; | ||
32 | public string TouchName = ""; | ||
33 | public string Text = ""; | ||
34 | |||
35 | public LLUUID CreatorID; | ||
36 | public LLUUID OwnerID; | ||
37 | public LLUUID LastOwnerID; | ||
38 | public Int32 CreationDate; | ||
39 | |||
40 | public LLUUID uuid; | ||
41 | public uint m_localID; | ||
42 | |||
43 | public uint ParentID = 0; | ||
44 | |||
45 | public uint OwnerMask = FULL_MASK_PERMISSIONS; | ||
46 | public uint NextOwnerMask = FULL_MASK_PERMISSIONS; | ||
47 | public uint GroupMask = FULL_MASK_PERMISSIONS; | ||
48 | public uint EveryoneMask = FULL_MASK_PERMISSIONS; | ||
49 | public uint BaseMask = FULL_MASK_PERMISSIONS; | ||
50 | |||
51 | protected PrimitiveBaseShape m_Shape; | ||
52 | |||
53 | protected AllNewSceneObjectGroup m_parentGroup; | ||
54 | |||
55 | public HandleUpdate UpdateHandler; | ||
56 | |||
57 | #region Properties | ||
58 | protected string m_name; | ||
59 | /// <summary> | ||
60 | /// | ||
61 | /// </summary> | ||
62 | public virtual string Name | ||
63 | { | ||
64 | get { return m_name; } | ||
65 | set { m_name = value; } | ||
66 | } | ||
67 | |||
68 | protected LLVector3 m_offset; | ||
69 | public LLVector3 OffsetPosition | ||
70 | { | ||
71 | get | ||
72 | { | ||
73 | return m_offset; | ||
74 | } | ||
75 | set | ||
76 | { | ||
77 | m_offset = value; | ||
78 | } | ||
79 | } | ||
80 | |||
81 | protected LLQuaternion m_rotationOffset; | ||
82 | public LLQuaternion RotationOffset | ||
83 | { | ||
84 | get | ||
85 | { | ||
86 | return m_rotationOffset; | ||
87 | } | ||
88 | set | ||
89 | { | ||
90 | m_rotationOffset = value; | ||
91 | } | ||
92 | } | ||
93 | |||
94 | private string m_description = ""; | ||
95 | public string Description | ||
96 | { | ||
97 | get | ||
98 | { | ||
99 | return this.m_description; | ||
100 | } | ||
101 | set | ||
102 | { | ||
103 | this.m_description = value; | ||
104 | } | ||
105 | } | ||
106 | |||
107 | public PrimitiveBaseShape Shape | ||
108 | { | ||
109 | get | ||
110 | { | ||
111 | return this.m_Shape; | ||
112 | } | ||
113 | } | ||
114 | |||
115 | public LLVector3 Scale | ||
116 | { | ||
117 | set | ||
118 | { | ||
119 | this.m_Shape.Scale = value; | ||
120 | } | ||
121 | get | ||
122 | { | ||
123 | return this.m_Shape.Scale; | ||
124 | } | ||
125 | } | ||
126 | #endregion | ||
127 | |||
128 | #region Constructors | ||
129 | public AllNewSceneObjectPart(ulong regionHandle, AllNewSceneObjectGroup parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 position) | ||
130 | { | ||
131 | this.m_regionHandle = regionHandle; | ||
132 | this.m_parentGroup = parent; | ||
133 | |||
134 | this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
135 | this.OwnerID = ownerID; | ||
136 | this.CreatorID = this.OwnerID; | ||
137 | this.LastOwnerID = LLUUID.Zero; | ||
138 | this.uuid = LLUUID.Random(); | ||
139 | this.m_localID = (uint)(localID); | ||
140 | this.m_Shape = shape; | ||
141 | |||
142 | this.UpdateHandler(ref position, UpdateType.GroupPositionEdit, this); | ||
143 | this.OffsetPosition = position; | ||
144 | } | ||
145 | #endregion | ||
146 | |||
147 | #region Shape | ||
148 | /// <summary> | ||
149 | /// | ||
150 | /// </summary> | ||
151 | /// <param name="shapeBlock"></param> | ||
152 | public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock) | ||
153 | { | ||
154 | this.m_Shape.PathBegin = shapeBlock.PathBegin; | ||
155 | this.m_Shape.PathEnd = shapeBlock.PathEnd; | ||
156 | this.m_Shape.PathScaleX = shapeBlock.PathScaleX; | ||
157 | this.m_Shape.PathScaleY = shapeBlock.PathScaleY; | ||
158 | this.m_Shape.PathShearX = shapeBlock.PathShearX; | ||
159 | this.m_Shape.PathShearY = shapeBlock.PathShearY; | ||
160 | this.m_Shape.PathSkew = shapeBlock.PathSkew; | ||
161 | this.m_Shape.ProfileBegin = shapeBlock.ProfileBegin; | ||
162 | this.m_Shape.ProfileEnd = shapeBlock.ProfileEnd; | ||
163 | this.m_Shape.PathCurve = shapeBlock.PathCurve; | ||
164 | this.m_Shape.ProfileCurve = shapeBlock.ProfileCurve; | ||
165 | this.m_Shape.ProfileHollow = shapeBlock.ProfileHollow; | ||
166 | this.m_Shape.PathRadiusOffset = shapeBlock.PathRadiusOffset; | ||
167 | this.m_Shape.PathRevolutions = shapeBlock.PathRevolutions; | ||
168 | this.m_Shape.PathTaperX = shapeBlock.PathTaperX; | ||
169 | this.m_Shape.PathTaperY = shapeBlock.PathTaperY; | ||
170 | this.m_Shape.PathTwist = shapeBlock.PathTwist; | ||
171 | this.m_Shape.PathTwistBegin = shapeBlock.PathTwistBegin; | ||
172 | } | ||
173 | #endregion | ||
174 | |||
175 | #region Texture | ||
176 | /// <summary> | ||
177 | /// | ||
178 | /// </summary> | ||
179 | /// <param name="textureEntry"></param> | ||
180 | public void UpdateTextureEntry(byte[] textureEntry) | ||
181 | { | ||
182 | this.m_Shape.TextureEntry = textureEntry; | ||
183 | } | ||
184 | #endregion | ||
185 | |||
186 | #region Position | ||
187 | /// <summary> | ||
188 | /// | ||
189 | /// </summary> | ||
190 | /// <param name="pos"></param> | ||
191 | public void UpdateGroupPosition(LLVector3 pos) | ||
192 | { | ||
193 | LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); | ||
194 | this.UpdateHandler(ref newPos, UpdateType.GroupPositionEdit, this); | ||
195 | this.OffsetPosition = newPos; | ||
196 | } | ||
197 | |||
198 | public void UpdateSinglePosition(LLVector3 pos) | ||
199 | { | ||
200 | LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); | ||
201 | this.UpdateHandler(ref newPos, UpdateType.SinglePositionEdit, this); | ||
202 | this.OffsetPosition = newPos; | ||
203 | } | ||
204 | #endregion | ||
205 | |||
206 | #region rotation | ||
207 | public void UpdateGroupRotation(LLQuaternion rot) | ||
208 | { | ||
209 | this.RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W); | ||
210 | } | ||
211 | |||
212 | /// <summary> | ||
213 | /// | ||
214 | /// </summary> | ||
215 | /// <param name="pos"></param> | ||
216 | /// <param name="rot"></param> | ||
217 | public void UpdateGroupMouseRotation(LLVector3 pos, LLQuaternion rot) | ||
218 | { | ||
219 | this.RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W); | ||
220 | this.UpdateHandler(ref pos, UpdateType.GroupPositionEdit, this); | ||
221 | this.OffsetPosition = pos; | ||
222 | } | ||
223 | |||
224 | /// <summary> | ||
225 | /// | ||
226 | /// </summary> | ||
227 | /// <param name="rot"></param> | ||
228 | public void UpdateSingleRotation(LLQuaternion rot) | ||
229 | { | ||
230 | //Console.WriteLine("updating single prim rotation"); | ||
231 | Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); | ||
232 | Axiom.Math.Quaternion oldParentRot = new Quaternion(this.RotationOffset.W, this.RotationOffset.X, this.RotationOffset.Y, this.RotationOffset.Z); | ||
233 | this.RotationOffset = new LLQuaternion(axRot.x, axRot.y, axRot.z, axRot.w); | ||
234 | |||
235 | LLVector3 offset = this.OffsetPosition; | ||
236 | this.UpdateHandler(ref offset, UpdateType.SingleRotationEdit, this); | ||
237 | } | ||
238 | #endregion | ||
239 | |||
240 | #region Resizing/Scale | ||
241 | /// <summary> | ||
242 | /// | ||
243 | /// </summary> | ||
244 | /// <param name="scale"></param> | ||
245 | public void ResizeGoup(LLVector3 scale) | ||
246 | { | ||
247 | LLVector3 offset = (scale - this.m_Shape.Scale); | ||
248 | offset.X /= 2; | ||
249 | offset.Y /= 2; | ||
250 | offset.Z /= 2; | ||
251 | |||
252 | this.UpdateHandler(ref offset, UpdateType.ResizeOffset, this); | ||
253 | this.OffsetPosition += offset; | ||
254 | this.m_Shape.Scale = scale; | ||
255 | } | ||
256 | #endregion | ||
257 | } | ||
258 | } | ||
diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs index 67ba500..f421529 100644 --- a/OpenSim/Region/Environment/Scenes/Primitive.cs +++ b/OpenSim/Region/Environment/Scenes/Primitive.cs | |||
@@ -9,7 +9,7 @@ using OpenSim.Framework.Types; | |||
9 | 9 | ||
10 | namespace OpenSim.Region.Environment.Scenes | 10 | namespace OpenSim.Region.Environment.Scenes |
11 | { | 11 | { |
12 | // public delegate void PrimCountTaintedDelegate(); | 12 | public delegate void PrimCountTaintedDelegate(); |
13 | 13 | ||
14 | public class Primitive : EntityBase | 14 | public class Primitive : EntityBase |
15 | { | 15 | { |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 7ed4c96..f435681 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -910,5 +910,59 @@ namespace OpenSim.Region.Environment.Scenes | |||
910 | } | 910 | } |
911 | 911 | ||
912 | #endregion | 912 | #endregion |
913 | |||
914 | #region Alert Methods | ||
915 | public void SendGeneralAlert(string message) | ||
916 | { | ||
917 | foreach (ScenePresence presence in this.Avatars.Values) | ||
918 | { | ||
919 | presence.ControllingClient.SendAlertMessage(message); | ||
920 | } | ||
921 | } | ||
922 | |||
923 | public void SendAlertToUser(LLUUID agentID, string message, bool modal) | ||
924 | { | ||
925 | if (this.Avatars.ContainsKey(agentID)) | ||
926 | { | ||
927 | this.Avatars[agentID].ControllingClient.SendAgentAlertMessage(message, modal); | ||
928 | } | ||
929 | } | ||
930 | |||
931 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) | ||
932 | { | ||
933 | foreach (ScenePresence presence in this.Avatars.Values) | ||
934 | { | ||
935 | if ((presence.firstname == firstName) && (presence.lastname == lastName)) | ||
936 | { | ||
937 | presence.ControllingClient.SendAgentAlertMessage(message, modal); | ||
938 | break; | ||
939 | } | ||
940 | } | ||
941 | } | ||
942 | |||
943 | public void HandleAlertCommand(string[] commandParams) | ||
944 | { | ||
945 | if (commandParams[0] == "general") | ||
946 | { | ||
947 | string message = this.CombineParams(commandParams, 1); | ||
948 | this.SendGeneralAlert(message); | ||
949 | } | ||
950 | else | ||
951 | { | ||
952 | string message = this.CombineParams(commandParams, 2); | ||
953 | this.SendAlertToUser(commandParams[0], commandParams[1], message, false); | ||
954 | } | ||
955 | } | ||
956 | |||
957 | private string CombineParams(string[] commandParams, int pos) | ||
958 | { | ||
959 | string result = ""; | ||
960 | for (int i = pos; i < commandParams.Length; i++) | ||
961 | { | ||
962 | result += commandParams[i]+ " "; | ||
963 | } | ||
964 | return result; | ||
965 | } | ||
966 | #endregion | ||
913 | } | 967 | } |
914 | } \ No newline at end of file | 968 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 8274912..7acef97 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -141,6 +141,9 @@ namespace SimpleApp | |||
141 | public virtual void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item) { } | 141 | public virtual void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item) { } |
142 | public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname) { } | 142 | public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname) { } |
143 | 143 | ||
144 | public void SendAlertMessage(string message) { } | ||
145 | public void SendAgentAlertMessage(string message, bool modal) { } | ||
146 | |||
144 | public virtual void SendRegionHandshake(RegionInfo regionInfo) | 147 | public virtual void SendRegionHandshake(RegionInfo regionInfo) |
145 | { | 148 | { |
146 | this.OnRegionHandShakeReply(this); | 149 | this.OnRegionHandShakeReply(this); |