本文整理汇总了C#中Aurora.Framework.Servers.HttpServer.OSHttpRequest类的典型用法代码示例。如果您正苦于以下问题:C# OSHttpRequest类的具体用法?C# OSHttpRequest怎么用?C# OSHttpRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OSHttpRequest类属于Aurora.Framework.Servers.HttpServer命名空间,在下文中一共展示了OSHttpRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:33,代码来源:news.cs
示例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;
}
开发者ID:rjspence,项目名称:YourSim,代码行数:26,代码来源:index.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>();
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;
}
开发者ID:rjspence,项目名称:YourSim,代码行数:35,代码来源:edit_news.cs
示例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;
}
开发者ID:rjspence,项目名称:YourSim,代码行数:27,代码来源:add_news.cs
示例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;
}
开发者ID:rjspence,项目名称:YourSim,代码行数:29,代码来源:home.cs
示例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;
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:35,代码来源:gridstatus.cs
示例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;
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:26,代码来源:add_news.cs
示例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);
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:26,代码来源:SimulatorFeatures.cs
示例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;
}
开发者ID:rjspence,项目名称:YourSim,代码行数:26,代码来源:news_manager.cs
示例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;
}
开发者ID:rjspence,项目名称:YourSim,代码行数:28,代码来源:factory_reset.cs
示例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];
}
开发者ID:andsim,项目名称:Aurora-Sim-Optional-Modules,代码行数:29,代码来源:WorldViewRequestHandler.cs
示例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;
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:34,代码来源:edit_news.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>();
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;
}
开发者ID:rjspence,项目名称:YourSim,代码行数:59,代码来源:region_search.cs
示例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;
}
开发者ID:rjspence,项目名称:YourSim,代码行数:8,代码来源:chat.cs
示例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;
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:8,代码来源:maintenance.cs
示例16: Run
public void Run()
{
while (m_running)
{
PollServiceHttpRequest req = m_request.Dequeue();
try
{
if (req.PollServiceArgs.Valid())
{
if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
{
StreamReader str;
try
{
str = new StreamReader(req.Request.Body);
}
catch (ArgumentException)
{
// Stream was not readable means a child agent
// was closed due to logout, leaving the
// Event Queue request orphaned.
continue;
}
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id,
str.ReadToEnd());
var request = new OSHttpRequest(req.HttpContext, req.Request);
m_server.MessageHandler.SendGenericHTTPResponse(
responsedata,
request.MakeResponse(System.Net.HttpStatusCode.OK, "OK"),
request
);
}
else
{
if ((Environment.TickCount - req.RequestTime) > m_timeout)
{
var request = new OSHttpRequest(req.HttpContext, req.Request);
m_server.MessageHandler.SendGenericHTTPResponse(
req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id),
request.MakeResponse(System.Net.HttpStatusCode.OK, "OK"),
request);
}
else
{
ReQueuePollServiceItem reQueueItem = ReQueue;
if (reQueueItem != null)
reQueueItem(req);
}
}
}
}
catch (Exception e)
{
MainConsole.Instance.ErrorFormat("Exception in poll service thread: " + e);
}
}
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:58,代码来源:PollServiceWorkerThread.cs
示例17: Handle
public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest,
OSHttpResponse httpResponse)
{
byte[] data = ReadFully(request);
string param = GetParam(path);
string responseString = m_method(data, path, param);
return Encoding.UTF8.GetBytes(responseString);
}
开发者ID:Gnu32,项目名称:Silverfin,代码行数:9,代码来源:BinaryStreamHandler.cs
示例18: 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:rjspence,项目名称:YourSim,代码行数:9,代码来源:Authenticator.cs
示例19: Handle
public override byte[] Handle(string path, Stream request,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
MainConsole.Instance.DebugFormat ("[SIMULATION]: Stream handler called");
Hashtable keysvals = new Hashtable ();
Hashtable headervals = new Hashtable ();
string[] querystringkeys = httpRequest.QueryString.AllKeys;
string[] rHeaders = httpRequest.Headers.AllKeys;
keysvals.Add ("uri", httpRequest.RawUrl);
keysvals.Add ("content-type", httpRequest.ContentType);
keysvals.Add ("http-method", httpRequest.HttpMethod);
foreach (string queryname in querystringkeys)
keysvals.Add (queryname, httpRequest.QueryString[queryname]);
foreach (string headername in rHeaders)
headervals[headername] = httpRequest.Headers[headername];
keysvals.Add ("headers", headervals);
keysvals.Add ("querystringkeys", querystringkeys);
Stream inputStream = httpRequest.ContentType == "application/x-gzip" ? new GZipStream (request, CompressionMode.Decompress) : request;
Encoding encoding = Encoding.UTF8;
StreamReader reader = new StreamReader (inputStream, encoding);
string requestBody = reader.ReadToEnd ();
reader.Close ();
keysvals.Add ("body", requestBody);
httpResponse.StatusCode = 200;
httpResponse.ContentType = "text/html";
httpResponse.KeepAlive = false;
Hashtable responsedata = new Hashtable ();
UUID agentID;
UUID regionID;
string action;
if (!WebUtils.GetParams ((string)keysvals["uri"], out agentID, out regionID, out action))
{
MainConsole.Instance.InfoFormat ("[AGENT HANDLER]: Invalid parameters for agent message {0}", keysvals["uri"]);
httpResponse.StatusCode = 404;
return encoding.GetBytes ("false");
}
DoAgentPost (keysvals, responsedata, agentID);
httpResponse.StatusCode = (int)responsedata["int_response_code"];
return encoding.GetBytes ((string)responsedata["str_response_string"]);
}
开发者ID:skidzTweak,项目名称:HyperGrid,代码行数:57,代码来源:AgentHandlers.cs
示例20: GetAuthentication
public static UserAccount GetAuthentication(OSHttpRequest request)
{
if (request.Cookies["SessionID"] != null)
{
UUID sessionID = UUID.Parse(request.Cookies["SessionID"].Value);
if (_authenticatedUsers.ContainsKey(sessionID))
return _authenticatedUsers[sessionID];
}
return null;
}
开发者ID:rjspence,项目名称:YourSim,代码行数:10,代码来源:Authenticator.cs
注:本文中的Aurora.Framework.Servers.HttpServer.OSHttpRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论