Пример #1
0
        public static OSD TeleportFinishEvent(
            ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint,
            uint locationID, uint flags, string capsURL, UUID agentID,
            int regionSizeX, int regionSizeY)
        {
            OSDMap info = new OSDMap();

            info.Add("AgentID", OSD.FromUUID(agentID));
            info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this?
            info.Add("RegionHandle", OSD.FromBinary(ulongToByteArray(regionHandle)));
            info.Add("SeedCapability", OSD.FromString(capsURL));
            info.Add("SimAccess", OSD.FromInteger(simAccess));
            info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes()));
            info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port));
            info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation
            info.Add("RegionSizeX", OSD.FromUInteger((uint)regionSizeX));
            info.Add("RegionSizeY", OSD.FromUInteger((uint)regionSizeY));

            OSDArray infoArr = new OSDArray();

            infoArr.Add(info);

            OSDMap body = new OSDMap();

            body.Add("Info", infoArr);

            return(BuildEvent("TeleportFinish", body));
        }
Пример #2
0
        public static OSD EstablishAgentCommunication(UUID agentID, ulong regionhandle, string simIpAndPort, string seedcap, int RegionSizeX, int RegionSizeY)
        {
            OSDMap body = new OSDMap(3);

            body.Add("agent-id", new OSDUUID(agentID));
            body.Add("sim-ip-and-port", new OSDString(simIpAndPort));
            body.Add("seed-capability", new OSDString(seedcap));
            body.Add("region-handle", OSD.FromULong(regionhandle));
            body.Add("region-size-x", OSD.FromInteger(RegionSizeX));
            body.Add("region-size-y", OSD.FromInteger(RegionSizeY));

            return(buildEvent("EstablishAgentCommunication", body));
        }
Пример #3
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["InfoUUID"]         = OSD.FromUUID(InfoUUID);
            map["Dwell"]            = OSD.FromInteger(Dwell);
            map["Flags"]            = OSD.FromInteger((int)Flags);
            map["Name"]             = OSD.FromString(Name);
            map["Description"]      = OSD.FromString(Description);
            map["UserLocation"]     = OSD.FromVector3(UserLocation);
            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);
            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["UserLookAt"]       = OSD.FromVector3(UserLookAt);
            map["AuthBuyerID"]      = OSD.FromUUID(AuthBuyerID);
            map["OtherCleanTime"]   = OSD.FromInteger(OtherCleanTime);
            map["RegionHandle"]     = OSD.FromULong(RegionHandle);
            map["Private"]          = OSD.FromBoolean(Private);
            map["GenericDataMap"]   = GenericData;
            return(map);
        }
        /// <summary>
        ///   Pack AgentCircuitData into an OSDMap for transmission over LLSD XML or LLSD json
        /// </summary>
        /// <returns>map of the agent circuit data</returns>
        public virtual OSDMap PackAgentCircuitData()
        {
            OSDMap args = new OSDMap();

            args["agent_id"]          = OSD.FromUUID(AgentID);
            args["caps_path"]         = OSD.FromString(CapsPath);
            args["child"]             = OSD.FromBoolean(child);
            args["roothandle"]        = OSD.FromULong(roothandle);
            args["reallyischild"]     = OSD.FromBoolean(reallyischild);
            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);
            args["first_name"]         = OSD.FromString(firstname);
            args["last_name"]          = OSD.FromString(lastname);
            args["draw_distance"]      = DrawDistance;
            args["RegionUDPPort"]      = RegionUDPPort;

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

                OSDMap appmap = Appearance.Pack();
                args["packed_appearance"] = appmap;
            }
            else
            {
                MainConsole.Instance.Error("[AgentCircuitData]: NOT PACKING APPEARANCE FOR " + firstname + " " + lastname +
                                           ", user may be messed up");
            }

            if (ServiceURLs != null && ServiceURLs.Count > 0)
            {
                OSDMap urls = new OSDMap();
                foreach (KeyValuePair <string, object> kvp in ServiceURLs)
                {
                    //System.Console.WriteLine("XXX " + kvp.Key + "=" + kvp.Value);
                    urls[kvp.Key] = OSD.FromString((kvp.Value == null) ? string.Empty : kvp.Value.ToString());
                }
                args["serviceurls"] = urls;
            }

            return(args);
        }
Пример #5
0
        public static OSD EstablishAgentCommunication(UUID agentID, string simIpAndPort, string seedcap,
                                                      ulong regionHandle, int regionSizeX, int regionSizeY)
        {
            OSDMap body = new OSDMap(6)
            {
                { "agent-id", new OSDUUID(agentID) },
                { "sim-ip-and-port", new OSDString(simIpAndPort) },
                { "seed-capability", new OSDString(seedcap) },
                { "region-handle", OSD.FromULong(regionHandle) },
                { "region-size-x", OSD.FromUInteger((uint)regionSizeX) },
                { "region-size-y", OSD.FromUInteger((uint)regionSizeY) }
            };

            return(BuildEvent("EstablishAgentCommunication", body));
        }
Пример #6
0
        public static OSD GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data)
        {
            OSDArray AgentData    = new OSDArray(1);
            OSDMap   AgentDataMap = new OSDMap(1);

            AgentDataMap.Add("AgentID", OSD.FromUUID(receiverAgent));
            AgentData.Add(AgentDataMap);

            OSDArray GroupData    = new OSDArray(data.Length);
            OSDArray NewGroupData = new OSDArray(data.Length);

            foreach (GroupMembershipData membership in data)
            {
                OSDMap GroupDataMap    = new OSDMap(6);
                OSDMap NewGroupDataMap = new OSDMap(1);

                GroupDataMap.Add("GroupID", OSD.FromUUID(membership.GroupID));
                GroupDataMap.Add("GroupPowers", OSD.FromULong(membership.GroupPowers));
                GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(membership.AcceptNotices));
                GroupDataMap.Add("GroupInsigniaID", OSD.FromUUID(membership.GroupPicture));
                GroupDataMap.Add("Contribution", OSD.FromInteger(membership.Contribution));
                GroupDataMap.Add("GroupName", OSD.FromString(membership.GroupName));
                NewGroupDataMap.Add("ListInProfile", OSD.FromBoolean(membership.ListInProfile));

                GroupData.Add(GroupDataMap);
                NewGroupData.Add(NewGroupDataMap);
            }

            OSDMap llDataStruct = new OSDMap(3);

            llDataStruct.Add("AgentData", AgentData);
            llDataStruct.Add("GroupData", GroupData);
            llDataStruct.Add("NewGroupData", NewGroupData);

            return(BuildEvent("AgentGroupDataUpdate", llDataStruct));
        }
Пример #7
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);
        }