Example #1
0
    public override string doDyop(object param)
    {
        ParamOnline p = (ParamOnline)param;

        bool cres = createGMUser(p);

        if (!cres)
        {
            return(Helper.genJsonStr(m_retData));
        }

        if (!p.checkSign(m_gmUser))
        {
            m_retData.Add("result", RetCode.RET_SIGN_ERROR);
            return(Helper.genJsonStr(m_retData));
        }

        Player player = new Player(p.m_playerAcc, m_gmUser);

        if (!player.m_isExists)
        {
            m_retData.Add("result", RetCode.RET_NO_PLAYER);
            return(Helper.genJsonStr(m_retData));
        }
        if (!player.isOwner(m_gmUser.m_acc))
        {
            m_retData.Add("result", RetCode.RET_NO_RIGHT);
            return(Helper.genJsonStr(m_retData));
        }

        m_retData.Add("result", RetCode.RET_SUCCESS);
        m_retData.Add("playerAcc", p.m_playerAcc);
        m_retData.Add("online", player.isInGame());
        return(Helper.genJsonStr(m_retData));
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            ParamOnline param = new ParamOnline();

            param.m_gmAccount = Request.QueryString["gmAcc"];
            param.m_gmPwd     = Request.QueryString["gmPwd"];
            param.m_playerAcc = Request.QueryString["playerAcc"];
            param.m_sign      = Request.QueryString["sign"];

            if (!param.isParamValid())
            {
                Dictionary <string, object> data = new Dictionary <string, object>();
                data.Add("result", RetCode.RET_PARAM_NOT_VALID);
                Response.Write(Helper.genJsonStr(data));
                return;
            }

            DyOpOnline dy     = new DyOpOnline();
            string     retStr = dy.doDyop(param);

            Response.Write(retStr);
        }