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


C# Implementation.OSHttpRequest类代码示例

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


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

示例1: Fill

        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();
            if (requestParameters.ContainsKey("Submit"))
            {
                string title = requestParameters["NewsTitle"].ToString();
                string text = requestParameters["NewsText"].ToString();
                IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();
                GridNewsItem item = new GridNewsItem {Text = text, Time = DateTime.Now, Title = title};
                item.ID = connector.GetGenericCount(UUID.Zero, "WebGridNews") + 1;
                connector.AddGeneric(UUID.Zero, "WebGridNews", item.ID.ToString(), item.ToOSD());
                response = "<h3>News item added successfully, redirecting to main page</h3>" +
                           "<script language=\"javascript\">" +
                           "setTimeout(function() {window.location.href = \"index.html?page=news_manager\";}, 0);" +
                           "</script>";
                return null;
            }

            vars.Add("NewsItemTitle", translator.GetTranslatedString("NewsItemTitle"));
            vars.Add("NewsItemText", translator.GetTranslatedString("NewsItemText"));
            vars.Add("AddNewsText", translator.GetTranslatedString("AddNewsText"));
            vars.Add("Submit", translator.GetTranslatedString("Submit"));

            return vars;
        }
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:28,代码来源:add_news.cs

示例2: SimulatorFeaturesCAP

        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);
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:28,代码来源:SimulatorFeatures.cs

示例3: Fill

        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            vars.Add("DisplayLG1", "display: none;");
            vars.Add("DisplayLG2", "display: none;");
            vars.Add("DisplayLG3", "display: none;");
            vars.Add("DisplayLG4", "display: none;");
            vars.Add("DisplayLG5", "display: none;");
            vars.Add("DisplayLG6", "display: none;");
            if (translator.LanguageName == "en")
                vars["DisplayLG1"] = "";
            if (translator.LanguageName == "fr")
                vars["DisplayLG2"] = "";
            if (translator.LanguageName == "de")
                vars["DisplayLG3"] = "";
            if (translator.LanguageName == "it")
                vars["DisplayLG4"] = "";
            if (translator.LanguageName == "es")
                vars["DisplayLG5"] = "";
            if (translator.LanguageName == "nl")
                vars["DisplayLG6"] = "";

            return vars;
        }
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:28,代码来源:index.cs

示例4: AgentExperiences

        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);
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:7,代码来源:AgentExperiences.cs

示例5: ProcessGetGroupAPI

        public byte [] ProcessGetGroupAPI (string path, Stream request, OSHttpRequest httpRequest,
                                          OSHttpResponse httpResponse)
        {
            string groupID;
            if (httpRequest.QueryString ["group_id"] != null) {
                groupID = httpRequest.QueryString ["group_id"];
                MainConsole.Instance.Debug ("[GroupAPIv1] Requesting groups bans for group_id: " + groupID);

                // Get group banned member list
                OSDMap bannedUsers = new OSDMap ();
                var banUsers = m_groupService.GetGroupBannedMembers (m_service.AgentID, (UUID)groupID);
                if (banUsers != null) {
                    foreach (GroupBannedAgentsData user in banUsers) {
                        OSDMap banned = new OSDMap ();
                        banned ["ban_date"] = user.BanDate;
                        bannedUsers [user.AgentID.ToString ()] = banned;
                    }
                }

                OSDMap map = new OSDMap ();
                map ["group_id"] = groupID;
                map ["ban_list"] = bannedUsers;
                return OSDParser.SerializeLLSDXmlBytes (map);
            }

            return null;
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:27,代码来源:GroupAPIv1.cs

示例6: Fill

 public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                        OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                        ITranslator translator, out string response)
 {
     response = null;
     var vars = new Dictionary<string, object>();
     IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();
     if (httpRequest.Query.Contains("delete"))
     {
         string newsID = httpRequest.Query["delete"].ToString();
         connector.RemoveGeneric(UUID.Zero, "WebGridNews", newsID);
         vars["Success"] = "Successfully deleted the news item";
     }
     else
         vars["Success"] = "";
     var newsItems = connector.GetGenerics<GridNewsItem>(UUID.Zero, "WebGridNews");
     vars.Add("News", newsItems.ConvertAll<Dictionary<string, object>>(item => item.ToDictionary()));
     vars.Add("NewsManager", translator.GetTranslatedString("NewsManager"));
     vars.Add("EditNewsItem", translator.GetTranslatedString("EditNewsItem"));
     vars.Add("AddNewsItem", translator.GetTranslatedString("AddNewsItem"));
     vars.Add("DeleteNewsItem", translator.GetTranslatedString("DeleteNewsItem"));
     vars.Add("NewsTitleText", translator.GetTranslatedString("NewsTitleText"));
     vars.Add("NewsDateText", translator.GetTranslatedString("NewsDateText"));
     vars.Add("EditNewsText", translator.GetTranslatedString("EditNewsText"));
     vars.Add("DeleteNewsText", translator.GetTranslatedString("DeleteNewsText"));
     return vars;
 }
开发者ID:VirtualReality,项目名称:Universe,代码行数:27,代码来源:news_manager.cs

示例7: Fill

        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            if (requestParameters.ContainsKey("ResetMenu"))
            {
                PagesMigrator.ResetToDefaults();
                response = "Menu: "+ translator.GetTranslatedString("ChangesSavedSuccessfully");
                return null;
            }
            if (requestParameters.ContainsKey("ResetSettings"))
            {
                SettingsMigrator.ResetToDefaults(webInterface);
                response = "WebUI: "+ translator.GetTranslatedString("ChangesSavedSuccessfully");
                return null;
            }

            vars.Add("FactoryReset", translator.GetTranslatedString("FactoryReset"));
            vars.Add("ResetMenuText", translator.GetTranslatedString("ResetMenuText"));
            vars.Add("ResetSettingsText", translator.GetTranslatedString("ResetSettingsText"));
            vars.Add("ResetMenuInfoText", translator.GetTranslatedString("ResetMenuText"));
            vars.Add("ResetSettingsInfoText", translator.GetTranslatedString("ResetSettingsInfoText"));
            vars.Add("Reset", translator.GetTranslatedString("Reset"));

            return vars;
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:29,代码来源:factory_reset.cs

示例8: Fill

        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                                OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                                ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();
            //IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();

            // Check if we're looking at the standard page or the submitted one
            if (requestParameters.ContainsKey("Submit"))
            {
            }
            else
            {
                //vars.Add("ErrorMessage", error);

                vars.Add("SimConsoleText", translator.GetTranslatedString("SimConsoleText"));
                vars.Add("SimAddressText", translator.GetTranslatedString("SimAddressText"));
                vars.Add("UserNameText", translator.GetTranslatedString("UserNameText"));
                vars.Add("PasswordText", translator.GetTranslatedString("PasswordText"));
                vars.Add("SendCommandText", translator.GetTranslatedString("SendCommandText"));

                vars.Add("Login", translator.GetTranslatedString("Login"));

            }
            return vars;
        }
开发者ID:VirtualReality,项目名称:Universe,代码行数:27,代码来源:sim_console.cs

示例9: FindExperienceByName

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

            return OSDParser.SerializeLLSDXmlBytes (experience);
        }
开发者ID:VirtualReality,项目名称:Universe,代码行数:8,代码来源:AssortedExperiences.cs

示例10: CheckAdminAuthentication

 public static bool CheckAdminAuthentication (OSHttpRequest request)
 {
     if (request.Cookies ["SessionID"] != null) {
         if (_authenticatedAdminUsers.ContainsKey (UUID.Parse (request.Cookies ["SessionID"].Value)))
             return true;
     }
     return false;
 }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:8,代码来源:Authenticator.cs

示例11: Fill

        public Dictionary<string, object> Fill (WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object> ();

            List<Dictionary<string, object>> RegionListVars = new List<Dictionary<string, object>> ();
            var sortBy = new Dictionary<string, bool> ();
            if (httpRequest.Query.ContainsKey ("region"))
                sortBy.Add (httpRequest.Query ["region"].ToString (), true);
            else if (httpRequest.Query.ContainsKey ("Order"))
                sortBy.Add (httpRequest.Query ["Order"].ToString (), true);


            var regionData = Framework.Utilities.DataManager.RequestPlugin<IRegionData> ();
            var regions = regionData.Get ((RegionFlags) 0,
                                          RegionFlags.Hyperlink | RegionFlags.Foreign | RegionFlags.Hidden,
                                          null, null, sortBy);
            foreach (var region in regions) {
                string info;
                info = (region.RegionArea < 1000000) ? region.RegionArea + " m2" : (region.RegionArea / 1000000) + " km2";
                info = info + ", " + region.RegionTerrain;

                RegionListVars.Add (new Dictionary<string, object> {
                    { "RegionLocX", region.RegionLocX / Constants.RegionSize },
                    { "RegionLocY", region.RegionLocY / Constants.RegionSize },
                    { "RegionName", region.RegionName },
                    { "RegionInfo", info},
                    { "RegionStatus", region.IsOnline ? "yes" : "no"},
                    { "RegionID", region.RegionID },
                    { "RegionURI", region.RegionURI }
                });
            }

            vars.Add ("RegionList", RegionListVars);
            vars.Add ("RegionText", translator.GetTranslatedString ("Region"));

            vars.Add ("RegionNameText", translator.GetTranslatedString ("RegionNameText"));
            vars.Add ("RegionLocXText", translator.GetTranslatedString ("RegionLocXText"));
            vars.Add ("RegionLocYText", translator.GetTranslatedString ("RegionLocYText"));
            vars.Add ("RegionOnlineText", translator.GetTranslatedString ("Online"));
            vars.Add ("SortByLocX", translator.GetTranslatedString ("SortByLocX"));
            vars.Add ("SortByLocY", translator.GetTranslatedString ("SortByLocY"));
            vars.Add ("SortByName", translator.GetTranslatedString ("SortByName"));
            vars.Add ("RegionListText", translator.GetTranslatedString ("RegionListText"));
            vars.Add ("FirstText", translator.GetTranslatedString ("FirstText"));
            vars.Add ("BackText", translator.GetTranslatedString ("BackText"));
            vars.Add ("NextText", translator.GetTranslatedString ("NextText"));
            vars.Add ("LastText", translator.GetTranslatedString ("LastText"));
            vars.Add ("CurrentPageText", translator.GetTranslatedString ("CurrentPageText"));
            vars.Add ("MoreInfoText", translator.GetTranslatedString ("MoreInfoText"));
            vars.Add ("RegionMoreInfo", translator.GetTranslatedString ("RegionMoreInfo"));
            vars.Add ("MainServerURL", webInterface.GridURL);

            return vars;
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:57,代码来源:region_list.cs

示例12: Fill

        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            return vars;
        }
开发者ID:VirtualReality,项目名称:Universe,代码行数:9,代码来源:add_event.cs

示例13: Fill

 public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
     OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
     ITranslator translator, out string response)
 {
     response = null;
     var vars = new Dictionary<string, object>();
     vars.Add("RegistrationText", translator.GetTranslatedString("RegistrationText"));
     vars.Add("RegistrationsDisabled", translator.GetTranslatedString("RegistrationsDisabled"));
     return vars;
 }
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:10,代码来源:noregistrations.cs

示例14: ChangeAuthentication

 public static void ChangeAuthentication(OSHttpRequest request, UserAccount account)
 {
     if (request.Cookies["SessionID"] != null)
     {
         UUID sessionID = UUID.Parse(request.Cookies["SessionID"].Value);
         if (_authenticatedUsers.ContainsKey(sessionID))
             _authenticatedUsers[sessionID] = account;
         if (_authenticatedAdminUsers.ContainsKey(sessionID))
             _authenticatedAdminUsers[sessionID] = account;
     }
 }
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:11,代码来源:Authenticator.cs

示例15: Fill

        public Dictionary<string, object> Fill (WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object> ();
            var settings = webInterface.GetGridSettings ();

            if (requestParameters.ContainsKey ("Submit")) {
                settings.Gridname = requestParameters ["Gridname"].ToString ();
                settings.Gridnick = requestParameters ["Gridnick"].ToString ();
                settings.WelcomeMessage = requestParameters ["WelcomeMessage"].ToString ();
                settings.GovernorName = requestParameters ["GovernorName"].ToString ();
                settings.RealEstateOwnerName = requestParameters ["RealEstateOwnerName"].ToString ();
                settings.BankerName = requestParameters ["BankerName"].ToString ();
                settings.MarketplaceOwnerName = requestParameters ["MarketplaceOwnerName"].ToString ();
                settings.MainlandEstateName = requestParameters ["MainlandEstateName"].ToString ();
                settings.SystemEstateName = requestParameters ["SystemEstateName"].ToString ();

                // update main grid setup
                webInterface.SaveGridSettings (settings);
                response = "Successfully updated grid settings.";

                return null;
            }

            vars.Add ("Gridname", settings.Gridname);
            vars.Add ("Gridnick", settings.Gridnick);
            vars.Add ("WelcomeMessage", settings.WelcomeMessage);
            vars.Add ("GovernorName", settings.GovernorName);
            vars.Add ("RealEstateOwnerName", settings.RealEstateOwnerName);
            vars.Add ("BankerName", settings.BankerName);
            vars.Add ("MarketplaceOwnerName", settings.MarketplaceOwnerName);
            vars.Add ("MainlandEstateName", settings.MainlandEstateName);
            vars.Add ("SystemEstateName", settings.SystemEstateName);


            vars.Add ("GridSettingsManager", translator.GetTranslatedString ("GridSettingsManager"));
            vars.Add ("GridnameText", translator.GetTranslatedString ("GridnameText"));
            vars.Add ("GridnickText", translator.GetTranslatedString ("GridnickText"));
            vars.Add ("WelcomeMessageText", translator.GetTranslatedString ("WelcomeMessageText"));
            vars.Add ("GovernorNameText", translator.GetTranslatedString ("GovernorNameText"));
            vars.Add ("RealEstateOwnerNameText", translator.GetTranslatedString ("RealEstateOwnerNameText"));
            vars.Add ("BankerNameText", translator.GetTranslatedString ("BankerNameText"));
            vars.Add ("MarketPlaceOwnerNameText", translator.GetTranslatedString ("MarketPlaceOwnerNameText"));
            vars.Add ("MainlandEstateNameText", translator.GetTranslatedString ("MainlandEstateNameText"));
            vars.Add ("SystemEstateNameText", translator.GetTranslatedString ("SystemEstateNameText"));

            vars.Add ("Save", translator.GetTranslatedString ("Save"));
            vars.Add ("No", translator.GetTranslatedString ("No"));
            vars.Add ("Yes", translator.GetTranslatedString ("Yes"));

            return vars;
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:54,代码来源:gridsettings_manager.cs


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