1
This commit is contained in:
parent
c88d0f970c
commit
d304c823ab
@ -22,10 +22,17 @@ struct HttpProxyRequest
|
||||
|
||||
static void _ProxyCallback(f8::JsonHttpRequest* request)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
a8::UdpLog::Instance()->Debug("ProxyCallbBack request:%s",
|
||||
{
|
||||
request->request.ToJsonStr()
|
||||
});
|
||||
#endif
|
||||
std::string seq_id = request->request.Get("seq_id");
|
||||
HttpProxyRequest* req = HttpProxy::Instance()->GetRequest(seq_id);
|
||||
if (req) {
|
||||
a8::XObject data;
|
||||
|
||||
data.ReadFromJsonString(request->request.Get("data").GetString());
|
||||
if (data.HasKey("errcode") && data.Get("errcode").GetInt() == 0) {
|
||||
req->on_ok(req->param, data);
|
||||
@ -84,14 +91,27 @@ std::string HttpProxy::HttpGet(a8::XParams param,
|
||||
{
|
||||
HttpProxyRequest* req = HttpProxy::Instance()->GetRequest(param.sender.GetString());
|
||||
if (req) {
|
||||
req->on_ok(req->param, data);
|
||||
#ifdef DEBUG
|
||||
a8::UdpLog::Instance()->Debug("ProxyHttpGet ok url:%s params:%s",
|
||||
{
|
||||
req->url,
|
||||
req->url_params.ToJsonStr(),
|
||||
});
|
||||
#endif
|
||||
}
|
||||
HttpProxy::Instance()->DestoryRequest(req);
|
||||
},
|
||||
[] (a8::XParams& param, const std::string& response)
|
||||
{
|
||||
HttpProxyRequest* req = HttpProxy::Instance()->GetRequest(param.sender.GetString());
|
||||
if (req) {
|
||||
#ifdef DEBUG
|
||||
a8::UdpLog::Instance()->Debug("ProxyHttpGet error url:%s params:%s response:%s",
|
||||
{
|
||||
req->url,
|
||||
req->url_params.ToJsonStr(),
|
||||
response
|
||||
});
|
||||
#endif
|
||||
req->on_error(req->param, response);
|
||||
}
|
||||
HttpProxy::Instance()->DestoryRequest(req);
|
||||
|
@ -3,7 +3,7 @@ package cs;
|
||||
|
||||
enum Constant_e
|
||||
{
|
||||
ProtoVersion = 2021073001;
|
||||
ProtoVersion = 2022032201;
|
||||
}
|
||||
|
||||
message CMPing
|
||||
@ -755,6 +755,8 @@ message CMJoin
|
||||
optional int32 show_team_ui = 62;
|
||||
optional int32 hero_skin = 63;
|
||||
optional string pre_battle_payload = 70;
|
||||
|
||||
optional string hero_uniid = 71;
|
||||
}
|
||||
|
||||
message CMReconnect
|
||||
|
Loading…
x
Reference in New Issue
Block a user