OpenSim.Framework.AvatarAppearance.Pack C# (CSharp) 메소드

Pack() 공개 메소드

Create an OSDMap from the appearance data
public Pack ( ) : OSDMap
리턴 OSDMap
        public OSDMap Pack()
        {
            OSDMap data = new OSDMap();

            data["serial"] = OSD.FromInteger(m_serial);
            data["height"] = OSD.FromReal(m_avatarHeight);
            data["hipoffset"] = OSD.FromReal(m_hipOffset);

            // Wearables
            OSDArray wears = new OSDArray(AvatarWearable.MAX_WEARABLES);
            for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
                wears.Add(m_wearables[i].Pack());
            data["wearables"] = wears;

            // Avatar Textures
            OSDArray textures = new OSDArray(AvatarAppearance.TEXTURE_COUNT);
            for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
            {
                if (m_texture.FaceTextures[i] != null)
                    textures.Add(OSD.FromUUID(m_texture.FaceTextures[i].TextureID));
                else
                    textures.Add(OSD.FromUUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
            }
            data["textures"] = textures;

            // Visual Parameters
            OSDBinary visualparams = new OSDBinary(m_visualparams);
            data["visualparams"] = visualparams;

            // Attachments
            OSDArray attachs = new OSDArray(m_attachments.Count);
            foreach (AvatarAttachment attach in GetAttachments())
                attachs.Add(attach.Pack());
            data["attachments"] = attachs;

            return data;
        }

Usage Example

예제 #1
0
        /// <summary>
        /// Pack AgentCircuitData into an OSDMap for transmission over LLSD XML or LLSD json
        /// </summary>
        /// <returns>map of the agent circuit data</returns>
        public OSDMap PackAgentCircuitData()
        {
            OSDMap args = new OSDMap();

            args["agent_id"]  = OSD.FromUUID(AgentID);
            args["caps_path"] = OSD.FromString(CapsPath);

            #region OPENSIM ONLY

            args["first_name"] = OSD.FromString(firstname);
            args["last_name"]  = OSD.FromString(lastname);

            #endregion

            args["child"]             = OSD.FromBoolean(child);
            args["circuit_code"]      = OSD.FromString(circuitcode.ToString());
            args["secure_session_id"] = OSD.FromUUID(SecureSessionID);
            args["session_id"]        = OSD.FromUUID(SessionID);

            args["service_session_id"] = OSD.FromString(ServiceSessionID);
            args["start_pos"]          = OSD.FromString(startpos.ToString());
            args["client_ip"]          = OSD.FromString(IPAddress);
            args["otherInfo"]          = OSDParser.SerializeLLSDXmlString(OtherInformation);
            args["teleport_flags"]     = OSD.FromUInteger(teleportFlags);

            if (Appearance != null)
            {
                args["appearance_serial"] = OSD.FromInteger(Appearance.Serial);

                OSDMap appmap = Appearance.Pack();
                args["packed_appearance"] = appmap;
            }

            return(args);
        }
All Usage Examples Of OpenSim.Framework.AvatarAppearance::Pack