mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-14 10:20:05 +00:00
dongresource
d4d0f388c4
* Monkey Skyway paths are now saved in a format compatible with paths.json * flush() is called on every periodic DB save in addition to the /flush and /mss N export commands * Monkeys now accept WIP routes
42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "CNShardServer.hpp"
|
|
#include "NPCManager.hpp"
|
|
|
|
#include <unordered_map>
|
|
|
|
const int SLIDER_SPEED = 1200;
|
|
const int SLIDER_STOP_TICKS = 8;
|
|
|
|
struct WarpLocation;
|
|
|
|
struct TransportRoute {
|
|
int type, start, end, cost, mssSpeed, mssRouteNum;
|
|
};
|
|
|
|
struct TransportLocation {
|
|
int npcID, x, y, z;
|
|
};
|
|
|
|
namespace TransportManager {
|
|
extern std::map<int32_t, TransportRoute> Routes;
|
|
extern std::map<int32_t, TransportLocation> Locations;
|
|
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
|
|
extern std::unordered_map<int32_t, std::queue<WarpLocation>> NPCQueues; // NPC ids with queued pathing points
|
|
|
|
void init();
|
|
|
|
void transportRegisterLocationHandler(CNSocket*, CNPacketData*);
|
|
void transportWarpHandler(CNSocket*, CNPacketData*);
|
|
|
|
void testMssRoute(CNSocket *sock, std::vector<WarpLocation>* route);
|
|
|
|
void tickTransportationSystem(CNServer*, time_t);
|
|
void stepNPCPathing();
|
|
void stepSkywaySystem();
|
|
|
|
void lerp(std::queue<WarpLocation>*, WarpLocation, WarpLocation, int, float);
|
|
void lerp(std::queue<WarpLocation>*, WarpLocation, WarpLocation, int);
|
|
}
|