diff --git a/include/gamePacket/_gamePacket.cpp b/include/gamePacket/_gamePacket.cpp index d42ac6cb..0ad2db2d 100644 --- a/include/gamePacket/_gamePacket.cpp +++ b/include/gamePacket/_gamePacket.cpp @@ -4,6 +4,7 @@ #include "tile_activate.hpp" #include "item_activate.hpp" #include "item_activate_object.hpp" +#include "set_icon_state.hpp" #include "ping_reply.hpp" #include "disconnect.hpp" @@ -16,6 +17,7 @@ std::unordered_map> gamePa {0x07, std::bind(&tile_activate, std::placeholders::_1, std::placeholders::_2)}, {0x0a, std::bind(&item_activate, std::placeholders::_1, std::placeholders::_2)}, {0x0b, std::bind(&item_activate_object, std::placeholders::_1, std::placeholders::_2)}, + {0x12, std::bind(&set_icon_state, std::placeholders::_1, std::placeholders::_2)}, {0x15, std::bind(&ping_reply, std::placeholders::_1, std::placeholders::_2)}, {0x1a, std::bind(&disconnect, std::placeholders::_1, std::placeholders::_2)} }; \ No newline at end of file diff --git a/include/gamePacket/set_icon_state.cpp b/include/gamePacket/set_icon_state.cpp new file mode 100644 index 00000000..b7aae16d --- /dev/null +++ b/include/gamePacket/set_icon_state.cpp @@ -0,0 +1,12 @@ +#include "pch.hpp" +#include "set_icon_state.hpp" + +/* @note the "..." bubble while typing */ +void set_icon_state(ENetEvent& event, ::gamePacket gamePacket) +{ + ::peer *pPeer = static_cast<::peer*>(event.peer->data); + if (pPeer->netid == 0) return; // @note not in a world + + gamePacket.netid = pPeer->netid; + state_visuals(*event.peer, std::move(gamePacket)); +} diff --git a/include/gamePacket/set_icon_state.hpp b/include/gamePacket/set_icon_state.hpp new file mode 100644 index 00000000..8fe963d8 --- /dev/null +++ b/include/gamePacket/set_icon_state.hpp @@ -0,0 +1,3 @@ +#pragma once + +extern void set_icon_state(ENetEvent& event, ::gamePacket gamePacket); \ No newline at end of file