TrinityCore
Loading...
Searching...
No Matches
WorldserverServiceDispatcher.cpp
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
19
21{
22 AddService<WorldserverService<account::v1::AccountService>>();
23 AddService<WorldserverService<account::v2::client::AccountService>>();
24 AddService<WorldserverService<authentication::v1::AuthenticationService>>();
25 AddService<WorldserverService<authentication::v2::client::AuthenticationService>>();
26 AddService<WorldserverService<block_list::v1::client::BlockListService>>();
27 AddService<Services::ClubMembershipService>();
28 AddService<Services::ClubService>();
29 AddService<WorldserverService<connection::v1::ConnectionService>>();
30 AddService<WorldserverService<friends::v1::FriendsService>>();
31 AddService<WorldserverService<friends::v2::client::FriendsService>>();
32 AddService<WorldserverService<game_utilities::v1::GameUtilitiesService>>();
33 AddService<Services::GameUtilitiesService>();
34 AddService<WorldserverService<notification::v1::NotificationService>>();
35 AddService<WorldserverService<notification::v2::client::NotificationService>>();
36 AddService<WorldserverService<presence::v1::PresenceService>>();
37 AddService<WorldserverService<presence::v2::client::PresenceService>>();
38 AddService<WorldserverService<report::v1::ReportService>>();
39 AddService<WorldserverService<report::v2::ReportService>>();
40 AddService<WorldserverService<report::v3::client::ReportService>>();
41 AddService<WorldserverService<resources::v1::ResourcesService>>();
42 AddService<WorldserverService<whisper::v2::client::WhisperService>>();
43}
44
46{
47 auto itr = _dispatchers.find(serviceHash);
48 if (itr != _dispatchers.end())
49 itr->second(session, token, methodId, std::move(buffer));
50 else
51 TC_LOG_DEBUG("session.rpc", "{} tried to call invalid service 0x{:X}", session->GetPlayerInfo(), serviceHash);
52}
53
uint32_t uint32
Definition Define.h:154
#define TC_LOG_DEBUG(filterType__, message__,...)
Definition Log.h:173
void Dispatch(WorldSession *session, uint32 serviceHash, uint32 token, uint32 methodId, MessageBuffer buffer)
static WorldserverServiceDispatcher & Instance()
Player session in the World.
std::string GetPlayerInfo() const