SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GameDBSyncHandler.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 
10 #include "GameDBSyncContext.h"
11 #include "EventProcessor.h"
12 
13 #include <QThreadStorage>
14 
15 struct CharacterUpdateMessage;
16 struct CostumeUpdateMessage;
17 struct GameAccountRequest;
18 struct RemoveCharacterRequest;
19 struct WouldNameDuplicateRequest;
20 struct CreateNewCharacterRequest;
21 struct GetEntityRequest;
22 
23 class GameDBSyncHandler final : public EventProcessor
24 {
27  QThreadStorage<GameDbSyncContext> m_db_context;
28  // EventProcessor interface
29  bool per_thread_setup() override;
30  void dispatch(SEGSEvent *ev) override;
31  void on_character_update(CharacterUpdateMessage *msg);
32  void on_costume_update(CostumeUpdateMessage *msg);
33  void on_account_request(GameAccountRequest *msg);
34  void on_character_remove(RemoveCharacterRequest *msg);
35  void on_check_name_clash(WouldNameDuplicateRequest *ev);
36  void on_create_new_char(CreateNewCharacterRequest *ev);
37  void on_get_entity(GetEntityRequest *ev);
38  // This is an unique ID that links this DB with it's Game Server
39  uint8_t m_id;
40 public:
41  GameDBSyncHandler(uint8_t id);
42 };
GameDBSyncHandler(uint8_t id)
Definition: GameDBSyncHandler.cpp:54
Definition: SEGSEvent.h:32
Definition: GameDBSyncHandler.h:23
Definition: EventProcessor.h:13