void scoreToPlayer(int op) { ParamScore param = new ParamScore(); param.m_op = op; param.m_toAcc = m_acc.Text; param.m_score = m_score.Text; param.scoreToPlayer(); GMUser user = (GMUser)Session["user"]; OpRes res = user.doDyop(param, DyOpType.opTypeDyOpScore); m_scoreRes.InnerText = OpResMgr.getInstance().getResultString(res); }
public void ProcessRequest(HttpContext context) { RightMgr.getInstance().opCheck(RIGHT.SCORE, context.Session, context.Response); GMUser user = (GMUser)context.Session["user"]; ParamScore param = new ParamScore(); param.m_op = Convert.ToInt32(context.Request.Form["op"]); param.m_toAcc = context.Request.Form["acc"]; param.m_score = context.Request.Form["param"]; int targetType = Convert.ToInt32(context.Request.Form["targetType"]); if (targetType == AccType.ACC_PLAYER) { param.scoreToPlayer(); } else { param.scoreToMgr(); } OpRes res = user.doDyop(param, DyOpType.opTypeDyOpScore); string str = OpResMgr.getInstance().getResultString(res); long remainScoreFixBug = -1; if (targetType == AccType.ACC_SUPER_ADMIN || targetType == AccType.ACC_SUPER_ADMIN_SUB) { remainScoreFixBug = 0; } else { remainScoreFixBug = ItemHelp.getRemainMoney(param.m_toAcc, targetType == AccType.ACC_PLAYER, user); } Dictionary <string, object> ret = new Dictionary <string, object>(); ret.Add("result", (int)res); ret.Add("resultInfo", str); string rs = (user.m_accType == AccType.ACC_SUPER_ADMIN || user.m_accType == AccType.ACC_SUPER_ADMIN_SUB) ? "0" : ItemHelp.toStrByComma(ItemHelp.showMoneyValue(user.m_money)); ret.Add("remainScoreStr", rs); ret.Add("remainScore", ItemHelp.showMoneyValue(user.m_money)); ret.Add("remainScoreFixBug", ItemHelp.showMoneyValue(remainScoreFixBug)); str = BaseJsonSerializer.genJsonStr(ret); context.Response.ContentType = "text/plain"; context.Response.Write(str); }
OpRes execOrder(ResultPlayerOrderItem item, GMUser user) { if (item.m_orderState != OrderState.STATE_WAIT) { return(OpRes.opres_success); } ParamScore param = new ParamScore(); param.m_op = item.m_orderType; param.m_toAcc = item.m_playerAcc; param.m_score = item.m_orderMoney.ToString(); param.m_orderFrom = OrderGenerator.ORDER_FROM_PLAYER_ORDER; param.m_orderId = item.m_orderId; param.scoreToPlayer(); OpRes res = user.doDyop(param, DyOpType.opTypeDyOpScore); if (res == OpRes.opres_success /*|| * res == OpRes.op_res_player_in_game*/) { OpRes code = removeWait(item, user); if (code == OpRes.opres_success) { if (res == OpRes.opres_success) { addFinish(item, user, OrderState.STATE_FINISH); } else { addFinish(item, user, OrderState.STATE_HAS_SUB); } } } else if (res == OpRes.op_res_player_in_game) { string cmd = CPlayerOrder.genUpdateSql(item.m_orderId, OrderState.STATE_HAS_SUB); int count = user.sqlDb.executeOp(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); // 返回成功,界面可以重刷订单 res = OpRes.opres_success; } return(res); }