public bool Charge(UUID agentID, int amount, string text, int daysUntilNextCharge, TransactionType type, string identifer, bool chargeImmediately)
 {
     IMoneyModule moneyModule = m_registry.RequestModuleInterface<IMoneyModule>();
     if (moneyModule != null)
     {
         if (chargeImmediately)
         {
             bool success = moneyModule.Charge(agentID, amount, text, type);
             if (!success)
                 return false;
         }
         IScheduleService scheduler = m_registry.RequestModuleInterface<IScheduleService>();
         if (scheduler != null)
         {
             OSDMap itemInfo = new OSDMap();
             itemInfo.Add("AgentID", agentID);
             itemInfo.Add("Amount", amount);
             itemInfo.Add("Text", text);
             itemInfo.Add("Type", (int)type);
             SchedulerItem item = new SchedulerItem("ScheduledPayment " + identifer,
                                                    OSDParser.SerializeJsonString(itemInfo), false,
                                                    DateTime.UtcNow, daysUntilNextCharge, RepeatType.days, agentID);
             itemInfo.Add("SchedulerID", item.id);
             scheduler.Save(item);
         }
     }
     return true;
 }
        public bool Charge(UUID agentID, int amount, string text, int daysUntilNextCharge)
        {
            IMoneyModule moneyModule = m_registry.RequestModuleInterface<IMoneyModule>();
            if (moneyModule != null)
            {
                bool success = moneyModule.Charge(agentID, amount, text);
                if (!success)
                    return false;
                IScheduleService scheduler = m_registry.RequestModuleInterface<IScheduleService>();
                if (scheduler != null)
                {
                    OSDMap itemInfo = new OSDMap();
                    itemInfo.Add("AgentID", agentID);
                    itemInfo.Add("Amount", amount);
                    itemInfo.Add("Text", text);
                    SchedulerItem item = new SchedulerItem("ScheduledPayment",
                        OSDParser.SerializeJsonString(itemInfo), false,
                        DateTime.Now.AddDays(daysUntilNextCharge) - DateTime.Now);
                    itemInfo.Add("SchedulerID", item.id);
                    scheduler.Save(item);

                }
            }
            return true;
        }
        OSDMap GetAbuseReports (OSDMap map)
        {
            var resp = new OSDMap ();
            var areports = m_registry.RequestModuleInterface<IAbuseReports> ();

            int start = map ["Start"].AsInteger ();
            int count = map ["Count"].AsInteger ();
            bool active = map ["Active"].AsBoolean ();

            List<AbuseReport> arList = areports.GetAbuseReports (start, count, active);
            var AbuseReports = new OSDArray ();

            if (arList != null) {
                foreach (AbuseReport rpt in arList) {
                    AbuseReports.Add (rpt.ToOSD ());
                }
            }

            resp ["AbuseReports"] = AbuseReports;
            resp ["Start"] = OSD.FromInteger (start);
            resp ["Count"] = OSD.FromInteger (count); 
            resp ["Active"] = OSD.FromBoolean (active);

            return resp;
        }
        public virtual void AddNewUrls(string key, OSDMap urls)
        {
            m_autoConfig.Remove("ServerURI");
            foreach (KeyValuePair<string, OSD> kvp in urls)
            {
                if (kvp.Value == "" && kvp.Value.Type != OSDType.Array)
                    continue;
                if (!m_autoConfig.ContainsKey(kvp.Key))
                {
                    if (kvp.Value.Type == OSDType.String)
                        m_autoConfig[kvp.Key] = kvp.Value;
                    else if (kvp.Value.Type != OSDType.Boolean) // "Success" coming from IWC
                        m_autoConfig[kvp.Key] = string.Join(",", ((OSDArray)kvp.Value).ConvertAll<string>((osd) => osd).ToArray());
                }
                else
                {
                    List<string> keys = kvp.Value.Type == OSDType.Array ? ((OSDArray)kvp.Value).ConvertAll<string>((osd) => osd) : new List<string>(new string[1] { kvp.Value.AsString() });

                    foreach (string url in keys)
                    {
                        //Check to see whether the base URLs are the same (removes the UUID at the end)
                        if (url.Length < 36)
                            continue; //Not a URL
                        string u = url.Remove(url.Length - 36, 36);
                        if (!m_autoConfig[kvp.Key].AsString().Contains(u))
                            m_autoConfig[kvp.Key] = m_autoConfig[kvp.Key] + "," + kvp.Value;
                    }
                }
            }
            m_allConfigs[key] = urls;
        }
 /// <summary>
 ///     POST URL-encoded form data to a web service that returns LLSD or
 ///     JSON data
 /// </summary>
 public static string PostToService (string url, OSDMap data)
 {
     byte [] buffer = data != null ? Encoding.UTF8.GetBytes (OSDParser.SerializeJsonString (data, true)) : null;
     Task<byte []> t = ServiceOSDRequest (url, buffer, "POST", m_defaultTimeout);
     t.Wait ();
     return t.Result == null ? null : Encoding.UTF8.GetString (t.Result);
 }
        private Hashtable SimulatorFeaturesCAP(Hashtable mDhttpMethod)
        {
            OSDMap data = new OSDMap();
            data["MeshRezEnabled"] = true;
            data["MeshUploadEnabled"] = true;
            data["MeshXferEnabled"] = true;
            data["PhysicsMaterialsEnabled"] = true;


            OSDMap typesMap = new OSDMap();

            typesMap["convex"] = true;
            typesMap["none"] = true;
            typesMap["prim"] = true;

            data["PhysicsShapeTypes"] = typesMap;


            //Data URLS need sent as well
            //Not yet...
            //data["DataUrls"] = m_service.Registry.RequestModuleInterface<IGridRegistrationService> ().GetUrlForRegisteringClient (m_service.AgentID + "|" + m_service.RegionHandle);

            //Send back data
            Hashtable responsedata = new Hashtable();
            responsedata["int_response_code"] = 200; //501; //410; //404;
            responsedata["content_type"] = "text/plain";
            responsedata["keepalive"] = false;
            responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(data);
            return responsedata;
        }
Example #7
0
        public static bool AddGeneric(UUID ownerID, string type, string key, OSDMap map, string m_ServerURI)
        {
            string value = OSDParser.SerializeJsonString(map);

            NameValueCollection RequestArgs = new NameValueCollection
            {
                { "RequestMethod", "AddGeneric" },
                { "OwnerID", ownerID.ToString() },
                { "Type", type },
                { "Key", key },
                { "Value", value}
            };


            OSDMap Response = CachedPostRequest(RequestArgs, m_ServerURI);
            if (Response["Success"].AsBoolean())
            {
                return true;
            }
            else
            {
                //m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: Error {0}, {1}, {2}, {3}", ownerID, type, key, Response["Message"]);
                return false;
            }
        }
        public OSDMap FireMessageReceived(string SessionID, OSDMap message)
        {
            OSDMap result = null;
            ulong reg;
            if (ulong.TryParse(SessionID, out reg)) //Local region
            {
                if (OnMessageReceived != null)
                {
                    MessageReceived eventCopy = OnMessageReceived;
                    foreach (OSDMap r in from MessageReceived messagedelegate in eventCopy.GetInvocationList() select messagedelegate(message) into r where r != null select r)
                    {
                        result = r;
                    }
                }
            }
            else //IWC
            {
                /*string[] session = SessionID.Split('|');
                ISyncMessagePosterService smps = m_registry.RequestModuleInterface<ISyncMessagePosterService>();
                //Forward it on
                result = smps.Get(message, UUID.Parse(session[0]), ulong.Parse(session[1]));*/
            }

            return result;
        }
 public void PostInternal(bool remote, string url, OSDMap request)
 {
     if (remote)
         DoRemoteCallPost(true, url + "/syncmessage/", false, url + "/syncmessage/", request);
     else
         m_registry.RequestModuleInterface<ISyncMessageRecievedService>().FireMessageReceived(request);
 }
        public OSDMap GetExternalCaps(UUID agentID, GridRegion region)
        {
            if (m_registry == null) return new OSDMap();
            OSDMap resp = new OSDMap();
            if (m_registry.RequestModuleInterface<IGridServerInfoService>() != null)
            {
                m_servers = m_registry.RequestModuleInterface<IGridServerInfoService>().GetGridURIs("SyncMessageServerURI");
                OSDMap req = new OSDMap();
                req["AgentID"] = agentID;
                req["Region"] = region.ToOSD();
                req["Method"] = "GetCaps";

                List<ManualResetEvent> events = new List<ManualResetEvent>();
                foreach (string uri in m_servers)
                {
                    ManualResetEvent even = new ManualResetEvent(false);
                    m_syncPoster.Get(uri, req, (r) =>
                    {
                        if (r == null)
                            return;
                        foreach (KeyValuePair<string, OSD> kvp in r)
                            resp.Add(kvp.Key, kvp.Value);
                        even.Set();
                    });
                    events.Add(even);
                }
                ManualResetEvent.WaitAll(events.ToArray());
            }
            foreach (var h in GetHandlers(agentID, region.RegionID))
            {
                if (m_allowedCapsModules.Contains(h.Name))
                    h.IncomingCapsRequest(agentID, region, m_registry.RequestModuleInterface<ISimulationBase>(), ref resp);
            }
            return resp;
        }
        byte [] SimulatorFeaturesCAP (string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
        {
            OSDMap data = new OSDMap ();
            // AvatarHoverHeight enabled
            data ["AvatarHoverHeightEnabled"] = true;

            // MaxMaterialsPerTransaction enabled
            data ["MaxMaterialsPerTransaction"] = 50;

            data ["MeshRezEnabled"] = true;
            data ["MeshUploadEnabled"] = true;
            data ["MeshXferEnabled"] = true;
            data ["PhysicsMaterialsEnabled"] = true;

            OSDMap typesMap = new OSDMap ();

            typesMap ["convex"] = true;
            typesMap ["none"] = true;
            typesMap ["prim"] = true;

            data ["PhysicsShapeTypes"] = typesMap;

            // some additional features
            data ["god_names"] = GodNames (httpRequest);

            //Send back data
            return OSDParser.SerializeLLSDXmlBytes (data);
        }
        private byte[] SimulatorFeaturesCAP(string path, Stream request,
                                  OSHttpRequest httpRequest, OSHttpResponse httpResponse)
        {
            OSDMap data = new OSDMap();
            data["MeshRezEnabled"] = true;
            data["MeshUploadEnabled"] = true;
            data["MeshXferEnabled"] = true;
            data["PhysicsMaterialsEnabled"] = true;


            OSDMap typesMap = new OSDMap();

            typesMap["convex"] = true;
            typesMap["none"] = true;
            typesMap["prim"] = true;

            data["PhysicsShapeTypes"] = typesMap;


            //Data URLS need sent as well
            //Not yet...
            //data["DataUrls"] = m_service.Registry.RequestModuleInterface<IGridRegistrationService> ().GetUrlForRegisteringClient (m_service.AgentID + "|" + m_service.RegionHandle);

            //Send back data
            return OSDParser.SerializeLLSDXmlBytes(data);
        }
Example #13
0
        public OSDMap Pack()
        {
            OSDMap args = new OSDMap();
            args["message_type"] = OSD.FromString("AgentPosition");

            args["region_handle"] = OSD.FromString(RegionHandle.ToString());
            args["circuit_code"] = OSD.FromString(CircuitCode.ToString());
            args["agent_uuid"] = OSD.FromUUID(AgentID);
            args["session_uuid"] = OSD.FromUUID(SessionID);

            args["position"] = OSD.FromString(Position.ToString());
            args["velocity"] = OSD.FromString(Velocity.ToString());
            args["center"] = OSD.FromString(Center.ToString());
            args["size"] = OSD.FromString(Size.ToString());
            args["at_axis"] = OSD.FromString(AtAxis.ToString());
            args["left_axis"] = OSD.FromString(LeftAxis.ToString());
            args["up_axis"] = OSD.FromString(UpAxis.ToString());

            args["far"] = OSD.FromReal(Far);
            args["changed_grid"] = OSD.FromBoolean(ChangedGrid);

            if ((Throttles != null) && (Throttles.Length > 0))
                args["throttles"] = OSD.FromBinary(Throttles);

            return args;
        }
        public OSDMap GetInternal(bool remote, string url, OSDMap request)
        {
            try
            {
                LogMessage(remote, url, request);

                if (remote)
                {
                    if (url != "")
                    {
                        url = (url.EndsWith("/syncmessage/", StringComparison.Ordinal) ? url : (url + "/syncmessage/"));
                        return DoRemoteCallGet(true, url, false, url, request) as OSDMap;
                    }
                    else
                        return DoRemoteCallGet(true, "SyncMessageServerURI", false, url, request) as OSDMap;
                }

                return m_registry.RequestModuleInterface<ISyncMessageRecievedService>().FireMessageReceived(request);
            }
            catch (Exception ex)
            {
                MainConsole.Instance.WarnFormat("[Sync Message Poster Service]: Caught exception when attempting to post to {0}: {1}",
                                                                      url, ex.ToString());
            }

            return null;
        }
        public List<Email> GetEmails(UUID objectID)
        {
            OSDMap map = new OSDMap();

            map["ObjectID"] = objectID;
            map["Method"] = "getemails";

            List<Email> Messages = new List<Email>();
            try
            {
                List<string> urls =
                    m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("RemoteServerURI");
                foreach (string url in urls)
                {
                    OSDMap result = WebUtils.PostToService(url + "osd", map, true, false);
                    OSDArray array = (OSDArray) OSDParser.DeserializeJson(result["_RawResult"]);
                    foreach (OSD o in array)
                    {
                        Email message = new Email();
                        message.FromOSD((OSDMap) o);
                        Messages.Add(message);
                    }
                }
                return Messages;
            }
            catch (Exception e)
            {
                MainConsole.Instance.DebugFormat("[AuroraRemoteEmailConnector]: Exception when contacting server: {0}", e);
            }
            return Messages;
        }
        public AvatarAppearance(UUID avatarID, OSDMap map)
        {
            //            MainConsole.Instance.WarnFormat("[AVATAR APPEARANCE]: create appearance for {0} from OSDMap",avatarID);

            m_owner = avatarID;
            Unpack(map);
        }
 public void Unpack(OSDMap args)
 {
     if (args["point"] != null)
         AttachPoint = args["point"].AsInteger();
     ItemID = (args["item"] != null) ? args["item"].AsUUID() : UUID.Zero;
     AssetID = (args["asset"] != null) ? args["asset"].AsUUID() : UUID.Zero;
 }
Example #18
0
 /// <summary>
 /// Check to see if the client has baked textures that belong to banned clients
 /// </summary>
 /// <param name="client"></param>
 /// <param name="textureEntry"></param>
 public void CheckForBannedViewer(IClientAPI client, Primitive.TextureEntry textureEntry)
 {
     try
     {
         //Read the website once!
         if (m_map == null)
             m_map = (OSDMap)OSDParser.Deserialize(Utilities.ReadExternalWebsite("http://auroraserver.ath.cx:8080/client_tags.xml"));
         
         //This is the givaway texture!
         for (int i = 0; i < textureEntry.FaceTextures.Length; i++)
         {
             if (textureEntry.FaceTextures[i] != null)
             {
                 if (m_map.ContainsKey(textureEntry.FaceTextures[i].TextureID.ToString()))
                 {
                     OSDMap viewerMap = (OSDMap)m_map[textureEntry.FaceTextures[i].TextureID.ToString()];
                     //Check the names
                     if (BannedViewers.Contains(viewerMap["name"].ToString()))
                     {
                         client.Kick("You cannot use " + viewerMap["name"] + " in this sim.");
                         ((Scene)client.Scene).IncomingCloseAgent(client.AgentId);
                     }
                     else if (m_banEvilViewersByDefault && viewerMap.ContainsKey("evil") && (viewerMap["evil"].AsBoolean() == true))
                     {
                         client.Kick("You cannot use " + viewerMap["name"] + " in this sim.");
                         ((Scene)client.Scene).IncomingCloseAgent(client.AgentId);
                     }
                 }
             }
         }
     }
     catch { }
 }
 public UserInfo GetUserInfo(string userID)
 {
     List<string> urls = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf(userID,
                                                                                                "AgentInfoServerURI");
     foreach (string url in urls)
     {
         try
         {
             OSDMap request = new OSDMap();
             request["userID"] = userID;
             request["Method"] = "GetUserInfo";
             OSDMap result = WebUtils.PostToService(url, request, true, false);
             OSD r = OSDParser.DeserializeJson(result["_RawResult"]);
             if (r is OSDMap)
             {
                 OSDMap innerresult = (OSDMap) r;
                 UserInfo info = new UserInfo();
                 if (innerresult["Result"].AsString() == "null")
                     return null;
                 info.FromOSD((OSDMap) innerresult["Result"]);
                 return info;
             }
         }
         catch (Exception)
         {
         }
     }
     return null;
 }
        public override void FromOSD(OSDMap map)
        {
            AgentInfo = new IAgentInfo();
            AgentInfo.FromOSD((OSDMap) (map["AgentInfo"]));
            UserAccount = new UserAccount();
            UserAccount.FromOSD((OSDMap)(map["UserAccount"]));
            if (!map.ContainsKey("ActiveGroup"))
                ActiveGroup = null;
            else
            {
                ActiveGroup = new GroupMembershipData();
                ActiveGroup.FromOSD((OSDMap)(map["ActiveGroup"]));
            }

            GroupMemberships = ((OSDArray) map["GroupMemberships"]).ConvertAll<GroupMembershipData>((o) =>
                                                                                                        {
                                                                                                            GroupMembershipData
                                                                                                                group =
                                                                                                                    new GroupMembershipData
                                                                                                                        ();
                                                                                                            group
                                                                                                                .FromOSD
                                                                                                                ((OSDMap
                                                                                                                 ) o);
                                                                                                            return group;
                                                                                                        });
            OfflineMessages = ((OSDArray) map["OfflineMessages"]).ConvertAll<GridInstantMessage>((o) =>
                                                                                                     {
                                                                                                         GridInstantMessage
                                                                                                             group =
                                                                                                                 new GridInstantMessage
                                                                                                                     ();
                                                                                                         group.FromOSD(
                                                                                                             (OSDMap) o);
                                                                                                         return group;
                                                                                                     });
            MuteList = ((OSDArray) map["MuteList"]).ConvertAll<MuteList>((o) =>
                                                                             {
                                                                                 MuteList group = new MuteList();
                                                                                 group.FromOSD((OSDMap) o);
                                                                                 return group;
                                                                             });

            if (map.ContainsKey("Appearance"))
            {
                Appearance = new AvatarAppearance();
                Appearance.FromOSD((OSDMap)map["Appearance"]);
            }

            if (map.ContainsKey("FriendOnlineStatuses"))
                FriendOnlineStatuses = ((OSDArray)map["FriendOnlineStatuses"]).ConvertAll<UUID>((o) => { return o; });

            if (map.ContainsKey("Friends"))
                Friends = ((OSDArray)map["Friends"]).ConvertAll<FriendInfo>((o) =>
                { 
                    FriendInfo f = new FriendInfo();
                    f.FromOSD((OSDMap)o);
                    return f; 
                });
        }
Example #21
0
 public override OSDMap ToOSD ()
 {
     OSDMap map = new OSDMap ();
     map ["eventID"] = eventID;
     map ["creator"] = creator;
     map ["name"] = name;
     map ["category"] = category;
     map ["description"] = description;
     map ["date"] = date;
     map ["dateUTC"] = dateUTC;
     map ["duration"] = duration;
     map ["cover"] = cover;
     map ["amount"] = amount;
     map ["simName"] = simName;
     //map["globalPos"] = globalPos;
     map ["GPosX"] = OSD.FromReal (globalPos.X).ToString ();
     map ["GPosY"] = OSD.FromReal (globalPos.Y).ToString ();
     map ["GPosZ"] = OSD.FromReal (globalPos.Z).ToString ();
     //map["regionPos"] = regionPos;
     map ["RPosX"] = OSD.FromReal (regionPos.X).ToString ();
     map ["RPosY"] = OSD.FromReal (regionPos.Y).ToString ();
     map ["RPosZ"] = OSD.FromReal (regionPos.Z).ToString ();
     map ["eventFlags"] = eventFlags;
     map ["maturity"] = maturity;
     map ["regionId"] = regionId;
     map ["parcelId"] = parcelId;
     return map;
 }
Example #22
0
        protected override void UnpackData(OSDMap args, AgentDestinationData d, Hashtable request)
        {
            base.UnpackData(args, d, request);
            ExtendedAgentDestinationData data = (ExtendedAgentDestinationData)d;
            try
            {
                if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null)
                    data.host = args["gatekeeper_host"].AsString();
                if (args.ContainsKey("gatekeeper_port") && args["gatekeeper_port"] != null)
                    Int32.TryParse(args["gatekeeper_port"].AsString(), out data.port);
                if (args.ContainsKey("gatekeeper_serveruri") && args["gatekeeper_serveruri"] != null)
                    data.gatekeeperServerURI = args["gatekeeper_serveruri"];
                if (args.ContainsKey("destination_serveruri") && args["destination_serveruri"] != null)
                    data.destinationServerURI = args["destination_serveruri"];

            }
            catch (InvalidCastException)
            {
                m_log.ErrorFormat("[HOME AGENT HANDLER]: Bad cast in UnpackData");
            }

            string callerIP = GetCallerIP(request);
            // Verify if this call came from the login server
            if (callerIP == m_LoginServerIP)
                data.fromLogin = true;

        }
        public IUserProfileInfo GetUserProfile (UUID PrincipalID)
        {
            try
            {
                List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService> ().FindValueOf (PrincipalID.ToString (), "RemoteServerURI");
                foreach (string url in serverURIs)
                {
                    OSDMap map = new OSDMap();
                    map["Method"] = "getprofile";
                    map["PrincipalID"] = PrincipalID;
                    OSDMap response = WebUtils.PostToService (url + "osd", map, true, true);
                    if (response["_Result"].Type == OSDType.Map)
                    {
                        OSDMap responsemap = (OSDMap)response["_Result"];
                        if (responsemap.Count == 0)
                            continue;
                        IUserProfileInfo info = new IUserProfileInfo ();
                        info.FromOSD (responsemap);
                        return info;
                    }
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat ("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.ToString ());
            }

            return null;
        }
Example #24
0
 public static OSD DeserializeJson(JsonData json)
 {
     switch (json.GetJsonType())
     {
         case JsonType.Boolean:
             return OSD.FromBoolean((bool)json);
         case JsonType.Int:
             return OSD.FromInteger((int)json);
         case JsonType.Long:
             return OSD.FromLong((long)json);
         case JsonType.Double:
             return OSD.FromReal((double)json);
         case JsonType.String:
             string str = (string)json;
             if (String.IsNullOrEmpty(str))
                 return new OSD();
             else
                 return OSD.FromString(str);
         case JsonType.Array:
             OSDArray array = new OSDArray(json.Count);
             for (int i = 0; i < json.Count; i++)
                 array.Add(DeserializeJson(json[i]));
             return array;
         case JsonType.Object:
             OSDMap map = new OSDMap(json.Count);
             IDictionaryEnumerator e = ((IOrderedDictionary)json).GetEnumerator();
             while (e.MoveNext())
                 map.Add((string)e.Key, DeserializeJson((JsonData)e.Value));
             return map;
         case JsonType.None:
         default:
             return new OSD();
     }
 }
Example #25
0
        public VoiceConsole(RadegastInstance instance)
        {
            InitializeComponent();
            Disposed += new EventHandler(VoiceConsole_Disposed);

            this.instance = instance;

            // Callbacks
            netcom.ClientLoginStatus += new EventHandler<LoginProgressEventArgs>(netcom_ClientLoginStatus);

            this.instance.MainForm.Load += new EventHandler(MainForm_Load);

            config = instance.GlobalSettings["voice"] as OSDMap;
            if (config == null)
            {
                config = new OSDMap();
                config["enabled"] = new OSDBoolean(false);
                instance.GlobalSettings["voice"] = config;
                instance.GlobalSettings.Save();
            }

            chkVoiceEnable.Checked = config["enabled"].AsBoolean();
            if (chkVoiceEnable.Checked)
                Start();
        }
 protected OSDMap OnMessageReceived(OSDMap message)
 {
     //If it is an async message request, make sure that the request is valid and check it
     if (message["Method"] == "AsyncMessageRequest")
     {
         try
         {
             OSDMap response = new OSDMap();
             OSDArray array = new OSDArray();
             if (m_regionMessages.ContainsKey(message["RegionHandle"].AsULong()))
             {
                 foreach (OSDMap asyncMess in m_regionMessages[message["RegionHandle"].AsULong()])
                 {
                     array.Add(asyncMess);
                 }
                 m_regionMessages.Remove(message["RegionHandle"].AsULong());
             }
             response["Messages"] = array;
             return response;
         }
         catch
         {
         }
     }
     return null;
 }
Example #27
0
 public override OSDMap ToOSD()
 {
     OSDMap retVal = new OSDMap();
     retVal["URLS"] = URLS;
     retVal["SessionID"] = SessionID;
     return retVal;
 }
        /// <summary>
        /// Post a new message to the given region by region handle
        /// </summary>
        /// <param name="RegionHandle"></param>
        /// <param name="request"></param>
        public void Post(ulong RegionHandle, OSDMap request)
        {
            if (!m_regionMessages.ContainsKey(RegionHandle))
                m_regionMessages.Add(RegionHandle, new List<OSDMap>());

            m_regionMessages[RegionHandle].Add(request);
        }
Example #29
0
        public OSDMap PackAgentCircuitData()
        {
            OSDMap args = new OSDMap();
            args["agent_id"] = OSD.FromUUID(AgentID);
            args["base_folder"] = OSD.FromUUID(BaseFolder);
            args["caps_path"] = OSD.FromString(CapsPath);

            args["child"] = OSD.FromBoolean(child);
            args["circuit_code"] = OSD.FromString(CircuitCode.ToString());
            args["first_name"] = OSD.FromString(FirstName);
            args["last_name"] = OSD.FromString(LastName);
            args["inventory_folder"] = OSD.FromUUID(InventoryFolder);
            args["secure_session_id"] = OSD.FromUUID(SecureSessionID);
            args["session_id"] = OSD.FromUUID(SessionID);
            args["start_pos"] = OSD.FromString(startpos.ToString());
            args["client_version"] = OSD.FromString(ClientVersion);

            if (GroupPowers != null)
            {
                using (var ostream = new MemoryStream())
                {
                    Serializer.Serialize(ostream, GroupPowers);
                    args["group_powers"] = OSD.FromBinary(ostream.ToArray());
                }
            }

            return args;
        }
        public byte[] AgentExperiences (string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
        {
        	MainConsole.Instance.DebugFormat("[AgentExperiences] Call = {0}", httpRequest);
            var agentExp = new OSDMap();

            return OSDParser.SerializeLLSDXmlBytes (agentExp);
        }