Add experimental TransportManager

This commit is contained in:
Eperty123 2020-08-29 13:43:33 +02:00
parent b239fb9331
commit 437063d78a
4 changed files with 31 additions and 0 deletions

View File

@ -46,6 +46,7 @@ CXXSRC=\
src/Player.cpp\ src/Player.cpp\
src/PlayerManager.cpp\ src/PlayerManager.cpp\
src/settings.cpp\ src/settings.cpp\
src/TransportManager.cpp\
# headers (for timestamp purposes) # headers (for timestamp purposes)
CHDR=\ CHDR=\
@ -81,6 +82,7 @@ CXXHDR=\
src/Player.hpp\ src/Player.hpp\
src/PlayerManager.hpp\ src/PlayerManager.hpp\
src/settings.hpp\ src/settings.hpp\
src/TransportManager.hpp\
COBJ=$(CSRC:.c=.o) COBJ=$(CSRC:.c=.o)
CXXOBJ=$(CXXSRC:.cpp=.o) CXXOBJ=$(CXXSRC:.cpp=.o)

18
src/TransportManager.cpp Normal file
View 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
View File

@ -0,0 +1,9 @@
#pragma once
#include "CNShardServer.hpp"
namespace TransportManager {
void init();
void transportRegisterLocationHandler(CNSocket* sock, CNPacketData* data);
}

View File

@ -7,6 +7,7 @@
#include "MissionManager.hpp" #include "MissionManager.hpp"
#include "NanoManager.hpp" #include "NanoManager.hpp"
#include "NPCManager.hpp" #include "NPCManager.hpp"
#include "TransportManager.hpp"
#include "Database.hpp" #include "Database.hpp"
#include "settings.hpp" #include "settings.hpp"
@ -55,6 +56,7 @@ int main() {
MissionManager::init(); MissionManager::init();
NanoManager::init(); NanoManager::init();
NPCManager::init(); NPCManager::init();
TransportManager::init();
Database::open(); Database::open();