1
This commit is contained in:
parent
3a81c9ed37
commit
ce2679496a
@ -20,6 +20,7 @@ void JsonDataMgr::Init()
|
|||||||
|
|
||||||
std::string wsproxy_cluster_json_file;
|
std::string wsproxy_cluster_json_file;
|
||||||
std::string master_cluster_json_file;
|
std::string master_cluster_json_file;
|
||||||
|
std::string kcp_conf_json_file;
|
||||||
wsproxy_cluster_json_file = a8::Format
|
wsproxy_cluster_json_file = a8::Format
|
||||||
("%s/node%d/game%d.wsproxy.cluster.json",
|
("%s/node%d/game%d.wsproxy.cluster.json",
|
||||||
{
|
{
|
||||||
@ -34,11 +35,29 @@ void JsonDataMgr::Init()
|
|||||||
App::Instance()->GetNodeId(),
|
App::Instance()->GetNodeId(),
|
||||||
GAME_ID
|
GAME_ID
|
||||||
});
|
});
|
||||||
|
kcp_conf_json_file = a8::Format
|
||||||
|
("%s/kcp_conf.json",
|
||||||
|
{
|
||||||
|
work_path_,
|
||||||
|
});
|
||||||
|
|
||||||
wsproxy_cluster_json_.ReadFromFile(wsproxy_cluster_json_file);
|
wsproxy_cluster_json_.ReadFromFile(wsproxy_cluster_json_file);
|
||||||
master_cluster_json_.ReadFromFile(master_cluster_json_file);
|
master_cluster_json_.ReadFromFile(master_cluster_json_file);
|
||||||
|
kcp_conf_json_.ReadFromFile(kcp_conf_json_file);
|
||||||
udp_host_ = GetConf()->At("listen_udp_host")->AsXValue().GetString();
|
udp_host_ = GetConf()->At("listen_udp_host")->AsXValue().GetString();
|
||||||
udp_port_ = GetConf()->At("listen_udp_port")->AsXValue();
|
udp_port_ = GetConf()->At("listen_udp_port")->AsXValue();
|
||||||
|
{
|
||||||
|
kcp_conf_.sndwnd = kcp_conf_json_.At("sndwnd")->AsXValue();
|
||||||
|
kcp_conf_.rcvwnd = kcp_conf_json_.At("rcvwnd")->AsXValue();
|
||||||
|
|
||||||
|
kcp_conf_.nodelay = kcp_conf_json_.At("nodelay")->AsXValue();
|
||||||
|
kcp_conf_.interval = kcp_conf_json_.At("interval")->AsXValue();
|
||||||
|
kcp_conf_.resend = kcp_conf_json_.At("resend")->AsXValue();
|
||||||
|
kcp_conf_.nc = kcp_conf_json_.At("nc")->AsXValue();
|
||||||
|
|
||||||
|
kcp_conf_.rx_minrto = kcp_conf_json_.At("rx_minrto")->AsXValue();
|
||||||
|
kcp_conf_.fastresend = kcp_conf_json_.At("fastresend")->AsXValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JsonDataMgr::UnInit()
|
void JsonDataMgr::UnInit()
|
||||||
|
@ -4,16 +4,16 @@
|
|||||||
|
|
||||||
struct KcpConf
|
struct KcpConf
|
||||||
{
|
{
|
||||||
int sndwnd = 128;
|
int sndwnd = 0;
|
||||||
int rcvwnd = 128;
|
int rcvwnd = 0;
|
||||||
|
|
||||||
int nodelay = 2;
|
int nodelay = 0;
|
||||||
int interval = 10;
|
int interval = 0;
|
||||||
int resend = 2;
|
int resend = 0;
|
||||||
int nc = 1;
|
int nc = 0;
|
||||||
|
|
||||||
int rx_minrto = 0;
|
int rx_minrto = 0;
|
||||||
int fastresend = 1;
|
int fastresend = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class JsonDataMgr : public a8::Singleton<JsonDataMgr>
|
class JsonDataMgr : public a8::Singleton<JsonDataMgr>
|
||||||
@ -36,6 +36,7 @@ class JsonDataMgr : public a8::Singleton<JsonDataMgr>
|
|||||||
std::string work_path_ = "../config";
|
std::string work_path_ = "../config";
|
||||||
a8::XObject wsproxy_cluster_json_;
|
a8::XObject wsproxy_cluster_json_;
|
||||||
a8::XObject master_cluster_json_;
|
a8::XObject master_cluster_json_;
|
||||||
|
a8::XObject kcp_conf_json_;
|
||||||
std::string udp_host_;
|
std::string udp_host_;
|
||||||
int udp_port_ = 0;
|
int udp_port_ = 0;
|
||||||
KcpConf kcp_conf_ = {};
|
KcpConf kcp_conf_ = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user