aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorSean Dague2008-05-15 15:10:13 +0000
committerSean Dague2008-05-15 15:10:13 +0000
commit0c509ecdde73c7216d717da4fc4d32cb3b9d35c8 (patch)
tree01f6d58284dc69a5111f3651938c5068d71e538e /OpenSim
parentrefactoring to move AvatarAppearance into Framework and (diff)
downloadopensim-SC_OLD-0c509ecdde73c7216d717da4fc4d32cb3b9d35c8.zip
opensim-SC_OLD-0c509ecdde73c7216d717da4fc4d32cb3b9d35c8.tar.gz
opensim-SC_OLD-0c509ecdde73c7216d717da4fc4d32cb3b9d35c8.tar.bz2
opensim-SC_OLD-0c509ecdde73c7216d717da4fc4d32cb3b9d35c8.tar.xz
minor refactor of some properties for readability
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs70
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs18
-rw-r--r--OpenSim/Region/Modules/AvatarFactory/AppearanceTableMapper.cs10
-rw-r--r--OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs2
4 files changed, 50 insertions, 50 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 50afa75..64d8c0d 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -68,27 +68,27 @@ namespace OpenSim.Framework
68 68
69 public readonly static int VISUALPARAM_COUNT = 218; 69 public readonly static int VISUALPARAM_COUNT = 218;
70 70
71 protected LLUUID m_scenePresenceID; 71 protected LLUUID m_owner;
72 72
73 public LLUUID ScenePresenceID 73 public LLUUID Owner
74 { 74 {
75 get { return m_scenePresenceID; } 75 get { return m_owner; }
76 set { m_scenePresenceID = value; } 76 set { m_owner = value; }
77 } 77 }
78 protected int m_wearablesSerial = 1; 78 protected int m_serial = 1;
79 79
80 public int WearablesSerial 80 public int Serial
81 { 81 {
82 get { return m_wearablesSerial; } 82 get { return m_serial; }
83 set { m_wearablesSerial = value; } 83 set { m_serial = value; }
84 } 84 }
85 85
86 protected byte[] m_visualParams; 86 protected byte[] m_visualparams;
87 87
88 public byte[] VisualParams 88 public byte[] VisualParams
89 { 89 {
90 get { return m_visualParams; } 90 get { return m_visualparams; }
91 set { m_visualParams = value; } 91 set { m_visualparams = value; }
92 } 92 }
93 93
94 protected AvatarWearable[] m_wearables; 94 protected AvatarWearable[] m_wearables;
@@ -99,12 +99,12 @@ namespace OpenSim.Framework
99 set { m_wearables = value; } 99 set { m_wearables = value; }
100 } 100 }
101 101
102 protected LLObject.TextureEntry m_textureEntry; 102 protected LLObject.TextureEntry m_texture;
103 103
104 public LLObject.TextureEntry TextureEntry 104 public LLObject.TextureEntry Texture
105 { 105 {
106 get { return m_textureEntry; } 106 get { return m_texture; }
107 set { m_textureEntry = value; } 107 set { m_texture = value; }
108 } 108 }
109 109
110 protected float m_avatarHeight = 0; 110 protected float m_avatarHeight = 0;
@@ -123,18 +123,18 @@ namespace OpenSim.Framework
123 // this makes them all null 123 // this makes them all null
124 m_wearables[i] = new AvatarWearable(); 124 m_wearables[i] = new AvatarWearable();
125 } 125 }
126 m_wearablesSerial = 0; 126 m_serial = 0;
127 m_scenePresenceID = LLUUID.Zero; 127 m_owner = LLUUID.Zero;
128 m_visualParams = new byte[VISUALPARAM_COUNT]; 128 m_visualparams = new byte[VISUALPARAM_COUNT];
129 } 129 }
130 130
131 public AvatarAppearance(LLUUID avatarID, AvatarWearable[] wearables, byte[] visualParams) 131 public AvatarAppearance(LLUUID avatarID, AvatarWearable[] wearables, byte[] visualParams)
132 { 132 {
133 m_scenePresenceID = avatarID; 133 m_owner = avatarID;
134 m_wearablesSerial = 1; 134 m_serial = 1;
135 m_wearables = wearables; 135 m_wearables = wearables;
136 m_visualParams = visualParams; 136 m_visualparams = visualParams;
137 m_textureEntry = GetDefaultTextureEntry(); 137 m_texture = GetDefaultTexture();
138 } 138 }
139 139
140 /// <summary> 140 /// <summary>
@@ -145,15 +145,15 @@ namespace OpenSim.Framework
145 public void SetAppearance(byte[] texture, List<byte> visualParam) 145 public void SetAppearance(byte[] texture, List<byte> visualParam)
146 { 146 {
147 LLObject.TextureEntry textureEnt = new LLObject.TextureEntry(texture, 0, texture.Length); 147 LLObject.TextureEntry textureEnt = new LLObject.TextureEntry(texture, 0, texture.Length);
148 m_textureEntry = textureEnt; 148 m_texture = textureEnt;
149 149
150 m_visualParams = visualParam.ToArray(); 150 m_visualparams = visualParam.ToArray();
151 151
152 // Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters. 152 // Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters.
153 // (float)m_visualParams[25] = Height 153 // (float)m_visualParams[25] = Height
154 // (float)m_visualParams[125] = LegLength 154 // (float)m_visualParams[125] = LegLength
155 m_avatarHeight = (1.50856f + (((float) m_visualParams[25]/255.0f)*(2.525506f - 1.50856f))) 155 m_avatarHeight = (1.50856f + (((float) m_visualparams[25]/255.0f)*(2.525506f - 1.50856f)))
156 + (((float) m_visualParams[125]/255.0f)/1.5f); 156 + (((float) m_visualparams[125]/255.0f)/1.5f);
157 } 157 }
158 158
159 public void SetWearable(int wearableId, AvatarWearable wearable) 159 public void SetWearable(int wearableId, AvatarWearable wearable)
@@ -161,7 +161,7 @@ namespace OpenSim.Framework
161 m_wearables[wearableId] = wearable; 161 m_wearables[wearableId] = wearable;
162 } 162 }
163 163
164 public static LLObject.TextureEntry GetDefaultTextureEntry() 164 public static LLObject.TextureEntry GetDefaultTexture()
165 { 165 {
166 LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); 166 LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97"));
167 textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012"); 167 textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012");
@@ -183,13 +183,13 @@ namespace OpenSim.Framework
183 throw new ArgumentNullException("info"); 183 throw new ArgumentNullException("info");
184 } 184 }
185 185
186 m_scenePresenceID = new LLUUID((Guid)info.GetValue("m_scenePresenceID", typeof(Guid))); 186 m_owner = new LLUUID((Guid)info.GetValue("m_scenePresenceID", typeof(Guid)));
187 m_wearablesSerial = (int)info.GetValue("m_wearablesSerial", typeof(int)); 187 m_serial = (int)info.GetValue("m_wearablesSerial", typeof(int));
188 m_visualParams = (byte[])info.GetValue("m_visualParams", typeof(byte[])); 188 m_visualparams = (byte[])info.GetValue("m_visualParams", typeof(byte[]));
189 m_wearables = (AvatarWearable[])info.GetValue("m_wearables", typeof(AvatarWearable[])); 189 m_wearables = (AvatarWearable[])info.GetValue("m_wearables", typeof(AvatarWearable[]));
190 190
191 byte[] m_textureEntry_work = (byte[])info.GetValue("m_textureEntry", typeof(byte[])); 191 byte[] m_textureEntry_work = (byte[])info.GetValue("m_textureEntry", typeof(byte[]));
192 m_textureEntry = new LLObject.TextureEntry(m_textureEntry_work, 0, m_textureEntry_work.Length); 192 m_texture = new LLObject.TextureEntry(m_textureEntry_work, 0, m_textureEntry_work.Length);
193 193
194 m_avatarHeight = (float)info.GetValue("m_avatarHeight", typeof(float)); 194 m_avatarHeight = (float)info.GetValue("m_avatarHeight", typeof(float));
195 195
@@ -206,11 +206,11 @@ namespace OpenSim.Framework
206 throw new ArgumentNullException("info"); 206 throw new ArgumentNullException("info");
207 } 207 }
208 208
209 info.AddValue("m_scenePresenceID", m_scenePresenceID.UUID); 209 info.AddValue("m_scenePresenceID", m_owner.UUID);
210 info.AddValue("m_wearablesSerial", m_wearablesSerial); 210 info.AddValue("m_wearablesSerial", m_serial);
211 info.AddValue("m_visualParams", m_visualParams); 211 info.AddValue("m_visualParams", m_visualparams);
212 info.AddValue("m_wearables", m_wearables); 212 info.AddValue("m_wearables", m_wearables);
213 info.AddValue("m_textureEntry", m_textureEntry.ToBytes()); 213 info.AddValue("m_textureEntry", m_texture.ToBytes());
214 info.AddValue("m_avatarHeight", m_avatarHeight); 214 info.AddValue("m_avatarHeight", m_avatarHeight);
215 } 215 }
216 } 216 }
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 6f591e8..3815dfb 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -1415,7 +1415,7 @@ namespace OpenSim.Region.Environment.Scenes
1415 public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) 1415 public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
1416 { 1416 {
1417 remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, 1417 remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid,
1418 LocalId, m_pos, m_appearance.TextureEntry.ToBytes(), 1418 LocalId, m_pos, m_appearance.Texture.ToBytes(),
1419 m_parentID); 1419 m_parentID);
1420 m_scene.AddAgentUpdates(1); 1420 m_scene.AddAgentUpdates(1);
1421 } 1421 }
@@ -1451,7 +1451,7 @@ namespace OpenSim.Region.Environment.Scenes
1451 public void SendInitialData() 1451 public void SendInitialData()
1452 { 1452 {
1453 m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId, 1453 m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId,
1454 m_pos, m_appearance.TextureEntry.ToBytes(), m_parentID); 1454 m_pos, m_appearance.Texture.ToBytes(), m_parentID);
1455 if (!m_isChildAgent) 1455 if (!m_isChildAgent)
1456 { 1456 {
1457 m_scene.InformClientOfNeighbours(this); 1457 m_scene.InformClientOfNeighbours(this);
@@ -1465,7 +1465,7 @@ namespace OpenSim.Region.Environment.Scenes
1465 public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable) 1465 public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable)
1466 { 1466 {
1467 m_appearance.SetWearable(wearableId, wearable); 1467 m_appearance.SetWearable(wearableId, wearable);
1468 client.SendWearables(m_appearance.Wearables, m_appearance.WearablesSerial++); 1468 client.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
1469 } 1469 }
1470 1470
1471 /// <summary> 1471 /// <summary>
@@ -1474,7 +1474,7 @@ namespace OpenSim.Region.Environment.Scenes
1474 /// <param name="client"></param> 1474 /// <param name="client"></param>
1475 public void SendOwnAppearance() 1475 public void SendOwnAppearance()
1476 { 1476 {
1477 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.WearablesSerial++); 1477 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
1478 } 1478 }
1479 1479
1480 /// <summary> 1480 /// <summary>
@@ -1497,9 +1497,9 @@ namespace OpenSim.Region.Environment.Scenes
1497 public void SendAppearanceToOtherAgent(ScenePresence avatar) 1497 public void SendAppearanceToOtherAgent(ScenePresence avatar)
1498 { 1498 {
1499 avatar.ControllingClient.SendAppearance( 1499 avatar.ControllingClient.SendAppearance(
1500 m_appearance.ScenePresenceID, 1500 m_appearance.Owner,
1501 m_appearance.VisualParams, 1501 m_appearance.VisualParams,
1502 m_appearance.TextureEntry.ToBytes() 1502 m_appearance.Texture.ToBytes()
1503 ); 1503 );
1504 } 1504 }
1505 1505
@@ -1804,7 +1804,7 @@ namespace OpenSim.Region.Environment.Scenes
1804 1804
1805 static ScenePresence() 1805 static ScenePresence()
1806 { 1806 {
1807 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTextureEntry(); 1807 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
1808 DefaultTexture = textu.ToBytes(); 1808 DefaultTexture = textu.ToBytes();
1809 } 1809 }
1810 1810
@@ -1983,7 +1983,7 @@ namespace OpenSim.Region.Environment.Scenes
1983*/ 1983*/
1984 if (DefaultTexture == null) 1984 if (DefaultTexture == null)
1985 { 1985 {
1986 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTextureEntry(); 1986 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
1987 DefaultTexture = textu.ToBytes(); 1987 DefaultTexture = textu.ToBytes();
1988 } 1988 }
1989 } 1989 }
@@ -2064,7 +2064,7 @@ namespace OpenSim.Region.Environment.Scenes
2064*/ 2064*/
2065 if (DefaultTexture == null) 2065 if (DefaultTexture == null)
2066 { 2066 {
2067 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTextureEntry(); 2067 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
2068 DefaultTexture = textu.ToBytes(); 2068 DefaultTexture = textu.ToBytes();
2069 } 2069 }
2070 2070
diff --git a/OpenSim/Region/Modules/AvatarFactory/AppearanceTableMapper.cs b/OpenSim/Region/Modules/AvatarFactory/AppearanceTableMapper.cs
index 2d9f32f..5fb6867 100644
--- a/OpenSim/Region/Modules/AvatarFactory/AppearanceTableMapper.cs
+++ b/OpenSim/Region/Modules/AvatarFactory/AppearanceTableMapper.cs
@@ -50,12 +50,12 @@ namespace OpenSim.Region.Modules.AvatarFactory
50 m_schema = rowMapperSchema; 50 m_schema = rowMapperSchema;
51 51
52 m_keyFieldMapper = rowMapperSchema.AddMapping<Guid>("UUID", 52 m_keyFieldMapper = rowMapperSchema.AddMapping<Guid>("UUID",
53 delegate(AppearanceRowMapper mapper) { return mapper.Object.ScenePresenceID.UUID; }, 53 delegate(AppearanceRowMapper mapper) { return mapper.Object.Owner.UUID; },
54 delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.ScenePresenceID = new LLUUID(value.ToString()); }); 54 delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Owner = new LLUUID(value.ToString()); });
55 55
56 rowMapperSchema.AddMapping<uint>("Serial", 56 rowMapperSchema.AddMapping<uint>("Serial",
57 delegate(AppearanceRowMapper mapper) { return (uint)mapper.Object.WearablesSerial; }, 57 delegate(AppearanceRowMapper mapper) { return (uint)mapper.Object.Serial; },
58 delegate(AppearanceRowMapper mapper, uint value) { mapper.Object.WearablesSerial = (int)value; }); 58 delegate(AppearanceRowMapper mapper, uint value) { mapper.Object.Serial = (int)value; });
59 59
60 rowMapperSchema.AddMapping<Guid>("WearableItem0", 60 rowMapperSchema.AddMapping<Guid>("WearableItem0",
61 delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[0].ItemID.UUID; }, 61 delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[0].ItemID.UUID; },
@@ -196,7 +196,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
196 public bool Update(Guid userID, AvatarAppearance appearance) 196 public bool Update(Guid userID, AvatarAppearance appearance)
197 { 197 {
198 AppearanceRowMapper mapper = CreateRowMapper(appearance); 198 AppearanceRowMapper mapper = CreateRowMapper(appearance);
199 return Update(appearance.ScenePresenceID.UUID, mapper); 199 return Update(appearance.Owner.UUID, mapper);
200 } 200 }
201 201
202 protected AppearanceRowMapper CreateRowMapper(AvatarAppearance appearance) 202 protected AppearanceRowMapper CreateRowMapper(AvatarAppearance appearance)
diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
index a2ccc37..a1abe8b 100644
--- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
@@ -182,7 +182,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
182 if (m_appearanceMapper.TryGetValue(avatarId.UUID, out appearance)) 182 if (m_appearanceMapper.TryGetValue(avatarId.UUID, out appearance))
183 { 183 {
184 appearance.VisualParams = GetDefaultVisualParams(); 184 appearance.VisualParams = GetDefaultVisualParams();
185 appearance.TextureEntry = AvatarAppearance.GetDefaultTextureEntry(); 185 appearance.Texture = AvatarAppearance.GetDefaultTexture();
186 lock (m_avatarsAppearance) 186 lock (m_avatarsAppearance)
187 { 187 {
188 m_avatarsAppearance[avatarId] = appearance; 188 m_avatarsAppearance[avatarId] = appearance;