summaryrefslogtreecommitdiff
path: root/server/src/client.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2016-08-11 08:54:06 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2016-08-11 08:54:06 +0300
commit028ddc8e576e78d500f1cba443d7e21401130bb6 (patch)
tree8c3a3b1ae9899eaafb490e776d6407bb16f6213d /server/src/client.cpp
parentd9ffc27c8b563d76a493ec9eafad56ec5dda13b9 (diff)
server:
event_system: draft implementation of repeated events (we still have none defined by protcol) more appropriate names for some enums and structs messaging: a bit of refactoring in server_session (cut message handler to separate functions for each message type) more appropriate names for some functions curl_downloader: updating downloaded size variable during download process (thread safety required)
Diffstat (limited to 'server/src/client.cpp')
-rw-r--r--server/src/client.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/server/src/client.cpp b/server/src/client.cpp
index 67acdb0..4dd412b 100644
--- a/server/src/client.cpp
+++ b/server/src/client.cpp
@@ -20,6 +20,8 @@
#include "client.h"
#include "server_session.h"
+#include "event_subscription_repeated.h"
+#include "../../protocol/udm.pb.h"
client::client(std::string &client_auth_token, server_session *sess) : auth_token(client_auth_token), session(sess)
{
@@ -28,12 +30,36 @@ client::client(std::string &client_auth_token, server_session *sess) : auth_toke
void client::add_event_subscription(event_subscription_base* e)
{
+
subscriptions.push_back(e);
+ switch(e->get_subtype())
+ {
+ case EVENT_MODE_REPEATED:
+ {
+ event_subscription_repeated *re = static_cast<event_subscription_repeated*>(e);
+ re->set_owner(this);
+ re->start();
+ }
+ break;
+ default:
+ break;
+ }
}
const std::list<event_subscription_base*>& client::get_subscriptions()
{
return subscriptions;
}
+
+void client::fire_event(client_event_subscription_request* e)
+{
+ switch(e->type())
+ {
+ //TODO: design protocol for repeated events
+ default:
+ break;
+ }
+}
+
client::~client()
{
//dtor