summary refs log tree commit diff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:32:55 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:32:55 +0200
commitca432fda543c3d124bd507de7156400058fda802 (patch)
tree5d20deb8d4d89e26887668a59d45ad70789267eb /src/main.cpp
parentMerge branch 'master' into util (diff)
parentMerge pull request #21 from ItsNewe/master (diff)
downloadserver-ca432fda543c3d124bd507de7156400058fda802.tar.xz
Merge branch 'rtc'
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 00000000..372eaa00
--- /dev/null
+++ b/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<rtcPeerHandler>();
+	auto mongoHandler = std::make_unique<mongoStub>();
+
+	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<mongoStub::mongoMessage> t = mongoHandler->getNewMessages(&colCs);
+		for(auto &i : t){
+			std::cout << "[" << i.eventName << "] " << std::endl;
+		}
+	}
+
+	return 0;
+}
\ No newline at end of file