aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.Reg/Avatar.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/OpenSim.Reg/Avatar.cs206
1 files changed, 206 insertions, 0 deletions
diff --git a/OpenSim/OpenSim.Reg/Avatar.cs b/OpenSim/OpenSim.Reg/Avatar.cs
new file mode 100644
index 0000000..88a7969
--- /dev/null
+++ b/OpenSim/OpenSim.Reg/Avatar.cs
@@ -0,0 +1,206 @@
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Text;
5using libsecondlife;
6using libsecondlife.Packets;
7using OpenSim.Physics.Manager;
8using OpenSim.Framework.Inventory;
9using OpenSim.Framework.Interfaces;
10using OpenSim.Framework.Types;
11using Axiom.MathLib;
12
13namespace OpenSim.Region
14{
15 public partial class Avatar : Entity
16 {
17 public static bool PhysicsEngineFlying = false;
18 public static AvatarAnimations Animations;
19 public string firstname;
20 public string lastname;
21 public IClientAPI ControllingClient;
22 public LLUUID current_anim;
23 public int anim_seq;
24 private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate;
25 private bool updateflag = false;
26 private byte movementflag = 0;
27 private List<NewForce> forcesList = new List<NewForce>();
28 private short _updateCount = 0;
29 private Axiom.MathLib.Quaternion bodyRot;
30 private LLObject.TextureEntry avatarAppearanceTexture = null;
31 private byte[] visualParams;
32 private AvatarWearable[] Wearables;
33 private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
34 private ulong m_regionHandle;
35 private Dictionary<uint, IClientAPI> m_clientThreads;
36 private bool childAvatar = false;
37
38 protected RegionInfo m_regionInfo;
39 /// <summary>
40 ///
41 /// </summary>
42 /// <param name="theClient"></param>
43 /// <param name="world"></param>
44 /// <param name="clientThreads"></param>
45 /// <param name="regionDat"></param>
46 public Avatar(IClientAPI theClient, World world, Dictionary<uint, IClientAPI> clientThreads, RegionInfo reginfo)
47 {
48
49 m_world = world;
50 m_clientThreads = clientThreads;
51 this.uuid = theClient.AgentId;
52
53 m_regionInfo = reginfo;
54 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Avatar.cs - Loading details from grid (DUMMY)");
55 ControllingClient = theClient;
56 this.firstname = ControllingClient.FirstName;
57 this.lastname = ControllingClient.LastName;
58 localid = this.m_world.NextLocalId;
59 Pos = ControllingClient.StartPos;
60 visualParams = new byte[218];
61 for (int i = 0; i < 218; i++)
62 {
63 visualParams[i] = 100;
64 }
65
66 Wearables = AvatarWearable.DefaultWearables;
67
68 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
69 Console.WriteLine("avatar point 4");
70
71 //register for events
72 ControllingClient.OnRequestWearables += new GenericCall(this.SendOurAppearance);
73 //ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
74 ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.CompleteMovement);
75 ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.SendInitialPosition);
76 /* ControllingClient.OnAgentUpdate += new GenericCall3(this.HandleAgentUpdate);
77 ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
78 ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
79 ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
80 * */
81
82 ControllingClient.OnParcelPropertiesRequest +=new ParcelPropertiesRequest(this.m_world.parcelManager.handleParcelPropertiesRequest);
83 ControllingClient.OnParcelDivideRequest += new ParcelDivideRequest(this.m_world.parcelManager.handleParcelDivideRequest);
84 ControllingClient.OnParcelJoinRequest += new ParcelJoinRequest(this.m_world.parcelManager.handleParcelJoinRequest);
85 ControllingClient.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(this.m_world.parcelManager.handleParcelPropertiesUpdateRequest);
86
87 ControllingClient.OnEstateOwnerMessage += new EstateOwnerMessageRequest(this.m_world.estateManager.handleEstateOwnerMessage);
88 }
89
90 /// <summary>
91 ///
92 /// </summary>
93 public PhysicsActor PhysActor
94 {
95 set
96 {
97 this._physActor = value;
98 }
99 get
100 {
101 return _physActor;
102 }
103 }
104
105 /// <summary>
106 ///
107 /// </summary>
108 /// <param name="status"></param>
109 public void ChildStatusChange(bool status)
110 {
111
112 }
113
114 /// <summary>
115 ///
116 /// </summary>
117 public override void addForces()
118 {
119
120 }
121
122 /// <summary>
123 /// likely to removed very soon
124 /// </summary>
125 /// <param name="name"></param>
126 public static void SetupTemplate(string name)
127 {
128
129 }
130
131 /// <summary>
132 /// likely to removed very soon
133 /// </summary>
134 /// <param name="objdata"></param>
135 protected static void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
136 {
137
138
139
140 }
141
142 /// <summary>
143 ///
144 /// </summary>
145 public void CompleteMovement()
146 {
147 this.ControllingClient.MoveAgentIntoRegion(m_regionInfo);
148 }
149
150 /// <summary>
151 ///
152 /// </summary>
153 /// <param name="pack"></param>
154 public void HandleAgentUpdate(Packet pack)
155 {
156 this.HandleUpdate((AgentUpdatePacket)pack);
157 }
158
159 /// <summary>
160 ///
161 /// </summary>
162 /// <param name="pack"></param>
163 public void HandleUpdate(AgentUpdatePacket pack)
164 {
165
166 }
167
168 /// <summary>
169 ///
170 /// </summary>
171 public void SendRegionHandshake()
172 {
173
174 }
175
176 /// <summary>
177 ///
178 /// </summary>
179 public static void LoadAnims()
180 {
181
182 }
183
184 /// <summary>
185 ///
186 /// </summary>
187 public override void LandRenegerated()
188 {
189
190 }
191
192
193 public class NewForce
194 {
195 public float X;
196 public float Y;
197 public float Z;
198
199 public NewForce()
200 {
201
202 }
203 }
204 }
205
206}