当前位置: 首页>>代码示例>>C#>>正文


C# AvatarAppearance类代码示例

本文整理汇总了C#中AvatarAppearance的典型用法代码示例。如果您正苦于以下问题:C# AvatarAppearance类的具体用法?C# AvatarAppearance怎么用?C# AvatarAppearance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AvatarAppearance类属于命名空间,在下文中一共展示了AvatarAppearance类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToAppearance

        internal AvatarAppearance ToAppearance(OpenMetaverse.UUID owner)
        {
            AvatarAppearance app =
                new AvatarAppearance
                {
                    Owner = owner,
                    Serial = this.Serial,
                    VisualParams = this.VisualParams
                };

            List<AvatarWearable> wearables = new List<AvatarWearable>();

            for (int i = 0; i < AvatarWearable.MAX_WEARABLES && i < this.Wearables.Length; i++)
            {
                OpenMetaverse.UUID itemID = new OpenMetaverse.UUID(this.Wearables[i].ItemId);
                OpenMetaverse.UUID assetID = new OpenMetaverse.UUID(this.Wearables[i].AssetId);

                wearables.Add(new AvatarWearable(i, itemID, assetID));
            }

            app.SetWearables(wearables);

            var te = new OpenMetaverse.Primitive.TextureEntry(this.TextureEntry, 0, this.TextureEntry.Length);
            app.SetTextureEntries(te);

            app.SetHeight();

            return app;
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:29,代码来源:PackedAppearance.cs

示例2: FromAppearance

        internal static PackedAppearance FromAppearance(AvatarAppearance avatarAppearance)
        {
            PackedAppearance app = new PackedAppearance
            {
                TextureEntry = avatarAppearance.Texture.GetBytes(),
                VisualParams = avatarAppearance.VisualParams,
                Wearables = PackedWearable.FromWearables(avatarAppearance.GetWearables()),
                Serial = avatarAppearance.Serial
            };

            return app;
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:12,代码来源:PackedAppearance.cs

示例3: AvatarIsWearing

        /// <summary>
        ///   Update what the avatar is wearing using an item from their inventory.
        /// </summary>
        /// <param name = "client"></param>
        /// <param name = "e"></param>
        public void AvatarIsWearing(IClientAPI client, AvatarWearingArgs e)
        {
            IScenePresence sp = m_scene.GetScenePresence(client.AgentId);
            if (sp == null)
            {
                MainConsole.Instance.WarnFormat("[AvatarFactory]: AvatarIsWearing unable to find presence for {0}", client.AgentId);
                return;
            }

            MainConsole.Instance.DebugFormat("[AvatarFactory]: AvatarIsWearing called for {0}", client.AgentId);

            // operate on a copy of the appearance so we don't have to lock anything
            IAvatarAppearanceModule appearance = sp.RequestModuleInterface<IAvatarAppearanceModule>();
            AvatarAppearance avatAppearance = new AvatarAppearance(appearance.Appearance, false);

            IOpenRegionSettingsModule module = m_scene.RequestModuleInterface<IOpenRegionSettingsModule>();

            bool NeedsRebake = false;
            if (module != null && module.EnableTeenMode)
            {
                foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
                {
                    if (wear.Type == 10 & wear.ItemID == UUID.Zero && module.DefaultUnderpants != UUID.Zero)
                    {
                        NeedsRebake = true;
                        wear.ItemID = module.DefaultUnderpants;
                        InventoryItemBase item = new InventoryItemBase(UUID.Random())
                                                     {
                                                         InvType = (int) InventoryType.Wearable,
                                                         AssetType = (int) AssetType.Clothing,
                                                         Name = "Default Underpants",
                                                         Folder =
                                                             m_scene.InventoryService.GetFolderForType(client.AgentId,
                                                                                                       InventoryType.
                                                                                                           Wearable,
                                                                                                       AssetType.
                                                                                                           Clothing).ID,
                                                         Owner = client.AgentId,
                                                         CurrentPermissions = 0,
                                                         CreatorId = UUID.Zero.ToString(),
                                                         AssetID = module.DefaultUnderpants
                                                     };
                        //Locked
                        client.SendInventoryItemCreateUpdate(item, 0);
                    }
                    else if (wear.Type == 10 & wear.ItemID == UUID.Zero)
                    {
                        NeedsRebake = true;
                        InventoryItemBase item = new InventoryItemBase(UUID.Random())
                                                     {
                                                         InvType = (int) InventoryType.Wearable,
                                                         AssetType = (int) AssetType.Clothing,
                                                         Name = "Default Underpants",
                                                         Folder =
                                                             m_scene.InventoryService.GetFolderForType(client.AgentId,
                                                                                                       InventoryType.
                                                                                                           Wearable,
                                                                                                       AssetType.
                                                                                                           Clothing).ID,
                                                         Owner = client.AgentId,
                                                         CurrentPermissions = 0
                                                     };
                        //Locked
                        if (m_underPantsUUID == UUID.Zero)
                        {
                            m_underPantsUUID = UUID.Random();
                            AssetBase asset = new AssetBase(m_underPantsUUID, "Default Underpants", AssetType.Clothing,
                                                            UUID.Zero) {Data = Utils.StringToBytes(m_defaultUnderPants)};
                            asset.FillHash();
                            asset.ID = m_scene.AssetService.Store(asset);
                            m_underPantsUUID = asset.ID;
                        }
                        item.CreatorId = UUID.Zero.ToString();
                        item.AssetID = m_underPantsUUID;
                        m_scene.InventoryService.AddItem(item);
                        client.SendInventoryItemCreateUpdate(item, 0);
                        wear.ItemID = item.ID;
                    }
                    if (wear.Type == 11 && wear.ItemID == UUID.Zero && module.DefaultUndershirt != UUID.Zero)
                    {
                        NeedsRebake = true;
                        wear.ItemID = module.DefaultUndershirt;
                        InventoryItemBase item = new InventoryItemBase(UUID.Random())
                                                     {
                                                         InvType = (int) InventoryType.Wearable,
                                                         AssetType = (int) AssetType.Clothing,
                                                         Name = "Default Undershirt",
                                                         Folder =
                                                             m_scene.InventoryService.GetFolderForType(client.AgentId,
                                                                                                       InventoryType.
                                                                                                           Wearable,
                                                                                                       AssetType.
                                                                                                           Clothing).ID,
                                                         Owner = client.AgentId,
                                                         CurrentPermissions = 0,
//.........这里部分代码省略.........
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:101,代码来源:AvatarFactoryModule.cs

示例4: AvatarData

        public AvatarData(AvatarAppearance appearance)
        {
            AvatarType = 1; // SL avatars
            Data = new Dictionary<string, string>();

            Data["Serial"] = appearance.Serial.ToString();
            // Wearables
            Data["AvatarHeight"] = appearance.AvatarHeight.ToString();

            Data["Textures"] = OSDParser.SerializeJsonString(appearance.Texture.GetOSD());

            for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
            {
                for (int j = 0; j < appearance.Wearables[i].Count; j++)
                {
                    string fieldName = String.Format("Wearable {0}:{1}", i, j);
                    Data[fieldName] = String.Format("{0}:{1}",
                            appearance.Wearables[i][j].ItemID.ToString(),
                            appearance.Wearables[i][j].AssetID.ToString());
                }
            }

            // Visual Params
            string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT];
            byte[] binary = appearance.VisualParams;

            for (int i = 0; i < AvatarAppearance.VISUALPARAM_COUNT; i++)
            {
                vps[i] = binary[i].ToString();
            }

            Data["VisualParams"] = String.Join(",", vps);

            // Attachments
            List<AvatarAttachment> attachments = appearance.GetAttachments();
            foreach (AvatarAttachment attach in attachments)
            {
                Data["_ap_" + attach.AttachPoint] = attach.ItemID.ToString();
            }
        }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:40,代码来源:IAvatarService.cs

示例5: Login

        public LoginResponse Login(UUID AgentID, string Name, string authType, string passwd, string startLocation,
            string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP,
            Hashtable requestData)
        {
            LoginResponse response;
            UUID session = UUID.Random();
            UUID secureSession = UUID.Zero;

            MainConsole.Instance.InfoFormat(
                "[LLOGIN SERVICE]: Login request for {0} from {1} with user agent {2} starting in {3}",
                Name, clientIP.Address, clientVersion, startLocation);

            UserAccount account = AgentID != UUID.Zero
                                      ? m_UserAccountService.GetUserAccount(null, AgentID)
                                      : m_UserAccountService.GetUserAccount(null, Name);
            if (account == null && m_AllowAnonymousLogin)
            {
                m_UserAccountService.CreateUser(Name, passwd.StartsWith("$1$") ? passwd.Remove(0, 3) : passwd, "");
                account = m_UserAccountService.GetUserAccount(null, Name);
            }
            if (account == null)
            {
                MainConsole.Instance.InfoFormat("[LLOGIN SERVICE]: Login failed for user {0}: no account found", Name);
                return LLFailedLoginResponse.AccountProblem;
            }

            if (account.UserLevel < 0) //No allowing anyone less than 0
            {
                MainConsole.Instance.InfoFormat(
                    "[LLOGIN SERVICE]: Login failed for user {0}, reason: user is banned",
                    account.Name);
                return LLFailedLoginResponse.PermanentBannedProblem;
            }

            if (account.UserLevel < m_MinLoginLevel)
            {
                MainConsole.Instance.InfoFormat(
                    "[LLOGIN SERVICE]: Login failed for user {1}, reason: login is blocked for user level {0}",
                    account.UserLevel, account.Name);
                return LLFailedLoginResponse.LoginBlockedProblem;
            }

            IAgentInfo agent = null;
            IAgentConnector agentData = Framework.Utilities.DataManager.RequestPlugin<IAgentConnector>();
            if (agentData != null)
                agent = agentData.GetAgent(account.PrincipalID);
            if (agent == null)
            {
                agentData.CreateNewAgent(account.PrincipalID);
                agent = agentData.GetAgent(account.PrincipalID);
            }

            requestData["ip"] = clientIP.ToString();
            foreach (ILoginModule module in LoginModules)
            {
                object data;
                if ((response = module.Login(requestData, account, agent, authType, passwd, out data)) != null)
                {
                    MainConsole.Instance.InfoFormat(
                        "[LLOGIN SERVICE]: Login failed for user {1}, reason: {0}",
                        (data != null ? data.ToString() : (response is LLFailedLoginResponse) ? (response as LLFailedLoginResponse).Value : "Unknown"), account.Name);
                    return response;
                }
                if (data != null)
                    secureSession = (UUID) data; //TODO: NEED TO FIND BETTER WAY TO GET THIS DATA
            }

            try
            {
                string DisplayName = account.Name;
                AvatarAppearance avappearance = null;
                IProfileConnector profileData = Framework.Utilities.DataManager.RequestPlugin<IProfileConnector>();

                //
                // Get the user's inventory
                //
                if (m_RequireInventory && m_InventoryService == null)
                {
                    MainConsole.Instance.WarnFormat(
                        "[LLOGIN SERVICE]: Login failed for user {0}, reason: inventory service not set up",
                        account.Name);
                    return LLFailedLoginResponse.InventoryProblem;
                }
                List<InventoryFolderBase> inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID);
                if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel.Count == 0)))
                {
                    List<InventoryItemBase> defaultItems;
                    m_InventoryService.CreateUserInventory(account.PrincipalID, m_DefaultUserAvatarArchive == "",
                                                           out defaultItems);
                    inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID);
                    if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel.Count == 0)))
                    {
                        MainConsole.Instance.InfoFormat(
                            "[LLOGIN SERVICE]: Login failed for user {0}, reason: unable to retrieve user inventory",
                            account.Name);
                        return LLFailedLoginResponse.InventoryProblem;
                    }
                    if (defaultItems.Count > 0)
                    {
                        avappearance = new AvatarAppearance(account.PrincipalID);
//.........这里部分代码省略.........
开发者ID:keverw,项目名称:Aurora-Sim,代码行数:101,代码来源:LLLoginService.cs

示例6: Login


//.........这里部分代码省略.........
                }
                if (!GridUserInfoFound || guinfo.HomeRegionID == UUID.Zero) //Give them a default home and last
                {
                    List<GridRegion> DefaultRegions = m_GridService.GetDefaultRegions(account.ScopeID);
                    GridRegion DefaultRegion = null;
                    if (DefaultRegions.Count == 0)
                        DefaultRegion = destination;
                    else
                        DefaultRegion = DefaultRegions[0];

                    if (m_DefaultHomeRegion != "" && guinfo.HomeRegionID == UUID.Zero)
                    {
                        GridRegion newHomeRegion = m_GridService.GetRegionByName(account.ScopeID, m_DefaultHomeRegion);
                        if (newHomeRegion == null)
                            guinfo.HomeRegionID = guinfo.CurrentRegionID = DefaultRegion.RegionID;
                        else
                            guinfo.HomeRegionID = guinfo.CurrentRegionID = newHomeRegion.RegionID;
                    }
                    else if (guinfo.HomeRegionID == UUID.Zero)
                        guinfo.HomeRegionID = guinfo.CurrentRegionID = DefaultRegion.RegionID;

                    //Z = 0 so that it fixes it on the region server and puts it on the ground
                    guinfo.CurrentPosition = guinfo.HomePosition = new Vector3(128, 128, 25);

                    guinfo.HomeLookAt = guinfo.CurrentLookAt = new Vector3(0, 0, 0);

                    m_agentInfoService.SetLastPosition(guinfo.UserID, guinfo.CurrentRegionID, guinfo.CurrentPosition, guinfo.CurrentLookAt);
                    m_agentInfoService.SetHomePosition(guinfo.UserID, guinfo.HomeRegionID, guinfo.HomePosition, guinfo.HomeLookAt);
                }

                //
                // Get the avatar
                //
                AvatarAppearance avappearance = new AvatarAppearance(account.PrincipalID);
                if (m_AvatarService != null)
                {
                    avappearance = m_AvatarService.GetAppearance(account.PrincipalID);
                    if (avappearance == null)
                    {
                        //Create an appearance for the user if one doesn't exist
                        if (m_DefaultUserAvatarArchive != "")
                        {
                            m_log.Error("[LLoginService]: Cannot find an appearance for user " + account.Name +
                                ", loading the default avatar from " + m_DefaultUserAvatarArchive + ".");
                            archiver.LoadAvatarArchive(m_DefaultUserAvatarArchive, account.Name);
                        }
                        else
                        {
                            m_log.Error("[LLoginService]: Cannot find an appearance for user " + account.Name + ", setting to the default avatar.");
                            AvatarAppearance appearance = new AvatarAppearance(account.PrincipalID);
                            m_AvatarService.SetAvatar(account.PrincipalID, new AvatarData(appearance));
                        }
                        avappearance = m_AvatarService.GetAppearance(account.PrincipalID);
                    }
                    else
                    {
                        //Verify that all assets exist now
                        for (int i = 0; i < avappearance.Wearables.Length; i++)
                        {
                            bool messedUp = false;
                            foreach (KeyValuePair<UUID, UUID> item in avappearance.Wearables[i].GetItems())
                            {
                                AssetBase asset = m_AssetService.Get(item.Value.ToString());
                                if (asset == null)
                                {
                                    InventoryItemBase invItem = m_InventoryService.GetItem (new InventoryItemBase (item.Value));
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:67,代码来源:LLLoginService.cs

示例7: LoadItems

 private void LoadItems(OSDMap items, UUID OwnerID, InventoryFolderBase folderForAppearance, AvatarAppearance appearance, out List<InventoryItemBase> litems)
 {
     litems = new List<InventoryItemBase>();
     foreach (KeyValuePair<string, OSD> kvp in items)
     {
         string serialization = kvp.Value.AsString();
         InventoryItemBase item = OpenSim.Framework.Serialization.External.UserInventoryItemSerializer.Deserialize(serialization);
         m_log.Info("[AvatarArchive]: Loading item " + item.ID.ToString());
         UUID oldID = item.ID;
         item = GiveInventoryItem(item.CreatorIdAsUuid, OwnerID, item, folderForAppearance);
         litems.Add(item);
         FixItemIDs(oldID, item, appearance);
     }
 }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:14,代码来源:LLLoginService.cs

示例8: ConvertXMLToAvatarAppearance

        private AvatarAppearance ConvertXMLToAvatarAppearance(OSDMap map, out string FolderNameToPlaceAppearanceIn)
        {
            AvatarAppearance appearance = new AvatarAppearance();

            appearance.Unpack(map);
            FolderNameToPlaceAppearanceIn = map["FolderName"].AsString();
            return appearance;
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:8,代码来源:LLLoginService.cs

示例9: TryFindGridRegionForAgentLogin

 protected bool TryFindGridRegionForAgentLogin(List<GridRegion> regions, UserAccount account,
     AvatarAppearance appearance, UUID session, UUID secureSession, uint circuitCode, Vector3 position,
     IPEndPoint clientIP, AgentCircuitData aCircuit, out GridRegion destination)
 {
     foreach (GridRegion r in regions)
     {
         string reason;
         bool success = LaunchAgentDirectly(r, ref aCircuit, out reason);
         if (success)
         {
             aCircuit = MakeAgent(r, account, appearance, session, secureSession, circuitCode, position, clientIP);
             destination = r;
             return true;
         }
         else
             m_GridService.SetRegionUnsafe(r.RegionID);
     }
     destination = null;
     return false;
 }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:20,代码来源:LLLoginService.cs

示例10: setup

        public void setup()
        {
            AgentId = UUID.Random();
            BaseFolder = UUID.Random();
            CapsPath = "http://www.opensimulator.org/Caps/Foo";
            ChildrenCapsPaths = new Dictionary<ulong, string>();
            ChildrenCapsPaths.Add(ulong.MaxValue, "http://www.opensimulator.org/Caps/Foo2");
            firstname = "CoolAvatarTest";
            lastname = "test";
            StartPos = new Vector3(5,23,125);

            SecureSessionId = UUID.Random();
            SessionId = UUID.Random();

            AvAppearance = new AvatarAppearance(AgentId);
            VisualParams = new byte[218];

            //body
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEIGHT] = 155;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_THICKNESS] = 00;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BODY_FAT] = 0;

            //Torso
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_TORSO_MUSCLES] = 48;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_NECK_THICKNESS] = 43;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_NECK_LENGTH] = 255;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SHOULDERS] = 94;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_CHEST_MALE_NO_PECS] = 199;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_ARM_LENGTH] = 255;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HAND_SIZE] = 33;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_TORSO_LENGTH] = 240;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LOVE_HANDLES] = 0;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BELLY_SIZE] = 0;

            // legs
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LEG_MUSCLES] = 82;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LEG_LENGTH] = 255;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HIP_WIDTH] = 84;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HIP_LENGTH] = 166;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BUTT_SIZE] = 64;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SADDLEBAGS] = 89;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BOWED_LEGS] = 127;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOOT_SIZE] = 45;


            // head 
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SIZE] = 255;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SQUASH_STRETCH_HEAD] = 0; // head stretch
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SHAPE] = 155;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EGG_HEAD] = 127;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_POINTY_EARS] = 255;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_LENGTH] = 45;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FACE_SHEAR] = 127;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOREHEAD_ANGLE] = 104;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BIG_BROW] = 94;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_PUFFY_UPPER_CHEEKS] = 0; //  upper cheeks 
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_DOUBLE_CHIN] = 122; //  lower cheeks
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HIGH_CHEEK_BONES] = 130;



            // eyes
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYE_SIZE] = 105;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_WIDE_EYES] = 135;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYE_SPACING] = 184;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYELID_CORNER_UP] = 230;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYELID_INNER_CORNER_UP] = 120;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYE_DEPTH] = 158;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_UPPER_EYELID_FOLD] = 69;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BAGGY_EYES] = 38;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYELASHES_LONG] = 127;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_POP_EYE] = 127;

            VisualParams[(int)AvatarAppearance.VPElement.EYES_EYE_COLOR] = 25;
            VisualParams[(int)AvatarAppearance.VPElement.EYES_EYE_LIGHTNESS] = 127;

            // ears
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BIG_EARS] = 255;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EARS_OUT] = 127;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_ATTACHED_EARLOBES] = 127;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_POINTY_EARS] = 255;

            // nose
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_NOSE_BIG_OUT] = 79;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_WIDE_NOSE] = 35;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BROAD_NOSTRILS] = 86;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LOW_SEPTUM_NOSE] = 112; // nostril division
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BULBOUS_NOSE] = 25;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_NOBLE_NOSE_BRIDGE] = 25; // upper bridge
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LOWER_BRIDGE_NOSE] = 25; // lower bridge
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_WIDE_NOSE_BRIDGE] = 25;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_UPTURNED_NOSE_TIP] = 107;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BULBOUS_NOSE_TIP] = 25;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_CROOKED_NOSE] = 127;


            // Mouth
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LIP_WIDTH] = 122;
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_TALL_LIPS] = 10; // lip fullness
            VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LIP_THICKNESS] = 112;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:101,代码来源:AgentCircuitDataTest.cs

示例11: SetAppearance

 public bool SetAppearance(UUID principalID, AvatarAppearance appearance)
 {
     AvatarData avatar = new AvatarData(appearance);
     return SetAvatar(principalID, avatar);
 }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:5,代码来源:AvatarService.cs

示例12: UpdateUserAppearance

 public virtual void UpdateUserAppearance(UUID user, AvatarAppearance appearance)
 {
     foreach (IUserDataPlugin plugin in m_plugins)
     {
         try
         {
             plugin.UpdateUserAppearance(user, appearance);
         }
         catch (Exception e)
         {
             m_log.ErrorFormat("[USERSTORAGE]: Unable to update user appearance {0} via {1} ({2})", user.ToString(), plugin.Name, e.ToString());
         }
     }
 }
开发者ID:Ideia-Boa,项目名称:Diva-s-OpenSim-Tests,代码行数:14,代码来源:UserManagerBase.cs

示例13: GetAvatarAppearance

        /// <summary>
        /// Get the avatar apperance for the given client.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="appearance"></param>
        public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance)
        {
            AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);

            if (aCircuit == null)
            {
                m_log.DebugFormat("[APPEARANCE] Client did not supply a circuit. Non-Linden? Creating default appearance.");
                appearance = new AvatarAppearance(client.AgentId);
                return;
            }

            appearance = aCircuit.Appearance;
            if (appearance == null)
            {
                m_log.DebugFormat("[APPEARANCE]: Appearance not found in {0}, returning default", RegionInfo.RegionName);
                appearance = new AvatarAppearance(client.AgentId);
            }
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:23,代码来源:Scene.cs

示例14: SetAppearanceAssets

        private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance)
        {
            IInventoryService invService = m_scene.InventoryService;

            for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
            {
                for (int j = 0; j < appearance.Wearables[j].Count; j++)
                {
                    if (appearance.Wearables[i][j].ItemID == UUID.Zero)
                        continue;

                    // Ignore ruth's assets
                    if (appearance.Wearables[i][j].ItemID == AvatarWearable.DefaultWearables[i][j].ItemID)
                    {
                        //MainConsole.Instance.ErrorFormat(
                        //    "[AvatarFactory]: Found an asset for the default avatar, itemID {0}, wearable {1}, asset {2}" +
                        //    ", setting to default asset {3}.",
                        //    appearance.Wearables[i][j].ItemID, (WearableType)i, appearance.Wearables[i][j].AssetID,
                        //    AvatarWearable.DefaultWearables[i][j].AssetID);
                        appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID,
                                                    appearance.Wearables[i][j].AssetID);
                        continue;
                    }

                    InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID);
                    baseItem = invService.GetItem(baseItem);

                    if (baseItem != null)
                    {
                        if (baseItem.AssetType == (int) AssetType.Link)
                        {
                            baseItem = new InventoryItemBase(baseItem.AssetID, userID);
                            baseItem = invService.GetItem(baseItem);
                        }
                        appearance.Wearables[i].Add(baseItem.ID, baseItem.AssetID);
                    }
                    else
                    {
                        MainConsole.Instance.ErrorFormat(
                            "[AvatarFactory]: Can't find inventory item {0} for {1}, setting to default",
                            appearance.Wearables[i][j].ItemID, (WearableType) i);

                        appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID);
                        appearance.Wearables[i].Add(AvatarWearable.DefaultWearables[i][j].ItemID,
                                                    AvatarWearable.DefaultWearables[i][j].AssetID);
                    }
                }
            }
        }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:49,代码来源:AvatarFactoryModule.cs

示例15: ConvertXMLToAvatarAppearance

        private AvatarAppearance ConvertXMLToAvatarAppearance(List<string> file, out List<UUID> AttachmentIDs, out List<string> AttachmentPoints, out List<string> AttachmentAsset, out string FolderNameToPlaceAppearanceIn)
        {
            AvatarAppearance appearance = new AvatarAppearance();
            List<string> newFile = new List<string>();
            foreach (string line in file)
            {
                string newLine = line.TrimStart('<');
                newFile.Add(newLine.TrimEnd('>'));
            }
            appearance.AvatarHeight = Convert.ToInt32(newFile[1]);
            appearance.BodyAsset = new UUID(newFile[2]);
            appearance.BodyItem = new UUID(newFile[3]);
            appearance.EyesAsset = new UUID(newFile[4]);
            appearance.EyesItem = new UUID(newFile[5]);
            appearance.GlovesAsset = new UUID(newFile[6]);
            appearance.GlovesItem = new UUID(newFile[7]);
            appearance.HairAsset = new UUID(newFile[8]);
            appearance.HairItem = new UUID(newFile[9]);
            //Skip Hip Offset
            appearance.JacketAsset = new UUID(newFile[11]);
            appearance.JacketItem = new UUID(newFile[12]);
            appearance.Owner = new UUID(newFile[13]);
            appearance.PantsAsset = new UUID(newFile[14]);
            appearance.PantsItem = new UUID(newFile[15]);
            appearance.Serial = Convert.ToInt32(newFile[16]);
            appearance.ShirtAsset = new UUID(newFile[17]);
            appearance.ShirtItem = new UUID(newFile[18]);
            appearance.ShoesAsset = new UUID(newFile[19]);
            appearance.ShoesItem = new UUID(newFile[20]);
            appearance.SkinAsset = new UUID(newFile[21]);
            appearance.SkinItem = new UUID(newFile[22]);
            appearance.SkirtAsset = new UUID(newFile[23]);
            appearance.SkirtItem = new UUID(newFile[24]);
            appearance.SocksAsset = new UUID(newFile[25]);
            appearance.SocksItem = new UUID(newFile[26]);
            //appearance.Texture = new Primitive.TextureEntry(newFile[27],);
            appearance.UnderPantsAsset = new UUID(newFile[27]);
            appearance.UnderPantsItem = new UUID(newFile[28]);
            appearance.UnderShirtAsset = new UUID(newFile[29]);
            appearance.UnderShirtItem = new UUID(newFile[30]);
            FolderNameToPlaceAppearanceIn = newFile[31];

            Byte[] bytes = new byte[218];
            int i = 0;
            while (i <= 31)
            {
                newFile.RemoveAt(0); //Clear out the already processed parts
                i++;
            }
            i = 0;
            if (newFile[0] == "VisualParams")
            {
                foreach (string partLine in newFile)
                {
                    if (partLine.StartsWith("/VP"))
                    {
                        string newpartLine = "";
                        newpartLine = partLine.Replace("/VP", "");
                        bytes[i] = Convert.ToByte(newpartLine);
                        i++;
                    }
                }
            }
            appearance.VisualParams = bytes;
            List<string> WearableAsset = new List<string>();
            List<string> WearableItem = new List<string>();
            string texture = "";
            AttachmentIDs = new List<UUID>();
            AttachmentPoints = new List<string>();
            AttachmentAsset = new List<string>();
            foreach (string partLine in newFile)
            {
                if (partLine.StartsWith("WA"))
                {
                    string newpartLine = "";
                    newpartLine = partLine.Replace("WA", "");
                    WearableAsset.Add(newpartLine);
                }
                if (partLine.StartsWith("WI"))
                {
                    string newpartLine = "";
                    newpartLine = partLine.Replace("WI", "");
                    WearableItem.Add(newpartLine);
                }
                if (partLine.StartsWith("TEXTURE"))
                {
                    string newpartLine = "";
                    newpartLine = partLine.Replace("TEXTURE", "");
                    texture = newpartLine;
                }
                if (partLine.StartsWith("AI"))
                {
                    string newpartLine = "";
                    newpartLine = partLine.Replace("AI", "");
                    AttachmentIDs.Add(new UUID(newpartLine));
                }
                if (partLine.StartsWith("AA"))
                {
                    string newpartLine = "";
                    newpartLine = partLine.Replace("AA", "");
//.........这里部分代码省略.........
开发者ID:shangcheng,项目名称:Aurora,代码行数:101,代码来源:AppearanceArchiver.cs


注:本文中的AvatarAppearance类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。