mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-19 00:18:22 +00:00
Bug fixes and implementation cleanup
This commit is contained in:
+15
-18
@@ -9528,26 +9528,23 @@ void command_netstats(Client *c, const Seperator *sep)
|
||||
c->Message(0, "Outgoing Link Saturation %.2f%% (%.2fkb/sec)", 100.0 * (1.0 - ((opts.daybreak_options.outgoing_data_rate - stats.datarate_remaining) / opts.daybreak_options.outgoing_data_rate)), opts.daybreak_options.outgoing_data_rate);
|
||||
}
|
||||
|
||||
if (opts.track_opcode_stats) {
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
c->Message(0, "Sent Packet Types");
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto cnt = eqs_stats.SentCount[i];
|
||||
if (cnt > 0) {
|
||||
c->Message(0, "%s: %u (%.2f / sec)", OpcodeNames[i], cnt, cnt / sec_since_stats_reset);
|
||||
}
|
||||
}
|
||||
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
c->Message(0, "Recv Packet Types");
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto cnt = eqs_stats.RecvCount[i];
|
||||
if (cnt > 0) {
|
||||
c->Message(0, "%s: %u (%.2f / sec)", OpcodeNames[i], cnt, cnt / sec_since_stats_reset);
|
||||
}
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
c->Message(0, "Sent Packet Types");
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto cnt = eqs_stats.SentCount[i];
|
||||
if (cnt > 0) {
|
||||
c->Message(0, "%s: %u (%.2f / sec)", OpcodeNames[i], cnt, cnt / sec_since_stats_reset);
|
||||
}
|
||||
}
|
||||
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
c->Message(0, "Recv Packet Types");
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto cnt = eqs_stats.RecvCount[i];
|
||||
if (cnt > 0) {
|
||||
c->Message(0, "%s: %u (%.2f / sec)", OpcodeNames[i], cnt, cnt / sec_since_stats_reset);
|
||||
}
|
||||
}
|
||||
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -691,30 +691,27 @@ void callGetPacketStatistics(Json::Value &response)
|
||||
row["resent_non_fragments"] = stats.resent_full;
|
||||
row["dropped_datarate_packets"] = stats.dropped_datarate_packets;
|
||||
|
||||
if (opts.track_opcode_stats) {
|
||||
Json::Value sent_packet_types;
|
||||
|
||||
Json::Value sent_packet_types;
|
||||
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto count = eqs_stats.SentCount[i];
|
||||
if (count > 0) {
|
||||
sent_packet_types[OpcodeNames[i]] = count;
|
||||
}
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto count = eqs_stats.SentCount[i];
|
||||
if (count > 0) {
|
||||
sent_packet_types[OpcodeNames[i]] = count;
|
||||
}
|
||||
|
||||
Json::Value receive_packet_types;
|
||||
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto count = eqs_stats.RecvCount[i];
|
||||
if (count > 0) {
|
||||
receive_packet_types[OpcodeNames[i]] = count;
|
||||
}
|
||||
}
|
||||
|
||||
row["sent_packet_types"] = sent_packet_types;
|
||||
row["receive_packet_types"] = receive_packet_types;
|
||||
}
|
||||
|
||||
Json::Value receive_packet_types;
|
||||
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto count = eqs_stats.RecvCount[i];
|
||||
if (count > 0) {
|
||||
receive_packet_types[OpcodeNames[i]] = count;
|
||||
}
|
||||
}
|
||||
|
||||
row["sent_packet_types"] = sent_packet_types;
|
||||
row["receive_packet_types"] = receive_packet_types;
|
||||
|
||||
response.append(row);
|
||||
}
|
||||
}
|
||||
@@ -776,4 +773,4 @@ void EQEmuApiZoneDataService::get(Json::Value &response, const std::vector<std::
|
||||
if (method == "get_zone_attributes") {
|
||||
callGetZoneAttributes(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -44,6 +44,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "../common/eqemu_logsys_fmt.h"
|
||||
#include "../common/net/console_server.h"
|
||||
#include "../common/net/eqstream_concurrent.h"
|
||||
|
||||
#include "zone_config.h"
|
||||
#include "masterentity.h"
|
||||
@@ -461,7 +462,7 @@ int main(int argc, char** argv) {
|
||||
UpdateWindowTitle();
|
||||
std::shared_ptr<EQStreamInterface> eqss;
|
||||
EQStreamInterface *eqsi;
|
||||
std::unique_ptr<EQ::Net::EQStreamManager> eqsm;
|
||||
std::unique_ptr<EQ::Net::ConcurrentEQStreamManager> eqsm;
|
||||
std::chrono::time_point<std::chrono::system_clock> frame_prev = std::chrono::system_clock::now();
|
||||
std::unique_ptr<EQ::Net::ConsoleServer> console;
|
||||
|
||||
@@ -506,8 +507,7 @@ int main(int argc, char** argv) {
|
||||
opts.daybreak_options.resend_delay_min = RuleI(Network, ResendDelayMinMS);
|
||||
opts.daybreak_options.resend_delay_max = RuleI(Network, ResendDelayMaxMS);
|
||||
opts.daybreak_options.outgoing_data_rate = RuleR(Network, ClientDataRate);
|
||||
opts.track_opcode_stats = RuleB(Network, TrackOpcodeStats);
|
||||
eqsm.reset(new EQ::Net::EQStreamManager(opts));
|
||||
eqsm.reset(new EQ::Net::ConcurrentEQStreamManager(opts));
|
||||
eqsf_open = true;
|
||||
|
||||
eqsm->OnNewConnection([&stream_identifier](std::shared_ptr<EQStreamInterface> stream) {
|
||||
|
||||
Reference in New Issue
Block a user