TrinityCore
Loading...
Searching...
No Matches
WorldserverServiceDispatcher.h
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef WorldserverServiceDispatcher_h__
19
#define WorldserverServiceDispatcher_h__
20
21
#include "
WorldSession.h
"
22
#include "
MessageBuffer.h
"
23
#include "
Log.h
"
24
#include "
account_service.pb.h
"
25
#include "
authentication_service.pb.h
"
26
#include "
api/client/v1/block_list_listener.pb.h
"
27
#include "
api/client/v1/block_list_service.pb.h
"
28
#include "
challenge_service.pb.h
"
29
#include "
api/client/v1/club_listener.pb.h
"
30
#include "
api/client/v1/club_membership_listener.pb.h
"
31
#include "
ClubMembershipService.h
"
32
#include "
ClubService.h
"
33
#include "
connection_service.pb.h
"
34
#include "
friends_service.pb.h
"
35
#include "
WorldserverGameUtilitiesService.h
"
36
#include "
notification_service.pb.h
"
37
#include "
api/client/v2/notification_listener.pb.h
"
38
#include "
api/client/v2/notification_service.pb.h
"
39
#include "
presence_listener.pb.h
"
40
#include "
presence_service.pb.h
"
41
#include "
report_service.pb.h
"
42
#include "
api/client/v2/report_service.pb.h
"
43
#include "
resource_service.pb.h
"
44
#include "
api/client/v2/whisper_listener.pb.h
"
45
#include "
api/client/v2/whisper_service.pb.h
"
46
47
namespace
Battlenet
48
{
49
class
WorldserverServiceDispatcher
50
{
51
public
:
52
void
Dispatch
(
WorldSession
* session,
uint32
serviceHash,
uint32
token,
uint32
methodId,
MessageBuffer
buffer);
53
54
static
WorldserverServiceDispatcher
&
Instance
();
55
56
private
:
57
WorldserverServiceDispatcher
();
58
59
template
<
class
Service>
60
void
AddService
()
61
{
62
_dispatchers
[Service::OriginalHash::value] = &WorldserverServiceDispatcher::Dispatch<Service>;
63
}
64
65
template
<
class
Service>
66
static
void
Dispatch
(
WorldSession
* session,
uint32
token,
uint32
methodId,
MessageBuffer
buffer)
67
{
68
Service
(session).CallServerMethod(token, methodId, std::move(buffer));
69
}
70
71
typedef
void(*
ServiceMethod
)(
WorldSession
*,
uint32
,
uint32
,
MessageBuffer
);
72
std::unordered_map<uint32, ServiceMethod>
_dispatchers
;
73
};
74
}
75
76
#define sServiceDispatcher Battlenet::WorldserverServiceDispatcher::Instance()
77
78
#endif
// WorldserverServiceDispatcher_h__
ClubMembershipService.h
ClubService.h
uint32
uint32_t uint32
Definition
Define.h:154
Log.h
MessageBuffer.h
WorldSession.h
WorldserverGameUtilitiesService.h
account_service.pb.h
notification_service.pb.h
report_service.pb.h
authentication_service.pb.h
block_list_listener.pb.h
block_list_service.pb.h
challenge_service.pb.h
Battlenet::Service
Definition
Service.h:53
Battlenet::WorldserverServiceDispatcher
Definition
WorldserverServiceDispatcher.h:50
Battlenet::WorldserverServiceDispatcher::WorldserverServiceDispatcher
WorldserverServiceDispatcher()
Definition
WorldserverServiceDispatcher.cpp:20
Battlenet::WorldserverServiceDispatcher::ServiceMethod
void(* ServiceMethod)(WorldSession *, uint32, uint32, MessageBuffer)
Definition
WorldserverServiceDispatcher.h:71
Battlenet::WorldserverServiceDispatcher::Dispatch
void Dispatch(WorldSession *session, uint32 serviceHash, uint32 token, uint32 methodId, MessageBuffer buffer)
Definition
WorldserverServiceDispatcher.cpp:39
Battlenet::WorldserverServiceDispatcher::_dispatchers
std::unordered_map< uint32, ServiceMethod > _dispatchers
Definition
WorldserverServiceDispatcher.h:72
Battlenet::WorldserverServiceDispatcher::Instance
static WorldserverServiceDispatcher & Instance()
Definition
WorldserverServiceDispatcher.cpp:48
Battlenet::WorldserverServiceDispatcher::AddService
void AddService()
Definition
WorldserverServiceDispatcher.h:60
Battlenet::WorldserverServiceDispatcher::Dispatch
static void Dispatch(WorldSession *session, uint32 token, uint32 methodId, MessageBuffer buffer)
Definition
WorldserverServiceDispatcher.h:66
MessageBuffer
Definition
MessageBuffer.h:26
WorldSession
Player session in the World.
Definition
WorldSession.h:977
club_listener.pb.h
club_membership_listener.pb.h
connection_service.pb.h
friends_service.pb.h
Battlenet
Definition
LoginHttpSession.cpp:119
notification_listener.pb.h
notification_service.pb.h
presence_listener.pb.h
presence_service.pb.h
report_service.pb.h
resource_service.pb.h
whisper_listener.pb.h
whisper_service.pb.h
server
game
Services
WorldserverServiceDispatcher.h
Generated on Sun May 10 2026 02:09:03 for TrinityCore by
1.9.8