using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Sog; using ProtoCSStruct; namespace Operation { public class PayRecordReq : Singleton { //查询充值回包 public void OnUserPayRes(uint serverID, StructPacket packet) { HttpRequestInfo m_request = null; try { ref var res = ref packet.GetMessage(); 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(); 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(); 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; } } } } }