You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

141 lines
5.6 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Sog;
using ProtoCSStruct;
namespace Operation
{
public class PayRecordReq : Singleton<PayRecordReq>
{
//查询充值回包
public void OnUserPayRes(uint serverID, StructPacket packet)
{
HttpRequestInfo m_request = null;
try
{
ref var res = ref packet.GetMessage<SSGmQueryUserPayRecordRes>();
var id = res.Id;
m_request = OperationServer.m_httpService.m_requestList.Find(f => f.Http.id == id);
TraceLog.Debug("PayRecordReq.OnUserPayRes uid {0} ", id);
LitJson.JsonData builder = new LitJson.JsonData();
HttpQueryParams queryParams = new HttpQueryParams(m_request.Http.httpRequest.Url);
QueryPayRecord.OnUserPayResMsg(id, builder, m_request.Http.httpResponse, m_request.Http.httpRequest, queryParams, ref res);
m_request.Http.httpResponse.ContentAsUTF8 = builder.ToJson();
}
catch (Exception ex)
{
TraceLog.Error("PayRecordReq.OnUserPayRes Error Msg {0}", ex.Message);
}
finally
{
if (m_request != null)
{
m_request.ProcessEnd = true;
}
}
}
//查询账号信息回包
public void OnUserAccountInfoRes(uint serverID, StructPacket packet)
{
HttpRequestInfo m_request = null;
try
{
ref var res = ref packet.GetMessage<SSGmQueryUserAccountInfoRes>();
var id = res.Id;
TraceLog.Debug("PayRecordReq.OnUserAccountInfoRes uid {0} ", id);
m_request = OperationServer.m_httpService.m_requestList.Find(f => f.Http.id == id);
LitJson.JsonData builder = new LitJson.JsonData();
HttpQueryParams queryParams = new HttpQueryParams(m_request.Http.httpRequest.Url);
if (m_request.Http.httpRequest.Url.Contains("player_monitor"))
{
PlayerMonitor.OnResMsg(id, builder, m_request.Http.httpResponse, m_request.Http.httpRequest, queryParams, ref res);
}
else
{
if (res.ReqType == 1)
{
SelectRole.OnResMsgHero(id, builder, m_request.Http.httpResponse, m_request.Http.httpRequest, queryParams, ref res, m_request.Http.callbackArgs);
}
else
{
SelectAccount.OnResMsg(id, builder, m_request.Http.httpResponse, m_request.Http.httpRequest, queryParams, ref res);
}
}
m_request.Http.httpResponse.ContentAsUTF8 = builder.ToJson();
}
catch (Exception ex)
{
TraceLog.Error("PayRecordReq.OnUserAccountInfoRes Error Msg {0}", ex.Message);
}
finally
{
if (m_request != null)
{
m_request.ProcessEnd = true;
}
}
}
//查询账号信息回包
public void OnUserRoleInfoRes(uint serverID, StructPacket packet)
{
HttpRequestInfo m_request = null;
try
{
ref var res = ref packet.GetMessage<SSGmQueryUserRoletInfoRes>();
var id = res.Id;
TraceLog.Debug("PayRecordReq.OnUserAccountInfoRes uid {0} ", id);
m_request = OperationServer.m_httpService.m_requestList.Find(f => f.Http.id == id);
LitJson.JsonData builder = new LitJson.JsonData();
HttpQueryParams queryParams = new HttpQueryParams(m_request.Http.httpRequest.Url);
//关卡回包
if (m_request.Http.httpRequest.Url.Contains("select_cus"))
{
SelectCus.OnResMsg(id, builder, m_request.Http.httpResponse, m_request.Http.httpRequest, queryParams, ref res);
m_request.Http.httpResponse.ContentAsUTF8 = builder.ToJson();
return;
}
if (m_request.Http.httpRequest.Url.Contains("player_monitor"))
{
PlayerMonitor.OnResMsg(id, builder, m_request.Http.httpResponse, m_request.Http.httpRequest, queryParams, ref res);
m_request.Http.httpResponse.ContentAsUTF8 = builder.ToJson();
return;
}
//其他回包
else
{
if (res.ReqType == 1)
{
// 需要解析添加英雄名称 ,道具名称的
SelectRole.OnResMsgParse(id, builder, m_request.Http.httpResponse, m_request.Http.httpRequest, queryParams, ref res);
}
else
{
SelectRole.OnResMsg(id, builder, m_request.Http.httpResponse, m_request.Http.httpRequest, queryParams, ref res);
}
}
m_request.Http.httpResponse.ContentAsUTF8 = builder.ToJson();
}
catch (Exception ex)
{
TraceLog.Error("PayRecordReq.OnUserAccountInfoRes Error Msg {0},trace={1}", ex.Message,ex.StackTrace);
}
finally
{
if (m_request != null)
{
m_request.ProcessEnd = true;
}
}
}
}
}