mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-12-28 19:47:11 +01:00
first changes
This commit is contained in:
14
src/server.h
14
src/server.h
@@ -29,6 +29,7 @@ class ServiceBase
|
||||
{
|
||||
public:
|
||||
virtual bool is_single_socket() const = 0;
|
||||
virtual bool is_checksummed() const = 0;
|
||||
virtual uint8_t get_protocol_identifier() const = 0;
|
||||
virtual const char* get_protocol_name() const = 0;
|
||||
|
||||
@@ -39,17 +40,20 @@ template <typename ProtocolType>
|
||||
class Service final : public ServiceBase
|
||||
{
|
||||
public:
|
||||
bool is_single_socket() const final {
|
||||
bool is_single_socket() const override {
|
||||
return ProtocolType::server_sends_first;
|
||||
}
|
||||
uint8_t get_protocol_identifier() const final {
|
||||
bool is_checksummed() const override {
|
||||
return ProtocolType::use_checksum;
|
||||
}
|
||||
uint8_t get_protocol_identifier() const override {
|
||||
return ProtocolType::protocol_identifier;
|
||||
}
|
||||
const char* get_protocol_name() const final {
|
||||
const char* get_protocol_name() const override {
|
||||
return ProtocolType::protocol_name();
|
||||
}
|
||||
|
||||
Protocol_ptr make_protocol(const Connection_ptr& c) const final {
|
||||
Protocol_ptr make_protocol(const Connection_ptr& c) const override {
|
||||
return std::make_shared<ProtocolType>(c);
|
||||
}
|
||||
};
|
||||
@@ -71,7 +75,7 @@ class ServicePort : public std::enable_shared_from_this<ServicePort>
|
||||
std::string get_protocol_names() const;
|
||||
|
||||
bool add_service(const Service_ptr& new_svc);
|
||||
Protocol_ptr make_protocol(NetworkMessage& msg, const Connection_ptr& connection) const;
|
||||
Protocol_ptr make_protocol(bool checksummed, NetworkMessage& msg, const Connection_ptr& connection) const;
|
||||
|
||||
void onStopServer();
|
||||
void onAccept(Connection_ptr connection, const boost::system::error_code& error);
|
||||
|
||||
Reference in New Issue
Block a user