diff options
Diffstat (limited to 'server/src/client.cpp')
-rw-r--r-- | server/src/client.cpp | 26 |
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 |