From a92c6637cea0ce595c712c3d445b57a1184e833e Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Thu, 12 Aug 2021 20:33:42 +0200 Subject: :sparkles: rtc --- rtc/src/main.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 rtc/src/main.cpp (limited to 'rtc/src/main.cpp') diff --git a/rtc/src/main.cpp b/rtc/src/main.cpp new file mode 100644 index 00000000..372eaa00 --- /dev/null +++ b/rtc/src/main.cpp @@ -0,0 +1,47 @@ +// $$$$$$\ $$\ +// $$ __$$\ $$ | +// $$ / \__|$$$$$$\ $$$$$$$\ $$$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$\ $$$$$$$ | +// $$$$\ $$ __$$\ $$ _____|$$ _____|$$ _____|$$ __$$\ $$ __$$\ $$ __$$ | +// $$ _| $$ / $$ |\$$$$$$\ \$$$$$$\ $$ / $$ / $$ |$$ | \__|$$ / $$ | +// $$ | $$ | $$ | \____$$\ \____$$\ $$ | $$ | $$ |$$ | $$ | $$ | +// $$ | \$$$$$$ |$$$$$$$ |$$$$$$$ |\$$$$$$$\ \$$$$$$ |$$ | \$$$$$$$ | +// \__| \______/ \_______/ \_______/ \_______| \______/ \__| \_______| +// +// +// +// $$\ $$$$$$\ +// \__| $$ __$$\ +// $$\ $$\ $$$$$$\ $$\ $$$$$$$\ $$$$$$\ $$ / \__| $$$$$$\ $$$$$$\ $$\ $$\ $$$$$$\ $$$$$$\ +// \$$\ $$ |$$ __$$\ $$ |$$ _____|$$ __$$\ \$$$$$$\ $$ __$$\ $$ __$$\\$$\ $$ |$$ __$$\ $$ __$$\ +// \$$\$$ / $$ / $$ |$$ |$$ / $$$$$$$$ | \____$$\ $$$$$$$$ |$$ | \__|\$$\$$ / $$$$$$$$ |$$ | \__| +// \$$$ / $$ | $$ |$$ |$$ | $$ ____|$$\ $$ |$$ ____|$$ | \$$$ / $$ ____|$$ | +// \$ / \$$$$$$ |$$ |\$$$$$$$\ \$$$$$$$\ \$$$$$$ |\$$$$$$$\ $$ | \$ / \$$$$$$$\ $$ | +// \_/ \______/ \__| \_______| \_______| \______/ \_______|\__| \_/ \_______|\__| +// +// +// + +#include "rtcPeerHandler.hpp" //Handle peer connection requests +#include "mongoStub.hpp" //Handle communication with the MongoDB server + +int main(int argc, char **argv){ + + auto commsHandler = std::make_shared(); + auto mongoHandler = std::make_unique(); + + mongocxx::options::change_stream options; + //voiceEvents collection watcher + mongocxx::change_stream colCs = mongoHandler->getCol().watch(options); + + std::cout << "Server created and listening for events" << std::endl; + + //Check for new messages in the collection + for (;;){ + std::vector t = mongoHandler->getNewMessages(&colCs); + for(auto &i : t){ + std::cout << "[" << i.eventName << "] " << std::endl; + } + } + + return 0; +} \ No newline at end of file -- cgit 1.5.1