public static OSD EnableSimulator(ulong handle, byte[] IPAddress, int Port, int RegionSizeX, int RegionSizeY)
        {
            OSDMap llsdSimInfo = new OSDMap(3)
            {
                { "Handle", new OSDBinary(ulongToByteArray(handle)) },
                { "IP", new OSDBinary(IPAddress) },
                { "Port", new OSDInteger(Port) },
                { "RegionSizeX", OSD.FromUInteger((uint)RegionSizeX) },
                { "RegionSizeY", OSD.FromUInteger((uint)RegionSizeY) }
            };

            OSDArray arr = new OSDArray(1)
            {
                llsdSimInfo
            };

            OSDMap llsdBody = new OSDMap(1)
            {
                { "SimulatorInfo", arr }
            };

            return(buildEvent("EnableSimulator", llsdBody));
        }
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap {
                { "fromAgentID", OSD.FromUUID(FromAgentID) },
                { "fromAgentName", OSD.FromString(FromAgentName) },
                { "toAgentID", OSD.FromUUID(ToAgentID) },
                { "dialog", OSD.FromInteger(Dialog) },
                { "fromGroup", OSD.FromBoolean(FromGroup) },
                { "message", OSD.FromString(Message) },
                { "imSessionID", OSD.FromUUID(SessionID) },
                { "offline", OSD.FromInteger(Offline) },
                //  broken for non en_US locales                                  {"Position", OSD.FromVector3(Position)},
                { "GPosX", OSD.FromReal(Position.X).ToString() },
                { "GPosY", OSD.FromReal(Position.Y).ToString() },
                { "GPosZ", OSD.FromReal(Position.Z).ToString() },
                { "binaryBucket", OSD.FromBinary(BinaryBucket) },
                { "ParentEstateID", OSD.FromUInteger(ParentEstateID) },
                { "RegionID", OSD.FromUUID(RegionID) },
                { "timestamp", OSD.FromUInteger(Timestamp) }
            };

            return(map);
        }
Exemplo n.º 3
0
        public override OSDMap ToOSD()
        {
            OSDMap Classified = new OSDMap
            {
                { "ClassifiedUUID", OSD.FromUUID(ClassifiedUUID) },
                { "CreatorUUID", OSD.FromUUID(CreatorUUID) },
                { "CreationDate", OSD.FromUInteger(CreationDate) },
                { "ExpirationDate", OSD.FromUInteger(ExpirationDate) },
                { "Category", OSD.FromUInteger(Category) },
                { "Name", OSD.FromString(Name) },
                { "Description", OSD.FromString(Description) },
                { "ParcelUUID", OSD.FromUUID(ParcelUUID) },
                { "ParentEstate", OSD.FromUInteger(ParentEstate) },
                { "SnapshotUUID", OSD.FromUUID(SnapshotUUID) },
                { "SimName", OSD.FromString(SimName) },
                { "GlobalPos", OSD.FromVector3(GlobalPos) },
                { "ParcelName", OSD.FromString(ParcelName) },
                { "ClassifiedFlags", OSD.FromInteger(ClassifiedFlags) },
                { "PriceForListing", OSD.FromInteger(PriceForListing) }
            };

            return(Classified);
        }
Exemplo n.º 4
0
        public static OSD CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt,
                                      IPAddress address, int port,
                                      string capsURL, UUID agentID, UUID sessionID, int RegionSizeX, int RegionSizeY)
        {
            OSDArray lookAtArr = new OSDArray(3)
            {
                OSD.FromReal(lookAt.X), OSD.FromReal(lookAt.Y), OSD.FromReal(lookAt.Z)
            };

            OSDArray positionArr = new OSDArray(3)
            {
                OSD.FromReal(pos.X),
                OSD.FromReal(pos.Y),
                OSD.FromReal(pos.Z)
            };

            OSDMap infoMap = new OSDMap(2)
            {
                { "LookAt", lookAtArr }, { "Position", positionArr }
            };

            OSDArray infoArr = new OSDArray(1)
            {
                infoMap
            };

            OSDMap agentDataMap = new OSDMap(2)
            {
                { "AgentID", OSD.FromUUID(agentID) },
                { "SessionID", OSD.FromUUID(sessionID) }
            };

            OSDArray agentDataArr = new OSDArray(1)
            {
                agentDataMap
            };

            OSDMap regionDataMap = new OSDMap(4)
            {
                { "RegionHandle", OSD.FromBinary(ulongToByteArray(handle)) },
                { "SeedCapability", OSD.FromString(capsURL) },
                { "SimIP", OSD.FromBinary(address.GetAddressBytes()) },
                { "SimPort", OSD.FromInteger(port) },
                { "RegionSizeX", OSD.FromUInteger((uint)RegionSizeX) },
                { "RegionSizeY", OSD.FromUInteger((uint)RegionSizeY) }
            };

            OSDArray regionDataArr = new OSDArray(1)
            {
                regionDataMap
            };

            OSDMap llsdBody = new OSDMap(3)
            {
                { "Info", infoArr },
                { "AgentData", agentDataArr },
                { "RegionData", regionDataArr }
            };

            return(buildEvent("CrossedRegion", llsdBody));
        }
Exemplo n.º 5
0
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map ["GroupID"]          = OSD.FromUUID(GroupID);
            map ["IsGroupOwned"]     = OSD.FromBoolean(IsGroupOwned);
            map ["OwnerID"]          = OSD.FromUUID(OwnerID);
            map ["Maturity"]         = OSD.FromInteger(Maturity);
            map ["Area"]             = OSD.FromInteger(Area);
            map ["AuctionID"]        = OSD.FromUInteger(AuctionID);
            map ["SalePrice"]        = OSD.FromInteger(SalePrice);
            map ["Dwell"]            = OSD.FromInteger(Dwell);
            map ["Flags"]            = OSD.FromInteger((int)Flags);
            map ["Name"]             = OSD.FromString(Name);
            map ["Description"]      = OSD.FromString(Description);
            map ["LocalID"]          = OSD.FromInteger(LocalID);
            map ["GlobalID"]         = OSD.FromUUID(GlobalID);
            map ["RegionID"]         = OSD.FromUUID(RegionID);
            map ["ScopeID"]          = OSD.FromUUID(ScopeID);
            map ["MediaDescription"] = OSD.FromString(MediaDescription);
            map ["MediaWidth"]       = OSD.FromInteger(MediaWidth);
            map ["MediaHeight"]      = OSD.FromInteger(MediaHeight);
            map ["MediaLoop"]        = OSD.FromBoolean(MediaLoop);
            map ["MediaType"]        = OSD.FromString(MediaType);
            map ["ObscureMedia"]     = OSD.FromBoolean(ObscureMedia);
            map ["ObscureMusic"]     = OSD.FromBoolean(ObscureMusic);
            // 25062016 LibOMV update
            map ["SeeAVs"]        = OSD.FromBoolean(SeeAVS);
            map ["AnyAVSounds"]   = OSD.FromBoolean(AnyAVSounds);
            map ["GroupAVSounds"] = OSD.FromBoolean(GroupAVSounds);
            // End
            map ["SnapshotID"]     = OSD.FromUUID(SnapshotID);
            map ["MediaAutoScale"] = OSD.FromInteger(MediaAutoScale);
            map ["MediaLoopSet"]   = OSD.FromReal(MediaLoopSet);
            map ["MediaURL"]       = OSD.FromString(MediaURL);
            map ["MusicURL"]       = OSD.FromString(MusicURL);
            map ["Bitmap"]         = OSD.FromBinary(Bitmap);
            map ["Category"]       = OSD.FromInteger((int)Category);
            map ["FirstParty"]     = OSD.FromBoolean(FirstParty);
            map ["ClaimDate"]      = OSD.FromInteger(ClaimDate);
            map ["ClaimPrice"]     = OSD.FromInteger(ClaimPrice);
            map ["Status"]         = OSD.FromInteger((int)Status);
            map ["LandingType"]    = OSD.FromInteger(LandingType);
            map ["PassHours"]      = OSD.FromReal(PassHours);
            map ["PassPrice"]      = OSD.FromInteger(PassPrice);
            map ["AuthBuyerID"]    = OSD.FromUUID(AuthBuyerID);
            map ["OtherCleanTime"] = OSD.FromInteger(OtherCleanTime);
            map ["RegionHandle"]   = OSD.FromULong(RegionHandle);
            map ["Private"]        = OSD.FromBoolean(Private);
            map ["AuctionInfo"]    = AuctionInfo.ToOSD();

            // OSD.FromVector3 is broken for non en_US locales
            // map["UserLocation"] = OSD.FromVector3(UserLocation);
            map["ULocX"] = OSD.FromReal(UserLocation.X).ToString();
            map["ULocY"] = OSD.FromReal(UserLocation.Y).ToString();
            map["ULocZ"] = OSD.FromReal(UserLocation.Z).ToString();
            // map["UserLookAt"] = OSD.FromVector3(UserLookAt);
            map["ULookX"] = OSD.FromReal(UserLookAt.X).ToString();
            map["ULookY"] = OSD.FromReal(UserLookAt.Y).ToString();
            map["ULookZ"] = OSD.FromReal(UserLookAt.Z).ToString();

            return(map);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Convert the value of the given property to OSD type.
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        public OSDArray ToOSDArray()
        {
            //DebugLog.WarnFormat("[SYNCED PROPERTY] ToOSDArray called for property {0}", Property.ToString());
            lock (m_lock)
            {
                OSDArray propertyData = new OSDArray();
                propertyData.Add(OSD.FromInteger((uint)Property));
                propertyData.Add(OSD.FromLong(LastUpdateTimeStamp));
                propertyData.Add(OSD.FromString(LastUpdateSyncID));

                OSD value = null;
                switch (Property)
                {
                ///////////////////////////////////////
                //SOP properties with complex structure
                ///////////////////////////////////////
                case SyncableProperties.Type.AgentCircuitData:
                case SyncableProperties.Type.AvatarAppearance:
                    value = (OSDMap)LastUpdateValue;
                    break;

                case SyncableProperties.Type.Animations:
                    value = (OSDArray)LastUpdateValue;
                    break;

                ////////////////////////////
                // Integer/enum type properties
                ////////////////////////////
                case SyncableProperties.Type.CreationDate:              // int
                case SyncableProperties.Type.LinkNum:                   // int
                case SyncableProperties.Type.OwnershipCost:             // int
                case SyncableProperties.Type.SalePrice:                 // int
                case SyncableProperties.Type.ScriptAccessPin:           // int
                case SyncableProperties.Type.AggregateScriptEvents:     // enum
                case SyncableProperties.Type.Flags:                     // enum
                case SyncableProperties.Type.LocalFlags:                // enum
                case SyncableProperties.Type.PresenceType:              // enum
                    value = OSD.FromInteger((int)LastUpdateValue);
                    break;

                ////////////////////////////
                // Byte type properties
                ////////////////////////////
                case SyncableProperties.Type.ClickAction:
                case SyncableProperties.Type.Material:
                case SyncableProperties.Type.ObjectSaleType:
                    value = OSD.FromInteger((byte)LastUpdateValue);
                    break;

                ////////////////////////////
                // Boolean type properties
                ////////////////////////////
                case SyncableProperties.Type.AllowedDrop:
                case SyncableProperties.Type.IsAttachment:
                case SyncableProperties.Type.PassTouches:
                case SyncableProperties.Type.VolumeDetectActive:
                case SyncableProperties.Type.Flying:
                case SyncableProperties.Type.IsColliding:
                case SyncableProperties.Type.CollidingGround:
                case SyncableProperties.Type.Kinematic:
                case SyncableProperties.Type.IsSelected:
                case SyncableProperties.Type.AllowMovement:
                    value = OSD.FromBoolean((bool)LastUpdateValue);
                    break;

                ////////////////////////////
                // Vector3 type properties
                ////////////////////////////
                case SyncableProperties.Type.AngularVelocity:
                case SyncableProperties.Type.AttachedPos:
                case SyncableProperties.Type.GroupPosition:
                case SyncableProperties.Type.OffsetPosition:
                case SyncableProperties.Type.Scale:
                case SyncableProperties.Type.SitTargetPosition:
                case SyncableProperties.Type.SitTargetPositionLL:
                case SyncableProperties.Type.SOP_Acceleration:
                case SyncableProperties.Type.Velocity:
                case SyncableProperties.Type.Force:
                case SyncableProperties.Type.PA_Acceleration:
                case SyncableProperties.Type.PA_Velocity:
                case SyncableProperties.Type.PA_TargetVelocity:
                case SyncableProperties.Type.Position:
                case SyncableProperties.Type.RotationalVelocity:
                case SyncableProperties.Type.Size:
                case SyncableProperties.Type.Torque:
                case SyncableProperties.Type.AbsolutePosition:
                    value = OSD.FromVector3((Vector3)LastUpdateValue);
                    break;

                ////////////////////////////
                // UUID type properties
                ////////////////////////////
                case SyncableProperties.Type.AttachedAvatar:
                case SyncableProperties.Type.CollisionSound:
                case SyncableProperties.Type.CreatorID:
                case SyncableProperties.Type.FolderID:
                case SyncableProperties.Type.GroupID:
                case SyncableProperties.Type.LastOwnerID:
                case SyncableProperties.Type.OwnerID:
                case SyncableProperties.Type.Sound:
                    value = OSD.FromUUID((UUID)LastUpdateValue);
                    break;

                ////////////////////////////
                // UInt type properties
                ////////////////////////////
                case SyncableProperties.Type.LocalId:
                case SyncableProperties.Type.AttachmentPoint:
                case SyncableProperties.Type.BaseMask:
                case SyncableProperties.Type.Category:
                case SyncableProperties.Type.EveryoneMask:
                case SyncableProperties.Type.GroupMask:
                case SyncableProperties.Type.InventorySerial:
                case SyncableProperties.Type.NextOwnerMask:
                case SyncableProperties.Type.OwnerMask:
                case SyncableProperties.Type.AgentControlFlags:
                case SyncableProperties.Type.ParentId:
                    value = OSD.FromUInteger((uint)LastUpdateValue);
                    break;

                ////////////////////////////
                // Float type properties
                ////////////////////////////
                case SyncableProperties.Type.CollisionSoundVolume:
                case SyncableProperties.Type.Buoyancy:
                    value = OSD.FromReal((float)LastUpdateValue);
                    break;

                ////////////////////////////
                // String type properties
                ////////////////////////////
                case SyncableProperties.Type.Color:
                case SyncableProperties.Type.CreatorData:
                case SyncableProperties.Type.Description:
                case SyncableProperties.Type.MediaUrl:
                case SyncableProperties.Type.Name:
                case SyncableProperties.Type.RealRegion:
                case SyncableProperties.Type.Shape:
                case SyncableProperties.Type.SitName:
                case SyncableProperties.Type.TaskInventory:
                case SyncableProperties.Type.Text:
                case SyncableProperties.Type.TouchName:
                    value = OSD.FromString((string)LastUpdateValue);
                    break;

                ////////////////////////////
                // byte[] (binary data) type properties
                ////////////////////////////
                case SyncableProperties.Type.ParticleSystem:
                case SyncableProperties.Type.TextureAnimation:
                    value = OSD.FromBinary((byte[])LastUpdateValue);
                    break;

                ////////////////////////////
                // Quaternion type properties
                ////////////////////////////
                case SyncableProperties.Type.RotationOffset:
                case SyncableProperties.Type.SitTargetOrientation:
                case SyncableProperties.Type.SitTargetOrientationLL:
                case SyncableProperties.Type.Orientation:
                case SyncableProperties.Type.Rotation:
                    value = OSD.FromQuaternion((Quaternion)LastUpdateValue);
                    break;

                default:
                    DebugLog.WarnFormat("[SYNCED PROPERTY] ToOSDArray: No handler for property {0} ", Property);
                    break;
                }
                propertyData.Add(value);
                return(propertyData);
            }
        }