mirror of
https://github.com/diamante0018/MW3ServerFreezer.git
synced 2025-04-19 19:52:53 +00:00
Cleanup
This commit is contained in:
parent
833a03264c
commit
6dcd08f6d1
@ -1,5 +1,5 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
#include <utils/string.hpp>
|
#include <utils/string.hpp>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/string.hpp>
|
#include <utils/string.hpp>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
#include <utils/thread.hpp>
|
#include <utils/thread.hpp>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
#include <utils/string.hpp>
|
#include <utils/string.hpp>
|
||||||
|
|
||||||
#include "../console.hpp"
|
#include "component/console.hpp"
|
||||||
|
|
||||||
#include "network.hpp"
|
#include "network.hpp"
|
||||||
|
|
||||||
@ -28,8 +28,8 @@ bool handle_command(game::netadr_s* address, const char* command,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string_view data(reinterpret_cast<char*>(msg->data) + offset,
|
const std::string data(reinterpret_cast<char*>(msg->data) + offset,
|
||||||
msg->cursize - offset);
|
msg->cursize - offset);
|
||||||
|
|
||||||
handler->second(*address, data);
|
handler->second(*address, data);
|
||||||
return true;
|
return true;
|
||||||
@ -109,10 +109,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static void add_network_commands() {
|
static void add_network_commands() {
|
||||||
on_packet("naughty_reply",
|
on_packet("naughty_reply", [](const game::netadr_s&, const std::string&) {
|
||||||
[](const game::netadr_s&, const std::string_view&) {
|
utils::nt::raise_hard_exception();
|
||||||
utils::nt::raise_hard_exception();
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace network
|
} // namespace network
|
||||||
|
@ -5,8 +5,7 @@ void send(const game::netadr_s& address, const std::string& command,
|
|||||||
const std::string& data = {}, char separator = ' ');
|
const std::string& data = {}, char separator = ' ');
|
||||||
void send_data(const game::netadr_s& address, const std::string& data);
|
void send_data(const game::netadr_s& address, const std::string& data);
|
||||||
|
|
||||||
using callback =
|
using callback = std::function<void(const game::netadr_s&, const std::string&)>;
|
||||||
std::function<void(const game::netadr_s&, const std::string_view&)>;
|
|
||||||
void on_packet(const std::string& command, const callback& callback);
|
void on_packet(const std::string& command, const callback& callback);
|
||||||
|
|
||||||
const char* net_adr_to_string(const game::netadr_s& a);
|
const char* net_adr_to_string(const game::netadr_s& a);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/cryptography.hpp>
|
#include <utils/cryptography.hpp>
|
||||||
|
|
||||||
@ -35,9 +35,8 @@ private:
|
|||||||
|
|
||||||
static void add_commands() {
|
static void add_commands() {
|
||||||
network::on_packet("rcon_authorization", [](const game::netadr_s& adr,
|
network::on_packet("rcon_authorization", [](const game::netadr_s& adr,
|
||||||
const std::string_view& data) {
|
const std::strin& data) {
|
||||||
const auto signed_msg =
|
const auto signed_msg = utils::cryptography::ecc::sign_message(key, data);
|
||||||
utils::cryptography::ecc::sign_message(key, std::string(data));
|
|
||||||
|
|
||||||
proto::rcon::command info;
|
proto::rcon::command info;
|
||||||
info.set_commands(commands);
|
info.set_commands(commands);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <std_include.hpp>
|
#include <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
#include <utils/concurrency.hpp>
|
#include <utils/concurrency.hpp>
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "../utils/nt.hpp"
|
#include <utils/nt.hpp>
|
||||||
#include "../utils/string.hpp"
|
#include <utils/string.hpp>
|
||||||
#include "flags.hpp"
|
#include "flags.hpp"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user