UserAppearance.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSim Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using libsecondlife;
  28. namespace OpenSim.Framework
  29. {
  30. /// <summary>
  31. /// Information about a particular user known to the userserver
  32. /// </summary>
  33. public class UserAppearance
  34. {
  35. // these are guessed at by the list here -
  36. // http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll
  37. // correct them over time for when were are wrong.
  38. public const int BODY = 0;
  39. public const int SKIN = 1;
  40. public const int HAIR = 2;
  41. public const int EYES = 3;
  42. public const int SHIRT = 4;
  43. public const int PANTS = 5;
  44. public const int SHOES = 6;
  45. public const int SOCKS = 7;
  46. public const int JACKET = 8;
  47. public const int GLOVES = 9;
  48. public const int UNDERSHIRT = 10;
  49. public const int UNDERPANTS = 11;
  50. public const int SKIRT = 12;
  51. private const int MAX_WEARABLES = 13;
  52. private static LLUUID BODY_ASSET = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
  53. private static LLUUID BODY_ITEM = new LLUUID("66c41e39-38f9-f75a-024e-585989bfaba9");
  54. private static LLUUID SKIN_ASSET = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb");
  55. private static LLUUID SKIN_ITEM = new LLUUID("77c41e39-38f9-f75a-024e-585989bfabc9");
  56. private static LLUUID SHIRT_ASSET = new LLUUID("00000000-38f9-1111-024e-222222111110");
  57. private static LLUUID SHIRT_ITEM = new LLUUID("77c41e39-38f9-f75a-0000-585989bf0000");
  58. private static LLUUID PANTS_ASSET = new LLUUID("00000000-38f9-1111-024e-222222111120");
  59. private static LLUUID PANTS_ITEM = new LLUUID("77c41e39-38f9-f75a-0000-5859892f1111");
  60. private AvatarWearable[] wearables;
  61. public UserAppearance()
  62. {
  63. wearables = new AvatarWearable[MAX_WEARABLES];
  64. for (int i = 0; i < MAX_WEARABLES; i++)
  65. {
  66. // this makes them all null
  67. wearables[i] = new AvatarWearable();
  68. }
  69. }
  70. public LLUUID BodyItem {
  71. get { return wearables[BODY].ItemID; }
  72. set { wearables[BODY].ItemID = value; }
  73. }
  74. public LLUUID BodyAsset {
  75. get { return wearables[BODY].AssetID; }
  76. set { wearables[BODY].AssetID = value; }
  77. }
  78. public LLUUID SkinItem {
  79. get { return wearables[SKIN].ItemID; }
  80. set { wearables[SKIN].ItemID = value; }
  81. }
  82. public LLUUID SkinAsset {
  83. get { return wearables[SKIN].AssetID; }
  84. set { wearables[SKIN].AssetID = value; }
  85. }
  86. public LLUUID HairItem {
  87. get { return wearables[HAIR].ItemID; }
  88. set { wearables[HAIR].ItemID = value; }
  89. }
  90. public LLUUID HairAsset {
  91. get { return wearables[HAIR].AssetID; }
  92. set { wearables[HAIR].AssetID = value; }
  93. }
  94. public LLUUID EyesItem {
  95. get { return wearables[EYES].ItemID; }
  96. set { wearables[EYES].ItemID = value; }
  97. }
  98. public LLUUID EyesAsset {
  99. get { return wearables[EYES].AssetID; }
  100. set { wearables[EYES].AssetID = value; }
  101. }
  102. public LLUUID ShirtItem {
  103. get { return wearables[SHIRT].ItemID; }
  104. set { wearables[SHIRT].ItemID = value; }
  105. }
  106. public LLUUID ShirtAsset {
  107. get { return wearables[SHIRT].AssetID; }
  108. set { wearables[SHIRT].AssetID = value; }
  109. }
  110. public LLUUID PantsItem {
  111. get { return wearables[PANTS].ItemID; }
  112. set { wearables[PANTS].ItemID = value; }
  113. }
  114. public LLUUID PantsAsset {
  115. get { return wearables[BODY].AssetID; }
  116. set { wearables[BODY].AssetID = value; }
  117. }
  118. public LLUUID ShoesItem {
  119. get { return wearables[SHOES].ItemID; }
  120. set { wearables[SHOES].ItemID = value; }
  121. }
  122. public LLUUID ShoesAsset {
  123. get { return wearables[SHOES].AssetID; }
  124. set { wearables[SHOES].AssetID = value; }
  125. }
  126. public LLUUID SocksItem {
  127. get { return wearables[SOCKS].ItemID; }
  128. set { wearables[SOCKS].ItemID = value; }
  129. }
  130. public LLUUID SocksAsset {
  131. get { return wearables[SOCKS].AssetID; }
  132. set { wearables[SOCKS].AssetID = value; }
  133. }
  134. public LLUUID JacketItem {
  135. get { return wearables[JACKET].ItemID; }
  136. set { wearables[JACKET].ItemID = value; }
  137. }
  138. public LLUUID JacketAsset {
  139. get { return wearables[JACKET].AssetID; }
  140. set { wearables[JACKET].AssetID = value; }
  141. }
  142. public LLUUID GlovesItem {
  143. get { return wearables[GLOVES].ItemID; }
  144. set { wearables[GLOVES].ItemID = value; }
  145. }
  146. public LLUUID GlovesAsset {
  147. get { return wearables[GLOVES].AssetID; }
  148. set { wearables[GLOVES].AssetID = value; }
  149. }
  150. public LLUUID UnderShirtItem {
  151. get { return wearables[UNDERSHIRT].ItemID; }
  152. set { wearables[UNDERSHIRT].ItemID = value; }
  153. }
  154. public LLUUID UnderShirtAsset {
  155. get { return wearables[UNDERSHIRT].AssetID; }
  156. set { wearables[UNDERSHIRT].AssetID = value; }
  157. }
  158. public LLUUID UnderPantsItem {
  159. get { return wearables[UNDERPANTS].ItemID; }
  160. set { wearables[UNDERPANTS].ItemID = value; }
  161. }
  162. public LLUUID UnderPantsAsset {
  163. get { return wearables[UNDERPANTS].AssetID; }
  164. set { wearables[UNDERPANTS].AssetID = value; }
  165. }
  166. public LLUUID SkirtItem {
  167. get { return wearables[SKIRT].ItemID; }
  168. set { wearables[SKIRT].ItemID = value; }
  169. }
  170. public LLUUID SkirtAsset {
  171. get { return wearables[SKIRT].AssetID; }
  172. set { wearables[SKIRT].AssetID = value; }
  173. }
  174. public void SetDefaultWearables()
  175. {
  176. wearables[BODY].AssetID = BODY_ASSET;
  177. wearables[BODY].ItemID = BODY_ITEM;
  178. wearables[SKIN].AssetID = SKIN_ASSET;
  179. wearables[SKIN].ItemID = SKIN_ITEM;
  180. wearables[SHIRT].AssetID = SHIRT_ASSET;
  181. wearables[SHIRT].ItemID = SHIRT_ITEM;
  182. wearables[PANTS].AssetID = PANTS_ASSET;
  183. wearables[PANTS].ItemID = PANTS_ITEM;
  184. }
  185. }
  186. }