|
Rehti MMORPG
1.0.0
Rehti MMORPG is a free and open source MMORPG game.
|
#include <Client.hpp>

Public Member Functions | |
| Client (std::string ip, std::string port) | |
| boost::asio::awaitable< bool > | connect () |
| Connects to the server. More... | |
| boost::asio::awaitable< void > | attack (const int &targetId) |
| Sends an attack message to the server. More... | |
| boost::asio::awaitable< void > | move (const int &x, const int &y) |
| Sends a move message to the server. More... | |
| boost::asio::awaitable< void > | interactWithObject (const int &objectId) |
| Sends an object interaction message to the server. More... | |
| boost::asio::awaitable< void > | pickUpItem (const int &itemId, const int &x, const int &y) |
| Sends a PickUpItemMessage to the server. More... | |
| boost::asio::awaitable< void > | useItem (const int itemInstanceId) |
| Send a UseItemMessage for item with given instance id. More... | |
| boost::asio::awaitable< void > | dropItem (const int itemInstanceId) |
| Send a DropItemMessage for item with given instance id. More... | |
| boost::asio::awaitable< void > | unequipItem (const int itemInstanceId) |
| Send a UnequipMessage for item with given instance id. More... | |
| boost::asio::awaitable< void > | talk (const int &npcId) |
| Send talk message to the server. More... | |
| void | start () |
| Starts the client. More... | |
| boost::asio::awaitable< bool > | login () |
| Prompts user for login information and sends a LoginMessage with that information. Currently only username used for identification. More... | |
| void | processMessages () |
| Processes messages from the server. More... | |
| void | startGraphics () |
| Starts the graphics library. More... | |
| void | handleMouseClick (const Hit &hit) |
| Handles a mouse click hit on the graphics window. More... | |
Private Attributes | |
| boost::asio::io_context | ioContextM |
| boost::asio::ip::tcp::resolver | resolverM |
| boost::asio::ip::tcp::resolver::results_type | endpointsM |
| boost::asio::executor_work_guard< boost::asio::io_context::executor_type > | workGuardM |
| MessageQueue | messagesM |
| std::unique_ptr< Connection > | connectionM |
| std::thread | graphicsThreadM |
| std::thread | connectionThreadM |
| std::thread | ioThreadM |
| RehtiGraphics * | pGraphLibM |
| std::condition_variable | graphLibReadyM |
| GraphLib ready lock. More... | |
| bool | graphLibReadyFlagM = false |
| GraphLib ready flag. More... | |
| std::mutex | graphLibMutexM |
| RehtiAudio | audioLibM |
| Hit | lastHitM |
| Last detected hit from a mouse click. More... | |
| GameStateMessage | prevGameStateMsgM |
| Previous game state message. More... | |
| AssetCache & | assetCacheM = AssetCache::getInstance() |
| Client::Client | ( | std::string | ip, |
| std::string | port | ||
| ) |

| boost::asio::awaitable< void > Client::attack | ( | const int & | targetId | ) |
Sends an attack message to the server.
| targetId | Id of the target entity |

| boost::asio::awaitable< bool > Client::connect | ( | ) |
Connects to the server.


| boost::asio::awaitable< void > Client::dropItem | ( | const int | itemInstanceId | ) |
Send a DropItemMessage for item with given instance id.
| itemInstanceId |

| void Client::handleMouseClick | ( | const Hit & | hit | ) |
Handles a mouse click hit on the graphics window.
| hit | contains hit information. See Hit. |


| boost::asio::awaitable< void > Client::interactWithObject | ( | const int & | objectId | ) |
Sends an object interaction message to the server.
| objectId | the id of the object to interact with |

| boost::asio::awaitable< bool > Client::login | ( | ) |
Prompts user for login information and sends a LoginMessage with that information. Currently only username used for identification.

| boost::asio::awaitable< void > Client::move | ( | const int & | x, |
| const int & | y | ||
| ) |
Sends a move message to the server.
| x | coordinate to move to |
| y | coordinate to move to |

| boost::asio::awaitable< void > Client::pickUpItem | ( | const int & | itemId, |
| const int & | x, | ||
| const int & | y | ||
| ) |
Sends a PickUpItemMessage to the server.
| itemId | instance id of the item to be picked up |
| x | x coordinate of the item |
| y | y coordinate of the item |

| void Client::processMessages | ( | ) |
Processes messages from the server.


| void Client::start | ( | ) |
Starts the client.


| void Client::startGraphics | ( | ) |
Starts the graphics library.


| boost::asio::awaitable< void > Client::talk | ( | const int & | npcId | ) |
Send talk message to the server.
| npcId | Id of the npc to talk to |

| boost::asio::awaitable< void > Client::unequipItem | ( | const int | itemInstanceId | ) |
Send a UnequipMessage for item with given instance id.
| itemInstanceId |

| boost::asio::awaitable< void > Client::useItem | ( | const int | itemInstanceId | ) |
Send a UseItemMessage for item with given instance id.
| itemInstanceId |

|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
GraphLib ready flag.
|
private |
GraphLib ready lock.
|
private |
|
private |
|
private |
Last detected hit from a mouse click.
|
private |
|
private |
|
private |
Previous game state message.
|
private |
|
private |