Mana
Loading...
Searching...
No Matches
playerhandler.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-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 "net/net.h"
25#include "net/playerhandler.h"
26
28
29namespace TmwAthena {
30
31class PlayerHandler final : public MessageHandler, public Net::PlayerHandler,
32 public EventListener
33{
34 public:
36
37 void handleMessage(MessageIn &msg) override;
38
39 void attack(int id) override;
40 void emote(int emoteId) override;
41
42 void increaseAttribute(int attr) override;
43 void decreaseAttribute(int attr) override;
44 void increaseSkill(int skillId) override;
45
46 void pickUp(FloorItem *floorItem) override;
47 void setDirection(char direction) override;
48 void setDestination(int x, int y, int direction = -1) override;
49 void changeAction(Being::Action action) override;
50
51 void respawn() override;
52
53 void ignorePlayer(const std::string &player, bool ignore) override;
54 void ignoreAll(bool ignore) override;
55
56 bool canUseMagic() override;
57 bool canCorrectAttributes() override;
58
59 int getJobLocation() override;
60
61 Vector getDefaultMoveSpeed() const override;
62
63 Vector getPixelsPerSecondMoveSpeed(const Vector &speed, Map *map = nullptr) override;
64
65 bool usePixelPrecision() override
66 { return false; }
67
68 // EventListener
69 void event(Event::Channel channel, const Event &event) override;
70
72
73 private:
75
77};
78
79} // namespace TmwAthena
Definition being.h:65
Action
Action the being is currently performing WARNING: Has to be in sync with the same enum in the Being c...
Definition being.h:73
void ignore(Event::Channel channel)
Definition event.h:42
Channel
Definition event.h:45
An item lying on the floor.
Definition flooritem.h:32
A tile map.
Definition map.h:147
Used for parsing an incoming message from eAthena.
Definition messagein.h:35
void ignorePlayer(const std::string &player, bool ignore) override
bool canCorrectAttributes() override
void emote(int emoteId) override
Vector getDefaultMoveSpeed() const override
Get the original default movement speed.
void setDirection(char direction) override
void applyQuestStatusEffects(Being *npc)
void changeAction(Being::Action action) override
void ignoreAll(bool ignore) override
bool usePixelPrecision() override
Tells whether the client has to use pixel paths.
QuestEffectMap mActiveQuestEffects
void setDestination(int x, int y, int direction=-1) override
void increaseAttribute(int attr) override
void attack(int id) override
void increaseSkill(int skillId) override
void event(Event::Channel channel, const Event &event) override
void pickUp(FloorItem *floorItem) override
Vector getPixelsPerSecondMoveSpeed(const Vector &speed, Map *map=nullptr) override
Convert the original server-dependant speed for internal use.
void decreaseAttribute(int attr) override
void handleMessage(MessageIn &msg) override
Vector class.
Definition vector.h:33
Warning: buffers and other variables are shared, so there can be only one connection active at a time...