2020-08-29 11:43:33 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CNShardServer.hpp"
|
2020-09-17 02:27:21 +00:00
|
|
|
#include "NPCManager.hpp"
|
|
|
|
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
struct WarpLocation;
|
2020-08-29 11:43:33 +00:00
|
|
|
|
2020-09-13 20:26:16 +00:00
|
|
|
struct TransportRoute {
|
|
|
|
int type, start, end, cost, mssSpeed, mssRouteNum;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TransportLocation {
|
|
|
|
int npcID, x, y, z;
|
|
|
|
};
|
|
|
|
|
2020-08-29 11:43:33 +00:00
|
|
|
namespace TransportManager {
|
2020-09-13 20:26:16 +00:00
|
|
|
extern std::map<int32_t, TransportRoute> Routes;
|
|
|
|
extern std::map<int32_t, TransportLocation> Locations;
|
2020-09-22 01:03:48 +00:00
|
|
|
extern std::map<int32_t, std::queue<WarpLocation>> SkywayPaths; // predefined skyway paths with points
|
|
|
|
extern std::unordered_map<CNSocket*, std::queue<WarpLocation>> SkywayQueues; // player sockets with queued broomstick points
|
2020-09-23 14:29:29 +00:00
|
|
|
extern std::unordered_map<int32_t, std::queue<WarpLocation>> NPCQueues; // NPC ids with queued pathing points
|
2020-09-13 20:26:16 +00:00
|
|
|
|
2020-08-29 11:43:33 +00:00
|
|
|
void init();
|
|
|
|
|
2020-09-23 14:29:29 +00:00
|
|
|
void transportRegisterLocationHandler(CNSocket*, CNPacketData*);
|
|
|
|
void transportWarpHandler(CNSocket*, CNPacketData*);
|
2020-09-17 02:27:21 +00:00
|
|
|
|
2020-09-23 14:29:29 +00:00
|
|
|
void tickTransportationSystem(CNServer*, time_t);
|
|
|
|
void stepNPCPathing();
|
|
|
|
void stepSkywaySystem();
|
|
|
|
|
|
|
|
static void lerp(std::queue<WarpLocation>*, WarpLocation, WarpLocation, int);
|
2020-08-29 11:43:33 +00:00
|
|
|
}
|