// // MPFW SERVER // // // * * // // * . * // implemented // *I* // | // * // v // // (Net)Quake(World)-compatible game server // // ^ // // | // // eventually? // // // // //// github.com/safariminer /// tilde.town/~safariminer // // // Notes relative to netquake // - based on : https://www.gamers.org/dEngine/quake/QDP/qnp.html // - Netquake = UDP // - all numbers = big endian unless exception // - don't blindly follow the spec: // | game endpoints in quake don't have auth // | do not use basic range, randomize ports throughout the available range // | verify ip and port // | even though the spec calls for it, don't display IP/port info in playerinfo control // #ifdef _DEBUG #define MPFW_SERVER_VERSION std::string(std::string("Debug Build ") + std::string(__DATE__)) #else #define MPFW_SERVER_VERSION "Release build" #endif #include // basic io #include // dynamic arrays #include // keyval maps #include #include #include #include #include "Config.h" #include "NetQuake.h" #include #include #include bool _serverRunning = true; int rcp = 0; Config::Config *config = new Config::Config; int main(int argc, char** argv) { std::print("MPFW Server\nBuild Version: {}\n--------------------\n", MPFW_SERVER_VERSION); std::vector gameEndpoints; NetQuake::Internal::InternalRequestConsole* internalRequestConsole = new NetQuake::Internal::InternalRequestConsole(); asio::io_context io_context; std::print("Starting control server thread...\n"); std::thread controlServer(NetQuake::NetQuake_ControlServer, internalRequestConsole, config, &_serverRunning); controlServer.detach(); std::print("Started control server thread\n"); while (_serverRunning) { internalRequestConsole->Update(config, &gameEndpoints); } delete internalRequestConsole; return 0; }