mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 05:20:05 +00:00
Add experimental TransportManager
This commit is contained in:
parent
b239fb9331
commit
437063d78a
2
Makefile
2
Makefile
@ -46,6 +46,7 @@ CXXSRC=\
|
||||
src/Player.cpp\
|
||||
src/PlayerManager.cpp\
|
||||
src/settings.cpp\
|
||||
src/TransportManager.cpp\
|
||||
|
||||
# headers (for timestamp purposes)
|
||||
CHDR=\
|
||||
@ -81,6 +82,7 @@ CXXHDR=\
|
||||
src/Player.hpp\
|
||||
src/PlayerManager.hpp\
|
||||
src/settings.hpp\
|
||||
src/TransportManager.hpp\
|
||||
|
||||
COBJ=$(CSRC:.c=.o)
|
||||
CXXOBJ=$(CXXSRC:.cpp=.o)
|
||||
|
18
src/TransportManager.cpp
Normal file
18
src/TransportManager.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "CNShardServer.hpp"
|
||||
#include "CNStructs.hpp"
|
||||
#include "PlayerManager.hpp"
|
||||
#include "TransportManager.hpp"
|
||||
|
||||
void TransportManager::init() {
|
||||
REGISTER_SHARD_PACKET(P_CL2FE_REQ_REGIST_TRANSPORTATION_LOCATION, transportRegisterLocationHandler);
|
||||
}
|
||||
|
||||
void TransportManager::transportRegisterLocationHandler(CNSocket* sock, CNPacketData* data) {
|
||||
sP_CL2FE_REQ_REGIST_TRANSPORTATION_LOCATION* transport = (sP_CL2FE_REQ_REGIST_TRANSPORTATION_LOCATION*)data->buf;
|
||||
|
||||
INITSTRUCT(sP_FE2CL_REP_PC_REGIST_TRANSPORTATION_LOCATION_SUCC, resp);
|
||||
resp.eTT = transport->eTT;
|
||||
resp.iLocationID = transport->iLocationID;
|
||||
|
||||
sock->sendPacket((void*)&resp, P_FE2CL_REP_PC_REGIST_TRANSPORTATION_LOCATION_SUCC, sizeof(sP_FE2CL_REP_PC_REGIST_TRANSPORTATION_LOCATION_SUCC));
|
||||
}
|
9
src/TransportManager.hpp
Normal file
9
src/TransportManager.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "CNShardServer.hpp"
|
||||
|
||||
namespace TransportManager {
|
||||
void init();
|
||||
|
||||
void transportRegisterLocationHandler(CNSocket* sock, CNPacketData* data);
|
||||
}
|
@ -7,6 +7,7 @@
|
||||
#include "MissionManager.hpp"
|
||||
#include "NanoManager.hpp"
|
||||
#include "NPCManager.hpp"
|
||||
#include "TransportManager.hpp"
|
||||
#include "Database.hpp"
|
||||
|
||||
#include "settings.hpp"
|
||||
@ -55,6 +56,7 @@ int main() {
|
||||
MissionManager::init();
|
||||
NanoManager::init();
|
||||
NPCManager::init();
|
||||
TransportManager::init();
|
||||
|
||||
Database::open();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user