using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using g = com.xykj.games;
using m = com.xykj.model;
namespace web.Code
{
    public class Eng
    {

        private HttpApplication content;

        public Eng(HttpApplication content)
        {
            this.content = content;
            var l = content.Request.Url.LocalPath;

            if (l == "/create.html" || l == "/create.htm")
            {
                new Create().OnCreate(content);
            }
            else if (l =="/test.html" ||l =="/test.htm" )
            {
                new web.stion.Test().EngTest(content);
            }
            else
            {
                ConfigKey.Insert("gname", Config.game.Name);
                Run();
            }


        }
         
        public void Run()
        {
             
            Config.port.PortEngine = "休闲游戏_1.2";
             

            var gn = new g.GameEngine();
            var html = gn.OnPlay(Config.user, Config.game, Config.server, Config.port, Config.order);
            ConfigKey.Insert("play", html);




            /**** 固定值 *************************************************************/
            ConfigKey.Insert("md5", XY.GAME_PAY_MD5);
            ConfigKey.Insert("sign", XY.GAME_PAY_SIGN);
            ConfigKey.Insert("action", XY.GAME_PAY_ACTION);
        }
    }
}
