Polyphase Game Engine
Loading...
Searching...
No Matches
ControllerServerRoutes.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5class ControllerServer;
6
7// app is a crow::SimpleApp* — crow types are hidden from headers to avoid WinSock conflicts.
8void RegisterRoutes(void* app, ControllerServer* server);
9
10// Used at the top of every route handler so requests arriving while the editor
11// is tearing down get a 503 instead of parking a Crow worker on a future that
12// will never be ticked. Keeps the diff in ControllerServerRoutes.cpp readable.
13#define RETURN_IF_SHUTTING_DOWN(serverPtr) \
14 do { \
15 if ((serverPtr) && (serverPtr)->IsShuttingDown()) \
16 return crow::response(503, "application/json", \
17 R"({"error":"shutting_down"})"); \
18 } while (0)
19
20#endif