mirror of
https://gitlab.com/hashborgir/d2tweaks-rnd2k.git
synced 2024-11-30 12:45:58 +00:00
39 lines
855 B
C++
39 lines
855 B
C++
#pragma once
|
|
#include <stdint.h>
|
|
#define MODULE_INIT(module_name) static d2_tweaks::server::modules::module_name g_instance;
|
|
|
|
namespace diablo2 {
|
|
namespace structures {
|
|
struct game;
|
|
struct unit;
|
|
}
|
|
}
|
|
|
|
namespace d2_tweaks {
|
|
namespace common {
|
|
struct packet_header;
|
|
}
|
|
|
|
namespace server {
|
|
namespace modules {
|
|
class server_module {
|
|
public:
|
|
virtual ~server_module() = default;
|
|
server_module();
|
|
|
|
virtual void init() = 0;
|
|
|
|
/**
|
|
* \brief
|
|
* \param game
|
|
* \param player
|
|
* \param packet
|
|
* \return true - block further packet processing, false - pass packet to game
|
|
*/
|
|
virtual bool handle_packet(diablo2::structures::game* game, diablo2::structures::unit* player, common::packet_header* packet);
|
|
virtual void tick(diablo2::structures::game* game, diablo2::structures::unit* unit);
|
|
};
|
|
}
|
|
}
|
|
}
|