本文整理汇总了C#中Aurora.Framework.Servers.HttpServer.OSHttpRequest类的典型用法代码示例。如果您正苦于以下问题:C# OSHttpRequest类的具体用法?C# OSHttpRequest怎么用?C# OSHttpRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OSHttpRequest类属于Aurora.Framework.Servers.HttpServer命名空间,在下文中一共展示了OSHttpRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fill
public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
OSHttpResponse httpResponse, Dictionary<string, object> requestParameters, ITranslator translator)
{
var vars = new Dictionary<string, object>();
IGenericsConnector connector = Aurora.DataManager.DataManager.RequestPlugin<IGenericsConnector>();
GridNewsItem news = connector.GetGeneric<GridNewsItem>(UUID.Zero, "WebGridNews", httpRequest.Query["newsid"].ToString());
if (news != null)
{
vars.Add("NewsTitle", news.Title);
vars.Add("NewsText", news.Text);
vars.Add("NewsID", news.ID.ToString());
}
else
{
if (httpRequest.Query["newsid"].ToString() == "-1")
{
vars.Add("NewsTitle", "No news to report");
vars.Add("NewsText", "");
}
else
{
vars.Add("NewsTitle", "Invalid News Item");
vars.Add("NewsText", "");
}
vars.Add("NewsID", "-1");
}
vars.Add("News", translator.GetTranslatedString("News"));
vars.Add("NewsItemTitle", translator.GetTranslatedString("NewsItemTitle"));
vars.Add("NewsItemText", translator.GetTranslatedString("NewsItemText"));
vars.Add("EditNewsText", translator.GetTranslatedString("EditNewsText"));
return vars;
}
示例2: 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>();
// Style Switcher
vars.Add("styles1", translator.GetTranslatedString("styles1"));
vars.Add("styles2", translator.GetTranslatedString("styles2"));
vars.Add("styles3", translator.GetTranslatedString("styles3"));
vars.Add("styles4", translator.GetTranslatedString("styles4"));
vars.Add("styles5", translator.GetTranslatedString("styles5"));
vars.Add("StyleSwitcherStylesText", translator.GetTranslatedString("StyleSwitcherStylesText"));
vars.Add("StyleSwitcherLanguagesText", translator.GetTranslatedString("StyleSwitcherLanguagesText"));
vars.Add("StyleSwitcherChoiceText", translator.GetTranslatedString("StyleSwitcherChoiceText"));
// Language Switcher
vars.Add("en", translator.GetTranslatedString("en"));
vars.Add("fr", translator.GetTranslatedString("fr"));
vars.Add("de", translator.GetTranslatedString("de"));
vars.Add("it", translator.GetTranslatedString("it"));
vars.Add("es", translator.GetTranslatedString("es"));
return vars;
}
示例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>();
IGenericsConnector connector = Aurora.DataManager.DataManager.RequestPlugin<IGenericsConnector>();
GridNewsItem news;
if (requestParameters.ContainsKey("Submit"))
{
string title = requestParameters["NewsTitle"].ToString();
string text = requestParameters["NewsText"].ToString();
string id = requestParameters["NewsID"].ToString();
news = connector.GetGeneric<GridNewsItem>(UUID.Zero, "WebGridNews", id);
connector.RemoveGeneric(UUID.Zero, "WebGridNews", id);
GridNewsItem item = new GridNewsItem { Text = text, Time = news.Time, Title = title, ID = int.Parse(id) };
connector.AddGeneric(UUID.Zero, "WebGridNews", id, item.ToOSD());
response = "<h3>News item editted successfully, redirecting to main page</h3>" +
"<script language=\"javascript\">" +
"setTimeout(function() {window.location.href = \"index.html?page=news_manager\";}, 0);" +
"</script>";
return null;
}
news = connector.GetGeneric<GridNewsItem>(UUID.Zero, "WebGridNews", httpRequest.Query["newsid"].ToString());
vars.Add("NewsTitle", news.Title);
vars.Add("NewsText", news.Text);
vars.Add("NewsID", news.ID.ToString());
vars.Add("NewsItemTitle", translator.GetTranslatedString("NewsItemTitle"));
vars.Add("NewsItemText", translator.GetTranslatedString("NewsItemText"));
vars.Add("EditNewsText", translator.GetTranslatedString("EditNewsText"));
vars.Add("Submit", translator.GetTranslatedString("Submit"));
return vars;
}
示例4: 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 = Aurora.DataManager.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;
}
示例5: 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>();
// Tooltips Urls
vars.Add("TooltipsWelcomeScreen", translator.GetTranslatedString("TooltipsWelcomeScreen"));
vars.Add("TooltipsWorldMap", translator.GetTranslatedString("TooltipsWorldMap"));
// Index Page
vars.Add("HomeText", translator.GetTranslatedString("HomeText"));
vars.Add("HomeTextWelcome", translator.GetTranslatedString("HomeTextWelcome"));
vars.Add("HomeTextTips", translator.GetTranslatedString("HomeTextTips"));
vars.Add("WelcomeScreen", translator.GetTranslatedString("WelcomeScreen"));
vars.Add("WelcomeToText", translator.GetTranslatedString("WelcomeToText"));
IGenericsConnector generics = Aurora.DataManager.DataManager.RequestPlugin<IGenericsConnector>();
var settings = generics.GetGeneric<GridSettings>(UUID.Zero, "WebSettings", "Settings");
if (PagesMigrator.RequiresUpdate() && PagesMigrator.CheckWhetherIgnoredVersionUpdate(settings.LastPagesVersionUpdateIgnored))
vars.Add("PagesUpdateRequired", translator.GetTranslatedString("Pages") + " " + translator.GetTranslatedString("DefaultsUpdated"));
else
vars.Add("PagesUpdateRequired", "");
if (SettingsMigrator.RequiresUpdate() && SettingsMigrator.CheckWhetherIgnoredVersionUpdate(settings.LastSettingsVersionUpdateIgnored))
vars.Add("SettingsUpdateRequired", translator.GetTranslatedString("Settings") + " " + translator.GetTranslatedString("DefaultsUpdated"));
else
vars.Add("SettingsUpdateRequired", "");
return vars;
}
示例6: Fill
public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
OSHttpResponse httpResponse, Dictionary<string, object> requestParameters, ITranslator translator)
{
var vars = new Dictionary<string, object>();
IAgentInfoConnector users = DataManager.DataManager.RequestPlugin<IAgentInfoConnector>();
IGenericsConnector connector = Aurora.DataManager.DataManager.RequestPlugin<IGenericsConnector>();
GridWelcomeScreen welcomeInfo = connector.GetGeneric<GridWelcomeScreen>(UUID.Zero, "GridWelcomeScreen", "GridWelcomeScreen");
if (welcomeInfo == null)
welcomeInfo = GridWelcomeScreen.Default;
IConfigSource config = webInterface.Registry.RequestModuleInterface<ISimulationBase>().ConfigSource;
vars.Add("GridStatus", translator.GetTranslatedString("GridStatus"));
vars.Add("GridOnline", welcomeInfo.GridStatus ? translator.GetTranslatedString("Online") : translator.GetTranslatedString("Offline"));
vars.Add("TotalUserCount", translator.GetTranslatedString("TotalUserCount"));
vars.Add("UserCount", webInterface.Registry.RequestModuleInterface<IUserAccountService>().
NumberOfUserAccounts(null, "").ToString());
vars.Add("TotalRegionCount", translator.GetTranslatedString("TotalRegionCount"));
vars.Add("RegionCount", DataManager.DataManager.RequestPlugin<IRegionData>().
Count((Framework.RegionFlags)0, (Framework.RegionFlags)0).ToString());
vars.Add("UniqueVisitors", translator.GetTranslatedString("UniqueVisitors"));
vars.Add("UniqueVisitorCount", users.RecentlyOnline((uint)TimeSpan.FromDays(30).TotalSeconds, false).ToString());
vars.Add("OnlineNow", translator.GetTranslatedString("OnlineNow"));
vars.Add("OnlineNowCount", users.RecentlyOnline(5 * 60, true).ToString());
vars.Add("HGActiveText", translator.GetTranslatedString("HyperGrid"));
string disabled = translator.GetTranslatedString("Disabled"),
enabled = translator.GetTranslatedString("Enabled");
vars.Add("HGActive", disabled + "(TODO: FIX)");
vars.Add("VoiceActiveLabel", translator.GetTranslatedString("Voice"));
vars.Add("VoiceActive", config.Configs["Voice"] != null && config.Configs["Voice"].GetString("Module", "GenericVoice") != "GenericVoice" ? enabled : disabled);
vars.Add("CurrencyActiveLabel", translator.GetTranslatedString("Currency"));
vars.Add("CurrencyActive", webInterface.Registry.RequestModuleInterface<IMoneyModule>() != null ? enabled : disabled);
return vars;
}
示例7: Fill
public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
OSHttpResponse httpResponse, Dictionary<string, object> requestParameters, ITranslator translator)
{
var vars = new Dictionary<string, object>();
if (requestParameters.ContainsKey("Submit"))
{
string title = requestParameters["NewsTitle"].ToString();
string text = requestParameters["NewsText"].ToString();
IGenericsConnector connector = Aurora.DataManager.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());
vars["ErrorMessage"] = "News item added successfully";
webInterface.Redirect(httpResponse, "index.html?page=news_manager", filename);
return vars;
}
else
vars["ErrorMessage"] = "";
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;
}
示例8: SimulatorFeaturesCAP
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);
}
示例9: 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 = Aurora.DataManager.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;
}
示例10: 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 = translator.GetTranslatedString("ChangesSavedSuccessfully");
return null;
}
if (requestParameters.ContainsKey("ResetSettings"))
{
SettingsMigrator.ResetToDefaults();
response = 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;
}
示例11: Handle
public override byte[] Handle(string path, Stream requestData,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
httpResponse.ContentType = "image/jpeg";
// StreamReader sr = new StreamReader(requestData);
// string body = sr.ReadToEnd();
// sr.Close();
// body = body.Trim();
try
{
lock (m_RequestLock)
{
Dictionary<string, object> request =
new Dictionary<string, object>();
foreach (string name in httpRequest.QueryString)
request[name] = httpRequest.QueryString[name];
return SendWorldView(request);
}
}
catch (Exception e)
{
m_log.Debug("[WORLDVIEW]: Exception: " + e.ToString());
}
return new Byte[0];
}
示例12: Fill
public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
OSHttpResponse httpResponse, Dictionary<string, object> requestParameters, ITranslator translator)
{
var vars = new Dictionary<string, object>();
IGenericsConnector connector = Aurora.DataManager.DataManager.RequestPlugin<IGenericsConnector>();
GridNewsItem news;
if (requestParameters.ContainsKey("Submit"))
{
string title = requestParameters["NewsTitle"].ToString();
string text = requestParameters["NewsText"].ToString();
string id = requestParameters["NewsID"].ToString();
news = connector.GetGeneric<GridNewsItem>(UUID.Zero, "WebGridNews", id);
connector.RemoveGeneric(UUID.Zero, "WebGridNews", id);
GridNewsItem item = new GridNewsItem { Text = text, Time = news.Time, Title = title, ID = int.Parse(id) };
connector.AddGeneric(UUID.Zero, "WebGridNews", id, item.ToOSD());
vars["ErrorMessage"] = "News item edit successfully";
webInterface.Redirect(httpResponse, "index.html?page=news_manager", filename);
return vars;
}
else
vars["ErrorMessage"] = "";
news = connector.GetGeneric<GridNewsItem>(UUID.Zero, "WebGridNews", httpRequest.Query["newsid"].ToString());
vars.Add("NewsTitle", news.Title);
vars.Add("NewsText", news.Text);
vars.Add("NewsID", news.ID.ToString());
vars.Add("NewsItemTitle", translator.GetTranslatedString("NewsItemTitle"));
vars.Add("NewsItemText", translator.GetTranslatedString("NewsItemText"));
vars.Add("EditNewsText", translator.GetTranslatedString("EditNewsText"));
vars.Add("Submit", translator.GetTranslatedString("Submit"));
return vars;
}
示例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>();
var regionslist = new List<Dictionary<string, object>>();
uint amountPerQuery = 10;
if (requestParameters.ContainsKey("Submit"))
{
IGridService gridService = webInterface.Registry.RequestModuleInterface<IGridService>();
string regionname = requestParameters["regionname"].ToString();
int start = httpRequest.Query.ContainsKey("Start") ? int.Parse(httpRequest.Query["Start"].ToString()) : 0;
uint count = gridService.GetRegionsByNameCount(null, regionname);
int maxPages = (int)(count / amountPerQuery) - 1;
if (start == -1)
start = (int)(maxPages < 0 ? 0 : maxPages);
vars.Add("CurrentPage", start);
vars.Add("NextOne", start + 1 > maxPages ? start : start + 1);
vars.Add("BackOne", start - 1 < 0 ? 0 : start - 1);
var regions = gridService.GetRegionsByName(null, regionname, (uint)start, amountPerQuery);
if (regions != null)
{
foreach (var region in regions)
{
regionslist.Add(new Dictionary<string, object> { { "RegionName", region.RegionName },
{ "RegionID", region.RegionID } });
}
}
}
else
{
vars.Add("CurrentPage", 0);
vars.Add("NextOne", 0);
vars.Add("BackOne", 0);
}
vars.Add("RegionsList", regionslist);
vars.Add("RegionSearchText", translator.GetTranslatedString("RegionSearchText"));
vars.Add("SearchForRegionText", translator.GetTranslatedString("SearchForRegionText"));
vars.Add("RegionNameText", translator.GetTranslatedString("RegionNameText"));
vars.Add("Search", translator.GetTranslatedString("Search"));
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("SearchResultForRegionText", translator.GetTranslatedString("SearchResultForRegionText"));
vars.Add("RegionMoreInfo", translator.GetTranslatedString("RegionMoreInfo"));
vars.Add("MoreInfoText", translator.GetTranslatedString("MoreInfoText"));
return vars;
}
示例14: 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("ChatText", translator.GetTranslatedString("ChatText"));
return vars;
}
示例15: Fill
public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
OSHttpResponse httpResponse, Dictionary<string, object> requestParameters, ITranslator translator)
{
var vars = new Dictionary<string, object>();
vars.Add("WebsiteDownInfoText", translator.GetTranslatedString("WebsiteDownInfoText"));
vars.Add("WebsiteDownText", translator.GetTranslatedString("WebsiteDownText"));
return vars;
}