本文整理汇总了C#中HttpGet.GetInt方法的典型用法代码示例。如果您正苦于以下问题:C# HttpGet.GetInt方法的具体用法?C# HttpGet.GetInt怎么用?C# HttpGet.GetInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpGet
的用法示例。
在下文中一共展示了HttpGet.GetInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Request
/// <summary>
/// 请求处理
/// </summary>
/// <param name="typeName"></param>
/// <param name="response"></param>
/// <param name="userFactory"></param>
/// <param name="httpGet"></param>
public static void Request(string typeName, HttpGet httpGet, IGameResponse response, Func<int, BaseUser> userFactory)
{
string tempName = string.Format(typeName, httpGet.ActionId);
int actionID = 0;
string errorInfo = "";
try
{
bool isRL = BaseStruct.CheckRunloader(httpGet);
if (isRL || httpGet.CheckSign())
{
if (httpGet.GetInt("ActionID", ref actionID))
{
BaseStruct action = FindRoute(typeName, httpGet, actionID);
Process(action, httpGet, response, userFactory);
if (action != null)
{
return;
}
}
}
else
{
errorInfo = "签名验证失败";
TraceLog.WriteError("Action request {3} error:{2},rl:{0},param:{1}", isRL, httpGet.ParamString, errorInfo, tempName);
}
}
catch (Exception ex)
{
TraceLog.WriteError("Action request {0} error:{1}\r\nparam:{2}", tempName, ex, httpGet.ParamString);
}
RequestError(response, actionID, errorInfo);
}
示例2: RequestScript
/// <summary>
/// 请求脚本处理
/// </summary>
/// <param name="httpGet">请求参数对象</param>
/// <param name="response">字节输出处理</param>
/// <param name="userFactory">创建user对象工厂,可为Null</param>
public static void RequestScript(HttpGet httpGet, IGameResponse response, Func<int, BaseUser> userFactory)
{
int actionID = httpGet.GetInt("actionId");
string errorInfo = "";
try
{
bool isRl = BaseStruct.CheckRunloader(httpGet);
if (isRl || httpGet.CheckSign())
{
ScriptRoute scriptRoute = new ScriptRoute(actionID);
RouteItem routeItem;
var pythonManager = PythonScriptManager.Current;
if (pythonManager.TryGetAction(actionID, out routeItem))
{
if (scriptRoute.TryLoadAction(routeItem.ScriptPath))
{
var baseStruct = new ScriptAction((short)actionID, httpGet, scriptRoute, routeItem.IgnoreAuthorize);
Process(baseStruct, httpGet, response, userFactory);
return;
}
}
}
else
{
errorInfo = "签名验证失败";
TraceLog.WriteError("Action request error:{2},rl:{0},param:{1}", isRl, httpGet.ParamString, errorInfo);
}
}
catch (Exception ex)
{
TraceLog.WriteError("Action request error:{0}\r\nparam:{1}", ex, httpGet.ParamString);
}
RequestError(response, actionID, errorInfo);
}