Mana
Loading...
Searching...
No Matches
gamehandler.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "eventlistener.h"
25
26#include "net/gamehandler.h"
27#include "net/net.h"
28
30#include "net/tmwa/token.h"
31
32namespace TmwAthena {
33
34class GameHandler final : public MessageHandler, public Net::GameHandler,
35 public EventListener
36{
37 public:
39
40 void handleMessage(MessageIn &msg) override;
41
42 void event(Event::Channel channel, const Event &event) override;
43
44 void connect() override;
45
46 bool isConnected() override;
47
48 void disconnect() override;
49
50 void quit() override;
51
52 bool removeDeadBeings() const override { return true; }
53
54 void clear();
55
56 void setMap(const std::string &map);
57
59 bool canUseMagicBar() const override { return true; }
60
61 int getPickupRange() const override;
62
63 int getNpcTalkRange() const override { return DEFAULT_TILE_LENGTH * 30; }
64
65 private:
66 std::string mMap;
67 int mCharID;
73};
74
75} // namespace TmwAthena
Definition event.h:42
Channel
Definition event.h:45
void handleMessage(MessageIn &msg) override
void connect() override
int getPickupRange() const override
Tells the range is pixel where the player can pickup items from.
void disconnect() override
void setMap(const std::string &map)
bool removeDeadBeings() const override
Definition gamehandler.h:52
int getNpcTalkRange() const override
Tells the range is pixel where the player can talk to an NPC from.
Definition gamehandler.h:63
bool isConnected() override
void event(Event::Channel channel, const Event &event) override
bool canUseMagicBar() const override
The tmwAthena protocol is making use of the MP status bar.
Definition gamehandler.h:59
std::string mMap
Keeps the map filename.
Definition gamehandler.h:66
int mTileX
< Saved for map-server switching
Definition gamehandler.h:72
Used for parsing an incoming message from eAthena.
Definition messagein.h:35
const int DEFAULT_TILE_LENGTH
Definition map.h:38
Warning: buffers and other variables are shared, so there can be only one connection active at a time...