This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/packet.cpp
maybegreat48 13ff1be75a
Reactions, remote kick and better protections (#807)
* feat(Scripts): Complete GlobalPlayerBD
* feat(Scripts): add GPBD_Kicking
* feat(Scripts): start work on GPBD_FM_3
* feat(Scripts): add more to GPBD_FM_3
* feat(Scripts): complete GPBD_FM_3
* feat(Scripts): start work on GPBD_FM
* feat(Scripts): improve GPBD_FM
* feat(Scripts): complete GPBD_FM
* feat(Reactions): Add reactions
* feat(Protections): Improve protections
* feat(RemoteKick): Add remote kick
* feat(Stats): add KillsOnPlayers and DeathsByPlayers
* fix(Classes): Fix compiler warnings
2023-01-03 16:48:32 +00:00

30 lines
864 B
C++

#include "common.hpp"
#include "packet.hpp"
#include "services/players/player_service.hpp"
#include "gta_util.hpp"
#include <network/Network.hpp>
namespace big
{
packet::packet() :
m_buffer(m_data, 0x4000)
{
}
void packet::send(uint32_t msg_id)
{
g_pointers->m_queue_packet(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr, msg_id, m_data, (m_buffer.m_curBit + 7) >> 3, 1, nullptr);
}
void packet::send(player_ptr player, int connection_id)
{
send(player->get_session_player()->m_player_data.m_peer_id_2, connection_id);
}
void packet::send(int peer_id, int connection_id)
{
auto mgr = gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr;
auto peer = g_pointers->m_get_connection_peer(mgr, peer_id);
g_pointers->m_send_packet(mgr, peer, connection_id, m_data, (m_buffer.m_curBit + 7) >> 3, 0x1000000);
}
}