-
Notifications
You must be signed in to change notification settings - Fork 576
Http
ScutGame edited this page Dec 19, 2014
·
7 revisions
Scut提供了一套Console版本针对Http协议的部署支持,6.7.9.0以上版本将不支持对IIS部署方式。
- 提供继承GameHttpHost父类处理Http请求,在MainClass脚本类继承它。
#!Csharp
public class MainClass : GameHttpHost
{
protected override void OnStartAffer()
{
//这里处理服务启动后的业务
}
protected override void OnRequested(ActionGetter actionGetter, BaseGameResponse response)
{
//这里处理玩家请求的业务
Console.WriteLine("url:{0}", actionGetter.ToParamString());
base.OnRequested(actionGetter, response);
}
}
- 配置
在项目中的GameServer.exe.config文件中增加以下配置。(注:配置时Service.aspx页面可以不需要此文件的存在)
<add key="Game.Http.Host" value="ph.scutgame.com,127.0.0.1" />
<add key="Game.Http.Port" value="8080" />
<add key="Game.Http.Name" value="Service.aspx" />
访问Url:http://ph.scutgame.com:8080/Service.aspx 或 http://127.0.0.1:8080/Service.aspx