mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-25 22:57:15 +00:00
Shared task service
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
|
||||
SET(service_sources
|
||||
tasks_service.cpp
|
||||
)
|
||||
|
||||
SET(service_headers
|
||||
tasks_service.h
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(tasks_service ${service_sources} ${service_headers})
|
||||
|
||||
INSTALL(TARGETS tasks_service RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
|
||||
TARGET_LINK_LIBRARIES(tasks_service ${SERVER_LIBS})
|
||||
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||
@@ -0,0 +1,31 @@
|
||||
#include "tasks_service.h"
|
||||
#include "../../common/eqemu_logsys.h"
|
||||
|
||||
EQ::TasksService::TasksService()
|
||||
: EQ::Service("Tasks", 100, 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
EQ::TasksService::~TasksService() {
|
||||
|
||||
}
|
||||
|
||||
void EQ::TasksService::OnStart() {
|
||||
|
||||
}
|
||||
|
||||
void EQ::TasksService::OnStop() {
|
||||
|
||||
}
|
||||
|
||||
void EQ::TasksService::OnHeartbeat(double time_since_last) {
|
||||
|
||||
}
|
||||
|
||||
void EQ::TasksService::OnRoutedMessage(const std::string& identifier, int type, const EQ::Net::Packet& p)
|
||||
{
|
||||
LogF(Logs::General, Logs::World_Server, "Routed message of type {0} with length {1}", type, p.Length());
|
||||
}
|
||||
|
||||
EQRegisterService(EQ::TasksService);
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "../../common/service.h"
|
||||
|
||||
namespace EQ
|
||||
{
|
||||
class TasksService : public EQ::Service
|
||||
{
|
||||
public:
|
||||
TasksService();
|
||||
virtual ~TasksService();
|
||||
|
||||
protected:
|
||||
virtual void OnStart();
|
||||
virtual void OnStop();
|
||||
virtual void OnHeartbeat(double time_since_last);
|
||||
virtual void OnRoutedMessage(const std::string& identifier, int type, const EQ::Net::Packet& p);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user