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