SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
AuthDBSyncHandler.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
6  */
7 
8 #pragma once
9 
10 #include "AuthDBSyncContext.h"
11 #include "EventProcessor.h"
12 
13 #include <QThreadStorage>
14 
15 namespace SEGSEvents
16 {
17 struct CreateAccountMessage;
18 struct RetrieveAccountRequest;
19 struct ValidatePasswordRequest;
20 }
21 
22 class AuthDBSyncHandler final : public EventProcessor
23 {
26  QThreadStorage<AuthDbSyncContext> m_db_context;
27  // EventProcessor interface
28  bool per_thread_startup() override;
29  void dispatch(SEGSEvents::Event *ev) override;
30  void serialize_from(std::istream &is) override;
31  void serialize_to(std::ostream &is) override;
32 
33  // Event handlers
34  void on_create_account(SEGSEvents::CreateAccountMessage *msg);
35  void on_retrieve_account(SEGSEvents::RetrieveAccountRequest *msg);
36  void on_validate_password(SEGSEvents::ValidatePasswordRequest *msg);
37 public:
40 };
Definition: AuthDBSyncHandler.h:22
Definition: SEGSEvent.h:35
Definition: LinkLevelEvent.h:13
Definition: EventProcessor.h:22
#define IMPL_ID(EventProcessorChildType)
Definition: EventProcessor.h:44