Shared task service

This commit is contained in:
KimLS
2019-06-09 18:39:32 -07:00
parent c1484a698c
commit b3a3d9bec5
23 changed files with 338 additions and 54 deletions
+17
View File
@@ -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)
+31
View File
@@ -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);
+19
View File
@@ -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);
};
}